@nicia-ai/typegraph 0.49.0 → 0.50.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +56 -52
- package/dist/backend/index.d.cts +3 -3
- package/dist/backend/index.d.ts +3 -3
- package/dist/backend/index.js +11 -11
- package/dist/backend/postgres/index.cjs +34 -28
- package/dist/backend/postgres/index.d.cts +7 -7
- package/dist/backend/postgres/index.d.ts +7 -7
- package/dist/backend/postgres/index.js +17 -15
- package/dist/backend/postgres/pglite-store.cjs +36 -35
- package/dist/backend/postgres/pglite-store.cjs.map +1 -1
- 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 +32 -31
- package/dist/backend/postgres/pglite-store.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +19 -17
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +18 -16
- package/dist/backend/sqlite/index.cjs +31 -25
- package/dist/backend/sqlite/index.d.cts +7 -7
- package/dist/backend/sqlite/index.d.ts +7 -7
- package/dist/backend/sqlite/index.js +15 -13
- package/dist/backend/sqlite/libsql.cjs +22 -20
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +17 -15
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local-store.cjs +37 -36
- package/dist/backend/sqlite/local-store.cjs.map +1 -1
- 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 +33 -32
- package/dist/backend/sqlite/local-store.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +20 -18
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +18 -16
- package/dist/{chunk-LTXQOEIC.js → chunk-2CYI5HRH.js} +248 -203
- package/dist/chunk-2CYI5HRH.js.map +1 -0
- package/dist/{chunk-KF6K7TGH.js → chunk-2GIV5X4P.js} +702 -422
- package/dist/chunk-2GIV5X4P.js.map +1 -0
- package/dist/{chunk-2TYSSBU5.js → chunk-2Q45FAIE.js} +15 -15
- package/dist/{chunk-2TYSSBU5.js.map → chunk-2Q45FAIE.js.map} +1 -1
- package/dist/{chunk-WODMN3Q2.cjs → chunk-45YZXI6X.cjs} +27 -27
- package/dist/{chunk-WODMN3Q2.cjs.map → chunk-45YZXI6X.cjs.map} +1 -1
- package/dist/{chunk-3DMMGT6S.js → chunk-46UGOVRW.js} +3 -3
- package/dist/{chunk-3DMMGT6S.js.map → chunk-46UGOVRW.js.map} +1 -1
- package/dist/{chunk-GLHXM7C4.js → chunk-5LKOVCPP.js} +60 -23
- package/dist/chunk-5LKOVCPP.js.map +1 -0
- package/dist/{chunk-JFRT7S3B.cjs → chunk-5OWHU7Z7.cjs} +261 -459
- package/dist/chunk-5OWHU7Z7.cjs.map +1 -0
- package/dist/{chunk-7SQSZN2J.js → chunk-5PP4KRPV.js} +5 -5
- package/dist/{chunk-7SQSZN2J.js.map → chunk-5PP4KRPV.js.map} +1 -1
- package/dist/chunk-6KQEICJ6.cjs +12 -0
- package/dist/{chunk-MKJ4KXL5.cjs.map → chunk-6KQEICJ6.cjs.map} +1 -1
- package/dist/{chunk-6SWPJEYN.js → chunk-6LEOAIIB.js} +40 -6
- package/dist/chunk-6LEOAIIB.js.map +1 -0
- package/dist/{chunk-DZAICA5J.js → chunk-6NKSE5AU.js} +4 -4
- package/dist/{chunk-DZAICA5J.js.map → chunk-6NKSE5AU.js.map} +1 -1
- package/dist/{chunk-OVI7IXYX.js → chunk-6S3PTHL4.js} +3 -3
- package/dist/{chunk-OVI7IXYX.js.map → chunk-6S3PTHL4.js.map} +1 -1
- package/dist/{chunk-3FPR224C.cjs → chunk-7CCMCMJO.cjs} +102 -102
- package/dist/{chunk-3FPR224C.cjs.map → chunk-7CCMCMJO.cjs.map} +1 -1
- package/dist/{chunk-SHFBB23Q.js → chunk-7OWE7WD6.js} +6 -4
- package/dist/chunk-7OWE7WD6.js.map +1 -0
- package/dist/chunk-7PRMDZIA.cjs +182 -0
- package/dist/chunk-7PRMDZIA.cjs.map +1 -0
- package/dist/{chunk-CHAOFCHV.js → chunk-AH2A74OZ.js} +3 -3
- package/dist/{chunk-CHAOFCHV.js.map → chunk-AH2A74OZ.js.map} +1 -1
- package/dist/{chunk-OORXGFL5.cjs → chunk-BYBDM423.cjs} +48 -48
- package/dist/{chunk-OORXGFL5.cjs.map → chunk-BYBDM423.cjs.map} +1 -1
- package/dist/{chunk-JB6T4GLL.cjs → chunk-C76WFIVZ.cjs} +808 -519
- package/dist/chunk-C76WFIVZ.cjs.map +1 -0
- package/dist/{chunk-3G5W2U2L.cjs → chunk-CS6JTQQ2.cjs} +302 -257
- package/dist/chunk-CS6JTQQ2.cjs.map +1 -0
- package/dist/{chunk-AOSSQDVO.cjs → chunk-CSNOYIB4.cjs} +13 -13
- package/dist/{chunk-AOSSQDVO.cjs.map → chunk-CSNOYIB4.cjs.map} +1 -1
- package/dist/{chunk-HEV35TGT.js → chunk-DI6VC62F.js} +13 -4
- package/dist/chunk-DI6VC62F.js.map +1 -0
- package/dist/{chunk-2QGYQBS2.cjs → chunk-DWUDZ66O.cjs} +10 -10
- package/dist/{chunk-2QGYQBS2.cjs.map → chunk-DWUDZ66O.cjs.map} +1 -1
- package/dist/{chunk-ZDKTPBGV.js → chunk-EDLKIQRI.js} +4 -4
- package/dist/{chunk-ZDKTPBGV.js.map → chunk-EDLKIQRI.js.map} +1 -1
- package/dist/chunk-EH3JZJUM.cjs +567 -0
- package/dist/chunk-EH3JZJUM.cjs.map +1 -0
- package/dist/{chunk-S5TERQVW.js → chunk-FX5ZW6PN.js} +196 -33
- package/dist/chunk-FX5ZW6PN.js.map +1 -0
- package/dist/{chunk-XVWOYKIK.js → chunk-FZHF5UWR.js} +3 -3
- package/dist/{chunk-XVWOYKIK.js.map → chunk-FZHF5UWR.js.map} +1 -1
- package/dist/{chunk-BFUOME67.cjs → chunk-G2TLHH6T.cjs} +20 -11
- package/dist/chunk-G2TLHH6T.cjs.map +1 -0
- package/dist/{chunk-5PRKMB24.cjs → chunk-GHZPZNFC.cjs} +12 -4
- package/dist/chunk-GHZPZNFC.cjs.map +1 -0
- package/dist/{chunk-ZFMCDJGB.js → chunk-GVYVGGPJ.js} +11 -199
- package/dist/chunk-GVYVGGPJ.js.map +1 -0
- package/dist/{chunk-SDBBMD4N.js → chunk-H3XP6BAV.js} +3 -3
- package/dist/{chunk-SDBBMD4N.js.map → chunk-H3XP6BAV.js.map} +1 -1
- package/dist/{chunk-ROR5ZR6A.cjs → chunk-HSEZ7X6Y.cjs} +45 -45
- package/dist/{chunk-ROR5ZR6A.cjs.map → chunk-HSEZ7X6Y.cjs.map} +1 -1
- package/dist/{chunk-LRQKXRXO.cjs → chunk-HY5BNOUN.cjs} +4 -4
- package/dist/{chunk-LRQKXRXO.cjs.map → chunk-HY5BNOUN.cjs.map} +1 -1
- package/dist/chunk-HZUB5CON.js +27 -0
- package/dist/chunk-HZUB5CON.js.map +1 -0
- package/dist/{chunk-MYKHJI2J.js → chunk-I5C6OTKR.js} +3 -3
- package/dist/{chunk-MYKHJI2J.js.map → chunk-I5C6OTKR.js.map} +1 -1
- package/dist/{chunk-3U5ABFDW.cjs → chunk-IHK5KA2Q.cjs} +31 -28
- package/dist/chunk-IHK5KA2Q.cjs.map +1 -0
- package/dist/{chunk-26YKDNUD.cjs → chunk-IPRP6TDL.cjs} +12 -10
- package/dist/chunk-IPRP6TDL.cjs.map +1 -0
- package/dist/{chunk-UGHG7PGX.js → chunk-IRPYOHRC.js} +26 -4
- package/dist/chunk-IRPYOHRC.js.map +1 -0
- package/dist/{chunk-7UOLHNWC.cjs → chunk-ISKCIQF2.cjs} +20 -20
- package/dist/{chunk-7UOLHNWC.cjs.map → chunk-ISKCIQF2.cjs.map} +1 -1
- package/dist/{chunk-7LZJNLA5.js → chunk-JG5XIJDY.js} +57 -31
- package/dist/chunk-JG5XIJDY.js.map +1 -0
- package/dist/{chunk-YYUHLYM2.cjs → chunk-K2XYLVVB.cjs} +134 -133
- package/dist/chunk-K2XYLVVB.cjs.map +1 -0
- package/dist/{chunk-5K2BKEBD.js → chunk-K46SDNQD.js} +10 -4
- package/dist/chunk-K46SDNQD.js.map +1 -0
- package/dist/{chunk-TZEGUG6D.cjs → chunk-K6VKTBST.cjs} +4 -4
- package/dist/{chunk-TZEGUG6D.cjs.map → chunk-K6VKTBST.cjs.map} +1 -1
- package/dist/chunk-KWNWG4RC.cjs +12 -0
- package/dist/{chunk-CICO5GXD.cjs.map → chunk-KWNWG4RC.cjs.map} +1 -1
- package/dist/{chunk-FQPEMEWX.cjs → chunk-LLVOQOWE.cjs} +80 -32
- package/dist/chunk-LLVOQOWE.cjs.map +1 -0
- package/dist/{chunk-TQHGE7UC.cjs → chunk-M5MSP3BI.cjs} +18 -10
- package/dist/chunk-M5MSP3BI.cjs.map +1 -0
- package/dist/{chunk-Z2JCLZFJ.js → chunk-MJPZNEJZ.js} +273 -291
- package/dist/chunk-MJPZNEJZ.js.map +1 -0
- package/dist/{chunk-TUNPBZY3.cjs → chunk-MM3JHVKZ.cjs} +4 -4
- package/dist/{chunk-TUNPBZY3.cjs.map → chunk-MM3JHVKZ.cjs.map} +1 -1
- package/dist/{chunk-BRRP76WO.js → chunk-MX7EKQPM.js} +457 -299
- package/dist/chunk-MX7EKQPM.js.map +1 -0
- package/dist/{chunk-D4QLTJSM.js → chunk-MZ34E2GN.js} +13 -12
- package/dist/chunk-MZ34E2GN.js.map +1 -0
- package/dist/{chunk-EDN4Y4ZG.cjs → chunk-OJHD3LXJ.cjs} +9 -9
- package/dist/{chunk-EDN4Y4ZG.cjs.map → chunk-OJHD3LXJ.cjs.map} +1 -1
- package/dist/{chunk-DO7SAMEK.cjs → chunk-ON47CBE4.cjs} +47 -47
- package/dist/{chunk-DO7SAMEK.cjs.map → chunk-ON47CBE4.cjs.map} +1 -1
- package/dist/{chunk-6LN7FIVU.js → chunk-PALYTHGM.js} +11 -4
- package/dist/chunk-PALYTHGM.js.map +1 -0
- package/dist/{chunk-YVF2EM7B.js → chunk-R7MRFE5P.js} +3 -3
- package/dist/{chunk-YVF2EM7B.js.map → chunk-R7MRFE5P.js.map} +1 -1
- package/dist/{chunk-EZEEWCFJ.cjs → chunk-RDP6ZRSM.cjs} +435 -265
- package/dist/chunk-RDP6ZRSM.cjs.map +1 -0
- package/dist/{chunk-GYEG3ZLZ.cjs → chunk-RJMHU2MG.cjs} +121 -18
- package/dist/chunk-RJMHU2MG.cjs.map +1 -0
- package/dist/chunk-RWUWTJQY.cjs +30 -0
- package/dist/chunk-RWUWTJQY.cjs.map +1 -0
- package/dist/{chunk-JPD2CTC3.js → chunk-S33YQEL7.js} +7 -7
- package/dist/{chunk-JPD2CTC3.js.map → chunk-S33YQEL7.js.map} +1 -1
- package/dist/chunk-S3SDEQMC.js +532 -0
- package/dist/chunk-S3SDEQMC.js.map +1 -0
- package/dist/{chunk-OI2GQ25X.cjs → chunk-SHC7BCG5.cjs} +7 -7
- package/dist/{chunk-OI2GQ25X.cjs.map → chunk-SHC7BCG5.cjs.map} +1 -1
- package/dist/{chunk-L3LQNR34.cjs → chunk-TEC24ZDA.cjs} +161 -161
- package/dist/{chunk-L3LQNR34.cjs.map → chunk-TEC24ZDA.cjs.map} +1 -1
- package/dist/{chunk-HDL2ARHX.cjs → chunk-TP4NJTI3.cjs} +63 -27
- package/dist/chunk-TP4NJTI3.cjs.map +1 -0
- package/dist/{chunk-UMGZDVOA.cjs → chunk-TTCOPKUL.cjs} +124 -124
- package/dist/{chunk-UMGZDVOA.cjs.map → chunk-TTCOPKUL.cjs.map} +1 -1
- package/dist/chunk-TUVD4DFR.cjs +1207 -0
- package/dist/chunk-TUVD4DFR.cjs.map +1 -0
- package/dist/{chunk-UGHQV7MP.cjs → chunk-TYGGUWMS.cjs} +178 -152
- package/dist/chunk-TYGGUWMS.cjs.map +1 -0
- package/dist/{chunk-WIC7DRXW.js → chunk-U3Z7XKAG.js} +7 -7
- package/dist/{chunk-WIC7DRXW.js.map → chunk-U3Z7XKAG.js.map} +1 -1
- package/dist/{chunk-NACVVDWB.js → chunk-U5EL6JUV.js} +10 -10
- package/dist/{chunk-NACVVDWB.js.map → chunk-U5EL6JUV.js.map} +1 -1
- package/dist/{chunk-OMZ37BM2.js → chunk-V76FGHY3.js} +5 -5
- package/dist/{chunk-OMZ37BM2.js.map → chunk-V76FGHY3.js.map} +1 -1
- package/dist/{chunk-6NGW27EO.cjs → chunk-VLBTRXA2.cjs} +10 -10
- package/dist/{chunk-6NGW27EO.cjs.map → chunk-VLBTRXA2.cjs.map} +1 -1
- package/dist/chunk-VTJVMP4I.js +1182 -0
- package/dist/chunk-VTJVMP4I.js.map +1 -0
- package/dist/{chunk-QTD6HX4O.js → chunk-W5SOCUBL.js} +5 -5
- package/dist/{chunk-QTD6HX4O.js.map → chunk-W5SOCUBL.js.map} +1 -1
- package/dist/{chunk-SR725PWF.cjs → chunk-WCLMKNQE.cjs} +1750 -1592
- package/dist/chunk-WCLMKNQE.cjs.map +1 -0
- package/dist/{chunk-2O4PCIZ6.cjs → chunk-WK23PGTP.cjs} +13 -13
- package/dist/{chunk-2O4PCIZ6.cjs.map → chunk-WK23PGTP.cjs.map} +1 -1
- package/dist/{chunk-KKBDXCLQ.js → chunk-WQBAQZHR.js} +4 -4
- package/dist/{chunk-KKBDXCLQ.js.map → chunk-WQBAQZHR.js.map} +1 -1
- package/dist/{chunk-MRDBBHIZ.cjs → chunk-X4GDXBOP.cjs} +2 -2
- package/dist/chunk-X4GDXBOP.cjs.map +1 -0
- package/dist/{chunk-3QNZ5SAJ.cjs → chunk-XMY2SXOH.cjs} +437 -455
- package/dist/chunk-XMY2SXOH.cjs.map +1 -0
- package/dist/{chunk-D5R42W5D.js → chunk-XZW2CTNO.js} +115 -12
- package/dist/chunk-XZW2CTNO.js.map +1 -0
- package/dist/{chunk-NVY5CJFP.js → chunk-Y55DLLEG.js} +9 -6
- package/dist/chunk-Y55DLLEG.js.map +1 -0
- package/dist/chunk-YA36ABIL.js +174 -0
- package/dist/chunk-YA36ABIL.js.map +1 -0
- package/dist/{chunk-ZLONH2UD.js → chunk-YDEJQWOL.js} +2 -2
- package/dist/chunk-YDEJQWOL.js.map +1 -0
- package/dist/{chunk-JONXFAPO.js → chunk-ZAQUKCUC.js} +5 -5
- package/dist/{chunk-JONXFAPO.js.map → chunk-ZAQUKCUC.js.map} +1 -1
- package/dist/{chunk-SIT26LAZ.cjs → chunk-ZBFZGLZE.cjs} +29 -5
- package/dist/chunk-ZBFZGLZE.cjs.map +1 -0
- package/dist/{chunk-P6YLZTRE.js → chunk-ZRJTM7MT.js} +3 -3
- package/dist/{chunk-P6YLZTRE.js.map → chunk-ZRJTM7MT.js.map} +1 -1
- package/dist/core/index.cjs +29 -28
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +9 -8
- package/dist/{ddl-D_oW-EVO.d.ts → ddl-B49O7dB_.d.ts} +3 -3
- package/dist/{ddl-BL1NZLMY.d.cts → ddl-DcZG660s.d.cts} +3 -3
- package/dist/graph-extension/index.cjs +21 -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 +5 -4
- package/dist/graph-merge/index.cjs +305 -303
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +9 -9
- package/dist/graph-merge/index.d.ts +9 -9
- package/dist/graph-merge/index.js +29 -27
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-D7d1u2gr.d.ts → index-B0PrmE3K.d.cts} +16 -2
- package/dist/{index-COs_z6nV.d.cts → index-CwcXsL5R.d.ts} +16 -2
- package/dist/index.cjs +223 -222
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +37 -36
- package/dist/index.js.map +1 -1
- 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/{ingestion-import-target-dNeL7iAv.d.ts → ingestion-import-target-CI8OWIkM.d.ts} +1 -1
- package/dist/{ingestion-import-target-XPxZYw89.d.cts → ingestion-import-target-DCpfM1PX.d.cts} +1 -1
- package/dist/interchange/index.cjs +55 -54
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +19 -8
- package/dist/interchange/index.d.ts +19 -8
- package/dist/interchange/index.js +19 -18
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-D9eRT_ns.d.ts → manager-Cfg1ENj1.d.ts} +30 -2
- package/dist/{manager-CYaff3n3.d.cts → manager-D348fa6W.d.cts} +30 -2
- package/dist/{materialize-indexes-DJ3ykH59.d.ts → materialize-indexes-C9GG3O3C.d.ts} +1 -1
- package/dist/{materialize-indexes-DTtAnvfY.d.cts → materialize-indexes-CrSiW_lT.d.cts} +1 -1
- package/dist/{postgres-CcL4bAHS.d.ts → postgres-CH1kkM5J.d.cts} +279 -2
- package/dist/{postgres-DMj39MEu.d.cts → postgres-UStOycLI.d.ts} +279 -2
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +46 -44
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +12 -10
- package/dist/provenance/index.js.map +1 -1
- package/dist/{repair-validity-windows-DlUSqwCg.d.ts → repair-validity-windows-BtOEe2pS.d.ts} +2 -2
- package/dist/{repair-validity-windows-BFNZvd_H.d.cts → repair-validity-windows-aWX7VNvv.d.cts} +2 -2
- package/dist/schema/index.cjs +46 -46
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +19 -19
- package/dist/{searchable-DHJMh_nj.d.cts → searchable-C8-RrL3l.d.cts} +1 -1
- package/dist/{searchable-bpE1bBfc.d.ts → searchable-z4BiFfHI.d.ts} +1 -1
- package/dist/{sqlite-YppHrNFb.d.cts → sqlite-Cyx9j9o6.d.cts} +309 -2
- package/dist/{sqlite-D7Oz0SQh.d.ts → sqlite-axLw5Lo5.d.ts} +309 -2
- package/dist/{store-bphCSo7z.d.cts → store-CTfQ9taw.d.ts} +102 -13
- package/dist/{store-DRrFCx5x.d.ts → store-DR9J7JVB.d.cts} +102 -13
- package/dist/{temporal-5GqpYCk2.d.cts → temporal-B4Ky4wzh.d.cts} +1 -1
- package/dist/{temporal-CbnLzTmM.d.ts → temporal-CBOrERz5.d.ts} +1 -1
- package/dist/{types-CXAhpW-c.d.cts → types-BE921wRl.d.cts} +1 -1
- package/dist/{types-Bx74kaTt.d.ts → types-BScHXVM7.d.ts} +1 -1
- package/dist/{types-BqFZTQmV.d.cts → types-CWg4dTjj.d.cts} +257 -6
- package/dist/{types-BqFZTQmV.d.ts → types-CWg4dTjj.d.ts} +257 -6
- package/dist/{where-O-k2wgYm.d.ts → where-BWXUPV3C.d.ts} +1 -1
- package/dist/{where-DI_Fqz-X.d.cts → where-CNtx1aLc.d.cts} +1 -1
- package/package.json +3 -2
- package/dist/chunk-26YKDNUD.cjs.map +0 -1
- package/dist/chunk-3G5W2U2L.cjs.map +0 -1
- package/dist/chunk-3KOY4FH3.cjs +0 -934
- package/dist/chunk-3KOY4FH3.cjs.map +0 -1
- package/dist/chunk-3QNZ5SAJ.cjs.map +0 -1
- package/dist/chunk-3U5ABFDW.cjs.map +0 -1
- package/dist/chunk-5K2BKEBD.js.map +0 -1
- package/dist/chunk-5PRKMB24.cjs.map +0 -1
- package/dist/chunk-6LN7FIVU.js.map +0 -1
- package/dist/chunk-6SWPJEYN.js.map +0 -1
- package/dist/chunk-7LZJNLA5.js.map +0 -1
- package/dist/chunk-BFUOME67.cjs.map +0 -1
- package/dist/chunk-BRRP76WO.js.map +0 -1
- package/dist/chunk-CICO5GXD.cjs +0 -12
- package/dist/chunk-D4QLTJSM.js.map +0 -1
- package/dist/chunk-D5R42W5D.js.map +0 -1
- package/dist/chunk-EZEEWCFJ.cjs.map +0 -1
- package/dist/chunk-FA2AFWLP.cjs +0 -167
- package/dist/chunk-FA2AFWLP.cjs.map +0 -1
- package/dist/chunk-FQPEMEWX.cjs.map +0 -1
- package/dist/chunk-GLHXM7C4.js.map +0 -1
- package/dist/chunk-GYEG3ZLZ.cjs.map +0 -1
- package/dist/chunk-HDL2ARHX.cjs.map +0 -1
- package/dist/chunk-HEV35TGT.js.map +0 -1
- package/dist/chunk-I4GAZH5Z.js +0 -913
- package/dist/chunk-I4GAZH5Z.js.map +0 -1
- package/dist/chunk-JB6T4GLL.cjs.map +0 -1
- package/dist/chunk-JBQQ7THH.js +0 -20
- package/dist/chunk-JBQQ7THH.js.map +0 -1
- package/dist/chunk-JFRT7S3B.cjs.map +0 -1
- package/dist/chunk-KF6K7TGH.js.map +0 -1
- package/dist/chunk-LTXQOEIC.js.map +0 -1
- package/dist/chunk-MKJ4KXL5.cjs +0 -12
- package/dist/chunk-MRDBBHIZ.cjs.map +0 -1
- package/dist/chunk-NVY5CJFP.js.map +0 -1
- package/dist/chunk-PWLJ77UV.cjs +0 -23
- package/dist/chunk-PWLJ77UV.cjs.map +0 -1
- package/dist/chunk-S5TERQVW.js.map +0 -1
- package/dist/chunk-SHFBB23Q.js.map +0 -1
- package/dist/chunk-SIT26LAZ.cjs.map +0 -1
- package/dist/chunk-SR725PWF.cjs.map +0 -1
- package/dist/chunk-TQHGE7UC.cjs.map +0 -1
- package/dist/chunk-UGHG7PGX.js.map +0 -1
- package/dist/chunk-UGHQV7MP.cjs.map +0 -1
- package/dist/chunk-YIURNGXI.js +0 -155
- package/dist/chunk-YIURNGXI.js.map +0 -1
- package/dist/chunk-YYUHLYM2.cjs.map +0 -1
- package/dist/chunk-Z2JCLZFJ.js.map +0 -1
- package/dist/chunk-ZFMCDJGB.js.map +0 -1
- package/dist/chunk-ZLONH2UD.js.map +0 -1
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { storeBackend, storeRuntime,
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
1
|
+
import { graphOwesClaims, runWritePlan, mixedWritePlan, createNodeBatchValidationSeams, primeBatchValidationCaches, createEdgeBatchValidationBackend, checkDisjointnessConstraint, checkCardinalityConstraint } from './chunk-2GIV5X4P.js';
|
|
2
|
+
import { storeBackend, storeRuntime, checkUniquenessConstraints } from './chunk-VTJVMP4I.js';
|
|
3
|
+
import { edgeCardinalityClaim } from './chunk-YA36ABIL.js';
|
|
4
|
+
import { IDENTITY_IMPORT_PROGRESS, IDENTITY_IMPORT_FAILED_ASSERTION } from './chunk-GVYVGGPJ.js';
|
|
5
|
+
import { constraintFenceRefusal } from './chunk-FX5ZW6PN.js';
|
|
6
|
+
import { acquireSerializedStreamLease, snapshotExportContention } from './chunk-IRPYOHRC.js';
|
|
7
|
+
import { isLiveNodeRow, rowPropsToObject } from './chunk-PALYTHGM.js';
|
|
8
|
+
import { getNodeKinds, getEdgeKinds } from './chunk-DI6VC62F.js';
|
|
9
|
+
import { encodeTupleKey, validateEdgeEndpoints } from './chunk-5LKOVCPP.js';
|
|
10
|
+
import { isCanonicalIsoDate, nowIso, assertWritableValidityWindow, validateOptionalCanonicalIsoDate, assertOrderedValidityWindow } from './chunk-K46SDNQD.js';
|
|
11
|
+
import { ConfigurationError, ValidationError, ExportStreamCancelledError, ExportStreamIdleTimeoutError, NodeNotFoundError, IdentityContradictionError, DatabaseOperationError, UniquenessError, DisjointError, CardinalityError, INVERTED_VALIDITY_WINDOW_CODE, IMMUTABLE_VALIDITY_LOWER_BOUND_CODE } from './chunk-YDEJQWOL.js';
|
|
11
12
|
import { requireDefined, createDataKeyedBag, hasOwnKey } from './chunk-DYATYRY4.js';
|
|
12
13
|
import { z } from 'zod';
|
|
13
14
|
|
|
@@ -308,22 +309,34 @@ async function importGraphData(store, data, options) {
|
|
|
308
309
|
const backend = storeBackend(store);
|
|
309
310
|
const runtime = storeRuntime(store);
|
|
310
311
|
const registry = store.registry;
|
|
312
|
+
const owedClaimReason = graphOwesClaims(graph, registry);
|
|
313
|
+
const claimRefusal = owedClaimReason === void 0 ? void 0 : constraintFenceRefusal({ graphId }, backend, owedClaimReason);
|
|
314
|
+
if (claimRefusal !== void 0) throw claimRefusal;
|
|
311
315
|
const nodeSchemas = buildNodeSchemaMap(graph);
|
|
312
316
|
const edgeSchemas = buildEdgeSchemaMap(graph);
|
|
313
317
|
const importedNodeIds = /* @__PURE__ */ new Set();
|
|
314
|
-
await
|
|
318
|
+
await runWritePlan(
|
|
315
319
|
{
|
|
316
320
|
graphId,
|
|
321
|
+
registry,
|
|
317
322
|
schemaVersion: store.introspect().schemaVersion,
|
|
318
323
|
historyEnabled: store.historyEnabled,
|
|
319
324
|
revisionTrackingEnabled: store.revisionTrackingEnabled,
|
|
320
|
-
revisionSchema: store.revisionSchema
|
|
325
|
+
revisionSchema: store.revisionSchema,
|
|
326
|
+
// HOW this caller takes position 3. `lockIdentityImportTarget` is
|
|
327
|
+
// `lockIdentityGraph` on an identity graph and a no-op otherwise, so the
|
|
328
|
+
// participation below is unconditional and the acquirer owns the
|
|
329
|
+
// "identity is configured" test, exactly as before the migration.
|
|
330
|
+
identityLock: (target) => runtime.lockIdentityImportTarget(target)
|
|
321
331
|
},
|
|
332
|
+
// An import writes node rows AND edge rows in one frame, so it declares the
|
|
333
|
+
// mixed family explicitly instead of receiving either narrower session.
|
|
334
|
+
mixedWritePlan(void 0, true),
|
|
322
335
|
backend,
|
|
323
|
-
async (target,
|
|
324
|
-
|
|
336
|
+
async (session, target, overlaidSession) => {
|
|
337
|
+
const frame = { session, target, overlaidSession };
|
|
325
338
|
await processNodes(
|
|
326
|
-
|
|
339
|
+
frame,
|
|
327
340
|
graphId,
|
|
328
341
|
registry,
|
|
329
342
|
data.nodes,
|
|
@@ -331,8 +344,7 @@ async function importGraphData(store, data, options) {
|
|
|
331
344
|
options,
|
|
332
345
|
result,
|
|
333
346
|
errors,
|
|
334
|
-
importedNodeIds
|
|
335
|
-
lock
|
|
347
|
+
importedNodeIds
|
|
336
348
|
);
|
|
337
349
|
await runtime.foldImportedIdentityNodes(
|
|
338
350
|
target,
|
|
@@ -341,7 +353,7 @@ async function importGraphData(store, data, options) {
|
|
|
341
353
|
).map((node) => ({ kind: node.kind, id: node.id }))
|
|
342
354
|
);
|
|
343
355
|
await processEdges(
|
|
344
|
-
|
|
356
|
+
frame,
|
|
345
357
|
graphId,
|
|
346
358
|
registry,
|
|
347
359
|
data.edges,
|
|
@@ -752,12 +764,12 @@ function buildEdgeSchemaMap(graph) {
|
|
|
752
764
|
}
|
|
753
765
|
return map;
|
|
754
766
|
}
|
|
755
|
-
async function processNodes(
|
|
767
|
+
async function processNodes(frame, graphId, registry, nodes, schemas, options, result, errors, importedNodeIds) {
|
|
756
768
|
const batchSize = options.batchSize;
|
|
757
769
|
for (let index = 0; index < nodes.length; index += batchSize) {
|
|
758
770
|
const batch = nodes.slice(index, index + batchSize);
|
|
759
771
|
await processNodeSlice(
|
|
760
|
-
|
|
772
|
+
frame,
|
|
761
773
|
graphId,
|
|
762
774
|
registry,
|
|
763
775
|
batch,
|
|
@@ -765,8 +777,7 @@ async function processNodes(backend, graphId, registry, nodes, schemas, options,
|
|
|
765
777
|
options,
|
|
766
778
|
result,
|
|
767
779
|
errors,
|
|
768
|
-
importedNodeIds
|
|
769
|
-
lock
|
|
780
|
+
importedNodeIds
|
|
770
781
|
);
|
|
771
782
|
}
|
|
772
783
|
}
|
|
@@ -800,7 +811,7 @@ function recordNodeOutcome(node, outcome, result, errors, importedNodeIds) {
|
|
|
800
811
|
}
|
|
801
812
|
}
|
|
802
813
|
}
|
|
803
|
-
async function processNodeSlice(
|
|
814
|
+
async function processNodeSlice(frame, graphId, registry, batch, schemas, options, result, errors, importedNodeIds) {
|
|
804
815
|
const record = (node, outcome) => {
|
|
805
816
|
recordNodeOutcome(node, outcome, result, errors, importedNodeIds);
|
|
806
817
|
};
|
|
@@ -859,20 +870,21 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
859
870
|
});
|
|
860
871
|
}
|
|
861
872
|
const {
|
|
862
|
-
|
|
873
|
+
reads,
|
|
874
|
+
reader: validationBackend,
|
|
863
875
|
registerPendingNode,
|
|
864
876
|
registerPendingUniqueEntries,
|
|
865
877
|
registerAppliedNodeUpdate,
|
|
866
878
|
seedNodeRow,
|
|
867
879
|
seedUniqueRow
|
|
868
|
-
} =
|
|
880
|
+
} = createNodeBatchValidationSeams(graphId, registry, frame.target);
|
|
869
881
|
await primeBatchValidationCaches(
|
|
870
882
|
{ graphId, registry },
|
|
871
883
|
candidates.map((candidate) => candidate.draft),
|
|
872
|
-
|
|
884
|
+
frame.target,
|
|
873
885
|
{ seedNodeRow, seedUniqueRow }
|
|
874
886
|
);
|
|
875
|
-
const
|
|
887
|
+
const overlaidSession = frame.overlaidSession(reads);
|
|
876
888
|
const accepted = [];
|
|
877
889
|
for (const candidate of candidates) {
|
|
878
890
|
const { node, schemaEntry, props } = candidate;
|
|
@@ -911,25 +923,13 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
911
923
|
record(node, { status: "error", error: updateWindow.error });
|
|
912
924
|
break;
|
|
913
925
|
}
|
|
914
|
-
const updateError = await updateImportedNode(
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
// create at flush (which would throw and roll back the whole
|
|
922
|
-
// import). Writes still delegate to the real backend.
|
|
923
|
-
validationBackend,
|
|
924
|
-
node,
|
|
925
|
-
{
|
|
926
|
-
existing,
|
|
927
|
-
schema: schemaEntry.registration.type.schema,
|
|
928
|
-
validatedProps: props,
|
|
929
|
-
uniqueConstraints,
|
|
930
|
-
windowFence: updateWindow.value
|
|
931
|
-
}
|
|
932
|
-
);
|
|
926
|
+
const updateError = await updateImportedNode(overlaidSession, node, {
|
|
927
|
+
existing,
|
|
928
|
+
schema: schemaEntry.registration.type.schema,
|
|
929
|
+
validatedProps: props,
|
|
930
|
+
uniqueConstraints,
|
|
931
|
+
windowFence: updateWindow.value
|
|
932
|
+
});
|
|
933
933
|
if (updateError === void 0) {
|
|
934
934
|
registerAppliedNodeUpdate(
|
|
935
935
|
node.kind,
|
|
@@ -948,44 +948,38 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
948
948
|
}
|
|
949
949
|
continue;
|
|
950
950
|
}
|
|
951
|
-
const
|
|
952
|
-
|
|
951
|
+
const constraintResult = await catchDeclaredConstraintRefusal(async () => {
|
|
952
|
+
await checkUniquenessConstraints(
|
|
953
953
|
{ graphId, registry, backend: validationBackend },
|
|
954
954
|
node.kind,
|
|
955
955
|
node.id,
|
|
956
956
|
props,
|
|
957
957
|
uniqueConstraints
|
|
958
|
-
)
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
958
|
+
);
|
|
959
|
+
await checkDisjointnessConstraint(
|
|
960
|
+
{ graphId, registry, backend: validationBackend },
|
|
961
|
+
node.kind,
|
|
962
|
+
node.id
|
|
963
|
+
);
|
|
964
|
+
});
|
|
965
|
+
if (!constraintResult.ok) {
|
|
966
|
+
record(node, { status: "error", error: constraintResult.error });
|
|
962
967
|
continue;
|
|
963
968
|
}
|
|
964
|
-
registerPendingNode(buildImportInsertParams(graphId,
|
|
969
|
+
registerPendingNode(buildImportInsertParams(graphId, node, props));
|
|
965
970
|
registerPendingUniqueEntries(node.kind, node.id, props, uniqueConstraints);
|
|
966
971
|
accepted.push(candidate);
|
|
967
972
|
}
|
|
968
973
|
if (accepted.length > 0) {
|
|
969
|
-
|
|
970
|
-
(
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
}
|
|
979
|
-
await applyNodeInsertSideEffectsBatch(
|
|
980
|
-
writeContext,
|
|
981
|
-
accepted.map((candidate) => ({
|
|
982
|
-
kind: candidate.node.kind,
|
|
983
|
-
id: candidate.node.id,
|
|
984
|
-
schema: candidate.schemaEntry.registration.type.schema,
|
|
985
|
-
props: candidate.props,
|
|
986
|
-
uniqueConstraints: candidate.schemaEntry.registration.unique ?? []
|
|
987
|
-
})),
|
|
988
|
-
backend
|
|
974
|
+
await frame.session.createNodesNoReturn(
|
|
975
|
+
accepted.map(
|
|
976
|
+
(candidate) => importNodeInsertWork(
|
|
977
|
+
graphId,
|
|
978
|
+
candidate.node,
|
|
979
|
+
candidate.schemaEntry.registration,
|
|
980
|
+
candidate.props
|
|
981
|
+
)
|
|
982
|
+
)
|
|
989
983
|
);
|
|
990
984
|
for (const candidate of accepted) {
|
|
991
985
|
record(candidate.node, { status: "created" });
|
|
@@ -994,20 +988,11 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
994
988
|
for (const node of deferred) {
|
|
995
989
|
record(
|
|
996
990
|
node,
|
|
997
|
-
await processNode(
|
|
998
|
-
backend,
|
|
999
|
-
graphId,
|
|
1000
|
-
registry,
|
|
1001
|
-
node,
|
|
1002
|
-
schemas,
|
|
1003
|
-
options,
|
|
1004
|
-
lock
|
|
1005
|
-
)
|
|
991
|
+
await processNode(frame, graphId, registry, node, schemas, options)
|
|
1006
992
|
);
|
|
1007
993
|
}
|
|
1008
994
|
}
|
|
1009
|
-
function buildImportInsertParams(graphId,
|
|
1010
|
-
const { node, props } = candidate;
|
|
995
|
+
function buildImportInsertParams(graphId, node, props) {
|
|
1011
996
|
return {
|
|
1012
997
|
graphId,
|
|
1013
998
|
kind: node.kind,
|
|
@@ -1017,31 +1002,53 @@ function buildImportInsertParams(graphId, candidate) {
|
|
|
1017
1002
|
...node.validTo !== void 0 && { validTo: node.validTo }
|
|
1018
1003
|
};
|
|
1019
1004
|
}
|
|
1020
|
-
|
|
1005
|
+
function importNodeInsertWork(graphId, node, registration, props) {
|
|
1006
|
+
return {
|
|
1007
|
+
params: buildImportInsertParams(graphId, node, props),
|
|
1008
|
+
claim: {
|
|
1009
|
+
kind: node.kind,
|
|
1010
|
+
id: node.id,
|
|
1011
|
+
props,
|
|
1012
|
+
constraints: registration.unique ?? []
|
|
1013
|
+
},
|
|
1014
|
+
sideEffects: {
|
|
1015
|
+
kind: node.kind,
|
|
1016
|
+
id: node.id,
|
|
1017
|
+
schema: registration.type.schema,
|
|
1018
|
+
props,
|
|
1019
|
+
uniqueConstraints: registration.unique ?? []
|
|
1020
|
+
}
|
|
1021
|
+
};
|
|
1022
|
+
}
|
|
1023
|
+
async function catchDeclaredConstraintRefusal(fn) {
|
|
1021
1024
|
try {
|
|
1022
1025
|
return { ok: true, value: await fn() };
|
|
1023
1026
|
} catch (error) {
|
|
1024
|
-
if (error instanceof UniquenessError) {
|
|
1027
|
+
if (error instanceof UniquenessError || error instanceof DisjointError || error instanceof CardinalityError) {
|
|
1025
1028
|
return { ok: false, error: error.message };
|
|
1026
1029
|
}
|
|
1027
1030
|
throw error;
|
|
1028
1031
|
}
|
|
1029
1032
|
}
|
|
1030
1033
|
var NODE_UPDATE_TARGET_CHANGED_CODE = "INTERCHANGE_NODE_UPDATE_TARGET_CHANGED";
|
|
1031
|
-
async function updateImportedNode(
|
|
1034
|
+
async function updateImportedNode(session, node, args) {
|
|
1032
1035
|
try {
|
|
1033
|
-
const result = await
|
|
1034
|
-
() =>
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1036
|
+
const result = await catchDeclaredConstraintRefusal(
|
|
1037
|
+
() => (
|
|
1038
|
+
// The fence is an ARGUMENT the method requires, not a spread the call
|
|
1039
|
+
// site may forget: the guard's verdict travels to the statement that
|
|
1040
|
+
// honors it, and an empty fence (`{}`) is the stated decision to assert
|
|
1041
|
+
// nothing rather than an omission.
|
|
1042
|
+
session.reviseNode(
|
|
1043
|
+
{
|
|
1044
|
+
existing: args.existing,
|
|
1045
|
+
schema: args.schema,
|
|
1046
|
+
validatedProps: args.validatedProps,
|
|
1047
|
+
uniqueConstraints: args.uniqueConstraints,
|
|
1048
|
+
...node.validTo !== void 0 && { validTo: node.validTo }
|
|
1049
|
+
},
|
|
1050
|
+
{ validityLowerBound: args.windowFence }
|
|
1051
|
+
)
|
|
1045
1052
|
)
|
|
1046
1053
|
);
|
|
1047
1054
|
return result.ok ? void 0 : result.error;
|
|
@@ -1066,20 +1073,29 @@ function edgeIdentityConflict(edge, existing) {
|
|
|
1066
1073
|
if (differences.length === 0) return void 0;
|
|
1067
1074
|
return `${EDGE_IDENTITY_CONFLICT_CODE}: Edge "${edge.id}" already exists with a different immutable identity \u2014 ${differences.join("; ")}. Edge ids are unique per graph, so the incoming edge can neither update nor be created under that id. Give it a distinct id, or import it under the identity the stored row already carries.`;
|
|
1068
1075
|
}
|
|
1069
|
-
async function updateImportedEdge(
|
|
1076
|
+
async function updateImportedEdge(session, edge, props, windowFence) {
|
|
1070
1077
|
try {
|
|
1071
|
-
await
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1078
|
+
await session.reviseEdge(
|
|
1079
|
+
{
|
|
1080
|
+
id: edge.id,
|
|
1081
|
+
props,
|
|
1082
|
+
...edge.validTo !== void 0 && { validTo: edge.validTo }
|
|
1083
|
+
},
|
|
1084
|
+
{
|
|
1085
|
+
validityLowerBound: windowFence,
|
|
1086
|
+
// Import re-admits no row to a counted population — it never resurrects
|
|
1087
|
+
// and never clears an end — so it reads no stored `valid_to` and asserts
|
|
1088
|
+
// none. `{}` is the stated decision, not an omission.
|
|
1089
|
+
validityUpperBound: {},
|
|
1090
|
+
edgeIdentity: {
|
|
1091
|
+
kind: edge.kind,
|
|
1092
|
+
fromKind: edge.from.kind,
|
|
1093
|
+
fromId: edge.from.id,
|
|
1094
|
+
toKind: edge.to.kind,
|
|
1095
|
+
toId: edge.to.id
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
);
|
|
1083
1099
|
return void 0;
|
|
1084
1100
|
} catch (error) {
|
|
1085
1101
|
if (!(error instanceof DatabaseOperationError) || error.details.reason !== "no_row_returned") {
|
|
@@ -1141,7 +1157,7 @@ function validateUpdateValidityWindow(entity, storedValidFrom) {
|
|
|
1141
1157
|
);
|
|
1142
1158
|
return verdict.ok ? { ok: true, value: verdict.value.storedLowerBoundFence } : verdict;
|
|
1143
1159
|
}
|
|
1144
|
-
async function processNode(
|
|
1160
|
+
async function processNode(frame, graphId, registry, node, schemas, options) {
|
|
1145
1161
|
const schemaEntry = schemas.get(node.kind);
|
|
1146
1162
|
if (!schemaEntry) {
|
|
1147
1163
|
return { status: "error", error: `Unknown node kind: ${node.kind}` };
|
|
@@ -1160,8 +1176,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
|
|
|
1160
1176
|
}
|
|
1161
1177
|
const { registration } = schemaEntry;
|
|
1162
1178
|
const uniqueConstraints = registration.unique ?? [];
|
|
1163
|
-
const
|
|
1164
|
-
const existing = await backend.getNode(graphId, node.kind, node.id);
|
|
1179
|
+
const existing = await frame.target.getNode(graphId, node.kind, node.id);
|
|
1165
1180
|
if (existing) {
|
|
1166
1181
|
switch (options.onConflict) {
|
|
1167
1182
|
case "skip": {
|
|
@@ -1184,18 +1199,13 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
|
|
|
1184
1199
|
if (!updateWindow.ok) {
|
|
1185
1200
|
return { status: "error", error: updateWindow.error };
|
|
1186
1201
|
}
|
|
1187
|
-
const updateError = await updateImportedNode(
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
validatedProps: propsResult.data,
|
|
1195
|
-
uniqueConstraints,
|
|
1196
|
-
windowFence: updateWindow.value
|
|
1197
|
-
}
|
|
1198
|
-
);
|
|
1202
|
+
const updateError = await updateImportedNode(frame.session, node, {
|
|
1203
|
+
existing,
|
|
1204
|
+
schema: registration.type.schema,
|
|
1205
|
+
validatedProps: propsResult.data,
|
|
1206
|
+
uniqueConstraints,
|
|
1207
|
+
windowFence: updateWindow.value
|
|
1208
|
+
});
|
|
1199
1209
|
if (updateError !== void 0) {
|
|
1200
1210
|
return { status: "error", error: updateError };
|
|
1201
1211
|
}
|
|
@@ -1203,45 +1213,34 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
|
|
|
1203
1213
|
}
|
|
1204
1214
|
}
|
|
1205
1215
|
}
|
|
1206
|
-
const
|
|
1207
|
-
|
|
1208
|
-
{ graphId, registry, backend },
|
|
1216
|
+
const constraintResult = await catchDeclaredConstraintRefusal(async () => {
|
|
1217
|
+
await checkUniquenessConstraints(
|
|
1218
|
+
{ graphId, registry, backend: frame.target },
|
|
1209
1219
|
node.kind,
|
|
1210
1220
|
node.id,
|
|
1211
1221
|
propsResult.data,
|
|
1212
1222
|
uniqueConstraints
|
|
1213
|
-
)
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
graphId,
|
|
1220
|
-
kind: node.kind,
|
|
1221
|
-
id: node.id,
|
|
1222
|
-
props: propsResult.data,
|
|
1223
|
-
...node.validFrom !== void 0 && { validFrom: node.validFrom },
|
|
1224
|
-
...node.validTo !== void 0 && { validTo: node.validTo }
|
|
1223
|
+
);
|
|
1224
|
+
await checkDisjointnessConstraint(
|
|
1225
|
+
{ graphId, registry, backend: frame.target },
|
|
1226
|
+
node.kind,
|
|
1227
|
+
node.id
|
|
1228
|
+
);
|
|
1225
1229
|
});
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
schema: registration.type.schema,
|
|
1232
|
-
props: propsResult.data,
|
|
1233
|
-
uniqueConstraints
|
|
1234
|
-
},
|
|
1235
|
-
backend
|
|
1230
|
+
if (!constraintResult.ok) {
|
|
1231
|
+
return { status: "error", error: constraintResult.error };
|
|
1232
|
+
}
|
|
1233
|
+
await frame.session.createNode(
|
|
1234
|
+
importNodeInsertWork(graphId, node, registration, propsResult.data)
|
|
1236
1235
|
);
|
|
1237
1236
|
return { status: "created" };
|
|
1238
1237
|
}
|
|
1239
|
-
async function processEdges(
|
|
1238
|
+
async function processEdges(frame, graphId, registry, edges, edgeSchemas, nodeSchemas, options, result, errors, importedNodeIds) {
|
|
1240
1239
|
const batchSize = options.batchSize;
|
|
1241
1240
|
for (let index = 0; index < edges.length; index += batchSize) {
|
|
1242
1241
|
const batch = edges.slice(index, index + batchSize);
|
|
1243
1242
|
await processEdgeSlice(
|
|
1244
|
-
|
|
1243
|
+
frame,
|
|
1245
1244
|
graphId,
|
|
1246
1245
|
registry,
|
|
1247
1246
|
batch,
|
|
@@ -1279,10 +1278,29 @@ function recordEdgeOutcome(edge, outcome, result, errors) {
|
|
|
1279
1278
|
}
|
|
1280
1279
|
}
|
|
1281
1280
|
}
|
|
1282
|
-
|
|
1281
|
+
function edgeInsertParamsOf(graphId, candidate) {
|
|
1282
|
+
const { edge, props } = candidate;
|
|
1283
|
+
return {
|
|
1284
|
+
graphId,
|
|
1285
|
+
id: edge.id,
|
|
1286
|
+
kind: edge.kind,
|
|
1287
|
+
fromKind: edge.from.kind,
|
|
1288
|
+
fromId: edge.from.id,
|
|
1289
|
+
toKind: edge.to.kind,
|
|
1290
|
+
toId: edge.to.id,
|
|
1291
|
+
props,
|
|
1292
|
+
...edge.validFrom !== void 0 && { validFrom: edge.validFrom },
|
|
1293
|
+
...edge.validTo !== void 0 && { validTo: edge.validTo }
|
|
1294
|
+
};
|
|
1295
|
+
}
|
|
1296
|
+
async function processEdgeSlice(frame, graphId, registry, batch, edgeSchemas, nodeSchemas, options, result, errors, importedNodeIds) {
|
|
1283
1297
|
const record = (edge, outcome) => {
|
|
1284
1298
|
recordEdgeOutcome(edge, outcome, result, errors);
|
|
1285
1299
|
};
|
|
1300
|
+
const {
|
|
1301
|
+
backend: cardinalityValidationBackend,
|
|
1302
|
+
registerPendingEdgeForCardinality
|
|
1303
|
+
} = createEdgeBatchValidationBackend(frame.target);
|
|
1286
1304
|
const candidates = [];
|
|
1287
1305
|
const deferred = [];
|
|
1288
1306
|
const seenIds = /* @__PURE__ */ new Set();
|
|
@@ -1343,7 +1361,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1343
1361
|
}
|
|
1344
1362
|
const liveEndpointKeys = /* @__PURE__ */ new Set();
|
|
1345
1363
|
const checkedEndpointKeys = /* @__PURE__ */ new Set();
|
|
1346
|
-
if (options.validateReferences &&
|
|
1364
|
+
if (options.validateReferences && frame.target.getNodes !== void 0) {
|
|
1347
1365
|
const idsByKind = /* @__PURE__ */ new Map();
|
|
1348
1366
|
for (const { edge } of candidates) {
|
|
1349
1367
|
for (const endpoint of [edge.from, edge.to]) {
|
|
@@ -1356,7 +1374,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1356
1374
|
}
|
|
1357
1375
|
}
|
|
1358
1376
|
for (const [kind, ids] of idsByKind) {
|
|
1359
|
-
const rows = await
|
|
1377
|
+
const rows = await frame.target.getNodes(graphId, kind, [...ids]);
|
|
1360
1378
|
for (const row of rows) {
|
|
1361
1379
|
if (isLiveNodeRow(row)) {
|
|
1362
1380
|
liveEndpointKeys.add(makeNodeKey(kind, row.id));
|
|
@@ -1368,12 +1386,12 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1368
1386
|
const key = makeNodeKey(endpoint.kind, endpoint.id);
|
|
1369
1387
|
if (importedNodeIds.has(key)) return true;
|
|
1370
1388
|
if (checkedEndpointKeys.has(key)) return liveEndpointKeys.has(key);
|
|
1371
|
-
const row = await
|
|
1389
|
+
const row = await frame.target.getNode(graphId, endpoint.kind, endpoint.id);
|
|
1372
1390
|
return row !== void 0 && isLiveNodeRow(row);
|
|
1373
1391
|
};
|
|
1374
1392
|
const existingById = /* @__PURE__ */ new Map();
|
|
1375
|
-
if (candidates.length > 0 &&
|
|
1376
|
-
const rows = await
|
|
1393
|
+
if (candidates.length > 0 && frame.target.getEdges !== void 0) {
|
|
1394
|
+
const rows = await frame.target.getEdges(
|
|
1377
1395
|
graphId,
|
|
1378
1396
|
candidates.map((candidate) => candidate.edge.id)
|
|
1379
1397
|
);
|
|
@@ -1403,7 +1421,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1403
1421
|
continue;
|
|
1404
1422
|
}
|
|
1405
1423
|
}
|
|
1406
|
-
const existing = existingById.has(edge.id) ? existingById.get(edge.id) : await
|
|
1424
|
+
const existing = existingById.has(edge.id) ? existingById.get(edge.id) : await frame.target.getEdge(graphId, edge.id);
|
|
1407
1425
|
if (existing) {
|
|
1408
1426
|
const identityConflict = edgeIdentityConflict(edge, existing);
|
|
1409
1427
|
if (identityConflict !== void 0) {
|
|
@@ -1439,8 +1457,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1439
1457
|
break;
|
|
1440
1458
|
}
|
|
1441
1459
|
const updateError = await updateImportedEdge(
|
|
1442
|
-
|
|
1443
|
-
graphId,
|
|
1460
|
+
frame.session,
|
|
1444
1461
|
edge,
|
|
1445
1462
|
props,
|
|
1446
1463
|
updateWindow.value
|
|
@@ -1455,28 +1472,37 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1455
1472
|
}
|
|
1456
1473
|
continue;
|
|
1457
1474
|
}
|
|
1475
|
+
const insertParams = edgeInsertParamsOf(graphId, candidate);
|
|
1476
|
+
const cardinality = edgeSchemas.get(edge.kind)?.registration.cardinality ?? "many";
|
|
1477
|
+
const cardinalityResult = await catchDeclaredConstraintRefusal(
|
|
1478
|
+
() => checkCardinalityConstraint(
|
|
1479
|
+
{ graphId, registry, backend: cardinalityValidationBackend },
|
|
1480
|
+
edge.kind,
|
|
1481
|
+
cardinality,
|
|
1482
|
+
edge.from.kind,
|
|
1483
|
+
edge.from.id,
|
|
1484
|
+
edge.to.kind,
|
|
1485
|
+
edge.to.id,
|
|
1486
|
+
edge.validTo
|
|
1487
|
+
)
|
|
1488
|
+
);
|
|
1489
|
+
if (!cardinalityResult.ok) {
|
|
1490
|
+
record(edge, { status: "error", error: cardinalityResult.error });
|
|
1491
|
+
continue;
|
|
1492
|
+
}
|
|
1493
|
+
registerPendingEdgeForCardinality(insertParams, cardinality);
|
|
1458
1494
|
accepted.push(candidate);
|
|
1459
1495
|
}
|
|
1460
1496
|
if (accepted.length > 0) {
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
...edge.validFrom !== void 0 && { validFrom: edge.validFrom },
|
|
1471
|
-
...edge.validTo !== void 0 && { validTo: edge.validTo }
|
|
1472
|
-
}));
|
|
1473
|
-
if (backend.insertEdgesBatch === void 0) {
|
|
1474
|
-
for (const params of insertParamsList) {
|
|
1475
|
-
await backend.insertEdge(params);
|
|
1476
|
-
}
|
|
1477
|
-
} else {
|
|
1478
|
-
await backend.insertEdgesBatch(insertParamsList);
|
|
1479
|
-
}
|
|
1497
|
+
await frame.session.createEdgesNoReturn(
|
|
1498
|
+
accepted.map(
|
|
1499
|
+
(candidate) => importEdgeInsertWork(
|
|
1500
|
+
graphId,
|
|
1501
|
+
candidate,
|
|
1502
|
+
edgeSchemas.get(candidate.edge.kind)?.registration.cardinality ?? "many"
|
|
1503
|
+
)
|
|
1504
|
+
)
|
|
1505
|
+
);
|
|
1480
1506
|
for (const candidate of accepted) {
|
|
1481
1507
|
record(candidate.edge, { status: "created" });
|
|
1482
1508
|
}
|
|
@@ -1485,7 +1511,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1485
1511
|
record(
|
|
1486
1512
|
edge,
|
|
1487
1513
|
await processEdge(
|
|
1488
|
-
|
|
1514
|
+
frame,
|
|
1489
1515
|
graphId,
|
|
1490
1516
|
registry,
|
|
1491
1517
|
edge,
|
|
@@ -1497,7 +1523,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1497
1523
|
);
|
|
1498
1524
|
}
|
|
1499
1525
|
}
|
|
1500
|
-
async function processEdge(
|
|
1526
|
+
async function processEdge(frame, graphId, registry, edge, edgeSchemas, nodeSchemas, options, importedNodeIds) {
|
|
1501
1527
|
const schemaEntry = edgeSchemas.get(edge.kind);
|
|
1502
1528
|
if (!schemaEntry) {
|
|
1503
1529
|
return { status: "error", error: `Unknown edge kind: ${edge.kind}` };
|
|
@@ -1525,7 +1551,7 @@ async function processEdge(backend, graphId, registry, edge, edgeSchemas, nodeSc
|
|
|
1525
1551
|
const fromKey = makeNodeKey(edge.from.kind, edge.from.id);
|
|
1526
1552
|
const toKey = makeNodeKey(edge.to.kind, edge.to.id);
|
|
1527
1553
|
if (!importedNodeIds.has(fromKey)) {
|
|
1528
|
-
const fromExists = await
|
|
1554
|
+
const fromExists = await frame.target.getNode(
|
|
1529
1555
|
graphId,
|
|
1530
1556
|
edge.from.kind,
|
|
1531
1557
|
edge.from.id
|
|
@@ -1538,7 +1564,11 @@ async function processEdge(backend, graphId, registry, edge, edgeSchemas, nodeSc
|
|
|
1538
1564
|
}
|
|
1539
1565
|
}
|
|
1540
1566
|
if (!importedNodeIds.has(toKey)) {
|
|
1541
|
-
const toExists = await
|
|
1567
|
+
const toExists = await frame.target.getNode(
|
|
1568
|
+
graphId,
|
|
1569
|
+
edge.to.kind,
|
|
1570
|
+
edge.to.id
|
|
1571
|
+
);
|
|
1542
1572
|
if (toExists === void 0 || !isLiveNodeRow(toExists)) {
|
|
1543
1573
|
return {
|
|
1544
1574
|
status: "error",
|
|
@@ -1559,7 +1589,7 @@ async function processEdge(backend, graphId, registry, edge, edgeSchemas, nodeSc
|
|
|
1559
1589
|
if (validityError !== void 0) {
|
|
1560
1590
|
return { status: "error", error: validityError };
|
|
1561
1591
|
}
|
|
1562
|
-
const existing = await
|
|
1592
|
+
const existing = await frame.target.getEdge(graphId, edge.id);
|
|
1563
1593
|
if (existing) {
|
|
1564
1594
|
const identityConflict = edgeIdentityConflict(edge, existing);
|
|
1565
1595
|
if (identityConflict !== void 0) {
|
|
@@ -1587,8 +1617,7 @@ async function processEdge(backend, graphId, registry, edge, edgeSchemas, nodeSc
|
|
|
1587
1617
|
return { status: "error", error: updateWindow.error };
|
|
1588
1618
|
}
|
|
1589
1619
|
const updateError = await updateImportedEdge(
|
|
1590
|
-
|
|
1591
|
-
graphId,
|
|
1620
|
+
frame.session,
|
|
1592
1621
|
edge,
|
|
1593
1622
|
propsResult.data,
|
|
1594
1623
|
updateWindow.value
|
|
@@ -1600,20 +1629,36 @@ async function processEdge(backend, graphId, registry, edge, edgeSchemas, nodeSc
|
|
|
1600
1629
|
}
|
|
1601
1630
|
}
|
|
1602
1631
|
}
|
|
1603
|
-
|
|
1604
|
-
|
|
1605
|
-
|
|
1606
|
-
|
|
1607
|
-
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
|
|
1611
|
-
|
|
1612
|
-
|
|
1613
|
-
|
|
1614
|
-
|
|
1632
|
+
const cardinality = schemaEntry.registration.cardinality ?? "many";
|
|
1633
|
+
const cardinalityResult = await catchDeclaredConstraintRefusal(
|
|
1634
|
+
() => checkCardinalityConstraint(
|
|
1635
|
+
{ graphId, registry, backend: frame.target },
|
|
1636
|
+
edge.kind,
|
|
1637
|
+
cardinality,
|
|
1638
|
+
edge.from.kind,
|
|
1639
|
+
edge.from.id,
|
|
1640
|
+
edge.to.kind,
|
|
1641
|
+
edge.to.id,
|
|
1642
|
+
edge.validTo
|
|
1643
|
+
)
|
|
1644
|
+
);
|
|
1645
|
+
if (!cardinalityResult.ok) {
|
|
1646
|
+
return { status: "error", error: cardinalityResult.error };
|
|
1647
|
+
}
|
|
1648
|
+
await frame.session.createEdge(
|
|
1649
|
+
importEdgeInsertWork(
|
|
1650
|
+
graphId,
|
|
1651
|
+
{ edge, props: propsResult.data },
|
|
1652
|
+
cardinality
|
|
1653
|
+
)
|
|
1654
|
+
);
|
|
1615
1655
|
return { status: "created" };
|
|
1616
1656
|
}
|
|
1657
|
+
function importEdgeInsertWork(graphId, candidate, cardinality) {
|
|
1658
|
+
const params = edgeInsertParamsOf(graphId, candidate);
|
|
1659
|
+
const claim = edgeCardinalityClaim(cardinality, params);
|
|
1660
|
+
return { params, ...claim === void 0 ? {} : { claim } };
|
|
1661
|
+
}
|
|
1617
1662
|
function validateProperties(properties, schema, unknownStrategy) {
|
|
1618
1663
|
try {
|
|
1619
1664
|
const knownKeys = new Set(Object.keys(schema.shape));
|
|
@@ -2149,5 +2194,5 @@ async function* exportEdgeChunks(backend, graphId, kind, options) {
|
|
|
2149
2194
|
}
|
|
2150
2195
|
|
|
2151
2196
|
export { ConflictStrategySchema, ExportOptionsSchema, ExportStreamOptionsSchema, FORMAT_VERSION, GraphDataHeaderSchema, GraphDataSchema, GraphDataSourceSchema, GraphInterchangeChunkSchema, IdentityInterchangeModeSchema, ImportErrorSchema, ImportOptionsSchema, ImportResultSchema, InterchangeEdgeSchema, InterchangeIdentityAssertionSchema, InterchangeIdentitySchema, InterchangeNodeSchema, UnknownPropertyStrategySchema, exportGraph, exportGraphStream, exportStreamBackend, importGraph, importGraphStream, registerIngestionImportTarget, serializedStreamRefusal, withImportStreamLease };
|
|
2152
|
-
//# sourceMappingURL=chunk-
|
|
2153
|
-
//# sourceMappingURL=chunk-
|
|
2197
|
+
//# sourceMappingURL=chunk-2CYI5HRH.js.map
|
|
2198
|
+
//# sourceMappingURL=chunk-2CYI5HRH.js.map
|