@nicia-ai/typegraph 0.46.0 → 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-TTAITEPJ.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-Q7Q4WSLJ.cjs → chunk-5PDSCELM.cjs} +18 -14
- package/dist/chunk-5PDSCELM.cjs.map +1 -0
- 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-JIVMTW7W.js → chunk-A2LJG5GM.js} +9 -9
- package/dist/{chunk-JIVMTW7W.js.map → chunk-A2LJG5GM.js.map} +1 -1
- package/dist/{chunk-XMQSEJCF.cjs → chunk-A4R3H7RU.cjs} +237 -237
- package/dist/{chunk-XMQSEJCF.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-OH5E5KIO.js → chunk-AT3MLMJV.js} +10 -10
- package/dist/{chunk-OH5E5KIO.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-7GT72YHH.cjs → chunk-BQM5P2NO.cjs} +169 -167
- package/dist/chunk-BQM5P2NO.cjs.map +1 -0
- 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-XDF2UPEQ.cjs → chunk-C6KE2HSQ.cjs} +1364 -1311
- 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-NQ6BRJBE.js → chunk-EDHV4CBU.js} +8 -8
- package/dist/{chunk-NQ6BRJBE.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-N3257XE6.cjs → chunk-F36KZDFX.cjs} +91 -91
- package/dist/{chunk-N3257XE6.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-CNV4TXJG.js → chunk-GWUWRZXW.js} +3 -3
- package/dist/{chunk-CNV4TXJG.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-ONU3HIED.cjs → chunk-HNYLMPQQ.cjs} +68 -68
- package/dist/{chunk-ONU3HIED.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-QLRESYPU.js → chunk-KA4L2NZ3.js} +14 -14
- package/dist/{chunk-QLRESYPU.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-WEVQJ5LH.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-XNSI2FJO.cjs → chunk-N3QTGPC7.cjs} +99 -99
- package/dist/{chunk-XNSI2FJO.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-XNLIZYRZ.cjs → chunk-QPOQX2DI.cjs} +235 -235
- package/dist/{chunk-XNLIZYRZ.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-DLNROMQ7.js → chunk-R7EWHKID.js} +7 -4
- package/dist/chunk-R7EWHKID.js.map +1 -0
- 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-QWX5YA3K.js → chunk-WEJHA7AD.js} +18 -16
- package/dist/chunk-WEJHA7AD.js.map +1 -0
- 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-XQSCL77R.cjs → chunk-XBHRKLZU.cjs} +4 -4
- package/dist/{chunk-XQSCL77R.cjs.map → chunk-XBHRKLZU.cjs.map} +1 -1
- package/dist/{chunk-7Z5OR7KO.js → chunk-YQ4JONWE.js} +102 -49
- package/dist/chunk-YQ4JONWE.js.map +1 -0
- package/dist/{chunk-RJS7DECT.js → chunk-Z43KWLZF.js} +8 -8
- package/dist/{chunk-RJS7DECT.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-DawaWWjJ.d.ts → store-Bo1psfVZ.d.ts} +27 -8
- package/dist/{store-RwTJx8LX.d.cts → store-FTqBpuJD.d.cts} +27 -8
- 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.cts → types-Du78EvpN.d.cts} +7 -6
- package/dist/{types-HkveCCx0.d.ts → 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 +3 -3
- package/dist/chunk-5763DULU.js.map +0 -1
- package/dist/chunk-7GT72YHH.cjs.map +0 -1
- package/dist/chunk-7VQXLT5O.js.map +0 -1
- package/dist/chunk-7Z5OR7KO.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-DLNROMQ7.js.map +0 -1
- package/dist/chunk-J3WZ3FA2.js.map +0 -1
- package/dist/chunk-MUK4BU7K.cjs.map +0 -1
- package/dist/chunk-NI72YOJB.cjs.map +0 -1
- package/dist/chunk-Q7Q4WSLJ.cjs.map +0 -1
- package/dist/chunk-QWX5YA3K.js.map +0 -1
- package/dist/chunk-TQR4KBY2.cjs.map +0 -1
- package/dist/chunk-TTAITEPJ.cjs.map +0 -1
- package/dist/chunk-VQH4VAWD.cjs +0 -12
- package/dist/chunk-WEVQJ5LH.js.map +0 -1
- package/dist/chunk-XBYVV3MP.cjs.map +0 -1
- package/dist/chunk-XDF2UPEQ.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,20 +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
|
|
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(
|
|
574
577
|
input.validFrom,
|
|
575
578
|
"validFrom"
|
|
576
579
|
);
|
|
577
|
-
const
|
|
578
|
-
const
|
|
579
|
-
const windowVerdict = chunkQ7Q4WSLJ_cjs.assertWritableValidityWindow(
|
|
580
|
+
const validFrom = preservesLiveLowerBound ? void 0 : statedValidFrom;
|
|
581
|
+
const windowVerdict = chunk5PDSCELM_cjs.assertWritableValidityWindow(
|
|
580
582
|
`${kind} "${id}"`,
|
|
581
583
|
validFrom,
|
|
582
584
|
resurrectionInstant === void 0 ? {
|
|
@@ -591,7 +593,7 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
591
593
|
},
|
|
592
594
|
validTo
|
|
593
595
|
);
|
|
594
|
-
const writeContext =
|
|
596
|
+
const writeContext = chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock);
|
|
595
597
|
const effectiveValidFrom = validFrom ?? resurrectionInstant;
|
|
596
598
|
const shared = {
|
|
597
599
|
schema: nodeKind.schema,
|
|
@@ -612,15 +614,15 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
612
614
|
...windowVerdict.storedLowerBoundFence
|
|
613
615
|
};
|
|
614
616
|
if (options?.clearDeleted) {
|
|
615
|
-
const row2 = await
|
|
617
|
+
const row2 = await chunk32UETY6S_cjs.applyNodeUpdate(
|
|
616
618
|
writeContext,
|
|
617
619
|
{ ...shared, existing, clearDeleted: true },
|
|
618
620
|
backend
|
|
619
621
|
);
|
|
620
622
|
return rowToNode(row2);
|
|
621
623
|
}
|
|
622
|
-
if (!
|
|
623
|
-
const row = await
|
|
624
|
+
if (!chunkANKOXPCC_cjs.isLiveNodeRow(existing)) throw new chunkKCH7WQA5_cjs.NodeNotFoundError(kind, id);
|
|
625
|
+
const row = await chunk32UETY6S_cjs.applyNodeUpdate(
|
|
624
626
|
writeContext,
|
|
625
627
|
{ ...shared, existing },
|
|
626
628
|
backend
|
|
@@ -644,15 +646,15 @@ async function performNodeUpdateWithResurrectionRecovery(ctx, input, target, loc
|
|
|
644
646
|
}
|
|
645
647
|
const current = await target.getNode(ctx.graphId, input.kind, input.id);
|
|
646
648
|
if (current === void 0 || current.deleted_at !== void 0) {
|
|
647
|
-
throw new
|
|
649
|
+
throw new chunkKCH7WQA5_cjs.NodeNotFoundError(input.kind, input.id);
|
|
648
650
|
}
|
|
649
651
|
}
|
|
650
652
|
}
|
|
651
|
-
throw new
|
|
653
|
+
throw new chunkKCH7WQA5_cjs.NodeNotFoundError(input.kind, input.id);
|
|
652
654
|
}
|
|
653
655
|
function nodeUpdateRaceError(input, error) {
|
|
654
656
|
if (!isNodeUpdateNoRowError(error)) return error;
|
|
655
|
-
return new
|
|
657
|
+
return new chunkKCH7WQA5_cjs.DatabaseOperationError(
|
|
656
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.`,
|
|
657
659
|
{
|
|
658
660
|
operation: "update",
|
|
@@ -683,19 +685,19 @@ async function primeBatchValidationCaches(ctx, drafts, backend, seams) {
|
|
|
683
685
|
const groups = /* @__PURE__ */ new Map();
|
|
684
686
|
for (const draft of drafts) {
|
|
685
687
|
for (const constraint of draft.uniqueConstraints) {
|
|
686
|
-
if (!
|
|
687
|
-
const key =
|
|
688
|
+
if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, draft.validatedProps)) continue;
|
|
689
|
+
const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
688
690
|
draft.validatedProps,
|
|
689
691
|
constraint.fields,
|
|
690
692
|
constraint.collation
|
|
691
693
|
);
|
|
692
|
-
const kindsToCheck =
|
|
694
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
693
695
|
draft.kind,
|
|
694
696
|
constraint.scope,
|
|
695
697
|
ctx.registry
|
|
696
698
|
);
|
|
697
699
|
for (const kindToCheck of kindsToCheck) {
|
|
698
|
-
const groupKey =
|
|
700
|
+
const groupKey = chunkQPOQX2DI_cjs.encodeTupleKey([kindToCheck, constraint.name]);
|
|
699
701
|
const group = groups.get(groupKey) ?? {
|
|
700
702
|
nodeKind: kindToCheck,
|
|
701
703
|
constraintName: constraint.name,
|
|
@@ -735,7 +737,7 @@ async function prepareBatchCreates(ctx, inputs, backend, options) {
|
|
|
735
737
|
seedUniqueRow
|
|
736
738
|
} = createNodeBatchValidationBackend(ctx.graphId, ctx.registry, backend);
|
|
737
739
|
const drafts = inputs.map(
|
|
738
|
-
(input) => draftNodeCreate(ctx, input, input.id ??
|
|
740
|
+
(input) => draftNodeCreate(ctx, input, input.id ?? chunkA4R3H7RU_cjs.generateId(), options)
|
|
739
741
|
);
|
|
740
742
|
await primeBatchValidationCaches(ctx, drafts, backend, {
|
|
741
743
|
seedNodeRow,
|
|
@@ -772,12 +774,12 @@ function partitionCreates(preparedCreates) {
|
|
|
772
774
|
return { inserts, resurrections };
|
|
773
775
|
}
|
|
774
776
|
function isNodeUpdateNoRowError(error) {
|
|
775
|
-
return error instanceof
|
|
777
|
+
return error instanceof chunkKCH7WQA5_cjs.DatabaseOperationError && error.details.operation === "update" && error.details.entity === "node" && error.details.reason === "no_row_returned";
|
|
776
778
|
}
|
|
777
779
|
async function resurrectPreparedNode(ctx, target, lock, prepared) {
|
|
778
780
|
const current = await target.getNode(ctx.graphId, prepared.kind, prepared.id);
|
|
779
781
|
if (current === void 0) {
|
|
780
|
-
throw new
|
|
782
|
+
throw new chunkKCH7WQA5_cjs.DatabaseOperationError(
|
|
781
783
|
`Node tombstone disappeared before resurrection: ${prepared.kind} ${prepared.id}`,
|
|
782
784
|
{ operation: "update", entity: "node" }
|
|
783
785
|
);
|
|
@@ -786,8 +788,8 @@ async function resurrectPreparedNode(ctx, target, lock, prepared) {
|
|
|
786
788
|
throw createAlreadyExistsError("node", prepared.kind, prepared.id);
|
|
787
789
|
}
|
|
788
790
|
try {
|
|
789
|
-
return await
|
|
790
|
-
|
|
791
|
+
return await chunk32UETY6S_cjs.applyNodeUpdate(
|
|
792
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
791
793
|
{
|
|
792
794
|
existing: current,
|
|
793
795
|
clearDeleted: true,
|
|
@@ -861,10 +863,10 @@ async function batchCheckUniqueAcrossKinds(backend, graphId, constraintName, uni
|
|
|
861
863
|
}
|
|
862
864
|
async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
863
865
|
const kind = input.kind;
|
|
864
|
-
const id = input.id ??
|
|
866
|
+
const id = input.id ?? chunkA4R3H7RU_cjs.generateId();
|
|
865
867
|
const opContext = ctx.createOperationContext("create", "node", kind, id);
|
|
866
868
|
const shouldReturnRow = options?.returnRow ?? true;
|
|
867
|
-
return
|
|
869
|
+
return chunkQPOQX2DI_cjs.runHookedWriteOperation(
|
|
868
870
|
ctx,
|
|
869
871
|
opContext,
|
|
870
872
|
backend,
|
|
@@ -893,8 +895,8 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
893
895
|
}
|
|
894
896
|
const row = await withAlreadyExistsTranslation("node", async () => {
|
|
895
897
|
if (shouldReturnRow) return target.insertNode(prepared.insertParams);
|
|
896
|
-
await
|
|
897
|
-
|
|
898
|
+
await chunkA4R3H7RU_cjs.runInsertNoReturn(
|
|
899
|
+
chunkA4R3H7RU_cjs.nodeInsertDispatch(target),
|
|
898
900
|
prepared.insertParams
|
|
899
901
|
);
|
|
900
902
|
return;
|
|
@@ -917,7 +919,7 @@ async function executeNodeCreate(ctx, input, backend, options) {
|
|
|
917
919
|
...options
|
|
918
920
|
});
|
|
919
921
|
if (!result) {
|
|
920
|
-
throw new
|
|
922
|
+
throw new chunkKCH7WQA5_cjs.DatabaseOperationError(
|
|
921
923
|
"Node create failed: expected created node row",
|
|
922
924
|
{ operation: "insert", entity: "node" }
|
|
923
925
|
);
|
|
@@ -926,7 +928,7 @@ async function executeNodeCreate(ctx, input, backend, options) {
|
|
|
926
928
|
}
|
|
927
929
|
async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
928
930
|
if (inputs.length === 0) return;
|
|
929
|
-
await
|
|
931
|
+
await chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
930
932
|
ctx,
|
|
931
933
|
backend,
|
|
932
934
|
async (target, lock) => {
|
|
@@ -936,8 +938,8 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
936
938
|
const partition = partitionCreates(preparedCreates);
|
|
937
939
|
await withAlreadyExistsTranslation(
|
|
938
940
|
"node",
|
|
939
|
-
() =>
|
|
940
|
-
|
|
941
|
+
() => chunkA4R3H7RU_cjs.runInsertBatch(
|
|
942
|
+
chunkA4R3H7RU_cjs.nodeInsertDispatch(target),
|
|
941
943
|
partition.inserts.map((prepared) => prepared.insertParams)
|
|
942
944
|
)
|
|
943
945
|
);
|
|
@@ -960,7 +962,7 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
960
962
|
}
|
|
961
963
|
async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
962
964
|
if (inputs.length === 0) return [];
|
|
963
|
-
return
|
|
965
|
+
return chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
964
966
|
ctx,
|
|
965
967
|
backend,
|
|
966
968
|
async (target, lock) => {
|
|
@@ -975,8 +977,8 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
975
977
|
const partition = partitionCreates(preparedCreates);
|
|
976
978
|
const inserted = await withAlreadyExistsTranslation(
|
|
977
979
|
"node",
|
|
978
|
-
() =>
|
|
979
|
-
|
|
980
|
+
() => chunkA4R3H7RU_cjs.runInsertBatchReturning(
|
|
981
|
+
chunkA4R3H7RU_cjs.nodeInsertDispatch(target),
|
|
980
982
|
partition.inserts.map((prepared) => prepared.insertParams)
|
|
981
983
|
)
|
|
982
984
|
);
|
|
@@ -989,13 +991,13 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
989
991
|
await finalizeNodeCreateBatch(ctx, partition.inserts, target, lock);
|
|
990
992
|
const byReference = new Map(
|
|
991
993
|
[...inserted, ...resurrected].map((row) => [
|
|
992
|
-
|
|
994
|
+
chunkQPOQX2DI_cjs.refKey({ kind: row.kind, id: row.id }),
|
|
993
995
|
row
|
|
994
996
|
])
|
|
995
997
|
);
|
|
996
998
|
const rows = preparedCreates.map(
|
|
997
999
|
(prepared) => chunkN66HCGCY_cjs.requireDefined(
|
|
998
|
-
byReference.get(
|
|
1000
|
+
byReference.get(chunkQPOQX2DI_cjs.refKey({ kind: prepared.kind, id: prepared.id })),
|
|
999
1001
|
`Missing written row for ${prepared.kind} ${prepared.id}`
|
|
1000
1002
|
)
|
|
1001
1003
|
);
|
|
@@ -1020,7 +1022,7 @@ async function executeNodeUpdate(ctx, input, backend, options) {
|
|
|
1020
1022
|
input.kind,
|
|
1021
1023
|
input.id
|
|
1022
1024
|
);
|
|
1023
|
-
return
|
|
1025
|
+
return chunkQPOQX2DI_cjs.runHookedWriteOperation(
|
|
1024
1026
|
ctx,
|
|
1025
1027
|
opContext,
|
|
1026
1028
|
backend,
|
|
@@ -1057,19 +1059,19 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1057
1059
|
const schema = registration.type.schema;
|
|
1058
1060
|
const uniqueConstraints = registration.unique ?? [];
|
|
1059
1061
|
if (!backend.capabilities.transactions) {
|
|
1060
|
-
throw new
|
|
1062
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1061
1063
|
"updateWhere() requires a transactional backend so validation and sidecars are atomic",
|
|
1062
1064
|
{ code: "SET_UPDATE_TRANSACTIONS_REQUIRED", kind }
|
|
1063
1065
|
);
|
|
1064
1066
|
}
|
|
1065
1067
|
if (backend.updateNodeSet === void 0) {
|
|
1066
|
-
throw new
|
|
1068
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1067
1069
|
"This backend does not support set-based node updates",
|
|
1068
1070
|
{ code: "SET_UPDATE_UNSUPPORTED", kind }
|
|
1069
1071
|
);
|
|
1070
1072
|
}
|
|
1071
1073
|
if (Object.keys(inputPatch).length === 0) {
|
|
1072
|
-
throw new
|
|
1074
|
+
throw new chunkKCH7WQA5_cjs.ValidationError("updateWhere() patch must not be empty", {
|
|
1073
1075
|
entityType: "node",
|
|
1074
1076
|
kind,
|
|
1075
1077
|
operation: "update",
|
|
@@ -1080,7 +1082,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1080
1082
|
(property) => !Object.hasOwn(schema.shape, property)
|
|
1081
1083
|
);
|
|
1082
1084
|
if (unknownProperty !== void 0) {
|
|
1083
|
-
throw new
|
|
1085
|
+
throw new chunkKCH7WQA5_cjs.ValidationError(
|
|
1084
1086
|
`Unknown ${kind} property in updateWhere() patch: ${unknownProperty}`,
|
|
1085
1087
|
{
|
|
1086
1088
|
entityType: "node",
|
|
@@ -1095,7 +1097,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1095
1097
|
}
|
|
1096
1098
|
);
|
|
1097
1099
|
}
|
|
1098
|
-
const parsedPatch =
|
|
1100
|
+
const parsedPatch = chunkQPOQX2DI_cjs.validateNodeProps(schema.partial(), inputPatch, {
|
|
1099
1101
|
kind,
|
|
1100
1102
|
operation: "update"
|
|
1101
1103
|
});
|
|
@@ -1106,11 +1108,11 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1106
1108
|
unsetProperties.push(property);
|
|
1107
1109
|
continue;
|
|
1108
1110
|
}
|
|
1109
|
-
|
|
1111
|
+
chunkD6GCNNMK_cjs.assertJsonValue(value, property, `Node "${kind}" updateWhere patch`);
|
|
1110
1112
|
patch[property] = value;
|
|
1111
1113
|
}
|
|
1112
1114
|
if (Object.keys(patch).length === 0 && unsetProperties.length === 0) {
|
|
1113
|
-
throw new
|
|
1115
|
+
throw new chunkKCH7WQA5_cjs.ValidationError(
|
|
1114
1116
|
"updateWhere() patch has no recognized properties",
|
|
1115
1117
|
{
|
|
1116
1118
|
entityType: "node",
|
|
@@ -1123,19 +1125,19 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1123
1125
|
);
|
|
1124
1126
|
}
|
|
1125
1127
|
if (uniqueConstraints.length > 0 && (backend.hardDeleteUniquesByNodeIds === void 0 || backend.insertUniqueBatch === void 0 || backend.checkUniqueBatch === void 0)) {
|
|
1126
|
-
throw new
|
|
1128
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1127
1129
|
"updateWhere() requires batched uniqueness sidecar operations for constrained nodes",
|
|
1128
1130
|
{ code: "SET_UPDATE_UNIQUENESS_UNSUPPORTED", kind }
|
|
1129
1131
|
);
|
|
1130
1132
|
}
|
|
1131
1133
|
if (chunkHAHNRASW_cjs.getSearchableFields(schema).length > 0 && (backend.upsertFulltext === void 0 || backend.deleteFulltext === void 0 || backend.upsertFulltextBatch === void 0 || backend.deleteFulltextBatch === void 0)) {
|
|
1132
|
-
throw new
|
|
1134
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1133
1135
|
"updateWhere() requires batched fulltext sidecar operations for searchable nodes",
|
|
1134
1136
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1135
1137
|
);
|
|
1136
1138
|
}
|
|
1137
|
-
if (
|
|
1138
|
-
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(
|
|
1139
1141
|
"updateWhere() requires batched vector sidecar operations for embedded nodes",
|
|
1140
1142
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
1141
1143
|
);
|
|
@@ -1143,32 +1145,32 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1143
1145
|
const hookContext = ctx.createBulkOperationContext("updateWhere", kind);
|
|
1144
1146
|
return ctx.withBulkOperationHooks(
|
|
1145
1147
|
hookContext,
|
|
1146
|
-
() =>
|
|
1148
|
+
() => chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
1147
1149
|
ctx,
|
|
1148
1150
|
backend,
|
|
1149
1151
|
async (target, lock) => {
|
|
1150
1152
|
const updateNodeSet = target.updateNodeSet;
|
|
1151
1153
|
if (updateNodeSet === void 0) {
|
|
1152
|
-
throw new
|
|
1154
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1153
1155
|
"The transaction backend does not support set-based node updates",
|
|
1154
1156
|
{ code: "SET_UPDATE_UNSUPPORTED", kind }
|
|
1155
1157
|
);
|
|
1156
1158
|
}
|
|
1157
1159
|
const hardDeleteUniquesByNodeIds = target.hardDeleteUniquesByNodeIds;
|
|
1158
1160
|
if (uniqueConstraints.length > 0 && (hardDeleteUniquesByNodeIds === void 0 || target.insertUniqueBatch === void 0 || target.checkUniqueBatch === void 0)) {
|
|
1159
|
-
throw new
|
|
1161
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1160
1162
|
"The transaction backend lacks batched uniqueness operations",
|
|
1161
1163
|
{ code: "SET_UPDATE_UNIQUENESS_UNSUPPORTED", kind }
|
|
1162
1164
|
);
|
|
1163
1165
|
}
|
|
1164
1166
|
if (chunkHAHNRASW_cjs.getSearchableFields(schema).length > 0 && (target.upsertFulltext === void 0 || target.deleteFulltext === void 0 || target.upsertFulltextBatch === void 0 || target.deleteFulltextBatch === void 0)) {
|
|
1165
|
-
throw new
|
|
1167
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1166
1168
|
"The transaction backend lacks batched fulltext operations",
|
|
1167
1169
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1168
1170
|
);
|
|
1169
1171
|
}
|
|
1170
|
-
if (
|
|
1171
|
-
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(
|
|
1172
1174
|
"The transaction backend lacks batched vector operations",
|
|
1173
1175
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
1174
1176
|
);
|
|
@@ -1183,14 +1185,14 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1183
1185
|
});
|
|
1184
1186
|
if (result.affectedCount === 0) return { affectedCount: 0 };
|
|
1185
1187
|
const sidecarItems = result.rows.map((row) => {
|
|
1186
|
-
const props =
|
|
1187
|
-
const validatedProps =
|
|
1188
|
+
const props = chunkANKOXPCC_cjs.rowPropsToObject(row.props);
|
|
1189
|
+
const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(schema, props, {
|
|
1188
1190
|
kind,
|
|
1189
1191
|
operation: "update",
|
|
1190
1192
|
id: row.id
|
|
1191
1193
|
});
|
|
1192
1194
|
if (!chunkPWLJ77UV_cjs.canonicalEqual(validatedProps, props)) {
|
|
1193
|
-
throw new
|
|
1195
|
+
throw new chunkKCH7WQA5_cjs.ValidationError(
|
|
1194
1196
|
`Set update would persist a non-canonical ${kind} row`,
|
|
1195
1197
|
{
|
|
1196
1198
|
entityType: "node",
|
|
@@ -1219,15 +1221,15 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1219
1221
|
for (const constraint of uniqueConstraints) {
|
|
1220
1222
|
const keyToId = /* @__PURE__ */ new Map();
|
|
1221
1223
|
for (const item of sidecarItems) {
|
|
1222
|
-
if (!
|
|
1223
|
-
const key =
|
|
1224
|
+
if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, item.props)) continue;
|
|
1225
|
+
const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
1224
1226
|
item.props,
|
|
1225
1227
|
constraint.fields,
|
|
1226
1228
|
constraint.collation
|
|
1227
1229
|
);
|
|
1228
1230
|
const priorId = keyToId.get(key);
|
|
1229
1231
|
if (priorId !== void 0 && priorId !== item.id) {
|
|
1230
|
-
throw new
|
|
1232
|
+
throw new chunkKCH7WQA5_cjs.UniquenessError({
|
|
1231
1233
|
constraintName: constraint.name,
|
|
1232
1234
|
kind,
|
|
1233
1235
|
existingId: priorId,
|
|
@@ -1239,7 +1241,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1239
1241
|
}
|
|
1240
1242
|
const keys = [...keyToId.keys()];
|
|
1241
1243
|
if (keys.length === 0) continue;
|
|
1242
|
-
for (const kindToCheck of
|
|
1244
|
+
for (const kindToCheck of chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1243
1245
|
kind,
|
|
1244
1246
|
constraint.scope,
|
|
1245
1247
|
ctx.registry
|
|
@@ -1256,7 +1258,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1256
1258
|
if (existing.concrete_kind === kind && affectedIds.has(existing.node_id)) {
|
|
1257
1259
|
continue;
|
|
1258
1260
|
}
|
|
1259
|
-
throw new
|
|
1261
|
+
throw new chunkKCH7WQA5_cjs.UniquenessError({
|
|
1260
1262
|
constraintName: constraint.name,
|
|
1261
1263
|
kind: kindToCheck,
|
|
1262
1264
|
existingId: existing.node_id,
|
|
@@ -1272,8 +1274,8 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1272
1274
|
nodeIds: result.rows.map((row) => row.id)
|
|
1273
1275
|
});
|
|
1274
1276
|
}
|
|
1275
|
-
await
|
|
1276
|
-
|
|
1277
|
+
await chunk32UETY6S_cjs.applyNodeInsertSideEffectsBatch(
|
|
1278
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1277
1279
|
sidecarItems,
|
|
1278
1280
|
target
|
|
1279
1281
|
);
|
|
@@ -1290,7 +1292,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1290
1292
|
);
|
|
1291
1293
|
}
|
|
1292
1294
|
async function executeNodeUpsertUpdate(ctx, input, backend, options) {
|
|
1293
|
-
return
|
|
1295
|
+
return chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
1294
1296
|
ctx,
|
|
1295
1297
|
backend,
|
|
1296
1298
|
async (target, lock) => {
|
|
@@ -1325,7 +1327,7 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1325
1327
|
const gate = await backend.getNode(ctx.graphId, kind, id);
|
|
1326
1328
|
if (!gate || gate.deleted_at) return;
|
|
1327
1329
|
const opContext = ctx.createOperationContext("delete", "node", kind, id);
|
|
1328
|
-
return
|
|
1330
|
+
return chunkQPOQX2DI_cjs.runHookedWriteOperation(
|
|
1329
1331
|
ctx,
|
|
1330
1332
|
opContext,
|
|
1331
1333
|
backend,
|
|
@@ -1334,9 +1336,9 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1334
1336
|
if (identity !== void 0) await identity.lock(target);
|
|
1335
1337
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1336
1338
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1337
|
-
if (!preflight || !
|
|
1338
|
-
await
|
|
1339
|
-
|
|
1339
|
+
if (!preflight || !chunkANKOXPCC_cjs.isLiveNodeRow(preflight)) return;
|
|
1340
|
+
await chunk32UETY6S_cjs.applyNodeSoftDelete(
|
|
1341
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1340
1342
|
{
|
|
1341
1343
|
existing: preflight,
|
|
1342
1344
|
schema: registration.type.schema,
|
|
@@ -1352,14 +1354,14 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1352
1354
|
);
|
|
1353
1355
|
}
|
|
1354
1356
|
async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
1355
|
-
await
|
|
1357
|
+
await chunkQPOQX2DI_cjs.runInWriteTransaction(
|
|
1356
1358
|
ctx,
|
|
1357
1359
|
backend,
|
|
1358
1360
|
async (target, lock) => {
|
|
1359
1361
|
const identity = ctx.identity;
|
|
1360
1362
|
if (identity !== void 0) await identity.lock(target);
|
|
1361
1363
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1362
|
-
const writeContext =
|
|
1364
|
+
const writeContext = chunk32UETY6S_cjs.createNodeWriteContext(
|
|
1363
1365
|
ctx.graphId,
|
|
1364
1366
|
ctx.registry,
|
|
1365
1367
|
lock
|
|
@@ -1367,8 +1369,8 @@ async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
|
1367
1369
|
let affectedCount = 0;
|
|
1368
1370
|
for (const id of ids) {
|
|
1369
1371
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1370
|
-
if (!preflight || !
|
|
1371
|
-
await
|
|
1372
|
+
if (!preflight || !chunkANKOXPCC_cjs.isLiveNodeRow(preflight)) continue;
|
|
1373
|
+
await chunk32UETY6S_cjs.applyNodeSoftDelete(
|
|
1372
1374
|
writeContext,
|
|
1373
1375
|
{
|
|
1374
1376
|
existing: preflight,
|
|
@@ -1392,7 +1394,7 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
|
|
|
1392
1394
|
const gate = await backend.getNode(ctx.graphId, kind, id);
|
|
1393
1395
|
if (!gate) return;
|
|
1394
1396
|
const opContext = ctx.createOperationContext("delete", "node", kind, id);
|
|
1395
|
-
return
|
|
1397
|
+
return chunkQPOQX2DI_cjs.runHookedWriteOperation(
|
|
1396
1398
|
ctx,
|
|
1397
1399
|
opContext,
|
|
1398
1400
|
backend,
|
|
@@ -1400,8 +1402,8 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
|
|
|
1400
1402
|
const identity = ctx.identity;
|
|
1401
1403
|
if (identity !== void 0) await identity.lock(target);
|
|
1402
1404
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1403
|
-
await
|
|
1404
|
-
|
|
1405
|
+
await chunk32UETY6S_cjs.applyNodeHardDelete(
|
|
1406
|
+
chunk32UETY6S_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1405
1407
|
{
|
|
1406
1408
|
kind,
|
|
1407
1409
|
id,
|
|
@@ -1420,12 +1422,12 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1420
1422
|
const ifExists = options?.ifExists ?? "return";
|
|
1421
1423
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1422
1424
|
const nodeKind = registration.type;
|
|
1423
|
-
const validatedProps =
|
|
1425
|
+
const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1424
1426
|
kind,
|
|
1425
1427
|
operation: "create"
|
|
1426
1428
|
});
|
|
1427
1429
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1428
|
-
if (!
|
|
1430
|
+
if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, validatedProps)) {
|
|
1429
1431
|
const node = await executeNodeCreate(
|
|
1430
1432
|
ctx,
|
|
1431
1433
|
{ kind, props: validatedProps },
|
|
@@ -1434,12 +1436,12 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1434
1436
|
);
|
|
1435
1437
|
return { node, action: "created" };
|
|
1436
1438
|
}
|
|
1437
|
-
const key =
|
|
1439
|
+
const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
1438
1440
|
validatedProps,
|
|
1439
1441
|
constraint.fields,
|
|
1440
1442
|
constraint.collation
|
|
1441
1443
|
);
|
|
1442
|
-
const kindsToCheck =
|
|
1444
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1443
1445
|
kind,
|
|
1444
1446
|
constraint.scope,
|
|
1445
1447
|
ctx.registry
|
|
@@ -1496,25 +1498,25 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1496
1498
|
try {
|
|
1497
1499
|
return await attempt();
|
|
1498
1500
|
} catch (error) {
|
|
1499
|
-
if (!(error instanceof
|
|
1501
|
+
if (!(error instanceof chunkKCH7WQA5_cjs.UniquenessError)) throw error;
|
|
1500
1502
|
return attempt();
|
|
1501
1503
|
}
|
|
1502
1504
|
}
|
|
1503
1505
|
async function executeNodeFindByConstraint(ctx, kind, constraintName, props, backend) {
|
|
1504
1506
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1505
1507
|
const nodeKind = registration.type;
|
|
1506
|
-
const validatedProps =
|
|
1508
|
+
const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1507
1509
|
kind,
|
|
1508
1510
|
operation: "create"
|
|
1509
1511
|
});
|
|
1510
1512
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1511
|
-
if (!
|
|
1512
|
-
const key =
|
|
1513
|
+
if (!chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, validatedProps)) return void 0;
|
|
1514
|
+
const key = chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
1513
1515
|
validatedProps,
|
|
1514
1516
|
constraint.fields,
|
|
1515
1517
|
constraint.collation
|
|
1516
1518
|
);
|
|
1517
|
-
const kindsToCheck =
|
|
1519
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1518
1520
|
kind,
|
|
1519
1521
|
constraint.scope,
|
|
1520
1522
|
ctx.registry
|
|
@@ -1540,12 +1542,12 @@ async function executeNodeFindByConstraint(ctx, kind, constraintName, props, bac
|
|
|
1540
1542
|
function validateAndComputeKeys(nodeKind, kind, constraint, items) {
|
|
1541
1543
|
const validated = [];
|
|
1542
1544
|
for (const item of items) {
|
|
1543
|
-
const validatedProps =
|
|
1545
|
+
const validatedProps = chunkQPOQX2DI_cjs.validateNodeProps(nodeKind.schema, item.props, {
|
|
1544
1546
|
kind,
|
|
1545
1547
|
operation: "create"
|
|
1546
1548
|
});
|
|
1547
|
-
const applies =
|
|
1548
|
-
const key = applies ?
|
|
1549
|
+
const applies = chunkZBVZ7HXD_cjs.checkWherePredicate(constraint, validatedProps);
|
|
1550
|
+
const key = applies ? chunkZBVZ7HXD_cjs.computeUniqueKey(
|
|
1549
1551
|
validatedProps,
|
|
1550
1552
|
constraint.fields,
|
|
1551
1553
|
constraint.collation
|
|
@@ -1568,7 +1570,7 @@ async function executeNodeBulkFindByConstraint(ctx, kind, constraintName, items,
|
|
|
1568
1570
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1569
1571
|
const validated = validateAndComputeKeys(nodeKind, kind, constraint, items);
|
|
1570
1572
|
const uniqueKeys = collectUniqueKeys(validated);
|
|
1571
|
-
const kindsToCheck =
|
|
1573
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1572
1574
|
kind,
|
|
1573
1575
|
constraint.scope,
|
|
1574
1576
|
ctx.registry
|
|
@@ -1618,10 +1620,10 @@ function resolveNodeIndex(graph, kind, indexName) {
|
|
|
1618
1620
|
(candidate) => candidate.entity === "node" && candidate.kind === kind && candidate.name === indexName
|
|
1619
1621
|
);
|
|
1620
1622
|
if (declaration?.entity !== "node") {
|
|
1621
|
-
throw new
|
|
1623
|
+
throw new chunkKCH7WQA5_cjs.NodeIndexNotFoundError(indexName, kind);
|
|
1622
1624
|
}
|
|
1623
1625
|
if (declaration.method !== void 0) {
|
|
1624
|
-
throw new
|
|
1626
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1625
1627
|
`bulkFindByIndex cannot probe index "${indexName}" (method "${declaration.method}"): only btree indexes serve equality probes.`,
|
|
1626
1628
|
{ indexName, kind, method: declaration.method }
|
|
1627
1629
|
);
|
|
@@ -1659,7 +1661,7 @@ function validateIndexProbeValue(value, valueType, pointer, kind) {
|
|
|
1659
1661
|
}
|
|
1660
1662
|
}
|
|
1661
1663
|
function indexProbeTypeError(pointer, kind, expected, value) {
|
|
1662
|
-
return new
|
|
1664
|
+
return new chunkKCH7WQA5_cjs.ValidationError(
|
|
1663
1665
|
`Index probe value for "${pointer}" on node kind "${kind}" has an incompatible type`,
|
|
1664
1666
|
{
|
|
1665
1667
|
entityType: "node",
|
|
@@ -1693,7 +1695,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1693
1695
|
if (items.length === 0) return [];
|
|
1694
1696
|
const index = resolveNodeIndex(ctx.graph, kind, indexName);
|
|
1695
1697
|
if (index.fields.length === 0) {
|
|
1696
|
-
throw new
|
|
1698
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1697
1699
|
`bulkFindByIndex requires an index with at least one prop-based field on index "${indexName}" (node kind "${kind}")`,
|
|
1698
1700
|
{ indexName, kind },
|
|
1699
1701
|
{
|
|
@@ -1702,7 +1704,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1702
1704
|
);
|
|
1703
1705
|
}
|
|
1704
1706
|
if (index.fieldValueTypes.includes("date")) {
|
|
1705
|
-
throw new
|
|
1707
|
+
throw new chunkKCH7WQA5_cjs.ConfigurationError(
|
|
1706
1708
|
`bulkFindByIndex does not support date-typed key fields on index "${indexName}" (node kind "${kind}")`,
|
|
1707
1709
|
{ indexName, kind },
|
|
1708
1710
|
{
|
|
@@ -1712,7 +1714,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1712
1714
|
}
|
|
1713
1715
|
const limitPerInput = options?.limitPerInput;
|
|
1714
1716
|
if (limitPerInput !== void 0 && (!Number.isInteger(limitPerInput) || limitPerInput <= 0)) {
|
|
1715
|
-
throw new
|
|
1717
|
+
throw new chunkKCH7WQA5_cjs.ValidationError(
|
|
1716
1718
|
"bulkFindByIndex limitPerInput must be a positive integer",
|
|
1717
1719
|
{
|
|
1718
1720
|
entityType: "node",
|
|
@@ -1727,7 +1729,7 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1727
1729
|
}
|
|
1728
1730
|
);
|
|
1729
1731
|
}
|
|
1730
|
-
const adapter =
|
|
1732
|
+
const adapter = chunkZHOAZD7Q_cjs.getDialect(backend.dialect);
|
|
1731
1733
|
const probes = items.map(
|
|
1732
1734
|
(item) => index.fields.map((pointer, position) => {
|
|
1733
1735
|
const value = chunkA7J2YDDI_cjs.resolveJsonPointer(item.props, pointer);
|
|
@@ -1754,47 +1756,47 @@ async function executeNodeBulkFindByIndex(ctx, kind, indexName, items, backend,
|
|
|
1754
1756
|
}
|
|
1755
1757
|
groupToInputs[existing]?.push(inputIndex);
|
|
1756
1758
|
}
|
|
1757
|
-
const schema = backend.tableNames ?
|
|
1759
|
+
const schema = backend.tableNames ? chunkQU7QLJA4_cjs.createSqlSchema(backend.tableNames) : chunkQU7QLJA4_cjs.DEFAULT_SQL_SCHEMA;
|
|
1758
1760
|
const compileContext = {
|
|
1759
1761
|
dialect: backend.dialect,
|
|
1760
|
-
propsColumn:
|
|
1761
|
-
systemColumn: (column) =>
|
|
1762
|
+
propsColumn: chunk2ZWM2RFH_cjs.sql.raw(`"props"`),
|
|
1763
|
+
systemColumn: (column) => chunk2ZWM2RFH_cjs.sql.raw(`"${column}"`)
|
|
1762
1764
|
};
|
|
1763
|
-
const fieldKeys =
|
|
1765
|
+
const fieldKeys = chunkZHOAZD7Q_cjs.compileNodeIndexFieldKeys(index, compileContext);
|
|
1764
1766
|
const groupPredicates = groupProbes.map(
|
|
1765
|
-
(probe) =>
|
|
1767
|
+
(probe) => chunk2ZWM2RFH_cjs.sql`(${chunk2ZWM2RFH_cjs.sql.join(
|
|
1766
1768
|
fieldKeys.map((fieldKey, position) => {
|
|
1767
1769
|
const value = probe[position];
|
|
1768
1770
|
if (value === void 0 || value === null) {
|
|
1769
|
-
return
|
|
1771
|
+
return chunk2ZWM2RFH_cjs.sql`${fieldKey} IS NULL`;
|
|
1770
1772
|
}
|
|
1771
1773
|
return adapter.nullSafeEquals(
|
|
1772
1774
|
fieldKey,
|
|
1773
|
-
|
|
1775
|
+
chunk2ZWM2RFH_cjs.sql`${coerceIndexProbeBind(value, adapter)}`
|
|
1774
1776
|
);
|
|
1775
1777
|
}),
|
|
1776
|
-
|
|
1778
|
+
chunk2ZWM2RFH_cjs.sql` AND `
|
|
1777
1779
|
)})`
|
|
1778
1780
|
);
|
|
1779
1781
|
const caseBranches = groupPredicates.map(
|
|
1780
|
-
(predicate, group) =>
|
|
1782
|
+
(predicate, group) => chunk2ZWM2RFH_cjs.sql`WHEN ${predicate} THEN ${chunk2ZWM2RFH_cjs.sql.raw(String(group))}`
|
|
1781
1783
|
);
|
|
1782
|
-
const probeIndexExpr =
|
|
1784
|
+
const probeIndexExpr = chunk2ZWM2RFH_cjs.sql`CASE ${chunk2ZWM2RFH_cjs.sql.join(caseBranches, chunk2ZWM2RFH_cjs.sql` `)} ELSE NULL END`;
|
|
1783
1785
|
const conditions = [
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1786
|
+
chunk2ZWM2RFH_cjs.sql`"graph_id" = ${ctx.graphId}`,
|
|
1787
|
+
chunk2ZWM2RFH_cjs.sql`"kind" = ${kind}`,
|
|
1788
|
+
chunk2ZWM2RFH_cjs.sql`"deleted_at" IS NULL`
|
|
1787
1789
|
];
|
|
1788
1790
|
if (index.where !== void 0) {
|
|
1789
|
-
conditions.push(
|
|
1791
|
+
conditions.push(chunkZHOAZD7Q_cjs.compileIndexWhere(compileContext, index.where));
|
|
1790
1792
|
}
|
|
1791
|
-
conditions.push(
|
|
1792
|
-
const whereClause =
|
|
1793
|
-
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}`;
|
|
1794
1796
|
const capInSql = limitPerInput !== void 0 && backend.capabilities.windowFunctions;
|
|
1795
|
-
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"`;
|
|
1796
1798
|
const rawMatches = await backend.execute(
|
|
1797
|
-
|
|
1799
|
+
chunk2ZWM2RFH_cjs.asCompiledRowsSql(query)
|
|
1798
1800
|
);
|
|
1799
1801
|
const matches = limitPerInput !== void 0 && !capInSql ? capMatchesPerGroup(rawMatches, limitPerInput) : rawMatches;
|
|
1800
1802
|
const nodesById = await hydrateNodesById(
|
|
@@ -1827,7 +1829,7 @@ function capMatchesPerGroup(matches, limitPerInput) {
|
|
|
1827
1829
|
return capped;
|
|
1828
1830
|
}
|
|
1829
1831
|
async function hydrateNodesById(backend, graphId, kind, ids) {
|
|
1830
|
-
const rowsById = await
|
|
1832
|
+
const rowsById = await chunkA4R3H7RU_cjs.getNodeRowsByIds(backend, graphId, kind, ids);
|
|
1831
1833
|
const nodesById = /* @__PURE__ */ new Map();
|
|
1832
1834
|
for (const [id, row] of rowsById) {
|
|
1833
1835
|
if (row.deleted_at !== void 0) continue;
|
|
@@ -1843,7 +1845,7 @@ async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName,
|
|
|
1843
1845
|
const constraint = resolveConstraint(ctx.graph, kind, constraintName);
|
|
1844
1846
|
const validated = validateAndComputeKeys(nodeKind, kind, constraint, items);
|
|
1845
1847
|
const uniqueKeys = collectUniqueKeys(validated);
|
|
1846
|
-
const kindsToCheck =
|
|
1848
|
+
const kindsToCheck = chunkZBVZ7HXD_cjs.getKindsForUniquenessCheck(
|
|
1847
1849
|
kind,
|
|
1848
1850
|
constraint.scope,
|
|
1849
1851
|
ctx.registry
|
|
@@ -1946,7 +1948,7 @@ async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName,
|
|
|
1946
1948
|
try {
|
|
1947
1949
|
return await attempt();
|
|
1948
1950
|
} catch (error) {
|
|
1949
|
-
if (!(error instanceof
|
|
1951
|
+
if (!(error instanceof chunkKCH7WQA5_cjs.UniquenessError)) throw error;
|
|
1950
1952
|
return attempt();
|
|
1951
1953
|
}
|
|
1952
1954
|
}
|
|
@@ -1975,5 +1977,5 @@ exports.rowToEdgeMeta = rowToEdgeMeta;
|
|
|
1975
1977
|
exports.rowToNode = rowToNode;
|
|
1976
1978
|
exports.rowToNodeMeta = rowToNodeMeta;
|
|
1977
1979
|
exports.withAlreadyExistsTranslation = withAlreadyExistsTranslation;
|
|
1978
|
-
//# sourceMappingURL=chunk-
|
|
1979
|
-
//# sourceMappingURL=chunk-
|
|
1980
|
+
//# sourceMappingURL=chunk-BQM5P2NO.cjs.map
|
|
1981
|
+
//# sourceMappingURL=chunk-BQM5P2NO.cjs.map
|