@nicia-ai/typegraph 0.46.0 → 0.46.1
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/index.cjs +5 -5
- package/dist/backend/index.js +2 -2
- package/dist/backend/postgres/pglite-store.cjs +8 -8
- package/dist/backend/postgres/pglite-store.d.cts +2 -2
- package/dist/backend/postgres/pglite-store.d.ts +2 -2
- package/dist/backend/postgres/pglite-store.js +7 -7
- package/dist/backend/sqlite/local-store.cjs +8 -8
- package/dist/backend/sqlite/local-store.d.cts +2 -2
- package/dist/backend/sqlite/local-store.d.ts +2 -2
- package/dist/backend/sqlite/local-store.js +7 -7
- package/dist/{chunk-CNV4TXJG.js → chunk-2Z2Z3ZD6.js} +3 -3
- package/dist/{chunk-CNV4TXJG.js.map → chunk-2Z2Z3ZD6.js.map} +1 -1
- package/dist/{chunk-N3257XE6.cjs → chunk-65E3XWGF.cjs} +21 -21
- package/dist/{chunk-N3257XE6.cjs.map → chunk-65E3XWGF.cjs.map} +1 -1
- package/dist/{chunk-ONU3HIED.cjs → chunk-CMWHLBVN.cjs} +29 -29
- package/dist/{chunk-ONU3HIED.cjs.map → chunk-CMWHLBVN.cjs.map} +1 -1
- package/dist/{chunk-XNLIZYRZ.cjs → chunk-DTVWX77L.cjs} +56 -56
- package/dist/{chunk-XNLIZYRZ.cjs.map → chunk-DTVWX77L.cjs.map} +1 -1
- package/dist/{chunk-JIVMTW7W.js → chunk-GF3KXUTW.js} +4 -4
- package/dist/{chunk-JIVMTW7W.js.map → chunk-GF3KXUTW.js.map} +1 -1
- package/dist/{chunk-QWX5YA3K.js → chunk-L65OU2U3.js} +11 -9
- package/dist/chunk-L65OU2U3.js.map +1 -0
- package/dist/{chunk-QLRESYPU.js → chunk-LGHCOKTT.js} +5 -5
- package/dist/{chunk-QLRESYPU.js.map → chunk-LGHCOKTT.js.map} +1 -1
- package/dist/{chunk-WEVQJ5LH.js → chunk-M3WP7RQZ.js} +2 -2
- package/dist/chunk-M3WP7RQZ.js.map +1 -0
- package/dist/{chunk-Q7Q4WSLJ.cjs → chunk-MCLYU6BN.cjs} +6 -2
- package/dist/chunk-MCLYU6BN.cjs.map +1 -0
- package/dist/{chunk-RJS7DECT.js → chunk-MZLPX2R7.js} +3 -3
- package/dist/{chunk-RJS7DECT.js.map → chunk-MZLPX2R7.js.map} +1 -1
- package/dist/{chunk-NQ6BRJBE.js → chunk-NLI2AVEF.js} +3 -3
- package/dist/{chunk-NQ6BRJBE.js.map → chunk-NLI2AVEF.js.map} +1 -1
- package/dist/{chunk-XMQSEJCF.cjs → chunk-PF6F5NLJ.cjs} +20 -20
- package/dist/{chunk-XMQSEJCF.cjs.map → chunk-PF6F5NLJ.cjs.map} +1 -1
- package/dist/{chunk-XDF2UPEQ.cjs → chunk-PNTCATDE.cjs} +431 -421
- package/dist/chunk-PNTCATDE.cjs.map +1 -0
- package/dist/{chunk-7GT72YHH.cjs → chunk-PT7RIRIZ.cjs} +66 -64
- package/dist/chunk-PT7RIRIZ.cjs.map +1 -0
- package/dist/{chunk-TTAITEPJ.cjs → chunk-Q3G6A4I3.cjs} +2 -2
- package/dist/chunk-Q3G6A4I3.cjs.map +1 -0
- package/dist/{chunk-7Z5OR7KO.js → chunk-S6PW7VV5.js} +19 -9
- package/dist/chunk-S6PW7VV5.js.map +1 -0
- package/dist/{chunk-XQSCL77R.cjs → chunk-VLT6PEWR.cjs} +4 -4
- package/dist/{chunk-XQSCL77R.cjs.map → chunk-VLT6PEWR.cjs.map} +1 -1
- package/dist/{chunk-OH5E5KIO.js → chunk-WQZLUGVR.js} +6 -6
- package/dist/{chunk-OH5E5KIO.js.map → chunk-WQZLUGVR.js.map} +1 -1
- package/dist/{chunk-DLNROMQ7.js → chunk-XL7SLCXS.js} +6 -3
- package/dist/chunk-XL7SLCXS.js.map +1 -0
- package/dist/{chunk-XNSI2FJO.cjs → chunk-YBQOHKHN.cjs} +8 -8
- package/dist/{chunk-XNSI2FJO.cjs.map → chunk-YBQOHKHN.cjs.map} +1 -1
- package/dist/core/index.cjs +5 -5
- package/dist/core/index.js +1 -1
- package/dist/graph-merge/index.cjs +149 -149
- package/dist/graph-merge/index.d.cts +1 -1
- package/dist/graph-merge/index.d.ts +1 -1
- package/dist/graph-merge/index.js +8 -8
- package/dist/index.cjs +79 -79
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -9
- package/dist/interchange/index.cjs +34 -34
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/interchange/index.js +7 -7
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/provenance/index.cjs +16 -16
- package/dist/provenance/index.d.cts +1 -1
- package/dist/provenance/index.d.ts +1 -1
- package/dist/provenance/index.js +3 -3
- package/dist/schema/index.cjs +32 -32
- package/dist/schema/index.js +5 -5
- package/dist/{store-RwTJx8LX.d.cts → store-B0h6x7wo.d.cts} +12 -3
- package/dist/{store-DawaWWjJ.d.ts → store-ClQ-MZQS.d.ts} +12 -3
- package/package.json +3 -3
- package/dist/chunk-7GT72YHH.cjs.map +0 -1
- package/dist/chunk-7Z5OR7KO.js.map +0 -1
- package/dist/chunk-DLNROMQ7.js.map +0 -1
- package/dist/chunk-Q7Q4WSLJ.cjs.map +0 -1
- package/dist/chunk-QWX5YA3K.js.map +0 -1
- package/dist/chunk-TTAITEPJ.cjs.map +0 -1
- package/dist/chunk-WEVQJ5LH.js.map +0 -1
- package/dist/chunk-XDF2UPEQ.cjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkQ3G6A4I3_cjs = require('./chunk-Q3G6A4I3.cjs');
|
|
4
|
+
var chunkDTVWX77L_cjs = require('./chunk-DTVWX77L.cjs');
|
|
5
|
+
var chunkPF6F5NLJ_cjs = require('./chunk-PF6F5NLJ.cjs');
|
|
6
6
|
var chunkPWLJ77UV_cjs = require('./chunk-PWLJ77UV.cjs');
|
|
7
7
|
var chunkNFCVHQ5P_cjs = require('./chunk-NFCVHQ5P.cjs');
|
|
8
8
|
var chunkXBYVV3MP_cjs = require('./chunk-XBYVV3MP.cjs');
|
|
9
9
|
var chunkE4WNQBEF_cjs = require('./chunk-E4WNQBEF.cjs');
|
|
10
|
-
var
|
|
10
|
+
var chunkMCLYU6BN_cjs = require('./chunk-MCLYU6BN.cjs');
|
|
11
11
|
var chunk4UGOKMI5_cjs = require('./chunk-4UGOKMI5.cjs');
|
|
12
12
|
var chunkVCRRKBLN_cjs = require('./chunk-VCRRKBLN.cjs');
|
|
13
13
|
var chunkHAHNRASW_cjs = require('./chunk-HAHNRASW.cjs');
|
|
@@ -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 chunkDTVWX77L_cjs.encodeTupleKey([graphId, kind, id]);
|
|
247
247
|
}
|
|
248
248
|
function buildUniqueCacheKey(graphId, nodeKind, constraintName, key) {
|
|
249
|
-
return
|
|
249
|
+
return chunkDTVWX77L_cjs.encodeTupleKey([graphId, nodeKind, constraintName, key]);
|
|
250
250
|
}
|
|
251
251
|
function buildInsertNodeParams(graphId, kind, id, props, validFrom, validTo) {
|
|
252
252
|
const insertParams = {
|
|
@@ -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 : chunkDTVWX77L_cjs.validateNodeProps(nodeKind.schema, input.props, {
|
|
437
437
|
kind,
|
|
438
438
|
operation: "create"
|
|
439
439
|
});
|
|
440
|
-
const validFrom =
|
|
440
|
+
const validFrom = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(
|
|
441
441
|
input.validFrom,
|
|
442
442
|
"validFrom"
|
|
443
443
|
);
|
|
444
|
-
const validTo =
|
|
445
|
-
|
|
444
|
+
const validTo = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
445
|
+
chunkMCLYU6BN_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 chunkQ3G6A4I3_cjs.checkUniquenessConstraints(
|
|
470
|
+
chunkQ3G6A4I3_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 chunkQ3G6A4I3_cjs.applyNodeInsertSideEffectsBatch(
|
|
503
|
+
chunkQ3G6A4I3_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 chunkQ3G6A4I3_cjs.applyNodeInsertSideEffects(
|
|
519
|
+
chunkQ3G6A4I3_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 = chunkDTVWX77L_cjs.validateNodeProps(
|
|
533
533
|
registration.type.schema,
|
|
534
534
|
{ ...existingProps, ...inputProps },
|
|
535
535
|
{ kind, operation: "update", id }
|
|
@@ -570,13 +570,15 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
570
570
|
input.props
|
|
571
571
|
);
|
|
572
572
|
const nodeKind = registration.type;
|
|
573
|
-
const
|
|
573
|
+
const validTo = chunkMCLYU6BN_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
574
|
+
const resurrectionInstant = options?.clearDeleted === true && existing.deleted_at !== void 0 ? chunkMCLYU6BN_cjs.nowIso() : void 0;
|
|
575
|
+
const preservesLiveLowerBound = resurrectionInstant === void 0 && chunkMCLYU6BN_cjs.preservesImmutableLowerBound(input.onImmutableLowerBound);
|
|
576
|
+
const statedValidFrom = chunkMCLYU6BN_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 = chunkMCLYU6BN_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 = chunkQ3G6A4I3_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock);
|
|
595
597
|
const effectiveValidFrom = validFrom ?? resurrectionInstant;
|
|
596
598
|
const shared = {
|
|
597
599
|
schema: nodeKind.schema,
|
|
@@ -612,7 +614,7 @@ 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 chunkQ3G6A4I3_cjs.applyNodeUpdate(
|
|
616
618
|
writeContext,
|
|
617
619
|
{ ...shared, existing, clearDeleted: true },
|
|
618
620
|
backend
|
|
@@ -620,7 +622,7 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
620
622
|
return rowToNode(row2);
|
|
621
623
|
}
|
|
622
624
|
if (!chunkXBYVV3MP_cjs.isLiveNodeRow(existing)) throw new chunkNI72YOJB_cjs.NodeNotFoundError(kind, id);
|
|
623
|
-
const row = await
|
|
625
|
+
const row = await chunkQ3G6A4I3_cjs.applyNodeUpdate(
|
|
624
626
|
writeContext,
|
|
625
627
|
{ ...shared, existing },
|
|
626
628
|
backend
|
|
@@ -695,7 +697,7 @@ async function primeBatchValidationCaches(ctx, drafts, backend, seams) {
|
|
|
695
697
|
ctx.registry
|
|
696
698
|
);
|
|
697
699
|
for (const kindToCheck of kindsToCheck) {
|
|
698
|
-
const groupKey =
|
|
700
|
+
const groupKey = chunkDTVWX77L_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 ?? chunkPF6F5NLJ_cjs.generateId(), options)
|
|
739
741
|
);
|
|
740
742
|
await primeBatchValidationCaches(ctx, drafts, backend, {
|
|
741
743
|
seedNodeRow,
|
|
@@ -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 chunkQ3G6A4I3_cjs.applyNodeUpdate(
|
|
792
|
+
chunkQ3G6A4I3_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 ?? chunkPF6F5NLJ_cjs.generateId();
|
|
865
867
|
const opContext = ctx.createOperationContext("create", "node", kind, id);
|
|
866
868
|
const shouldReturnRow = options?.returnRow ?? true;
|
|
867
|
-
return
|
|
869
|
+
return chunkDTVWX77L_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 chunkPF6F5NLJ_cjs.runInsertNoReturn(
|
|
899
|
+
chunkPF6F5NLJ_cjs.nodeInsertDispatch(target),
|
|
898
900
|
prepared.insertParams
|
|
899
901
|
);
|
|
900
902
|
return;
|
|
@@ -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 chunkDTVWX77L_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
|
+
() => chunkPF6F5NLJ_cjs.runInsertBatch(
|
|
942
|
+
chunkPF6F5NLJ_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 chunkDTVWX77L_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
|
+
() => chunkPF6F5NLJ_cjs.runInsertBatchReturning(
|
|
981
|
+
chunkPF6F5NLJ_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
|
+
chunkDTVWX77L_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(chunkDTVWX77L_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 chunkDTVWX77L_cjs.runHookedWriteOperation(
|
|
1024
1026
|
ctx,
|
|
1025
1027
|
opContext,
|
|
1026
1028
|
backend,
|
|
@@ -1095,7 +1097,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1095
1097
|
}
|
|
1096
1098
|
);
|
|
1097
1099
|
}
|
|
1098
|
-
const parsedPatch =
|
|
1100
|
+
const parsedPatch = chunkDTVWX77L_cjs.validateNodeProps(schema.partial(), inputPatch, {
|
|
1099
1101
|
kind,
|
|
1100
1102
|
operation: "update"
|
|
1101
1103
|
});
|
|
@@ -1134,7 +1136,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1134
1136
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1135
1137
|
);
|
|
1136
1138
|
}
|
|
1137
|
-
if (
|
|
1139
|
+
if (chunkQ3G6A4I3_cjs.getEmbeddingFields(schema).length > 0 && (backend.upsertEmbedding === void 0 || backend.deleteEmbedding === void 0 || backend.upsertEmbeddingBatch === void 0 || backend.deleteEmbeddingBatch === void 0)) {
|
|
1138
1140
|
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
1139
1141
|
"updateWhere() requires batched vector sidecar operations for embedded nodes",
|
|
1140
1142
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
@@ -1143,7 +1145,7 @@ 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
|
+
() => chunkDTVWX77L_cjs.runInWriteTransaction(
|
|
1147
1149
|
ctx,
|
|
1148
1150
|
backend,
|
|
1149
1151
|
async (target, lock) => {
|
|
@@ -1167,7 +1169,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1167
1169
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1168
1170
|
);
|
|
1169
1171
|
}
|
|
1170
|
-
if (
|
|
1172
|
+
if (chunkQ3G6A4I3_cjs.getEmbeddingFields(schema).length > 0 && (target.upsertEmbedding === void 0 || target.deleteEmbedding === void 0 || target.upsertEmbeddingBatch === void 0 || target.deleteEmbeddingBatch === void 0)) {
|
|
1171
1173
|
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
1172
1174
|
"The transaction backend lacks batched vector operations",
|
|
1173
1175
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
@@ -1184,7 +1186,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1184
1186
|
if (result.affectedCount === 0) return { affectedCount: 0 };
|
|
1185
1187
|
const sidecarItems = result.rows.map((row) => {
|
|
1186
1188
|
const props = chunkXBYVV3MP_cjs.rowPropsToObject(row.props);
|
|
1187
|
-
const validatedProps =
|
|
1189
|
+
const validatedProps = chunkDTVWX77L_cjs.validateNodeProps(schema, props, {
|
|
1188
1190
|
kind,
|
|
1189
1191
|
operation: "update",
|
|
1190
1192
|
id: row.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 chunkQ3G6A4I3_cjs.applyNodeInsertSideEffectsBatch(
|
|
1278
|
+
chunkQ3G6A4I3_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 chunkDTVWX77L_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 chunkDTVWX77L_cjs.runHookedWriteOperation(
|
|
1329
1331
|
ctx,
|
|
1330
1332
|
opContext,
|
|
1331
1333
|
backend,
|
|
@@ -1335,8 +1337,8 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1335
1337
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1336
1338
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1337
1339
|
if (!preflight || !chunkXBYVV3MP_cjs.isLiveNodeRow(preflight)) return;
|
|
1338
|
-
await
|
|
1339
|
-
|
|
1340
|
+
await chunkQ3G6A4I3_cjs.applyNodeSoftDelete(
|
|
1341
|
+
chunkQ3G6A4I3_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 chunkDTVWX77L_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 = chunkQ3G6A4I3_cjs.createNodeWriteContext(
|
|
1363
1365
|
ctx.graphId,
|
|
1364
1366
|
ctx.registry,
|
|
1365
1367
|
lock
|
|
@@ -1368,7 +1370,7 @@ async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
|
1368
1370
|
for (const id of ids) {
|
|
1369
1371
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1370
1372
|
if (!preflight || !chunkXBYVV3MP_cjs.isLiveNodeRow(preflight)) continue;
|
|
1371
|
-
await
|
|
1373
|
+
await chunkQ3G6A4I3_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 chunkDTVWX77L_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 chunkQ3G6A4I3_cjs.applyNodeHardDelete(
|
|
1406
|
+
chunkQ3G6A4I3_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1405
1407
|
{
|
|
1406
1408
|
kind,
|
|
1407
1409
|
id,
|
|
@@ -1420,7 +1422,7 @@ 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 = chunkDTVWX77L_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1424
1426
|
kind,
|
|
1425
1427
|
operation: "create"
|
|
1426
1428
|
});
|
|
@@ -1503,7 +1505,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
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 = chunkDTVWX77L_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1507
1509
|
kind,
|
|
1508
1510
|
operation: "create"
|
|
1509
1511
|
});
|
|
@@ -1540,7 +1542,7 @@ 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 = chunkDTVWX77L_cjs.validateNodeProps(nodeKind.schema, item.props, {
|
|
1544
1546
|
kind,
|
|
1545
1547
|
operation: "create"
|
|
1546
1548
|
});
|
|
@@ -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 chunkPF6F5NLJ_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;
|
|
@@ -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-PT7RIRIZ.cjs.map
|
|
1981
|
+
//# sourceMappingURL=chunk-PT7RIRIZ.cjs.map
|