@nicia-ai/typegraph 0.46.1 → 0.46.2
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.
- package/dist/backend/drizzle/indexes.cjs +9 -9
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/drizzle/indexes.js +5 -5
- package/dist/backend/index.cjs +49 -49
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +10 -10
- package/dist/backend/postgres/index.cjs +26 -26
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +13 -13
- package/dist/backend/postgres/pglite-store.cjs +33 -33
- package/dist/backend/postgres/pglite-store.d.cts +8 -8
- package/dist/backend/postgres/pglite-store.d.ts +8 -8
- package/dist/backend/postgres/pglite-store.js +29 -29
- package/dist/backend/postgres/pglite.cjs +15 -15
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +14 -14
- package/dist/backend/sqlite/index.cjs +23 -23
- package/dist/backend/sqlite/index.d.cts +6 -6
- package/dist/backend/sqlite/index.d.ts +6 -6
- package/dist/backend/sqlite/index.js +11 -11
- package/dist/backend/sqlite/libsql.cjs +18 -18
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +13 -13
- package/dist/backend/sqlite/local-store.cjs +34 -34
- package/dist/backend/sqlite/local-store.d.cts +8 -8
- package/dist/backend/sqlite/local-store.d.ts +8 -8
- package/dist/backend/sqlite/local-store.js +30 -30
- package/dist/backend/sqlite/local.cjs +16 -16
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +14 -14
- package/dist/{chunk-VCRRKBLN.cjs → chunk-2ZWM2RFH.cjs} +9 -9
- package/dist/{chunk-VCRRKBLN.cjs.map → chunk-2ZWM2RFH.cjs.map} +1 -1
- package/dist/{chunk-Q3G6A4I3.cjs → chunk-32UETY6S.cjs} +26 -26
- package/dist/chunk-32UETY6S.cjs.map +1 -0
- package/dist/{chunk-JXA2ZP2Q.js → chunk-36LIJXWC.js} +4 -4
- package/dist/{chunk-JXA2ZP2Q.js.map → chunk-36LIJXWC.js.map} +1 -1
- package/dist/{chunk-MCLYU6BN.cjs → chunk-5PDSCELM.cjs} +14 -14
- package/dist/{chunk-MCLYU6BN.cjs.map → chunk-5PDSCELM.cjs.map} +1 -1
- package/dist/{chunk-775A4ZMN.js → chunk-5ZJOB5YS.js} +4 -4
- package/dist/{chunk-775A4ZMN.js.map → chunk-5ZJOB5YS.js.map} +1 -1
- package/dist/{chunk-J3WZ3FA2.js → chunk-62ZXBMSD.js} +24 -3
- package/dist/chunk-62ZXBMSD.js.map +1 -0
- package/dist/{chunk-7BQXPCGN.cjs → chunk-6BD6ZBKT.cjs} +10 -10
- package/dist/{chunk-7BQXPCGN.cjs.map → chunk-6BD6ZBKT.cjs.map} +1 -1
- package/dist/chunk-6LAXM4J2.cjs +12 -0
- package/dist/{chunk-VQH4VAWD.cjs.map → chunk-6LAXM4J2.cjs.map} +1 -1
- package/dist/{chunk-MSY7FSX4.js → chunk-72WUT4GG.js} +4 -4
- package/dist/{chunk-MSY7FSX4.js.map → chunk-72WUT4GG.js.map} +1 -1
- package/dist/chunk-73MWKDFK.cjs +12 -0
- package/dist/{chunk-A4OC4DVN.cjs.map → chunk-73MWKDFK.cjs.map} +1 -1
- package/dist/{chunk-BKCUOV7A.js → chunk-7TKNK32B.js} +5 -5
- package/dist/{chunk-BKCUOV7A.js.map → chunk-7TKNK32B.js.map} +1 -1
- package/dist/{chunk-GF3KXUTW.js → chunk-A2LJG5GM.js} +9 -9
- package/dist/{chunk-GF3KXUTW.js.map → chunk-A2LJG5GM.js.map} +1 -1
- package/dist/{chunk-PF6F5NLJ.cjs → chunk-A4R3H7RU.cjs} +237 -237
- package/dist/{chunk-PF6F5NLJ.cjs.map → chunk-A4R3H7RU.cjs.map} +1 -1
- package/dist/{chunk-RMQLSPA2.cjs → chunk-A7NMUYEL.cjs} +27 -27
- package/dist/{chunk-RMQLSPA2.cjs.map → chunk-A7NMUYEL.cjs.map} +1 -1
- package/dist/{chunk-U63GDNRC.cjs → chunk-AF3TWL5C.cjs} +4 -4
- package/dist/{chunk-U63GDNRC.cjs.map → chunk-AF3TWL5C.cjs.map} +1 -1
- package/dist/{chunk-XBYVV3MP.cjs → chunk-ANKOXPCC.cjs} +4 -4
- package/dist/chunk-ANKOXPCC.cjs.map +1 -0
- package/dist/{chunk-WQZLUGVR.js → chunk-AT3MLMJV.js} +10 -10
- package/dist/{chunk-WQZLUGVR.js.map → chunk-AT3MLMJV.js.map} +1 -1
- package/dist/{chunk-UV3SN74I.js → chunk-AU3IJNNP.js} +5 -5
- package/dist/{chunk-UV3SN74I.js.map → chunk-AU3IJNNP.js.map} +1 -1
- package/dist/{chunk-YAAM3M2S.cjs → chunk-BEB4OFZF.cjs} +10 -10
- package/dist/{chunk-YAAM3M2S.cjs.map → chunk-BEB4OFZF.cjs.map} +1 -1
- package/dist/{chunk-PT7RIRIZ.cjs → chunk-BQM5P2NO.cjs} +168 -168
- package/dist/{chunk-PT7RIRIZ.cjs.map → chunk-BQM5P2NO.cjs.map} +1 -1
- package/dist/{chunk-YWGVVALJ.js → chunk-BRN3RGD2.js} +3 -3
- package/dist/{chunk-YWGVVALJ.js.map → chunk-BRN3RGD2.js.map} +1 -1
- package/dist/{chunk-UDISNXDL.cjs → chunk-BZZI7B43.cjs} +47 -47
- package/dist/{chunk-UDISNXDL.cjs.map → chunk-BZZI7B43.cjs.map} +1 -1
- package/dist/{chunk-TQR4KBY2.cjs → chunk-C2ZP5YS6.cjs} +135 -133
- package/dist/chunk-C2ZP5YS6.cjs.map +1 -0
- package/dist/{chunk-PNN7RHVR.cjs → chunk-C4DYN2SD.cjs} +48 -48
- package/dist/{chunk-PNN7RHVR.cjs.map → chunk-C4DYN2SD.cjs.map} +1 -1
- package/dist/{chunk-PNTCATDE.cjs → chunk-C6KE2HSQ.cjs} +1355 -1312
- package/dist/chunk-C6KE2HSQ.cjs.map +1 -0
- package/dist/{chunk-LBJKZXDE.cjs → chunk-D6GCNNMK.cjs} +10 -10
- package/dist/{chunk-LBJKZXDE.cjs.map → chunk-D6GCNNMK.cjs.map} +1 -1
- package/dist/{chunk-JZUR7ZWE.js → chunk-DSAWGCMP.js} +3 -3
- package/dist/{chunk-JZUR7ZWE.js.map → chunk-DSAWGCMP.js.map} +1 -1
- package/dist/{chunk-U5SON7R2.cjs → chunk-DYPRZ53S.cjs} +27 -27
- package/dist/{chunk-U5SON7R2.cjs.map → chunk-DYPRZ53S.cjs.map} +1 -1
- package/dist/{chunk-YVWGEQJE.cjs → chunk-E4OSGBCM.cjs} +139 -133
- package/dist/chunk-E4OSGBCM.cjs.map +1 -0
- package/dist/{chunk-YDFDBE6D.js → chunk-EAMVXR5B.js} +4 -4
- package/dist/{chunk-YDFDBE6D.js.map → chunk-EAMVXR5B.js.map} +1 -1
- package/dist/{chunk-NLI2AVEF.js → chunk-EDHV4CBU.js} +8 -8
- package/dist/{chunk-NLI2AVEF.js.map → chunk-EDHV4CBU.js.map} +1 -1
- package/dist/{chunk-DCQVHAYQ.js → chunk-EDJDDY6H.js} +4 -4
- package/dist/{chunk-DCQVHAYQ.js.map → chunk-EDJDDY6H.js.map} +1 -1
- package/dist/{chunk-5262ZMTR.js → chunk-EJSYWAEV.js} +5 -5
- package/dist/{chunk-5262ZMTR.js.map → chunk-EJSYWAEV.js.map} +1 -1
- package/dist/{chunk-65E3XWGF.cjs → chunk-F36KZDFX.cjs} +91 -91
- package/dist/{chunk-65E3XWGF.cjs.map → chunk-F36KZDFX.cjs.map} +1 -1
- package/dist/{chunk-AKLS3BYZ.js → chunk-FA6Z7B5L.js} +3 -3
- package/dist/chunk-FA6Z7B5L.js.map +1 -0
- package/dist/{chunk-ASTI57H3.js → chunk-FCIZNUW5.js} +3 -3
- package/dist/{chunk-ASTI57H3.js.map → chunk-FCIZNUW5.js.map} +1 -1
- package/dist/{chunk-CBTIUB76.js → chunk-FSLTU57P.js} +3 -3
- package/dist/{chunk-CBTIUB76.js.map → chunk-FSLTU57P.js.map} +1 -1
- package/dist/{chunk-2LG2XB2M.js → chunk-FXNHZFZV.js} +3 -3
- package/dist/{chunk-2LG2XB2M.js.map → chunk-FXNHZFZV.js.map} +1 -1
- package/dist/{chunk-BSFJMMV3.cjs → chunk-GVAMRRZR.cjs} +4 -4
- package/dist/{chunk-BSFJMMV3.cjs.map → chunk-GVAMRRZR.cjs.map} +1 -1
- package/dist/{chunk-2Z2Z3ZD6.js → chunk-GWUWRZXW.js} +3 -3
- package/dist/{chunk-2Z2Z3ZD6.js.map → chunk-GWUWRZXW.js.map} +1 -1
- package/dist/{chunk-C23WSN5E.js → chunk-GWXXHOLU.js} +20 -14
- package/dist/chunk-GWXXHOLU.js.map +1 -0
- package/dist/{chunk-CMWHLBVN.cjs → chunk-HNYLMPQQ.cjs} +68 -68
- package/dist/{chunk-CMWHLBVN.cjs.map → chunk-HNYLMPQQ.cjs.map} +1 -1
- package/dist/{chunk-NMWDXFPH.js → chunk-IHRDX7K6.js} +4 -4
- package/dist/{chunk-NMWDXFPH.js.map → chunk-IHRDX7K6.js.map} +1 -1
- package/dist/{chunk-VGTJPTIC.js → chunk-JCNTKRAK.js} +5 -5
- package/dist/{chunk-VGTJPTIC.js.map → chunk-JCNTKRAK.js.map} +1 -1
- package/dist/{chunk-MXJDTH5B.cjs → chunk-JL5UEBWT.cjs} +45 -45
- package/dist/{chunk-MXJDTH5B.cjs.map → chunk-JL5UEBWT.cjs.map} +1 -1
- package/dist/{chunk-LGHCOKTT.js → chunk-KA4L2NZ3.js} +14 -14
- package/dist/{chunk-LGHCOKTT.js.map → chunk-KA4L2NZ3.js.map} +1 -1
- package/dist/{chunk-NI72YOJB.cjs → chunk-KCH7WQA5.cjs} +24 -2
- package/dist/chunk-KCH7WQA5.cjs.map +1 -0
- package/dist/{chunk-2NA5DYLO.cjs → chunk-KOAI3KIV.cjs} +4 -4
- package/dist/{chunk-2NA5DYLO.cjs.map → chunk-KOAI3KIV.cjs.map} +1 -1
- package/dist/{chunk-7VQXLT5O.js → chunk-KXSMF6PL.js} +101 -25
- package/dist/chunk-KXSMF6PL.js.map +1 -0
- package/dist/{chunk-M3WP7RQZ.js → chunk-LHYSY6SE.js} +6 -6
- package/dist/chunk-LHYSY6SE.js.map +1 -0
- package/dist/{chunk-WDGA7IYB.js → chunk-LNIWCQR4.js} +3 -3
- package/dist/{chunk-WDGA7IYB.js.map → chunk-LNIWCQR4.js.map} +1 -1
- package/dist/{chunk-YBQOHKHN.cjs → chunk-N3QTGPC7.cjs} +99 -99
- package/dist/{chunk-YBQOHKHN.cjs.map → chunk-N3QTGPC7.cjs.map} +1 -1
- package/dist/{chunk-K5ELX2GT.js → chunk-OZJCH7ZS.js} +3 -3
- package/dist/{chunk-K5ELX2GT.js.map → chunk-OZJCH7ZS.js.map} +1 -1
- package/dist/{chunk-62ZP23AW.cjs → chunk-PYKF7UIL.cjs} +13 -13
- package/dist/{chunk-62ZP23AW.cjs.map → chunk-PYKF7UIL.cjs.map} +1 -1
- package/dist/{chunk-PQBQG7IM.js → chunk-QOJ2L2AD.js} +3 -3
- package/dist/{chunk-PQBQG7IM.js.map → chunk-QOJ2L2AD.js.map} +1 -1
- package/dist/{chunk-DTVWX77L.cjs → chunk-QPOQX2DI.cjs} +235 -235
- package/dist/{chunk-DTVWX77L.cjs.map → chunk-QPOQX2DI.cjs.map} +1 -1
- package/dist/{chunk-NFCVHQ5P.cjs → chunk-QU7QLJA4.cjs} +26 -26
- package/dist/{chunk-NFCVHQ5P.cjs.map → chunk-QU7QLJA4.cjs.map} +1 -1
- package/dist/{chunk-XL7SLCXS.js → chunk-R7EWHKID.js} +3 -3
- package/dist/{chunk-XL7SLCXS.js.map → chunk-R7EWHKID.js.map} +1 -1
- package/dist/{chunk-HFHTMECK.js → chunk-RFDEYLIK.js} +7 -7
- package/dist/{chunk-HFHTMECK.js.map → chunk-RFDEYLIK.js.map} +1 -1
- package/dist/{chunk-MUK4BU7K.cjs → chunk-RHDOAQCT.cjs} +200 -124
- package/dist/chunk-RHDOAQCT.cjs.map +1 -0
- package/dist/{chunk-YBFHZUXX.js → chunk-S3G5VLSW.js} +6 -6
- package/dist/{chunk-YBFHZUXX.js.map → chunk-S3G5VLSW.js.map} +1 -1
- package/dist/{chunk-M4BDU5RX.cjs → chunk-S7WIRFNS.cjs} +12 -12
- package/dist/{chunk-M4BDU5RX.cjs.map → chunk-S7WIRFNS.cjs.map} +1 -1
- package/dist/{chunk-T4XNKYXB.js → chunk-SXWLLQ3D.js} +4 -4
- package/dist/{chunk-T4XNKYXB.js.map → chunk-SXWLLQ3D.js.map} +1 -1
- package/dist/{chunk-NK5Q7UNE.cjs → chunk-TCT66A7N.cjs} +10 -10
- package/dist/{chunk-NK5Q7UNE.cjs.map → chunk-TCT66A7N.cjs.map} +1 -1
- package/dist/{chunk-3DHZCOT7.cjs → chunk-UTVQPZPN.cjs} +20 -20
- package/dist/{chunk-3DHZCOT7.cjs.map → chunk-UTVQPZPN.cjs.map} +1 -1
- package/dist/{chunk-CXBHOOIQ.cjs → chunk-WA64ZSCA.cjs} +11 -11
- package/dist/{chunk-CXBHOOIQ.cjs.map → chunk-WA64ZSCA.cjs.map} +1 -1
- package/dist/{chunk-L65OU2U3.js → chunk-WEJHA7AD.js} +13 -13
- package/dist/{chunk-L65OU2U3.js.map → chunk-WEJHA7AD.js.map} +1 -1
- package/dist/{chunk-5UVRGXD3.js → chunk-WHS2Y43J.js} +5 -5
- package/dist/{chunk-5UVRGXD3.js.map → chunk-WHS2Y43J.js.map} +1 -1
- package/dist/{chunk-I5MOXA4H.js → chunk-WMKEGJG4.js} +3 -3
- package/dist/{chunk-I5MOXA4H.js.map → chunk-WMKEGJG4.js.map} +1 -1
- package/dist/{chunk-5763DULU.js → chunk-WYFB7BN3.js} +16 -14
- package/dist/chunk-WYFB7BN3.js.map +1 -0
- package/dist/{chunk-VLT6PEWR.cjs → chunk-XBHRKLZU.cjs} +4 -4
- package/dist/{chunk-VLT6PEWR.cjs.map → chunk-XBHRKLZU.cjs.map} +1 -1
- package/dist/{chunk-S6PW7VV5.js → chunk-YQ4JONWE.js} +91 -48
- package/dist/chunk-YQ4JONWE.js.map +1 -0
- package/dist/{chunk-MZLPX2R7.js → chunk-Z43KWLZF.js} +8 -8
- package/dist/{chunk-MZLPX2R7.js.map → chunk-Z43KWLZF.js.map} +1 -1
- package/dist/{chunk-E4WNQBEF.cjs → chunk-ZBVZ7HXD.cjs} +12 -12
- package/dist/{chunk-E4WNQBEF.cjs.map → chunk-ZBVZ7HXD.cjs.map} +1 -1
- package/dist/{chunk-4UGOKMI5.cjs → chunk-ZHOAZD7Q.cjs} +161 -161
- package/dist/{chunk-4UGOKMI5.cjs.map → chunk-ZHOAZD7Q.cjs.map} +1 -1
- package/dist/{chunk-XCAGZAKP.cjs → chunk-ZIH42CRX.cjs} +7 -7
- package/dist/{chunk-XCAGZAKP.cjs.map → chunk-ZIH42CRX.cjs.map} +1 -1
- package/dist/core/index.cjs +27 -27
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +7 -7
- package/dist/{ddl-BJcOp4WZ.d.cts → ddl-mE07h_EM.d.cts} +3 -3
- package/dist/{ddl-BXfGHbPN.d.ts → ddl-opIn8DfX.d.ts} +3 -3
- package/dist/graph-extension/index.cjs +20 -20
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +4 -4
- package/dist/graph-merge/index.cjs +248 -248
- package/dist/graph-merge/index.d.cts +8 -8
- package/dist/graph-merge/index.d.ts +8 -8
- package/dist/graph-merge/index.js +24 -24
- package/dist/{index-DxaYCv8Y.d.cts → index-Deyu8IXL.d.ts} +20 -3
- package/dist/{index-BSHvKfok.d.ts → index-DrRS51Ld.d.cts} +20 -3
- package/dist/index.cjs +219 -215
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +34 -34
- package/dist/indexes/index.cjs +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/indexes/index.js +6 -6
- package/dist/interchange/index.cjs +52 -52
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +16 -16
- package/dist/{manager-CfZAimti.d.ts → manager-DX983gJ0.d.ts} +2 -2
- package/dist/{manager-HGk6E_HW.d.cts → manager-ptr3JLRP.d.cts} +2 -2
- package/dist/{materialize-indexes-6A7dWGtb.d.cts → materialize-indexes-BXz77YqO.d.cts} +1 -1
- package/dist/{materialize-indexes-BMJP6Tms.d.ts → materialize-indexes-CpXoggWU.d.ts} +1 -1
- package/dist/{postgres-DFYWENdR.d.cts → postgres-DwgEXSPI.d.cts} +1 -1
- package/dist/{postgres-e7a9TdvR.d.ts → postgres-QdOMHTBz.d.ts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +42 -42
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +9 -9
- package/dist/schema/index.cjs +44 -44
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +17 -17
- package/dist/{searchable-9OQoPuRs.d.ts → searchable-BOUuA83f.d.ts} +1 -1
- package/dist/{searchable-CIje5XYD.d.cts → searchable-BrUh0pdc.d.cts} +1 -1
- package/dist/{sqlite-DerU5tc7.d.ts → sqlite-BfYcV61E.d.cts} +1 -1
- package/dist/{sqlite-DitnISa9.d.cts → sqlite-DK40XVR1.d.ts} +1 -1
- package/dist/{store-B0h6x7wo.d.cts → store-Bo1psfVZ.d.ts} +15 -5
- package/dist/{store-ClQ-MZQS.d.ts → store-FTqBpuJD.d.cts} +15 -5
- package/dist/{temporal-Bn-Fi8FJ.d.cts → temporal-CXewwLTB.d.cts} +1 -1
- package/dist/{temporal-BtM4UALv.d.ts → temporal-DPtn0HOu.d.ts} +1 -1
- package/dist/{types-KFfk-8Ah.d.ts → types-CeT7xM4M.d.ts} +1 -1
- package/dist/{types-HkveCCx0.d.ts → types-Du78EvpN.d.cts} +7 -6
- package/dist/{types-HkveCCx0.d.cts → types-Du78EvpN.d.ts} +7 -6
- package/dist/{types-CoIx8HX5.d.cts → types-XR1nHERK.d.cts} +1 -1
- package/dist/{where--fk7_0kv.d.cts → where-CJsp-YUf.d.cts} +1 -1
- package/dist/{where-ws5hf-Ov.d.ts → where-CMbFiWwp.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-5763DULU.js.map +0 -1
- package/dist/chunk-7VQXLT5O.js.map +0 -1
- package/dist/chunk-A4OC4DVN.cjs +0 -12
- package/dist/chunk-AKLS3BYZ.js.map +0 -1
- package/dist/chunk-C23WSN5E.js.map +0 -1
- package/dist/chunk-J3WZ3FA2.js.map +0 -1
- package/dist/chunk-M3WP7RQZ.js.map +0 -1
- package/dist/chunk-MUK4BU7K.cjs.map +0 -1
- package/dist/chunk-NI72YOJB.cjs.map +0 -1
- package/dist/chunk-PNTCATDE.cjs.map +0 -1
- package/dist/chunk-Q3G6A4I3.cjs.map +0 -1
- package/dist/chunk-S6PW7VV5.js.map +0 -1
- package/dist/chunk-TQR4KBY2.cjs.map +0 -1
- package/dist/chunk-VQH4VAWD.cjs +0 -12
- package/dist/chunk-XBYVV3MP.cjs.map +0 -1
- package/dist/chunk-YVWGEQJE.cjs.map +0 -1
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk32UETY6S_cjs = require('./chunk-32UETY6S.cjs');
|
|
4
|
+
var chunkQPOQX2DI_cjs = require('./chunk-QPOQX2DI.cjs');
|
|
5
|
+
var chunkA4R3H7RU_cjs = require('./chunk-A4R3H7RU.cjs');
|
|
6
6
|
var chunkPWLJ77UV_cjs = require('./chunk-PWLJ77UV.cjs');
|
|
7
|
-
var
|
|
8
|
-
var
|
|
9
|
-
var
|
|
10
|
-
var
|
|
11
|
-
var
|
|
12
|
-
var
|
|
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');
|
|
13
13
|
var chunkHAHNRASW_cjs = require('./chunk-HAHNRASW.cjs');
|
|
14
|
-
var
|
|
15
|
-
var
|
|
14
|
+
var chunkD6GCNNMK_cjs = require('./chunk-D6GCNNMK.cjs');
|
|
15
|
+
var chunkKCH7WQA5_cjs = require('./chunk-KCH7WQA5.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 =
|
|
25
|
-
const props =
|
|
24
|
+
const rawProps = chunkANKOXPCC_cjs.rowPropsToObject(row.props);
|
|
25
|
+
const props = chunkD6GCNNMK_cjs.filterReservedKeys(rawProps, chunkD6GCNNMK_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 =
|
|
45
|
-
const props =
|
|
44
|
+
const rawProps = chunkANKOXPCC_cjs.rowPropsToObject(row.props);
|
|
45
|
+
const props = chunkD6GCNNMK_cjs.filterReservedKeys(rawProps, chunkD6GCNNMK_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) =>
|
|
76
|
+
(constraint) => chunkZBVZ7HXD_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 =
|
|
85
|
+
const error = chunkZBVZ7HXD_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 =
|
|
102
|
+
const error = chunkZBVZ7HXD_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 =
|
|
122
|
+
const error = chunkZBVZ7HXD_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 =
|
|
144
|
+
const error = chunkZBVZ7HXD_cjs.checkCardinality(
|
|
145
145
|
edgeKind,
|
|
146
146
|
fromKind,
|
|
147
147
|
fromId,
|
|
@@ -162,7 +162,7 @@ var ENTITY_LABELS = {
|
|
|
162
162
|
};
|
|
163
163
|
function alreadyExistsError(entity, kind, id, detail, cause) {
|
|
164
164
|
const label = ENTITY_LABELS[entity];
|
|
165
|
-
return new
|
|
165
|
+
return new chunkKCH7WQA5_cjs.ValidationError(
|
|
166
166
|
`${label.title} already exists: ${detail}`,
|
|
167
167
|
{
|
|
168
168
|
entityType: entity,
|
|
@@ -172,7 +172,7 @@ function alreadyExistsError(entity, kind, id, detail, cause) {
|
|
|
172
172
|
issues: [
|
|
173
173
|
{
|
|
174
174
|
path: "id",
|
|
175
|
-
code:
|
|
175
|
+
code: chunkKCH7WQA5_cjs.ENTITY_ALREADY_EXISTS_CODE,
|
|
176
176
|
message: `${label.article} with this ID already exists`
|
|
177
177
|
}
|
|
178
178
|
]
|
|
@@ -187,7 +187,7 @@ function createAlreadyExistsError(entity, kind, id) {
|
|
|
187
187
|
return alreadyExistsError(entity, kind, id, `${kind}/${id}`, void 0);
|
|
188
188
|
}
|
|
189
189
|
function isDuplicateKeyInsertError(error, entity) {
|
|
190
|
-
return error instanceof
|
|
190
|
+
return error instanceof chunkKCH7WQA5_cjs.DatabaseOperationError && error.details.operation === "insert" && error.details.entity === entity && error.details.reason === "duplicate_key";
|
|
191
191
|
}
|
|
192
192
|
function rethrowAsAlreadyExists(error, entity) {
|
|
193
193
|
if (!isDuplicateKeyInsertError(error, entity)) throw error;
|
|
@@ -221,9 +221,9 @@ async function withAlreadyExistsTranslation(entity, run) {
|
|
|
221
221
|
|
|
222
222
|
// src/store/operations/node-operations.ts
|
|
223
223
|
function getNodeRegistration(graph, kind) {
|
|
224
|
-
if (!chunkN66HCGCY_cjs.hasOwnKey(graph.nodes, kind)) throw new
|
|
224
|
+
if (!chunkN66HCGCY_cjs.hasOwnKey(graph.nodes, kind)) throw new chunkKCH7WQA5_cjs.KindNotFoundError(kind, "node");
|
|
225
225
|
const registration = graph.nodes[kind];
|
|
226
|
-
if (registration === void 0) throw new
|
|
226
|
+
if (registration === void 0) throw new chunkKCH7WQA5_cjs.KindNotFoundError(kind, "node");
|
|
227
227
|
return registration;
|
|
228
228
|
}
|
|
229
229
|
function nodeFencesConstraintProbe(ctx, kind, operation) {
|
|
@@ -243,10 +243,10 @@ function nodeBatchFencesConstraintProbe(ctx, inputs, operation) {
|
|
|
243
243
|
return void 0;
|
|
244
244
|
}
|
|
245
245
|
function buildNodeCacheKey(graphId, kind, id) {
|
|
246
|
-
return
|
|
246
|
+
return chunkQPOQX2DI_cjs.encodeTupleKey([graphId, kind, id]);
|
|
247
247
|
}
|
|
248
248
|
function buildUniqueCacheKey(graphId, nodeKind, constraintName, key) {
|
|
249
|
-
return
|
|
249
|
+
return chunkQPOQX2DI_cjs.encodeTupleKey([graphId, nodeKind, constraintName, key]);
|
|
250
250
|
}
|
|
251
251
|
function buildInsertNodeParams(graphId, kind, id, props, validFrom, validTo) {
|
|
252
252
|
const insertParams = {
|
|
@@ -277,7 +277,7 @@ function resolveConstraint(graph, kind, constraintName) {
|
|
|
277
277
|
(candidate) => candidate.name === constraintName
|
|
278
278
|
);
|
|
279
279
|
if (constraint === void 0) {
|
|
280
|
-
throw new
|
|
280
|
+
throw new chunkKCH7WQA5_cjs.NodeConstraintNotFoundError(constraintName, kind);
|
|
281
281
|
}
|
|
282
282
|
return constraint;
|
|
283
283
|
}
|
|
@@ -338,8 +338,8 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
338
338
|
}
|
|
339
339
|
function registerPendingUniqueEntries(kind, id, props, constraints) {
|
|
340
340
|
for (const constraint of constraints) {
|
|
341
|
-
if (!
|
|
342
|
-
const key =
|
|
341
|
+
if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, props)) continue;
|
|
342
|
+
const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
343
343
|
props,
|
|
344
344
|
constraint.fields,
|
|
345
345
|
constraint.collation
|
|
@@ -352,7 +352,7 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
352
352
|
);
|
|
353
353
|
pendingUniqueOwners.set(concreteEntryKey, id);
|
|
354
354
|
if (constraint.scope !== "kind") {
|
|
355
|
-
const kindsToCheck =
|
|
355
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
356
356
|
kind,
|
|
357
357
|
constraint.scope,
|
|
358
358
|
registry
|
|
@@ -371,12 +371,12 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
371
371
|
}
|
|
372
372
|
function registerAppliedNodeUpdate(kind, id, oldProps, newProps, constraints) {
|
|
373
373
|
for (const constraint of constraints) {
|
|
374
|
-
const oldApplies =
|
|
375
|
-
const newApplies =
|
|
376
|
-
const oldKey = oldApplies ?
|
|
377
|
-
const newKey = newApplies ?
|
|
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;
|
|
378
378
|
if (oldKey === newKey) continue;
|
|
379
|
-
const kindsToCheck =
|
|
379
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
380
380
|
kind,
|
|
381
381
|
constraint.scope,
|
|
382
382
|
registry
|
|
@@ -416,7 +416,7 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
416
416
|
if (uniqueCache.has(cacheKey)) return;
|
|
417
417
|
uniqueCache.set(cacheKey, row);
|
|
418
418
|
}
|
|
419
|
-
const validationBackend =
|
|
419
|
+
const validationBackend = chunkANKOXPCC_cjs.createBackendOverlay(backend, {
|
|
420
420
|
getNode: getNodeCached,
|
|
421
421
|
checkUnique: checkUniqueCached
|
|
422
422
|
});
|
|
@@ -433,16 +433,16 @@ function draftNodeCreate(ctx, input, id, options) {
|
|
|
433
433
|
const kind = input.kind;
|
|
434
434
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
435
435
|
const nodeKind = registration.type;
|
|
436
|
-
const validatedProps = options?.propsPreValidated === true ? input.props :
|
|
436
|
+
const validatedProps = options?.propsPreValidated === true ? input.props : chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, input.props, {
|
|
437
437
|
kind,
|
|
438
438
|
operation: "create"
|
|
439
439
|
});
|
|
440
|
-
const validFrom =
|
|
440
|
+
const validFrom = chunk5PDSCELM_cjs.validateOptionalCanonicalIsoDate(
|
|
441
441
|
input.validFrom,
|
|
442
442
|
"validFrom"
|
|
443
443
|
);
|
|
444
|
-
const validTo =
|
|
445
|
-
|
|
444
|
+
const validTo = chunk5PDSCELM_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
445
|
+
chunk5PDSCELM_cjs.assertOrderedValidityWindow(`${kind} "${id}"`, validFrom, validTo);
|
|
446
446
|
return {
|
|
447
447
|
kind,
|
|
448
448
|
id,
|
|
@@ -466,8 +466,8 @@ async function finishNodeCreatePreparation(ctx, draft, backend) {
|
|
|
466
466
|
backend
|
|
467
467
|
};
|
|
468
468
|
await checkDisjointnessConstraint(constraintContext, kind, id);
|
|
469
|
-
await
|
|
470
|
-
|
|
469
|
+
await chunk32UETY6S_cjs.checkUniquenessConstraints(
|
|
470
|
+
chunk32UETY6S_cjs.createUniquenessContext(ctx.graphId, ctx.registry, backend),
|
|
471
471
|
kind,
|
|
472
472
|
id,
|
|
473
473
|
validatedProps,
|
|
@@ -499,8 +499,8 @@ async function validateAndPrepareNodeCreate(ctx, input, id, backend, options) {
|
|
|
499
499
|
);
|
|
500
500
|
}
|
|
501
501
|
async function finalizeNodeCreateBatch(ctx, preparedCreates, backend, lock) {
|
|
502
|
-
await
|
|
503
|
-
|
|
502
|
+
await chunk32UETY6S_cjs.applyNodeInsertSideEffectsBatch(
|
|
503
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
504
504
|
preparedCreates.map((prepared) => ({
|
|
505
505
|
kind: prepared.kind,
|
|
506
506
|
id: prepared.id,
|
|
@@ -515,8 +515,8 @@ function foldReferences(preparedCreates) {
|
|
|
515
515
|
return preparedCreates.filter((prepared) => prepared.idProvided).map((prepared) => ({ kind: prepared.kind, id: prepared.id }));
|
|
516
516
|
}
|
|
517
517
|
async function finalizeNodeCreate(ctx, prepared, backend, lock) {
|
|
518
|
-
await
|
|
519
|
-
|
|
518
|
+
await chunk32UETY6S_cjs.applyNodeInsertSideEffects(
|
|
519
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
520
520
|
{
|
|
521
521
|
kind: prepared.kind,
|
|
522
522
|
id: prepared.id,
|
|
@@ -529,7 +529,7 @@ async function finalizeNodeCreate(ctx, prepared, backend, lock) {
|
|
|
529
529
|
}
|
|
530
530
|
function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
531
531
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
532
|
-
const validatedProps =
|
|
532
|
+
const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(
|
|
533
533
|
registration.type.schema,
|
|
534
534
|
{ ...existingProps, ...inputProps },
|
|
535
535
|
{ kind, operation: "update", id }
|
|
@@ -537,7 +537,7 @@ function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
|
537
537
|
return { registration, validatedProps };
|
|
538
538
|
}
|
|
539
539
|
function resolveNodeUpdateProps(ctx, existing, inputProps) {
|
|
540
|
-
const existingProps =
|
|
540
|
+
const existingProps = chunkANKOXPCC_cjs.rowPropsToObject(existing.props);
|
|
541
541
|
const { registration, validatedProps } = computeNodeUpdate(
|
|
542
542
|
ctx,
|
|
543
543
|
existing.kind,
|
|
@@ -563,22 +563,22 @@ function nodeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps) {
|
|
|
563
563
|
async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
564
564
|
const { kind, id } = input;
|
|
565
565
|
const existing = await backend.getNode(ctx.graphId, kind, id);
|
|
566
|
-
if (!existing) throw new
|
|
566
|
+
if (!existing) throw new chunkKCH7WQA5_cjs.NodeNotFoundError(kind, id);
|
|
567
567
|
const { registration, validatedProps } = resolveNodeUpdateProps(
|
|
568
568
|
ctx,
|
|
569
569
|
existing,
|
|
570
570
|
input.props
|
|
571
571
|
);
|
|
572
572
|
const nodeKind = registration.type;
|
|
573
|
-
const validTo =
|
|
574
|
-
const resurrectionInstant = options?.clearDeleted === true && existing.deleted_at !== void 0 ?
|
|
575
|
-
const preservesLiveLowerBound = resurrectionInstant === void 0 &&
|
|
576
|
-
const statedValidFrom =
|
|
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(
|
|
577
577
|
input.validFrom,
|
|
578
578
|
"validFrom"
|
|
579
579
|
);
|
|
580
580
|
const validFrom = preservesLiveLowerBound ? void 0 : statedValidFrom;
|
|
581
|
-
const windowVerdict =
|
|
581
|
+
const windowVerdict = chunk5PDSCELM_cjs.assertWritableValidityWindow(
|
|
582
582
|
`${kind} "${id}"`,
|
|
583
583
|
validFrom,
|
|
584
584
|
resurrectionInstant === void 0 ? {
|
|
@@ -593,7 +593,7 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
593
593
|
},
|
|
594
594
|
validTo
|
|
595
595
|
);
|
|
596
|
-
const writeContext =
|
|
596
|
+
const writeContext = chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock);
|
|
597
597
|
const effectiveValidFrom = validFrom ?? resurrectionInstant;
|
|
598
598
|
const shared = {
|
|
599
599
|
schema: nodeKind.schema,
|
|
@@ -614,15 +614,15 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
614
614
|
...windowVerdict.storedLowerBoundFence
|
|
615
615
|
};
|
|
616
616
|
if (options?.clearDeleted) {
|
|
617
|
-
const row2 = await
|
|
617
|
+
const row2 = await chunk32UETY6S_cjs.applyNodeUpdate(
|
|
618
618
|
writeContext,
|
|
619
619
|
{ ...shared, existing, clearDeleted: true },
|
|
620
620
|
backend
|
|
621
621
|
);
|
|
622
622
|
return rowToNode(row2);
|
|
623
623
|
}
|
|
624
|
-
if (!
|
|
625
|
-
const row = await
|
|
624
|
+
if (!chunkANKOXPCC_cjs.isLiveNodeRow(existing)) throw new chunkKCH7WQA5_cjs.NodeNotFoundError(kind, id);
|
|
625
|
+
const row = await chunk32UETY6S_cjs.applyNodeUpdate(
|
|
626
626
|
writeContext,
|
|
627
627
|
{ ...shared, existing },
|
|
628
628
|
backend
|
|
@@ -646,15 +646,15 @@ async function performNodeUpdateWithResurrectionRecovery(ctx, input, target, loc
|
|
|
646
646
|
}
|
|
647
647
|
const current = await target.getNode(ctx.graphId, input.kind, input.id);
|
|
648
648
|
if (current === void 0 || current.deleted_at !== void 0) {
|
|
649
|
-
throw new
|
|
649
|
+
throw new chunkKCH7WQA5_cjs.NodeNotFoundError(input.kind, input.id);
|
|
650
650
|
}
|
|
651
651
|
}
|
|
652
652
|
}
|
|
653
|
-
throw new
|
|
653
|
+
throw new chunkKCH7WQA5_cjs.NodeNotFoundError(input.kind, input.id);
|
|
654
654
|
}
|
|
655
655
|
function nodeUpdateRaceError(input, error) {
|
|
656
656
|
if (!isNodeUpdateNoRowError(error)) return error;
|
|
657
|
-
return new
|
|
657
|
+
return new chunkKCH7WQA5_cjs.DatabaseOperationError(
|
|
658
658
|
`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
659
|
{
|
|
660
660
|
operation: "update",
|
|
@@ -685,19 +685,19 @@ async function primeBatchValidationCaches(ctx, drafts, backend, seams) {
|
|
|
685
685
|
const groups = /* @__PURE__ */ new Map();
|
|
686
686
|
for (const draft of drafts) {
|
|
687
687
|
for (const constraint of draft.uniqueConstraints) {
|
|
688
|
-
if (!
|
|
689
|
-
const key =
|
|
688
|
+
if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, draft.validatedProps)) continue;
|
|
689
|
+
const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
690
690
|
draft.validatedProps,
|
|
691
691
|
constraint.fields,
|
|
692
692
|
constraint.collation
|
|
693
693
|
);
|
|
694
|
-
const kindsToCheck =
|
|
694
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
695
695
|
draft.kind,
|
|
696
696
|
constraint.scope,
|
|
697
697
|
ctx.registry
|
|
698
698
|
);
|
|
699
699
|
for (const kindToCheck of kindsToCheck) {
|
|
700
|
-
const groupKey =
|
|
700
|
+
const groupKey = chunkQPOQX2DI_cjs.encodeTupleKey([kindToCheck, constraint.name]);
|
|
701
701
|
const group = groups.get(groupKey) ?? {
|
|
702
702
|
nodeKind: kindToCheck,
|
|
703
703
|
constraintName: constraint.name,
|
|
@@ -737,7 +737,7 @@ async function prepareBatchCreates(ctx, inputs, backend, options) {
|
|
|
737
737
|
seedUniqueRow
|
|
738
738
|
} = createNodeBatchValidationBackend(ctx.graphId, ctx.registry, backend);
|
|
739
739
|
const drafts = inputs.map(
|
|
740
|
-
(input) => draftNodeCreate(ctx, input, input.id ??
|
|
740
|
+
(input) => draftNodeCreate(ctx, input, input.id ?? chunkA4R3H7RU_cjs.generateId(), options)
|
|
741
741
|
);
|
|
742
742
|
await primeBatchValidationCaches(ctx, drafts, backend, {
|
|
743
743
|
seedNodeRow,
|
|
@@ -774,12 +774,12 @@ function partitionCreates(preparedCreates) {
|
|
|
774
774
|
return { inserts, resurrections };
|
|
775
775
|
}
|
|
776
776
|
function isNodeUpdateNoRowError(error) {
|
|
777
|
-
return error instanceof
|
|
777
|
+
return error instanceof chunkKCH7WQA5_cjs.DatabaseOperationError && error.details.operation === "update" && error.details.entity === "node" && error.details.reason === "no_row_returned";
|
|
778
778
|
}
|
|
779
779
|
async function resurrectPreparedNode(ctx, target, lock, prepared) {
|
|
780
780
|
const current = await target.getNode(ctx.graphId, prepared.kind, prepared.id);
|
|
781
781
|
if (current === void 0) {
|
|
782
|
-
throw new
|
|
782
|
+
throw new chunkKCH7WQA5_cjs.DatabaseOperationError(
|
|
783
783
|
`Node tombstone disappeared before resurrection: ${prepared.kind} ${prepared.id}`,
|
|
784
784
|
{ operation: "update", entity: "node" }
|
|
785
785
|
);
|
|
@@ -788,8 +788,8 @@ async function resurrectPreparedNode(ctx, target, lock, prepared) {
|
|
|
788
788
|
throw createAlreadyExistsError("node", prepared.kind, prepared.id);
|
|
789
789
|
}
|
|
790
790
|
try {
|
|
791
|
-
return await
|
|
792
|
-
|
|
791
|
+
return await chunk32UETY6S_cjs.applyNodeUpdate(
|
|
792
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
793
793
|
{
|
|
794
794
|
existing: current,
|
|
795
795
|
clearDeleted: true,
|
|
@@ -863,10 +863,10 @@ async function batchCheckUniqueAcrossKinds(backend, graphId, constraintName, uni
|
|
|
863
863
|
}
|
|
864
864
|
async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
865
865
|
const kind = input.kind;
|
|
866
|
-
const id = input.id ??
|
|
866
|
+
const id = input.id ?? chunkA4R3H7RU_cjs.generateId();
|
|
867
867
|
const opContext = ctx.createOperationContext("create", "node", kind, id);
|
|
868
868
|
const shouldReturnRow = options?.returnRow ?? true;
|
|
869
|
-
return
|
|
869
|
+
return chunkQPOQX2DI_cjs.runHookedWriteOperation(
|
|
870
870
|
ctx,
|
|
871
871
|
opContext,
|
|
872
872
|
backend,
|
|
@@ -895,8 +895,8 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
895
895
|
}
|
|
896
896
|
const row = await withAlreadyExistsTranslation("node", async () => {
|
|
897
897
|
if (shouldReturnRow) return target.insertNode(prepared.insertParams);
|
|
898
|
-
await
|
|
899
|
-
|
|
898
|
+
await chunkA4R3H7RU_cjs.runInsertNoReturn(
|
|
899
|
+
chunkA4R3H7RU_cjs.nodeInsertDispatch(target),
|
|
900
900
|
prepared.insertParams
|
|
901
901
|
);
|
|
902
902
|
return;
|
|
@@ -919,7 +919,7 @@ async function executeNodeCreate(ctx, input, backend, options) {
|
|
|
919
919
|
...options
|
|
920
920
|
});
|
|
921
921
|
if (!result) {
|
|
922
|
-
throw new
|
|
922
|
+
throw new chunkKCH7WQA5_cjs.DatabaseOperationError(
|
|
923
923
|
"Node create failed: expected created node row",
|
|
924
924
|
{ operation: "insert", entity: "node" }
|
|
925
925
|
);
|
|
@@ -928,7 +928,7 @@ async function executeNodeCreate(ctx, input, backend, options) {
|
|
|
928
928
|
}
|
|
929
929
|
async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
930
930
|
if (inputs.length === 0) return;
|
|
931
|
-
await
|
|
931
|
+
await chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
932
932
|
ctx,
|
|
933
933
|
backend,
|
|
934
934
|
async (target, lock) => {
|
|
@@ -938,8 +938,8 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
938
938
|
const partition = partitionCreates(preparedCreates);
|
|
939
939
|
await withAlreadyExistsTranslation(
|
|
940
940
|
"node",
|
|
941
|
-
() =>
|
|
942
|
-
|
|
941
|
+
() => chunkA4R3H7RU_cjs.runInsertBatch(
|
|
942
|
+
chunkA4R3H7RU_cjs.nodeInsertDispatch(target),
|
|
943
943
|
partition.inserts.map((prepared) => prepared.insertParams)
|
|
944
944
|
)
|
|
945
945
|
);
|
|
@@ -962,7 +962,7 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
962
962
|
}
|
|
963
963
|
async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
964
964
|
if (inputs.length === 0) return [];
|
|
965
|
-
return
|
|
965
|
+
return chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
966
966
|
ctx,
|
|
967
967
|
backend,
|
|
968
968
|
async (target, lock) => {
|
|
@@ -977,8 +977,8 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
977
977
|
const partition = partitionCreates(preparedCreates);
|
|
978
978
|
const inserted = await withAlreadyExistsTranslation(
|
|
979
979
|
"node",
|
|
980
|
-
() =>
|
|
981
|
-
|
|
980
|
+
() => chunkA4R3H7RU_cjs.runInsertBatchReturning(
|
|
981
|
+
chunkA4R3H7RU_cjs.nodeInsertDispatch(target),
|
|
982
982
|
partition.inserts.map((prepared) => prepared.insertParams)
|
|
983
983
|
)
|
|
984
984
|
);
|
|
@@ -991,13 +991,13 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
991
991
|
await finalizeNodeCreateBatch(ctx, partition.inserts, target, lock);
|
|
992
992
|
const byReference = new Map(
|
|
993
993
|
[...inserted, ...resurrected].map((row) => [
|
|
994
|
-
|
|
994
|
+
chunkQPOQX2DI_cjs.refKey({ kind: row.kind, id: row.id }),
|
|
995
995
|
row
|
|
996
996
|
])
|
|
997
997
|
);
|
|
998
998
|
const rows = preparedCreates.map(
|
|
999
999
|
(prepared) => chunkN66HCGCY_cjs.requireDefined(
|
|
1000
|
-
byReference.get(
|
|
1000
|
+
byReference.get(chunkQPOQX2DI_cjs.refKey({ kind: prepared.kind, id: prepared.id })),
|
|
1001
1001
|
`Missing written row for ${prepared.kind} ${prepared.id}`
|
|
1002
1002
|
)
|
|
1003
1003
|
);
|
|
@@ -1022,7 +1022,7 @@ async function executeNodeUpdate(ctx, input, backend, options) {
|
|
|
1022
1022
|
input.kind,
|
|
1023
1023
|
input.id
|
|
1024
1024
|
);
|
|
1025
|
-
return
|
|
1025
|
+
return chunkQPOQX2DI_cjs.runHookedWriteOperation(
|
|
1026
1026
|
ctx,
|
|
1027
1027
|
opContext,
|
|
1028
1028
|
backend,
|
|
@@ -1059,19 +1059,19 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1059
1059
|
const schema = registration.type.schema;
|
|
1060
1060
|
const uniqueConstraints = registration.unique ?? [];
|
|
1061
1061
|
if (!backend.capabilities.transactions) {
|
|
1062
|
-
throw new
|
|
1062
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1063
1063
|
"updateWhere() requires a transactional backend so validation and sidecars are atomic",
|
|
1064
1064
|
{ code: "SET_UPDATE_TRANSACTIONS_REQUIRED", kind }
|
|
1065
1065
|
);
|
|
1066
1066
|
}
|
|
1067
1067
|
if (backend.updateNodeSet === void 0) {
|
|
1068
|
-
throw new
|
|
1068
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1069
1069
|
"This backend does not support set-based node updates",
|
|
1070
1070
|
{ code: "SET_UPDATE_UNSUPPORTED", kind }
|
|
1071
1071
|
);
|
|
1072
1072
|
}
|
|
1073
1073
|
if (Object.keys(inputPatch).length === 0) {
|
|
1074
|
-
throw new
|
|
1074
|
+
throw new chunkKCH7WQA5_cjs.ValidationError("updateWhere() patch must not be empty", {
|
|
1075
1075
|
entityType: "node",
|
|
1076
1076
|
kind,
|
|
1077
1077
|
operation: "update",
|
|
@@ -1082,7 +1082,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1082
1082
|
(property) => !Object.hasOwn(schema.shape, property)
|
|
1083
1083
|
);
|
|
1084
1084
|
if (unknownProperty !== void 0) {
|
|
1085
|
-
throw new
|
|
1085
|
+
throw new chunkKCH7WQA5_cjs.ValidationError(
|
|
1086
1086
|
`Unknown ${kind} property in updateWhere() patch: ${unknownProperty}`,
|
|
1087
1087
|
{
|
|
1088
1088
|
entityType: "node",
|
|
@@ -1097,7 +1097,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1097
1097
|
}
|
|
1098
1098
|
);
|
|
1099
1099
|
}
|
|
1100
|
-
const parsedPatch =
|
|
1100
|
+
const parsedPatch = chunkQPOQX2DI_cjs.validateNodeProps(schema.partial(), inputPatch, {
|
|
1101
1101
|
kind,
|
|
1102
1102
|
operation: "update"
|
|
1103
1103
|
});
|
|
@@ -1108,11 +1108,11 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1108
1108
|
unsetProperties.push(property);
|
|
1109
1109
|
continue;
|
|
1110
1110
|
}
|
|
1111
|
-
|
|
1111
|
+
chunkD6GCNNMK_cjs.assertJsonValue(value, property, `Node "${kind}" updateWhere patch`);
|
|
1112
1112
|
patch[property] = value;
|
|
1113
1113
|
}
|
|
1114
1114
|
if (Object.keys(patch).length === 0 && unsetProperties.length === 0) {
|
|
1115
|
-
throw new
|
|
1115
|
+
throw new chunkKCH7WQA5_cjs.ValidationError(
|
|
1116
1116
|
"updateWhere() patch has no recognized properties",
|
|
1117
1117
|
{
|
|
1118
1118
|
entityType: "node",
|
|
@@ -1125,19 +1125,19 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1125
1125
|
);
|
|
1126
1126
|
}
|
|
1127
1127
|
if (uniqueConstraints.length > 0 && (backend.hardDeleteUniquesByNodeIds === void 0 || backend.insertUniqueBatch === void 0 || backend.checkUniqueBatch === void 0)) {
|
|
1128
|
-
throw new
|
|
1128
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1129
1129
|
"updateWhere() requires batched uniqueness sidecar operations for constrained nodes",
|
|
1130
1130
|
{ code: "SET_UPDATE_UNIQUENESS_UNSUPPORTED", kind }
|
|
1131
1131
|
);
|
|
1132
1132
|
}
|
|
1133
1133
|
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
|
|
1134
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1135
1135
|
"updateWhere() requires batched fulltext sidecar operations for searchable nodes",
|
|
1136
1136
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1137
1137
|
);
|
|
1138
1138
|
}
|
|
1139
|
-
if (
|
|
1140
|
-
throw new
|
|
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(
|
|
1141
1141
|
"updateWhere() requires batched vector sidecar operations for embedded nodes",
|
|
1142
1142
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
1143
1143
|
);
|
|
@@ -1145,32 +1145,32 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1145
1145
|
const hookContext = ctx.createBulkOperationContext("updateWhere", kind);
|
|
1146
1146
|
return ctx.withBulkOperationHooks(
|
|
1147
1147
|
hookContext,
|
|
1148
|
-
() =>
|
|
1148
|
+
() => chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
1149
1149
|
ctx,
|
|
1150
1150
|
backend,
|
|
1151
1151
|
async (target, lock) => {
|
|
1152
1152
|
const updateNodeSet = target.updateNodeSet;
|
|
1153
1153
|
if (updateNodeSet === void 0) {
|
|
1154
|
-
throw new
|
|
1154
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1155
1155
|
"The transaction backend does not support set-based node updates",
|
|
1156
1156
|
{ code: "SET_UPDATE_UNSUPPORTED", kind }
|
|
1157
1157
|
);
|
|
1158
1158
|
}
|
|
1159
1159
|
const hardDeleteUniquesByNodeIds = target.hardDeleteUniquesByNodeIds;
|
|
1160
1160
|
if (uniqueConstraints.length > 0 && (hardDeleteUniquesByNodeIds === void 0 || target.insertUniqueBatch === void 0 || target.checkUniqueBatch === void 0)) {
|
|
1161
|
-
throw new
|
|
1161
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1162
1162
|
"The transaction backend lacks batched uniqueness operations",
|
|
1163
1163
|
{ code: "SET_UPDATE_UNIQUENESS_UNSUPPORTED", kind }
|
|
1164
1164
|
);
|
|
1165
1165
|
}
|
|
1166
1166
|
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
|
|
1167
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1168
1168
|
"The transaction backend lacks batched fulltext operations",
|
|
1169
1169
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1170
1170
|
);
|
|
1171
1171
|
}
|
|
1172
|
-
if (
|
|
1173
|
-
throw new
|
|
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(
|
|
1174
1174
|
"The transaction backend lacks batched vector operations",
|
|
1175
1175
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
1176
1176
|
);
|
|
@@ -1185,14 +1185,14 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1185
1185
|
});
|
|
1186
1186
|
if (result.affectedCount === 0) return { affectedCount: 0 };
|
|
1187
1187
|
const sidecarItems = result.rows.map((row) => {
|
|
1188
|
-
const props =
|
|
1189
|
-
const validatedProps =
|
|
1188
|
+
const props = chunkANKOXPCC_cjs.rowPropsToObject(row.props);
|
|
1189
|
+
const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(schema, props, {
|
|
1190
1190
|
kind,
|
|
1191
1191
|
operation: "update",
|
|
1192
1192
|
id: row.id
|
|
1193
1193
|
});
|
|
1194
1194
|
if (!chunkPWLJ77UV_cjs.canonicalEqual(validatedProps, props)) {
|
|
1195
|
-
throw new
|
|
1195
|
+
throw new chunkKCH7WQA5_cjs.ValidationError(
|
|
1196
1196
|
`Set update would persist a non-canonical ${kind} row`,
|
|
1197
1197
|
{
|
|
1198
1198
|
entityType: "node",
|
|
@@ -1221,15 +1221,15 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1221
1221
|
for (const constraint of uniqueConstraints) {
|
|
1222
1222
|
const keyToId = /* @__PURE__ */ new Map();
|
|
1223
1223
|
for (const item of sidecarItems) {
|
|
1224
|
-
if (!
|
|
1225
|
-
const key =
|
|
1224
|
+
if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, item.props)) continue;
|
|
1225
|
+
const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
1226
1226
|
item.props,
|
|
1227
1227
|
constraint.fields,
|
|
1228
1228
|
constraint.collation
|
|
1229
1229
|
);
|
|
1230
1230
|
const priorId = keyToId.get(key);
|
|
1231
1231
|
if (priorId !== void 0 && priorId !== item.id) {
|
|
1232
|
-
throw new
|
|
1232
|
+
throw new chunkKCH7WQA5_cjs.UniquenessError({
|
|
1233
1233
|
constraintName: constraint.name,
|
|
1234
1234
|
kind,
|
|
1235
1235
|
existingId: priorId,
|
|
@@ -1241,7 +1241,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1241
1241
|
}
|
|
1242
1242
|
const keys = [...keyToId.keys()];
|
|
1243
1243
|
if (keys.length === 0) continue;
|
|
1244
|
-
for (const kindToCheck of
|
|
1244
|
+
for (const kindToCheck of chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1245
1245
|
kind,
|
|
1246
1246
|
constraint.scope,
|
|
1247
1247
|
ctx.registry
|
|
@@ -1258,7 +1258,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1258
1258
|
if (existing.concrete_kind === kind && affectedIds.has(existing.node_id)) {
|
|
1259
1259
|
continue;
|
|
1260
1260
|
}
|
|
1261
|
-
throw new
|
|
1261
|
+
throw new chunkKCH7WQA5_cjs.UniquenessError({
|
|
1262
1262
|
constraintName: constraint.name,
|
|
1263
1263
|
kind: kindToCheck,
|
|
1264
1264
|
existingId: existing.node_id,
|
|
@@ -1274,8 +1274,8 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1274
1274
|
nodeIds: result.rows.map((row) => row.id)
|
|
1275
1275
|
});
|
|
1276
1276
|
}
|
|
1277
|
-
await
|
|
1278
|
-
|
|
1277
|
+
await chunk32UETY6S_cjs.applyNodeInsertSideEffectsBatch(
|
|
1278
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1279
1279
|
sidecarItems,
|
|
1280
1280
|
target
|
|
1281
1281
|
);
|
|
@@ -1292,7 +1292,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1292
1292
|
);
|
|
1293
1293
|
}
|
|
1294
1294
|
async function executeNodeUpsertUpdate(ctx, input, backend, options) {
|
|
1295
|
-
return
|
|
1295
|
+
return chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
1296
1296
|
ctx,
|
|
1297
1297
|
backend,
|
|
1298
1298
|
async (target, lock) => {
|
|
@@ -1327,7 +1327,7 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1327
1327
|
const gate = await backend.getNode(ctx.graphId, kind, id);
|
|
1328
1328
|
if (!gate || gate.deleted_at) return;
|
|
1329
1329
|
const opContext = ctx.createOperationContext("delete", "node", kind, id);
|
|
1330
|
-
return
|
|
1330
|
+
return chunkQPOQX2DI_cjs.runHookedWriteOperation(
|
|
1331
1331
|
ctx,
|
|
1332
1332
|
opContext,
|
|
1333
1333
|
backend,
|
|
@@ -1336,9 +1336,9 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1336
1336
|
if (identity !== void 0) await identity.lock(target);
|
|
1337
1337
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1338
1338
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1339
|
-
if (!preflight || !
|
|
1340
|
-
await
|
|
1341
|
-
|
|
1339
|
+
if (!preflight || !chunkANKOXPCC_cjs.isLiveNodeRow(preflight)) return;
|
|
1340
|
+
await chunk32UETY6S_cjs.applyNodeSoftDelete(
|
|
1341
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1342
1342
|
{
|
|
1343
1343
|
existing: preflight,
|
|
1344
1344
|
schema: registration.type.schema,
|
|
@@ -1354,14 +1354,14 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1354
1354
|
);
|
|
1355
1355
|
}
|
|
1356
1356
|
async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
1357
|
-
await
|
|
1357
|
+
await chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
1358
1358
|
ctx,
|
|
1359
1359
|
backend,
|
|
1360
1360
|
async (target, lock) => {
|
|
1361
1361
|
const identity = ctx.identity;
|
|
1362
1362
|
if (identity !== void 0) await identity.lock(target);
|
|
1363
1363
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1364
|
-
const writeContext =
|
|
1364
|
+
const writeContext = chunk32UETY6S_cjs.createNodeWriteContext(
|
|
1365
1365
|
ctx.graphId,
|
|
1366
1366
|
ctx.registry,
|
|
1367
1367
|
lock
|
|
@@ -1369,8 +1369,8 @@ async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
|
1369
1369
|
let affectedCount = 0;
|
|
1370
1370
|
for (const id of ids) {
|
|
1371
1371
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1372
|
-
if (!preflight || !
|
|
1373
|
-
await
|
|
1372
|
+
if (!preflight || !chunkANKOXPCC_cjs.isLiveNodeRow(preflight)) continue;
|
|
1373
|
+
await chunk32UETY6S_cjs.applyNodeSoftDelete(
|
|
1374
1374
|
writeContext,
|
|
1375
1375
|
{
|
|
1376
1376
|
existing: preflight,
|
|
@@ -1394,7 +1394,7 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
|
|
|
1394
1394
|
const gate = await backend.getNode(ctx.graphId, kind, id);
|
|
1395
1395
|
if (!gate) return;
|
|
1396
1396
|
const opContext = ctx.createOperationContext("delete", "node", kind, id);
|
|
1397
|
-
return
|
|
1397
|
+
return chunkQPOQX2DI_cjs.runHookedWriteOperation(
|
|
1398
1398
|
ctx,
|
|
1399
1399
|
opContext,
|
|
1400
1400
|
backend,
|
|
@@ -1402,8 +1402,8 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
|
|
|
1402
1402
|
const identity = ctx.identity;
|
|
1403
1403
|
if (identity !== void 0) await identity.lock(target);
|
|
1404
1404
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1405
|
-
await
|
|
1406
|
-
|
|
1405
|
+
await chunk32UETY6S_cjs.applyNodeHardDelete(
|
|
1406
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1407
1407
|
{
|
|
1408
1408
|
kind,
|
|
1409
1409
|
id,
|
|
@@ -1422,12 +1422,12 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1422
1422
|
const ifExists = options?.ifExists ?? "return";
|
|
1423
1423
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1424
1424
|
const nodeKind = registration.type;
|
|
1425
|
-
const validatedProps =
|
|
1425
|
+
const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1426
1426
|
kind,
|
|
1427
1427
|
operation: "create"
|
|
1428
1428
|
});
|
|
1429
1429
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1430
|
-
if (!
|
|
1430
|
+
if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, validatedProps)) {
|
|
1431
1431
|
const node = await executeNodeCreate(
|
|
1432
1432
|
ctx,
|
|
1433
1433
|
{ kind, props: validatedProps },
|
|
@@ -1436,12 +1436,12 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1436
1436
|
);
|
|
1437
1437
|
return { node, action: "created" };
|
|
1438
1438
|
}
|
|
1439
|
-
const key =
|
|
1439
|
+
const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
1440
1440
|
validatedProps,
|
|
1441
1441
|
constraint.fields,
|
|
1442
1442
|
constraint.collation
|
|
1443
1443
|
);
|
|
1444
|
-
const kindsToCheck =
|
|
1444
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1445
1445
|
kind,
|
|
1446
1446
|
constraint.scope,
|
|
1447
1447
|
ctx.registry
|
|
@@ -1498,25 +1498,25 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1498
1498
|
try {
|
|
1499
1499
|
return await attempt();
|
|
1500
1500
|
} catch (error) {
|
|
1501
|
-
if (!(error instanceof
|
|
1501
|
+
if (!(error instanceof chunkKCH7WQA5_cjs.UniquenessError)) throw error;
|
|
1502
1502
|
return attempt();
|
|
1503
1503
|
}
|
|
1504
1504
|
}
|
|
1505
1505
|
async function executeNodeFindByConstraint(ctx, kind, constraintName, props, backend) {
|
|
1506
1506
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1507
1507
|
const nodeKind = registration.type;
|
|
1508
|
-
const validatedProps =
|
|
1508
|
+
const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1509
1509
|
kind,
|
|
1510
1510
|
operation: "create"
|
|
1511
1511
|
});
|
|
1512
1512
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1513
|
-
if (!
|
|
1514
|
-
const key =
|
|
1513
|
+
if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, validatedProps)) return void 0;
|
|
1514
|
+
const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
1515
1515
|
validatedProps,
|
|
1516
1516
|
constraint.fields,
|
|
1517
1517
|
constraint.collation
|
|
1518
1518
|
);
|
|
1519
|
-
const kindsToCheck =
|
|
1519
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1520
1520
|
kind,
|
|
1521
1521
|
constraint.scope,
|
|
1522
1522
|
ctx.registry
|
|
@@ -1542,12 +1542,12 @@ async function executeNodeFindByConstraint(ctx, kind, constraintName, props, bac
|
|
|
1542
1542
|
function validateAndComputeKeys(nodeKind, kind, constraint, items) {
|
|
1543
1543
|
const validated = [];
|
|
1544
1544
|
for (const item of items) {
|
|
1545
|
-
const validatedProps =
|
|
1545
|
+
const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, item.props, {
|
|
1546
1546
|
kind,
|
|
1547
1547
|
operation: "create"
|
|
1548
1548
|
});
|
|
1549
|
-
const applies =
|
|
1550
|
-
const key = applies ?
|
|
1549
|
+
const applies = chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, validatedProps);
|
|
1550
|
+
const key = applies ? chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
1551
1551
|
validatedProps,
|
|
1552
1552
|
constraint.fields,
|
|
1553
1553
|
constraint.collation
|
|
@@ -1570,7 +1570,7 @@ async function executeNodeBulkFindByConstraint(ctx, kind, constraintName, items,
|
|
|
1570
1570
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1571
1571
|
const validated = validateAndComputeKeys(nodeKind, kind, constraint, items);
|
|
1572
1572
|
const uniqueKeys = collectUniqueKeys(validated);
|
|
1573
|
-
const kindsToCheck =
|
|
1573
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1574
1574
|
kind,
|
|
1575
1575
|
constraint.scope,
|
|
1576
1576
|
ctx.registry
|
|
@@ -1620,10 +1620,10 @@ function resolveNodeIndex(graph, kind, indexName) {
|
|
|
1620
1620
|
(candidate) => candidate.entity === "node" && candidate.kind === kind && candidate.name === indexName
|
|
1621
1621
|
);
|
|
1622
1622
|
if (declaration?.entity !== "node") {
|
|
1623
|
-
throw new
|
|
1623
|
+
throw new chunkKCH7WQA5_cjs.NodeIndexNotFoundError(indexName, kind);
|
|
1624
1624
|
}
|
|
1625
1625
|
if (declaration.method !== void 0) {
|
|
1626
|
-
throw new
|
|
1626
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1627
1627
|
`bulkFindByIndex cannot probe index "${indexName}" (method "${declaration.method}"): only btree indexes serve equality probes.`,
|
|
1628
1628
|
{ indexName, kind, method: declaration.method }
|
|
1629
1629
|
);
|
|
@@ -1661,7 +1661,7 @@ function validateIndexProbeValue(value, valueType, pointer, kind) {
|
|
|
1661
1661
|
}
|
|
1662
1662
|
}
|
|
1663
1663
|
function indexProbeTypeError(pointer, kind, expected, value) {
|
|
1664
|
-
return new
|
|
1664
|
+
return new chunkKCH7WQA5_cjs.ValidationError(
|
|
1665
1665
|
`Index probe value for "${pointer}" on node kind "${kind}" has an incompatible type`,
|
|
1666
1666
|
{
|
|
1667
1667
|
entityType: "node",
|
|
@@ -1695,7 +1695,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1695
1695
|
if (items.length === 0) return [];
|
|
1696
1696
|
const index = resolveNodeIndex(ctx.graph, kind, indexName);
|
|
1697
1697
|
if (index.fields.length === 0) {
|
|
1698
|
-
throw new
|
|
1698
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1699
1699
|
`bulkFindByIndex requires an index with at least one prop-based field on index "${indexName}" (node kind "${kind}")`,
|
|
1700
1700
|
{ indexName, kind },
|
|
1701
1701
|
{
|
|
@@ -1704,7 +1704,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1704
1704
|
);
|
|
1705
1705
|
}
|
|
1706
1706
|
if (index.fieldValueTypes.includes("date")) {
|
|
1707
|
-
throw new
|
|
1707
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1708
1708
|
`bulkFindByIndex does not support date-typed key fields on index "${indexName}" (node kind "${kind}")`,
|
|
1709
1709
|
{ indexName, kind },
|
|
1710
1710
|
{
|
|
@@ -1714,7 +1714,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1714
1714
|
}
|
|
1715
1715
|
const limitPerInput = options?.limitPerInput;
|
|
1716
1716
|
if (limitPerInput !== void 0 && (!Number.isInteger(limitPerInput) || limitPerInput <= 0)) {
|
|
1717
|
-
throw new
|
|
1717
|
+
throw new chunkKCH7WQA5_cjs.ValidationError(
|
|
1718
1718
|
"bulkFindByIndex limitPerInput must be a positive integer",
|
|
1719
1719
|
{
|
|
1720
1720
|
entityType: "node",
|
|
@@ -1729,7 +1729,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1729
1729
|
}
|
|
1730
1730
|
);
|
|
1731
1731
|
}
|
|
1732
|
-
const adapter =
|
|
1732
|
+
const adapter = chunkZHOAZD7Q_cjs.getDialect(backend.dialect);
|
|
1733
1733
|
const probes = items.map(
|
|
1734
1734
|
(item) => index.fields.map((pointer, position) => {
|
|
1735
1735
|
const value = chunkA7J2YDDI_cjs.resolveJsonPointer(item.props, pointer);
|
|
@@ -1756,47 +1756,47 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1756
1756
|
}
|
|
1757
1757
|
groupToInputs[existing]?.push(inputIndex);
|
|
1758
1758
|
}
|
|
1759
|
-
const schema = backend.tableNames ?
|
|
1759
|
+
const schema = backend.tableNames ? chunkQU7QLJA4_cjs.createSqlSchema(backend.tableNames) : chunkQU7QLJA4_cjs.DEFAULT_SQL_SCHEMA;
|
|
1760
1760
|
const compileContext = {
|
|
1761
1761
|
dialect: backend.dialect,
|
|
1762
|
-
propsColumn:
|
|
1763
|
-
systemColumn: (column) =>
|
|
1762
|
+
propsColumn: chunk2ZWM2RFH_cjs.sql.raw(`"props"`),
|
|
1763
|
+
systemColumn: (column) => chunk2ZWM2RFH_cjs.sql.raw(`"${column}"`)
|
|
1764
1764
|
};
|
|
1765
|
-
const fieldKeys =
|
|
1765
|
+
const fieldKeys = chunkZHOAZD7Q_cjs.compileNodeIndexFieldKeys(index, compileContext);
|
|
1766
1766
|
const groupPredicates = groupProbes.map(
|
|
1767
|
-
(probe) =>
|
|
1767
|
+
(probe) => chunk2ZWM2RFH_cjs.sql`(${chunk2ZWM2RFH_cjs.sql.join(
|
|
1768
1768
|
fieldKeys.map((fieldKey, position) => {
|
|
1769
1769
|
const value = probe[position];
|
|
1770
1770
|
if (value === void 0 || value === null) {
|
|
1771
|
-
return
|
|
1771
|
+
return chunk2ZWM2RFH_cjs.sql`${fieldKey} IS NULL`;
|
|
1772
1772
|
}
|
|
1773
1773
|
return adapter.nullSafeEquals(
|
|
1774
1774
|
fieldKey,
|
|
1775
|
-
|
|
1775
|
+
chunk2ZWM2RFH_cjs.sql`${coerceIndexProbeBind(value, adapter)}`
|
|
1776
1776
|
);
|
|
1777
1777
|
}),
|
|
1778
|
-
|
|
1778
|
+
chunk2ZWM2RFH_cjs.sql` AND `
|
|
1779
1779
|
)})`
|
|
1780
1780
|
);
|
|
1781
1781
|
const caseBranches = groupPredicates.map(
|
|
1782
|
-
(predicate, group) =>
|
|
1782
|
+
(predicate, group) => chunk2ZWM2RFH_cjs.sql`WHEN ${predicate} THEN ${chunk2ZWM2RFH_cjs.sql.raw(String(group))}`
|
|
1783
1783
|
);
|
|
1784
|
-
const probeIndexExpr =
|
|
1784
|
+
const probeIndexExpr = chunk2ZWM2RFH_cjs.sql`CASE ${chunk2ZWM2RFH_cjs.sql.join(caseBranches, chunk2ZWM2RFH_cjs.sql` `)} ELSE NULL END`;
|
|
1785
1785
|
const conditions = [
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1786
|
+
chunk2ZWM2RFH_cjs.sql`"graph_id" = ${ctx.graphId}`,
|
|
1787
|
+
chunk2ZWM2RFH_cjs.sql`"kind" = ${kind}`,
|
|
1788
|
+
chunk2ZWM2RFH_cjs.sql`"deleted_at" IS NULL`
|
|
1789
1789
|
];
|
|
1790
1790
|
if (index.where !== void 0) {
|
|
1791
|
-
conditions.push(
|
|
1791
|
+
conditions.push(chunkZHOAZD7Q_cjs.compileIndexWhere(compileContext, index.where));
|
|
1792
1792
|
}
|
|
1793
|
-
conditions.push(
|
|
1794
|
-
const whereClause =
|
|
1795
|
-
const probedSelect =
|
|
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}`;
|
|
1796
1796
|
const capInSql = limitPerInput !== void 0 && backend.capabilities.windowFunctions;
|
|
1797
|
-
const query = capInSql ?
|
|
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"`;
|
|
1798
1798
|
const rawMatches = await backend.execute(
|
|
1799
|
-
|
|
1799
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(query)
|
|
1800
1800
|
);
|
|
1801
1801
|
const matches = limitPerInput !== void 0 && !capInSql ? capMatchesPerGroup(rawMatches, limitPerInput) : rawMatches;
|
|
1802
1802
|
const nodesById = await hydrateNodesById(
|
|
@@ -1829,7 +1829,7 @@ function capMatchesPerGroup(matches, limitPerInput) {
|
|
|
1829
1829
|
return capped;
|
|
1830
1830
|
}
|
|
1831
1831
|
async function hydrateNodesById(backend, graphId, kind, ids) {
|
|
1832
|
-
const rowsById = await
|
|
1832
|
+
const rowsById = await chunkA4R3H7RU_cjs.getNodeRowsByIds(backend, graphId, kind, ids);
|
|
1833
1833
|
const nodesById = /* @__PURE__ */ new Map();
|
|
1834
1834
|
for (const [id, row] of rowsById) {
|
|
1835
1835
|
if (row.deleted_at !== void 0) continue;
|
|
@@ -1845,7 +1845,7 @@ async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName,
|
|
|
1845
1845
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1846
1846
|
const validated = validateAndComputeKeys(nodeKind, kind, constraint, items);
|
|
1847
1847
|
const uniqueKeys = collectUniqueKeys(validated);
|
|
1848
|
-
const kindsToCheck =
|
|
1848
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1849
1849
|
kind,
|
|
1850
1850
|
constraint.scope,
|
|
1851
1851
|
ctx.registry
|
|
@@ -1948,7 +1948,7 @@ async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName,
|
|
|
1948
1948
|
try {
|
|
1949
1949
|
return await attempt();
|
|
1950
1950
|
} catch (error) {
|
|
1951
|
-
if (!(error instanceof
|
|
1951
|
+
if (!(error instanceof chunkKCH7WQA5_cjs.UniquenessError)) throw error;
|
|
1952
1952
|
return attempt();
|
|
1953
1953
|
}
|
|
1954
1954
|
}
|
|
@@ -1977,5 +1977,5 @@ exports.rowToEdgeMeta = rowToEdgeMeta;
|
|
|
1977
1977
|
exports.rowToNode = rowToNode;
|
|
1978
1978
|
exports.rowToNodeMeta = rowToNodeMeta;
|
|
1979
1979
|
exports.withAlreadyExistsTranslation = withAlreadyExistsTranslation;
|
|
1980
|
-
//# sourceMappingURL=chunk-
|
|
1981
|
-
//# sourceMappingURL=chunk-
|
|
1980
|
+
//# sourceMappingURL=chunk-BQM5P2NO.cjs.map
|
|
1981
|
+
//# sourceMappingURL=chunk-BQM5P2NO.cjs.map
|