@nicia-ai/typegraph 0.47.0 → 0.48.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.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/index.cjs +27 -19
- package/dist/backend/index.d.cts +37 -55
- package/dist/backend/index.d.ts +37 -55
- package/dist/backend/index.js +4 -4
- package/dist/backend/postgres/index.cjs +7 -7
- package/dist/backend/postgres/index.d.cts +21 -7
- package/dist/backend/postgres/index.d.ts +21 -7
- package/dist/backend/postgres/index.js +6 -6
- package/dist/backend/postgres/pglite-store.cjs +17 -17
- 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 +14 -14
- package/dist/backend/postgres/pglite.cjs +8 -8
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +7 -7
- package/dist/backend/sqlite/index.cjs +7 -7
- package/dist/backend/sqlite/index.d.cts +20 -7
- package/dist/backend/sqlite/index.d.ts +20 -7
- package/dist/backend/sqlite/index.js +6 -6
- package/dist/backend/sqlite/libsql.cjs +8 -8
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +6 -6
- package/dist/backend/sqlite/local-store.cjs +18 -18
- 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 +15 -15
- package/dist/backend/sqlite/local.cjs +9 -9
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +7 -7
- package/dist/{chunk-EMIB2RXD.cjs → chunk-2HIYYMWY.cjs} +99 -96
- package/dist/chunk-2HIYYMWY.cjs.map +1 -0
- package/dist/{chunk-6KFLYYOC.cjs → chunk-2QGYQBS2.cjs} +5 -5
- package/dist/{chunk-6KFLYYOC.cjs.map → chunk-2QGYQBS2.cjs.map} +1 -1
- package/dist/{chunk-5FT3TLPK.js → chunk-2SYZXD54.js} +16 -13
- package/dist/chunk-2SYZXD54.js.map +1 -0
- package/dist/{chunk-XYBQI6LE.js → chunk-2TYSSBU5.js} +6 -6
- package/dist/{chunk-XYBQI6LE.js.map → chunk-2TYSSBU5.js.map} +1 -1
- package/dist/{chunk-6JVZSOHQ.cjs → chunk-3FPR224C.cjs} +26 -26
- package/dist/{chunk-6JVZSOHQ.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
- package/dist/{chunk-MFZR4QKM.cjs → chunk-3KOY4FH3.cjs} +181 -4
- package/dist/chunk-3KOY4FH3.cjs.map +1 -0
- package/dist/{chunk-6FWSNSRE.js → chunk-4WMMBDS5.js} +4 -4
- package/dist/chunk-4WMMBDS5.js.map +1 -0
- package/dist/{chunk-NG2RB5WL.js → chunk-5K2BKEBD.js} +18 -3
- package/dist/chunk-5K2BKEBD.js.map +1 -0
- package/dist/chunk-5PRKMB24.cjs +124 -0
- package/dist/chunk-5PRKMB24.cjs.map +1 -0
- package/dist/chunk-6LN7FIVU.js +107 -0
- package/dist/chunk-6LN7FIVU.js.map +1 -0
- package/dist/{chunk-I4G3SQPF.cjs → chunk-7XUYFFR4.cjs} +7 -7
- package/dist/chunk-7XUYFFR4.cjs.map +1 -0
- package/dist/{chunk-KH7XW7VV.js → chunk-ACGSAMD3.js} +24 -27
- package/dist/chunk-ACGSAMD3.js.map +1 -0
- package/dist/{chunk-QS3NQZVC.js → chunk-AX6JGVTZ.js} +16 -11
- package/dist/chunk-AX6JGVTZ.js.map +1 -0
- package/dist/{chunk-DJZTXBWY.js → chunk-BRRP76WO.js} +71 -30
- package/dist/chunk-BRRP76WO.js.map +1 -0
- package/dist/{chunk-5UMTUOM5.js → chunk-CT3ZKTOF.js} +5 -4
- package/dist/chunk-CT3ZKTOF.js.map +1 -0
- package/dist/{chunk-XY5OMOJD.js → chunk-DZAICA5J.js} +3 -3
- package/dist/{chunk-XY5OMOJD.js.map → chunk-DZAICA5J.js.map} +1 -1
- package/dist/{chunk-OIFSOPSR.cjs → chunk-EZEEWCFJ.cjs} +38 -156
- package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
- package/dist/{chunk-AMMWA76F.cjs → chunk-FA2AFWLP.cjs} +6 -6
- package/dist/{chunk-AMMWA76F.cjs.map → chunk-FA2AFWLP.cjs.map} +1 -1
- package/dist/{chunk-FNOMT74T.js → chunk-I4GAZH5Z.js} +180 -5
- package/dist/chunk-I4GAZH5Z.js.map +1 -0
- package/dist/{chunk-WGX7JH7E.cjs → chunk-JB6T4GLL.cjs} +106 -134
- package/dist/chunk-JB6T4GLL.cjs.map +1 -0
- package/dist/{chunk-MX4DHSQP.cjs → chunk-JFRT7S3B.cjs} +92 -98
- package/dist/chunk-JFRT7S3B.cjs.map +1 -0
- package/dist/{chunk-SE6EGQSD.js → chunk-KF6K7TGH.js} +38 -66
- package/dist/chunk-KF6K7TGH.js.map +1 -0
- package/dist/{chunk-ZHNXLS3C.js → chunk-NACVVDWB.js} +208 -8
- package/dist/chunk-NACVVDWB.js.map +1 -0
- package/dist/{chunk-M35DF33T.js → chunk-OD4SSY2U.js} +29 -16
- package/dist/chunk-OD4SSY2U.js.map +1 -0
- package/dist/{chunk-U5EDAVOJ.cjs → chunk-OTUPEF2W.cjs} +54 -49
- package/dist/chunk-OTUPEF2W.cjs.map +1 -0
- package/dist/{chunk-BCQ76AXA.cjs → chunk-PFBRJBUL.cjs} +107 -94
- package/dist/chunk-PFBRJBUL.cjs.map +1 -0
- package/dist/{chunk-AVGUJWVX.js → chunk-S5TERQVW.js} +15 -132
- package/dist/chunk-S5TERQVW.js.map +1 -0
- package/dist/chunk-SIT26LAZ.cjs +614 -0
- package/dist/chunk-SIT26LAZ.cjs.map +1 -0
- package/dist/{chunk-BR7SHKGM.cjs → chunk-SR725PWF.cjs} +548 -507
- package/dist/chunk-SR725PWF.cjs.map +1 -0
- package/dist/{chunk-5FBRVORR.cjs → chunk-TKZXMWQF.cjs} +8 -7
- package/dist/chunk-TKZXMWQF.cjs.map +1 -0
- package/dist/{chunk-425IZOQ5.cjs → chunk-TQHGE7UC.cjs} +20 -2
- package/dist/chunk-TQHGE7UC.cjs.map +1 -0
- package/dist/{chunk-GYUJZARH.cjs → chunk-TUNPBZY3.cjs} +4 -4
- package/dist/{chunk-GYUJZARH.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
- package/dist/chunk-UGHG7PGX.js +592 -0
- package/dist/chunk-UGHG7PGX.js.map +1 -0
- package/dist/{chunk-KABFHAL7.cjs → chunk-UMGZDVOA.cjs} +213 -12
- package/dist/chunk-UMGZDVOA.cjs.map +1 -0
- package/dist/{chunk-UPAJHMW3.cjs → chunk-WCCATHMB.cjs} +54 -57
- package/dist/chunk-WCCATHMB.cjs.map +1 -0
- package/dist/{chunk-LEWHMOUY.js → chunk-YIURNGXI.js} +4 -4
- package/dist/{chunk-LEWHMOUY.js.map → chunk-YIURNGXI.js.map} +1 -1
- package/dist/{chunk-EP4RUYD6.js → chunk-YVF2EM7B.js} +3 -3
- package/dist/{chunk-EP4RUYD6.js.map → chunk-YVF2EM7B.js.map} +1 -1
- package/dist/{chunk-NNQ6A3RM.js → chunk-ZFMCDJGB.js} +7 -12
- package/dist/chunk-ZFMCDJGB.js.map +1 -0
- package/dist/core/index.cjs +6 -6
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +2 -2
- package/dist/ddl-BL1NZLMY.d.cts +78 -0
- package/dist/ddl-D_oW-EVO.d.ts +78 -0
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-merge/index.cjs +334 -191
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +65 -15
- package/dist/graph-merge/index.d.ts +65 -15
- package/dist/graph-merge/index.js +174 -32
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-CHTv4XMZ.d.cts → index-COs_z6nV.d.cts} +2 -2
- package/dist/{index-CzoJ3MUw.d.ts → index-D7d1u2gr.d.ts} +2 -2
- package/dist/index.cjs +90 -86
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +13 -13
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/interchange/index.cjs +38 -38
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +10 -10
- package/dist/{manager-DlY1vlla.d.cts → manager-CYaff3n3.d.cts} +2 -2
- package/dist/{manager-B6sOQzcQ.d.ts → manager-D9eRT_ns.d.ts} +2 -2
- package/dist/{materialize-indexes-DQL4xcpf.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
- package/dist/{materialize-indexes-sskhp-c_.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
- package/dist/{postgres-BXy_nyMs.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
- package/dist/{postgres-B6YOUcaK.d.ts → postgres-DMj39MEu.d.cts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +25 -26
- 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 +9 -10
- package/dist/provenance/index.js.map +1 -1
- package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
- package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +8 -8
- package/dist/{searchable-D9gMiwcS.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
- package/dist/{searchable-0Cn_lY8U.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
- package/dist/{sqlite-DioSxaPe.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
- package/dist/{sqlite-ClXuBYAj.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
- package/dist/{store-5j-w5onJ.d.ts → store-JUVvtmR4.d.cts} +113 -26
- package/dist/{store-CFedKGU5.d.cts → store-UzrGvZOo.d.ts} +113 -26
- package/dist/{temporal-CjO9FH1l.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
- package/dist/{temporal-Ce1pG0S1.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
- package/dist/{types-DKkMJZjR.d.cts → types-BqFZTQmV.d.cts} +29 -4
- package/dist/{types-DKkMJZjR.d.ts → types-BqFZTQmV.d.ts} +29 -4
- package/dist/{types-BrdOFu48.d.ts → types-Bx74kaTt.d.ts} +1 -1
- package/dist/{types-oj_OGAaZ.d.cts → types-CXAhpW-c.d.cts} +1 -1
- package/dist/{where-D1wKCJ4Q.d.cts → where-DI_Fqz-X.d.cts} +1 -1
- package/dist/{where-C8w2627G.d.ts → where-O-k2wgYm.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-3HGRTCDU.cjs +0 -269
- package/dist/chunk-3HGRTCDU.cjs.map +0 -1
- package/dist/chunk-425IZOQ5.cjs.map +0 -1
- package/dist/chunk-5FBRVORR.cjs.map +0 -1
- package/dist/chunk-5FT3TLPK.js.map +0 -1
- package/dist/chunk-5UMTUOM5.js.map +0 -1
- package/dist/chunk-6FWSNSRE.js.map +0 -1
- package/dist/chunk-AVGUJWVX.js.map +0 -1
- package/dist/chunk-BCQ76AXA.cjs.map +0 -1
- package/dist/chunk-BR7SHKGM.cjs.map +0 -1
- package/dist/chunk-DJZTXBWY.js.map +0 -1
- package/dist/chunk-EMIB2RXD.cjs.map +0 -1
- package/dist/chunk-FNOMT74T.js.map +0 -1
- package/dist/chunk-I4G3SQPF.cjs.map +0 -1
- package/dist/chunk-JR6SX5RH.cjs +0 -268
- package/dist/chunk-JR6SX5RH.cjs.map +0 -1
- package/dist/chunk-KABFHAL7.cjs.map +0 -1
- package/dist/chunk-KH7XW7VV.js.map +0 -1
- package/dist/chunk-M35DF33T.js.map +0 -1
- package/dist/chunk-MFZR4QKM.cjs.map +0 -1
- package/dist/chunk-MX4DHSQP.cjs.map +0 -1
- package/dist/chunk-NAZ2RA4L.js +0 -254
- package/dist/chunk-NAZ2RA4L.js.map +0 -1
- package/dist/chunk-NG2RB5WL.js.map +0 -1
- package/dist/chunk-NNQ6A3RM.js.map +0 -1
- package/dist/chunk-OIFSOPSR.cjs.map +0 -1
- package/dist/chunk-QS3NQZVC.js.map +0 -1
- package/dist/chunk-SE6EGQSD.js.map +0 -1
- package/dist/chunk-SHSSRCFR.js +0 -246
- package/dist/chunk-SHSSRCFR.js.map +0 -1
- package/dist/chunk-U5EDAVOJ.cjs.map +0 -1
- package/dist/chunk-UPAJHMW3.cjs.map +0 -1
- package/dist/chunk-WGX7JH7E.cjs.map +0 -1
- package/dist/chunk-ZHNXLS3C.js.map +0 -1
- package/dist/ddl-CprnMXJ-.d.ts +0 -38
- package/dist/ddl-DJA7Lci5.d.cts +0 -38
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import { getEmbeddingFields, applyNodeInsertSideEffectsBatch, createNodeWriteContext, applyNodeSoftDelete, applyNodeHardDelete, applyNodeUpdate, applyNodeInsertSideEffects, checkUniquenessConstraints
|
|
2
|
-
import {
|
|
3
|
-
import { runInsertBatch, nodeInsertDispatch, runInsertBatchReturning, getNodeRowsByIds, generateId, runInsertNoReturn } from './chunk-
|
|
1
|
+
import { getEmbeddingFields, validateResolvedNodeUniqueness, createUniquenessContext, applyNodeInsertSideEffectsBatch, createNodeWriteContext, applyNodeSoftDelete, applyNodeHardDelete, applyNodeUpdate, applyNodeInsertSideEffects, checkUniquenessConstraints } from './chunk-I4GAZH5Z.js';
|
|
2
|
+
import { runInWriteTransaction, refKey, runHookedWriteOperation, validateNodeProps } from './chunk-ZFMCDJGB.js';
|
|
3
|
+
import { encodeTupleKey, runInsertBatch, nodeInsertDispatch, runInsertBatchReturning, getNodeRowsByIds, generateId, runInsertNoReturn } from './chunk-S5TERQVW.js';
|
|
4
4
|
import { canonicalEqual } from './chunk-JBQQ7THH.js';
|
|
5
|
+
import { deriveBackend } from './chunk-UGHG7PGX.js';
|
|
5
6
|
import { createSqlSchema, DEFAULT_SQL_SCHEMA } from './chunk-NVY5CJFP.js';
|
|
6
|
-
import { rowPropsToObject,
|
|
7
|
+
import { rowPropsToObject, isLiveNodeRow } from './chunk-6LN7FIVU.js';
|
|
7
8
|
import { checkCardinality, checkUniqueEdge, checkWherePredicate, computeUniqueKey, getKindsForUniquenessCheck, checkDisjointness } from './chunk-GLHXM7C4.js';
|
|
8
|
-
import { validateOptionalCanonicalIsoDate,
|
|
9
|
+
import { validateOptionalCanonicalIsoDate, nowIso, resolveStampedValidityLowerBound, assertOrderedValidityWindow, preservesImmutableLowerBound, assertWritableValidityWindow } from './chunk-5K2BKEBD.js';
|
|
9
10
|
import { getDialect, compileNodeIndexFieldKeys, compileIndexWhere } from './chunk-ZDKTPBGV.js';
|
|
10
11
|
import { sql, asCompiledRowsSql } from './chunk-3DMMGT6S.js';
|
|
11
12
|
import { getSearchableFields } from './chunk-PC2UBAUB.js';
|
|
@@ -446,7 +447,7 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
446
447
|
if (uniqueCache.has(cacheKey)) return;
|
|
447
448
|
uniqueCache.set(cacheKey, row);
|
|
448
449
|
}
|
|
449
|
-
const validationBackend =
|
|
450
|
+
const validationBackend = deriveBackend(backend, {
|
|
450
451
|
getNode: getNodeCached,
|
|
451
452
|
checkUnique: checkUniqueCached
|
|
452
453
|
});
|
|
@@ -609,6 +610,7 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
609
610
|
"validFrom"
|
|
610
611
|
);
|
|
611
612
|
const validFrom = preservesLiveLowerBound ? void 0 : statedValidFrom;
|
|
613
|
+
const resurrectionBound = resurrectionInstant === void 0 ? void 0 : resolveStampedValidityLowerBound(validFrom, validTo, resurrectionInstant);
|
|
612
614
|
const windowVerdict = assertWritableValidityWindow(
|
|
613
615
|
`${kind} "${id}"`,
|
|
614
616
|
validFrom,
|
|
@@ -617,20 +619,18 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
617
619
|
appliesStatedValidFrom: false,
|
|
618
620
|
effectiveBoundIsStored: true
|
|
619
621
|
} : {
|
|
620
|
-
effectiveValidFrom:
|
|
622
|
+
effectiveValidFrom: resurrectionBound,
|
|
621
623
|
appliesStatedValidFrom: true,
|
|
622
|
-
// The
|
|
624
|
+
// The bound this write is about to stamp, not one the row holds.
|
|
623
625
|
effectiveBoundIsStored: false
|
|
624
626
|
},
|
|
625
627
|
validTo
|
|
626
628
|
);
|
|
627
629
|
const writeContext = createNodeWriteContext(ctx.graphId, ctx.registry, lock);
|
|
628
|
-
const effectiveValidFrom = validFrom ?? resurrectionInstant;
|
|
629
630
|
const shared = {
|
|
630
631
|
schema: nodeKind.schema,
|
|
631
632
|
validatedProps,
|
|
632
633
|
uniqueConstraints: registration.unique ?? [],
|
|
633
|
-
...effectiveValidFrom !== void 0 && { validFrom: effectiveValidFrom },
|
|
634
634
|
...validTo !== void 0 && { validTo },
|
|
635
635
|
...input.clearValidTo === true && { clearValidTo: true },
|
|
636
636
|
// The bound the verdict above READ, carried into the UPDATE's own `WHERE`
|
|
@@ -646,9 +646,10 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
646
646
|
...windowVerdict.storedLowerBoundFence
|
|
647
647
|
};
|
|
648
648
|
if (options?.clearDeleted) {
|
|
649
|
+
const resurrectionLowerBound = resurrectionInstant === void 0 ? validFrom !== void 0 && { validFrom } : { validFrom: resurrectionBound ?? null };
|
|
649
650
|
const row2 = await applyNodeUpdate(
|
|
650
651
|
writeContext,
|
|
651
|
-
{ ...shared, existing, clearDeleted: true },
|
|
652
|
+
{ ...shared, existing, clearDeleted: true, ...resurrectionLowerBound },
|
|
652
653
|
backend
|
|
653
654
|
);
|
|
654
655
|
return rowToNode(row2);
|
|
@@ -656,7 +657,11 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
656
657
|
if (!isLiveNodeRow(existing)) throw new NodeNotFoundError(kind, id);
|
|
657
658
|
const row = await applyNodeUpdate(
|
|
658
659
|
writeContext,
|
|
659
|
-
|
|
660
|
+
// An in-place update must not rewrite the stored bound, so it keeps the
|
|
661
|
+
// conditional spread: `buildUpdateNode` ignores `validFrom` off the
|
|
662
|
+
// resurrection leg, and stating one here would claim a rewrite that no
|
|
663
|
+
// statement performs.
|
|
664
|
+
{ ...shared, existing, ...validFrom !== void 0 && { validFrom } },
|
|
660
665
|
backend
|
|
661
666
|
);
|
|
662
667
|
return rowToNode(row);
|
|
@@ -819,6 +824,12 @@ async function resurrectPreparedNode(ctx, target, lock, prepared) {
|
|
|
819
824
|
if (current.deleted_at === void 0) {
|
|
820
825
|
throw createAlreadyExistsError("node", prepared.kind, prepared.id);
|
|
821
826
|
}
|
|
827
|
+
const resurrectionInstant = nowIso();
|
|
828
|
+
const resurrectionBound = resolveStampedValidityLowerBound(
|
|
829
|
+
prepared.insertParams.validFrom,
|
|
830
|
+
prepared.insertParams.validTo,
|
|
831
|
+
resurrectionInstant
|
|
832
|
+
);
|
|
822
833
|
try {
|
|
823
834
|
return await applyNodeUpdate(
|
|
824
835
|
createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
@@ -828,7 +839,10 @@ async function resurrectPreparedNode(ctx, target, lock, prepared) {
|
|
|
828
839
|
schema: prepared.nodeKind.schema,
|
|
829
840
|
validatedProps: prepared.validatedProps,
|
|
830
841
|
uniqueConstraints: prepared.uniqueConstraints,
|
|
831
|
-
|
|
842
|
+
// The decision itself, never an absence — see the same spelling on
|
|
843
|
+
// `performNodeUpdate`'s resurrection leg.
|
|
844
|
+
// eslint-disable-next-line unicorn/no-null -- `validFrom: null` means "store NULL"; omitting the key means "decide for me", and this path has already decided. See UpdateNodeParams.validFrom.
|
|
845
|
+
validFrom: resurrectionBound ?? null,
|
|
832
846
|
...prepared.insertParams.validTo === void 0 ? {} : { validTo: prepared.insertParams.validTo }
|
|
833
847
|
},
|
|
834
848
|
target
|
|
@@ -1263,57 +1277,15 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1263
1277
|
};
|
|
1264
1278
|
});
|
|
1265
1279
|
if (uniqueConstraints.length > 0) {
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
);
|
|
1276
|
-
const priorId = keyToId.get(key);
|
|
1277
|
-
if (priorId !== void 0 && priorId !== item.id) {
|
|
1278
|
-
throw new UniquenessError({
|
|
1279
|
-
constraintName: constraint.name,
|
|
1280
|
-
kind,
|
|
1281
|
-
existingId: priorId,
|
|
1282
|
-
newId: item.id,
|
|
1283
|
-
fields: constraint.fields
|
|
1284
|
-
});
|
|
1285
|
-
}
|
|
1286
|
-
keyToId.set(key, item.id);
|
|
1287
|
-
}
|
|
1288
|
-
const keys = [...keyToId.keys()];
|
|
1289
|
-
if (keys.length === 0) continue;
|
|
1290
|
-
for (const kindToCheck of getKindsForUniquenessCheck(
|
|
1291
|
-
kind,
|
|
1292
|
-
constraint.scope,
|
|
1293
|
-
ctx.registry
|
|
1294
|
-
)) {
|
|
1295
|
-
const existingRows = await requireDefined(
|
|
1296
|
-
target.checkUniqueBatch
|
|
1297
|
-
)({
|
|
1298
|
-
graphId: ctx.graphId,
|
|
1299
|
-
nodeKind: kindToCheck,
|
|
1300
|
-
constraintName: constraint.name,
|
|
1301
|
-
keys
|
|
1302
|
-
});
|
|
1303
|
-
for (const existing of existingRows) {
|
|
1304
|
-
if (existing.concrete_kind === kind && affectedIds.has(existing.node_id)) {
|
|
1305
|
-
continue;
|
|
1306
|
-
}
|
|
1307
|
-
throw new UniquenessError({
|
|
1308
|
-
constraintName: constraint.name,
|
|
1309
|
-
kind: kindToCheck,
|
|
1310
|
-
existingId: existing.node_id,
|
|
1311
|
-
newId: requireDefined(keyToId.get(existing.key)),
|
|
1312
|
-
fields: constraint.fields
|
|
1313
|
-
});
|
|
1314
|
-
}
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1280
|
+
await validateResolvedNodeUniqueness(
|
|
1281
|
+
createUniquenessContext(ctx.graphId, ctx.registry, target),
|
|
1282
|
+
sidecarItems.map((item) => ({
|
|
1283
|
+
kind: item.kind,
|
|
1284
|
+
id: item.id,
|
|
1285
|
+
props: item.props,
|
|
1286
|
+
constraints: item.uniqueConstraints
|
|
1287
|
+
}))
|
|
1288
|
+
);
|
|
1317
1289
|
await requireDefined(hardDeleteUniquesByNodeIds)({
|
|
1318
1290
|
graphId: ctx.graphId,
|
|
1319
1291
|
concreteKind: kind,
|
|
@@ -2014,5 +1986,5 @@ async function executeNodeBulkGetOrCreateByConstraint(ctx, kind, constraintName,
|
|
|
2014
1986
|
}
|
|
2015
1987
|
|
|
2016
1988
|
export { assertClearValidToSupported, assertValidityEndMutation, checkCardinalityConstraint, createNodeBatchValidationBackend, edgeWriteNeedsConstraintFence, executeNodeBulkFindByConstraint, executeNodeBulkFindByIndex, executeNodeBulkGetOrCreateByConstraint, executeNodeCreate, executeNodeCreateBatch, executeNodeCreateNoReturnBatch, executeNodeDelete, executeNodeDeleteBatch, executeNodeFindByConstraint, executeNodeGetOrCreateByConstraint, executeNodeHardDelete, executeNodeUpdate, executeNodeUpdateWhere, executeNodeUpsertUpdate, nodeUpsertDirtyCheck, primeBatchValidationCaches, rowToEdge, rowToEdgeMeta, rowToNode, rowToNodeMeta, validityEndAfterMutation, withAlreadyExistsTranslation };
|
|
2017
|
-
//# sourceMappingURL=chunk-
|
|
2018
|
-
//# sourceMappingURL=chunk-
|
|
1989
|
+
//# sourceMappingURL=chunk-KF6K7TGH.js.map
|
|
1990
|
+
//# sourceMappingURL=chunk-KF6K7TGH.js.map
|