@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,13 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk3KOY4FH3_cjs = require('./chunk-3KOY4FH3.cjs');
|
|
4
|
+
var chunkJFRT7S3B_cjs = require('./chunk-JFRT7S3B.cjs');
|
|
5
|
+
var chunkEZEEWCFJ_cjs = require('./chunk-EZEEWCFJ.cjs');
|
|
6
6
|
var chunkPWLJ77UV_cjs = require('./chunk-PWLJ77UV.cjs');
|
|
7
|
+
var chunkSIT26LAZ_cjs = require('./chunk-SIT26LAZ.cjs');
|
|
7
8
|
var chunk3U5ABFDW_cjs = require('./chunk-3U5ABFDW.cjs');
|
|
8
|
-
var
|
|
9
|
+
var chunk5PRKMB24_cjs = require('./chunk-5PRKMB24.cjs');
|
|
9
10
|
var chunkFQPEMEWX_cjs = require('./chunk-FQPEMEWX.cjs');
|
|
10
|
-
var
|
|
11
|
+
var chunkTQHGE7UC_cjs = require('./chunk-TQHGE7UC.cjs');
|
|
11
12
|
var chunkL3LQNR34_cjs = require('./chunk-L3LQNR34.cjs');
|
|
12
13
|
var chunkEDN4Y4ZG_cjs = require('./chunk-EDN4Y4ZG.cjs');
|
|
13
14
|
var chunkHAHNRASW_cjs = require('./chunk-HAHNRASW.cjs');
|
|
@@ -21,7 +22,7 @@ function nullToUndefined(value) {
|
|
|
21
22
|
return value === null ? void 0 : value;
|
|
22
23
|
}
|
|
23
24
|
function rowToNode(row) {
|
|
24
|
-
const rawProps =
|
|
25
|
+
const rawProps = chunk5PRKMB24_cjs.rowPropsToObject(row.props);
|
|
25
26
|
const props = chunk6NGW27EO_cjs.filterReservedKeys(rawProps, chunk6NGW27EO_cjs.RESERVED_NODE_KEYS);
|
|
26
27
|
return {
|
|
27
28
|
kind: row.kind,
|
|
@@ -41,7 +42,7 @@ function rowToNodeMeta(row) {
|
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
function rowToEdge(row) {
|
|
44
|
-
const rawProps =
|
|
45
|
+
const rawProps = chunk5PRKMB24_cjs.rowPropsToObject(row.props);
|
|
45
46
|
const props = chunk6NGW27EO_cjs.filterReservedKeys(rawProps, chunk6NGW27EO_cjs.RESERVED_EDGE_KEYS);
|
|
46
47
|
return {
|
|
47
48
|
id: row.id,
|
|
@@ -275,10 +276,10 @@ function nodeBatchFencesConstraintProbe(ctx, inputs, operation) {
|
|
|
275
276
|
return void 0;
|
|
276
277
|
}
|
|
277
278
|
function buildNodeCacheKey(graphId, kind, id) {
|
|
278
|
-
return
|
|
279
|
+
return chunkEZEEWCFJ_cjs.encodeTupleKey([graphId, kind, id]);
|
|
279
280
|
}
|
|
280
281
|
function buildUniqueCacheKey(graphId, nodeKind, constraintName, key) {
|
|
281
|
-
return
|
|
282
|
+
return chunkEZEEWCFJ_cjs.encodeTupleKey([graphId, nodeKind, constraintName, key]);
|
|
282
283
|
}
|
|
283
284
|
function buildInsertNodeParams(graphId, kind, id, props, validFrom, validTo) {
|
|
284
285
|
const insertParams = {
|
|
@@ -448,7 +449,7 @@ function createNodeBatchValidationBackend(graphId, registry, backend) {
|
|
|
448
449
|
if (uniqueCache.has(cacheKey)) return;
|
|
449
450
|
uniqueCache.set(cacheKey, row);
|
|
450
451
|
}
|
|
451
|
-
const validationBackend =
|
|
452
|
+
const validationBackend = chunkSIT26LAZ_cjs.deriveBackend(backend, {
|
|
452
453
|
getNode: getNodeCached,
|
|
453
454
|
checkUnique: checkUniqueCached
|
|
454
455
|
});
|
|
@@ -465,16 +466,16 @@ function draftNodeCreate(ctx, input, id, options) {
|
|
|
465
466
|
const kind = input.kind;
|
|
466
467
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
467
468
|
const nodeKind = registration.type;
|
|
468
|
-
const validatedProps = options?.propsPreValidated === true ? input.props :
|
|
469
|
+
const validatedProps = options?.propsPreValidated === true ? input.props : chunkJFRT7S3B_cjs.validateNodeProps(nodeKind.schema, input.props, {
|
|
469
470
|
kind,
|
|
470
471
|
operation: "create"
|
|
471
472
|
});
|
|
472
|
-
const validFrom =
|
|
473
|
+
const validFrom = chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(
|
|
473
474
|
input.validFrom,
|
|
474
475
|
"validFrom"
|
|
475
476
|
);
|
|
476
|
-
const validTo =
|
|
477
|
-
|
|
477
|
+
const validTo = chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
478
|
+
chunkTQHGE7UC_cjs.assertOrderedValidityWindow(`${kind} "${id}"`, validFrom, validTo);
|
|
478
479
|
return {
|
|
479
480
|
kind,
|
|
480
481
|
id,
|
|
@@ -498,8 +499,8 @@ async function finishNodeCreatePreparation(ctx, draft, backend) {
|
|
|
498
499
|
backend
|
|
499
500
|
};
|
|
500
501
|
await checkDisjointnessConstraint(constraintContext, kind, id);
|
|
501
|
-
await
|
|
502
|
-
|
|
502
|
+
await chunk3KOY4FH3_cjs.checkUniquenessConstraints(
|
|
503
|
+
chunk3KOY4FH3_cjs.createUniquenessContext(ctx.graphId, ctx.registry, backend),
|
|
503
504
|
kind,
|
|
504
505
|
id,
|
|
505
506
|
validatedProps,
|
|
@@ -531,8 +532,8 @@ async function validateAndPrepareNodeCreate(ctx, input, id, backend, options) {
|
|
|
531
532
|
);
|
|
532
533
|
}
|
|
533
534
|
async function finalizeNodeCreateBatch(ctx, preparedCreates, backend, lock) {
|
|
534
|
-
await
|
|
535
|
-
|
|
535
|
+
await chunk3KOY4FH3_cjs.applyNodeInsertSideEffectsBatch(
|
|
536
|
+
chunk3KOY4FH3_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
536
537
|
preparedCreates.map((prepared) => ({
|
|
537
538
|
kind: prepared.kind,
|
|
538
539
|
id: prepared.id,
|
|
@@ -547,8 +548,8 @@ function foldReferences(preparedCreates) {
|
|
|
547
548
|
return preparedCreates.filter((prepared) => prepared.idProvided).map((prepared) => ({ kind: prepared.kind, id: prepared.id }));
|
|
548
549
|
}
|
|
549
550
|
async function finalizeNodeCreate(ctx, prepared, backend, lock) {
|
|
550
|
-
await
|
|
551
|
-
|
|
551
|
+
await chunk3KOY4FH3_cjs.applyNodeInsertSideEffects(
|
|
552
|
+
chunk3KOY4FH3_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
552
553
|
{
|
|
553
554
|
kind: prepared.kind,
|
|
554
555
|
id: prepared.id,
|
|
@@ -561,7 +562,7 @@ async function finalizeNodeCreate(ctx, prepared, backend, lock) {
|
|
|
561
562
|
}
|
|
562
563
|
function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
563
564
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
564
|
-
const validatedProps =
|
|
565
|
+
const validatedProps = chunkJFRT7S3B_cjs.validateNodeProps(
|
|
565
566
|
registration.type.schema,
|
|
566
567
|
{ ...existingProps, ...inputProps },
|
|
567
568
|
{ kind, operation: "update", id }
|
|
@@ -569,7 +570,7 @@ function computeNodeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
|
569
570
|
return { registration, validatedProps };
|
|
570
571
|
}
|
|
571
572
|
function resolveNodeUpdateProps(ctx, existing, inputProps) {
|
|
572
|
-
const existingProps =
|
|
573
|
+
const existingProps = chunk5PRKMB24_cjs.rowPropsToObject(existing.props);
|
|
573
574
|
const { registration, validatedProps } = computeNodeUpdate(
|
|
574
575
|
ctx,
|
|
575
576
|
existing.kind,
|
|
@@ -603,15 +604,16 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
603
604
|
input.props
|
|
604
605
|
);
|
|
605
606
|
const nodeKind = registration.type;
|
|
606
|
-
const validTo =
|
|
607
|
-
const resurrectionInstant = options?.clearDeleted === true && existing.deleted_at !== void 0 ?
|
|
608
|
-
const preservesLiveLowerBound = resurrectionInstant === void 0 &&
|
|
609
|
-
const statedValidFrom =
|
|
607
|
+
const validTo = chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
608
|
+
const resurrectionInstant = options?.clearDeleted === true && existing.deleted_at !== void 0 ? chunkTQHGE7UC_cjs.nowIso() : void 0;
|
|
609
|
+
const preservesLiveLowerBound = resurrectionInstant === void 0 && chunkTQHGE7UC_cjs.preservesImmutableLowerBound(input.onImmutableLowerBound);
|
|
610
|
+
const statedValidFrom = chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(
|
|
610
611
|
input.validFrom,
|
|
611
612
|
"validFrom"
|
|
612
613
|
);
|
|
613
614
|
const validFrom = preservesLiveLowerBound ? void 0 : statedValidFrom;
|
|
614
|
-
const
|
|
615
|
+
const resurrectionBound = resurrectionInstant === void 0 ? void 0 : chunkTQHGE7UC_cjs.resolveStampedValidityLowerBound(validFrom, validTo, resurrectionInstant);
|
|
616
|
+
const windowVerdict = chunkTQHGE7UC_cjs.assertWritableValidityWindow(
|
|
615
617
|
`${kind} "${id}"`,
|
|
616
618
|
validFrom,
|
|
617
619
|
resurrectionInstant === void 0 ? {
|
|
@@ -619,20 +621,18 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
619
621
|
appliesStatedValidFrom: false,
|
|
620
622
|
effectiveBoundIsStored: true
|
|
621
623
|
} : {
|
|
622
|
-
effectiveValidFrom:
|
|
624
|
+
effectiveValidFrom: resurrectionBound,
|
|
623
625
|
appliesStatedValidFrom: true,
|
|
624
|
-
// The
|
|
626
|
+
// The bound this write is about to stamp, not one the row holds.
|
|
625
627
|
effectiveBoundIsStored: false
|
|
626
628
|
},
|
|
627
629
|
validTo
|
|
628
630
|
);
|
|
629
|
-
const writeContext =
|
|
630
|
-
const effectiveValidFrom = validFrom ?? resurrectionInstant;
|
|
631
|
+
const writeContext = chunk3KOY4FH3_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock);
|
|
631
632
|
const shared = {
|
|
632
633
|
schema: nodeKind.schema,
|
|
633
634
|
validatedProps,
|
|
634
635
|
uniqueConstraints: registration.unique ?? [],
|
|
635
|
-
...effectiveValidFrom !== void 0 && { validFrom: effectiveValidFrom },
|
|
636
636
|
...validTo !== void 0 && { validTo },
|
|
637
637
|
...input.clearValidTo === true && { clearValidTo: true },
|
|
638
638
|
// The bound the verdict above READ, carried into the UPDATE's own `WHERE`
|
|
@@ -648,17 +648,22 @@ async function performNodeUpdate(ctx, input, backend, lock, options) {
|
|
|
648
648
|
...windowVerdict.storedLowerBoundFence
|
|
649
649
|
};
|
|
650
650
|
if (options?.clearDeleted) {
|
|
651
|
-
const
|
|
651
|
+
const resurrectionLowerBound = resurrectionInstant === void 0 ? validFrom !== void 0 && { validFrom } : { validFrom: resurrectionBound ?? null };
|
|
652
|
+
const row2 = await chunk3KOY4FH3_cjs.applyNodeUpdate(
|
|
652
653
|
writeContext,
|
|
653
|
-
{ ...shared, existing, clearDeleted: true },
|
|
654
|
+
{ ...shared, existing, clearDeleted: true, ...resurrectionLowerBound },
|
|
654
655
|
backend
|
|
655
656
|
);
|
|
656
657
|
return rowToNode(row2);
|
|
657
658
|
}
|
|
658
|
-
if (!
|
|
659
|
-
const row = await
|
|
659
|
+
if (!chunk5PRKMB24_cjs.isLiveNodeRow(existing)) throw new chunkMRDBBHIZ_cjs.NodeNotFoundError(kind, id);
|
|
660
|
+
const row = await chunk3KOY4FH3_cjs.applyNodeUpdate(
|
|
660
661
|
writeContext,
|
|
661
|
-
|
|
662
|
+
// An in-place update must not rewrite the stored bound, so it keeps the
|
|
663
|
+
// conditional spread: `buildUpdateNode` ignores `validFrom` off the
|
|
664
|
+
// resurrection leg, and stating one here would claim a rewrite that no
|
|
665
|
+
// statement performs.
|
|
666
|
+
{ ...shared, existing, ...validFrom !== void 0 && { validFrom } },
|
|
662
667
|
backend
|
|
663
668
|
);
|
|
664
669
|
return rowToNode(row);
|
|
@@ -731,7 +736,7 @@ async function primeBatchValidationCaches(ctx, drafts, backend, seams) {
|
|
|
731
736
|
ctx.registry
|
|
732
737
|
);
|
|
733
738
|
for (const kindToCheck of kindsToCheck) {
|
|
734
|
-
const groupKey =
|
|
739
|
+
const groupKey = chunkEZEEWCFJ_cjs.encodeTupleKey([kindToCheck, constraint.name]);
|
|
735
740
|
const group = groups.get(groupKey) ?? {
|
|
736
741
|
nodeKind: kindToCheck,
|
|
737
742
|
constraintName: constraint.name,
|
|
@@ -771,7 +776,7 @@ async function prepareBatchCreates(ctx, inputs, backend, options) {
|
|
|
771
776
|
seedUniqueRow
|
|
772
777
|
} = createNodeBatchValidationBackend(ctx.graphId, ctx.registry, backend);
|
|
773
778
|
const drafts = inputs.map(
|
|
774
|
-
(input) => draftNodeCreate(ctx, input, input.id ??
|
|
779
|
+
(input) => draftNodeCreate(ctx, input, input.id ?? chunkEZEEWCFJ_cjs.generateId(), options)
|
|
775
780
|
);
|
|
776
781
|
await primeBatchValidationCaches(ctx, drafts, backend, {
|
|
777
782
|
seedNodeRow,
|
|
@@ -821,16 +826,25 @@ async function resurrectPreparedNode(ctx, target, lock, prepared) {
|
|
|
821
826
|
if (current.deleted_at === void 0) {
|
|
822
827
|
throw createAlreadyExistsError("node", prepared.kind, prepared.id);
|
|
823
828
|
}
|
|
829
|
+
const resurrectionInstant = chunkTQHGE7UC_cjs.nowIso();
|
|
830
|
+
const resurrectionBound = chunkTQHGE7UC_cjs.resolveStampedValidityLowerBound(
|
|
831
|
+
prepared.insertParams.validFrom,
|
|
832
|
+
prepared.insertParams.validTo,
|
|
833
|
+
resurrectionInstant
|
|
834
|
+
);
|
|
824
835
|
try {
|
|
825
|
-
return await
|
|
826
|
-
|
|
836
|
+
return await chunk3KOY4FH3_cjs.applyNodeUpdate(
|
|
837
|
+
chunk3KOY4FH3_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
827
838
|
{
|
|
828
839
|
existing: current,
|
|
829
840
|
clearDeleted: true,
|
|
830
841
|
schema: prepared.nodeKind.schema,
|
|
831
842
|
validatedProps: prepared.validatedProps,
|
|
832
843
|
uniqueConstraints: prepared.uniqueConstraints,
|
|
833
|
-
|
|
844
|
+
// The decision itself, never an absence — see the same spelling on
|
|
845
|
+
// `performNodeUpdate`'s resurrection leg.
|
|
846
|
+
// 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.
|
|
847
|
+
validFrom: resurrectionBound ?? null,
|
|
834
848
|
...prepared.insertParams.validTo === void 0 ? {} : { validTo: prepared.insertParams.validTo }
|
|
835
849
|
},
|
|
836
850
|
target
|
|
@@ -897,10 +911,10 @@ async function batchCheckUniqueAcrossKinds(backend, graphId, constraintName, uni
|
|
|
897
911
|
}
|
|
898
912
|
async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
899
913
|
const kind = input.kind;
|
|
900
|
-
const id = input.id ??
|
|
914
|
+
const id = input.id ?? chunkEZEEWCFJ_cjs.generateId();
|
|
901
915
|
const opContext = ctx.createOperationContext("create", "node", kind, id);
|
|
902
916
|
const shouldReturnRow = options?.returnRow ?? true;
|
|
903
|
-
return
|
|
917
|
+
return chunkJFRT7S3B_cjs.runHookedWriteOperation(
|
|
904
918
|
ctx,
|
|
905
919
|
opContext,
|
|
906
920
|
backend,
|
|
@@ -929,8 +943,8 @@ async function executeNodeCreateInternal(ctx, input, backend, options) {
|
|
|
929
943
|
}
|
|
930
944
|
const row = await withAlreadyExistsTranslation("node", async () => {
|
|
931
945
|
if (shouldReturnRow) return target.insertNode(prepared.insertParams);
|
|
932
|
-
await
|
|
933
|
-
|
|
946
|
+
await chunkEZEEWCFJ_cjs.runInsertNoReturn(
|
|
947
|
+
chunkEZEEWCFJ_cjs.nodeInsertDispatch(target),
|
|
934
948
|
prepared.insertParams
|
|
935
949
|
);
|
|
936
950
|
return;
|
|
@@ -962,7 +976,7 @@ async function executeNodeCreate(ctx, input, backend, options) {
|
|
|
962
976
|
}
|
|
963
977
|
async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
964
978
|
if (inputs.length === 0) return;
|
|
965
|
-
await
|
|
979
|
+
await chunkJFRT7S3B_cjs.runInWriteTransaction(
|
|
966
980
|
ctx,
|
|
967
981
|
backend,
|
|
968
982
|
async (target, lock) => {
|
|
@@ -972,8 +986,8 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
972
986
|
const partition = partitionCreates(preparedCreates);
|
|
973
987
|
await withAlreadyExistsTranslation(
|
|
974
988
|
"node",
|
|
975
|
-
() =>
|
|
976
|
-
|
|
989
|
+
() => chunkEZEEWCFJ_cjs.runInsertBatch(
|
|
990
|
+
chunkEZEEWCFJ_cjs.nodeInsertDispatch(target),
|
|
977
991
|
partition.inserts.map((prepared) => prepared.insertParams)
|
|
978
992
|
)
|
|
979
993
|
);
|
|
@@ -996,7 +1010,7 @@ async function executeNodeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
996
1010
|
}
|
|
997
1011
|
async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
998
1012
|
if (inputs.length === 0) return [];
|
|
999
|
-
return
|
|
1013
|
+
return chunkJFRT7S3B_cjs.runInWriteTransaction(
|
|
1000
1014
|
ctx,
|
|
1001
1015
|
backend,
|
|
1002
1016
|
async (target, lock) => {
|
|
@@ -1011,8 +1025,8 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
1011
1025
|
const partition = partitionCreates(preparedCreates);
|
|
1012
1026
|
const inserted = await withAlreadyExistsTranslation(
|
|
1013
1027
|
"node",
|
|
1014
|
-
() =>
|
|
1015
|
-
|
|
1028
|
+
() => chunkEZEEWCFJ_cjs.runInsertBatchReturning(
|
|
1029
|
+
chunkEZEEWCFJ_cjs.nodeInsertDispatch(target),
|
|
1016
1030
|
partition.inserts.map((prepared) => prepared.insertParams)
|
|
1017
1031
|
)
|
|
1018
1032
|
);
|
|
@@ -1025,13 +1039,13 @@ async function executeNodeCreateBatch(ctx, inputs, backend, options) {
|
|
|
1025
1039
|
await finalizeNodeCreateBatch(ctx, partition.inserts, target, lock);
|
|
1026
1040
|
const byReference = new Map(
|
|
1027
1041
|
[...inserted, ...resurrected].map((row) => [
|
|
1028
|
-
|
|
1042
|
+
chunkJFRT7S3B_cjs.refKey({ kind: row.kind, id: row.id }),
|
|
1029
1043
|
row
|
|
1030
1044
|
])
|
|
1031
1045
|
);
|
|
1032
1046
|
const rows = preparedCreates.map(
|
|
1033
1047
|
(prepared) => chunkN66HCGCY_cjs.requireDefined(
|
|
1034
|
-
byReference.get(
|
|
1048
|
+
byReference.get(chunkJFRT7S3B_cjs.refKey({ kind: prepared.kind, id: prepared.id })),
|
|
1035
1049
|
`Missing written row for ${prepared.kind} ${prepared.id}`
|
|
1036
1050
|
)
|
|
1037
1051
|
);
|
|
@@ -1056,7 +1070,7 @@ async function executeNodeUpdate(ctx, input, backend, options) {
|
|
|
1056
1070
|
input.kind,
|
|
1057
1071
|
input.id
|
|
1058
1072
|
);
|
|
1059
|
-
return
|
|
1073
|
+
return chunkJFRT7S3B_cjs.runHookedWriteOperation(
|
|
1060
1074
|
ctx,
|
|
1061
1075
|
opContext,
|
|
1062
1076
|
backend,
|
|
@@ -1064,7 +1078,7 @@ async function executeNodeUpdate(ctx, input, backend, options) {
|
|
|
1064
1078
|
if (input.clearValidTo === true) {
|
|
1065
1079
|
assertClearValidToSupported(backend, "node");
|
|
1066
1080
|
}
|
|
1067
|
-
const validTo =
|
|
1081
|
+
const validTo = chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(
|
|
1068
1082
|
input.validTo,
|
|
1069
1083
|
"validTo"
|
|
1070
1084
|
);
|
|
@@ -1145,7 +1159,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1145
1159
|
}
|
|
1146
1160
|
);
|
|
1147
1161
|
}
|
|
1148
|
-
const parsedPatch =
|
|
1162
|
+
const parsedPatch = chunkJFRT7S3B_cjs.validateNodeProps(schema.partial(), inputPatch, {
|
|
1149
1163
|
kind,
|
|
1150
1164
|
operation: "update"
|
|
1151
1165
|
});
|
|
@@ -1184,7 +1198,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1184
1198
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1185
1199
|
);
|
|
1186
1200
|
}
|
|
1187
|
-
if (
|
|
1201
|
+
if (chunk3KOY4FH3_cjs.getEmbeddingFields(schema).length > 0 && (backend.upsertEmbedding === void 0 || backend.deleteEmbedding === void 0 || backend.upsertEmbeddingBatch === void 0 || backend.deleteEmbeddingBatch === void 0)) {
|
|
1188
1202
|
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1189
1203
|
"updateWhere() requires batched vector sidecar operations for embedded nodes",
|
|
1190
1204
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
@@ -1193,7 +1207,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1193
1207
|
const hookContext = ctx.createBulkOperationContext("updateWhere", kind);
|
|
1194
1208
|
return ctx.withBulkOperationHooks(
|
|
1195
1209
|
hookContext,
|
|
1196
|
-
() =>
|
|
1210
|
+
() => chunkJFRT7S3B_cjs.runInWriteTransaction(
|
|
1197
1211
|
ctx,
|
|
1198
1212
|
backend,
|
|
1199
1213
|
async (target, lock) => {
|
|
@@ -1217,7 +1231,7 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1217
1231
|
{ code: "SET_UPDATE_FULLTEXT_UNSUPPORTED", kind }
|
|
1218
1232
|
);
|
|
1219
1233
|
}
|
|
1220
|
-
if (
|
|
1234
|
+
if (chunk3KOY4FH3_cjs.getEmbeddingFields(schema).length > 0 && (target.upsertEmbedding === void 0 || target.deleteEmbedding === void 0 || target.upsertEmbeddingBatch === void 0 || target.deleteEmbeddingBatch === void 0)) {
|
|
1221
1235
|
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
1222
1236
|
"The transaction backend lacks batched vector operations",
|
|
1223
1237
|
{ code: "SET_UPDATE_VECTOR_UNSUPPORTED", kind }
|
|
@@ -1233,8 +1247,8 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1233
1247
|
});
|
|
1234
1248
|
if (result.affectedCount === 0) return { affectedCount: 0 };
|
|
1235
1249
|
const sidecarItems = result.rows.map((row) => {
|
|
1236
|
-
const props =
|
|
1237
|
-
const validatedProps =
|
|
1250
|
+
const props = chunk5PRKMB24_cjs.rowPropsToObject(row.props);
|
|
1251
|
+
const validatedProps = chunkJFRT7S3B_cjs.validateNodeProps(schema, props, {
|
|
1238
1252
|
kind,
|
|
1239
1253
|
operation: "update",
|
|
1240
1254
|
id: row.id
|
|
@@ -1265,65 +1279,23 @@ async function executeNodeUpdateWhere(ctx, kind, inputPatch, candidateIds, candi
|
|
|
1265
1279
|
};
|
|
1266
1280
|
});
|
|
1267
1281
|
if (uniqueConstraints.length > 0) {
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1275
|
-
|
|
1276
|
-
|
|
1277
|
-
);
|
|
1278
|
-
const priorId = keyToId.get(key);
|
|
1279
|
-
if (priorId !== void 0 && priorId !== item.id) {
|
|
1280
|
-
throw new chunkMRDBBHIZ_cjs.UniquenessError({
|
|
1281
|
-
constraintName: constraint.name,
|
|
1282
|
-
kind,
|
|
1283
|
-
existingId: priorId,
|
|
1284
|
-
newId: item.id,
|
|
1285
|
-
fields: constraint.fields
|
|
1286
|
-
});
|
|
1287
|
-
}
|
|
1288
|
-
keyToId.set(key, item.id);
|
|
1289
|
-
}
|
|
1290
|
-
const keys = [...keyToId.keys()];
|
|
1291
|
-
if (keys.length === 0) continue;
|
|
1292
|
-
for (const kindToCheck of chunkFQPEMEWX_cjs.getKindsForUniquenessCheck(
|
|
1293
|
-
kind,
|
|
1294
|
-
constraint.scope,
|
|
1295
|
-
ctx.registry
|
|
1296
|
-
)) {
|
|
1297
|
-
const existingRows = await chunkN66HCGCY_cjs.requireDefined(
|
|
1298
|
-
target.checkUniqueBatch
|
|
1299
|
-
)({
|
|
1300
|
-
graphId: ctx.graphId,
|
|
1301
|
-
nodeKind: kindToCheck,
|
|
1302
|
-
constraintName: constraint.name,
|
|
1303
|
-
keys
|
|
1304
|
-
});
|
|
1305
|
-
for (const existing of existingRows) {
|
|
1306
|
-
if (existing.concrete_kind === kind && affectedIds.has(existing.node_id)) {
|
|
1307
|
-
continue;
|
|
1308
|
-
}
|
|
1309
|
-
throw new chunkMRDBBHIZ_cjs.UniquenessError({
|
|
1310
|
-
constraintName: constraint.name,
|
|
1311
|
-
kind: kindToCheck,
|
|
1312
|
-
existingId: existing.node_id,
|
|
1313
|
-
newId: chunkN66HCGCY_cjs.requireDefined(keyToId.get(existing.key)),
|
|
1314
|
-
fields: constraint.fields
|
|
1315
|
-
});
|
|
1316
|
-
}
|
|
1317
|
-
}
|
|
1318
|
-
}
|
|
1282
|
+
await chunk3KOY4FH3_cjs.validateResolvedNodeUniqueness(
|
|
1283
|
+
chunk3KOY4FH3_cjs.createUniquenessContext(ctx.graphId, ctx.registry, target),
|
|
1284
|
+
sidecarItems.map((item) => ({
|
|
1285
|
+
kind: item.kind,
|
|
1286
|
+
id: item.id,
|
|
1287
|
+
props: item.props,
|
|
1288
|
+
constraints: item.uniqueConstraints
|
|
1289
|
+
}))
|
|
1290
|
+
);
|
|
1319
1291
|
await chunkN66HCGCY_cjs.requireDefined(hardDeleteUniquesByNodeIds)({
|
|
1320
1292
|
graphId: ctx.graphId,
|
|
1321
1293
|
concreteKind: kind,
|
|
1322
1294
|
nodeIds: result.rows.map((row) => row.id)
|
|
1323
1295
|
});
|
|
1324
1296
|
}
|
|
1325
|
-
await
|
|
1326
|
-
|
|
1297
|
+
await chunk3KOY4FH3_cjs.applyNodeInsertSideEffectsBatch(
|
|
1298
|
+
chunk3KOY4FH3_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1327
1299
|
sidecarItems,
|
|
1328
1300
|
target
|
|
1329
1301
|
);
|
|
@@ -1343,11 +1315,11 @@ async function executeNodeUpsertUpdate(ctx, input, backend, options) {
|
|
|
1343
1315
|
if (input.clearValidTo === true) {
|
|
1344
1316
|
assertClearValidToSupported(backend, "node");
|
|
1345
1317
|
}
|
|
1346
|
-
return
|
|
1318
|
+
return chunkJFRT7S3B_cjs.runInWriteTransaction(
|
|
1347
1319
|
ctx,
|
|
1348
1320
|
backend,
|
|
1349
1321
|
async (target, lock) => {
|
|
1350
|
-
const validTo =
|
|
1322
|
+
const validTo = chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(
|
|
1351
1323
|
input.validTo,
|
|
1352
1324
|
"validTo"
|
|
1353
1325
|
);
|
|
@@ -1389,7 +1361,7 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1389
1361
|
const gate = await backend.getNode(ctx.graphId, kind, id);
|
|
1390
1362
|
if (!gate || gate.deleted_at) return;
|
|
1391
1363
|
const opContext = ctx.createOperationContext("delete", "node", kind, id);
|
|
1392
|
-
return
|
|
1364
|
+
return chunkJFRT7S3B_cjs.runHookedWriteOperation(
|
|
1393
1365
|
ctx,
|
|
1394
1366
|
opContext,
|
|
1395
1367
|
backend,
|
|
@@ -1398,9 +1370,9 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1398
1370
|
if (identity !== void 0) await identity.lock(target);
|
|
1399
1371
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1400
1372
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1401
|
-
if (!preflight || !
|
|
1402
|
-
await
|
|
1403
|
-
|
|
1373
|
+
if (!preflight || !chunk5PRKMB24_cjs.isLiveNodeRow(preflight)) return;
|
|
1374
|
+
await chunk3KOY4FH3_cjs.applyNodeSoftDelete(
|
|
1375
|
+
chunk3KOY4FH3_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1404
1376
|
{
|
|
1405
1377
|
existing: preflight,
|
|
1406
1378
|
schema: registration.type.schema,
|
|
@@ -1416,14 +1388,14 @@ async function executeNodeDelete(ctx, kind, id, backend) {
|
|
|
1416
1388
|
);
|
|
1417
1389
|
}
|
|
1418
1390
|
async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
1419
|
-
await
|
|
1391
|
+
await chunkJFRT7S3B_cjs.runInWriteTransaction(
|
|
1420
1392
|
ctx,
|
|
1421
1393
|
backend,
|
|
1422
1394
|
async (target, lock) => {
|
|
1423
1395
|
const identity = ctx.identity;
|
|
1424
1396
|
if (identity !== void 0) await identity.lock(target);
|
|
1425
1397
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1426
|
-
const writeContext =
|
|
1398
|
+
const writeContext = chunk3KOY4FH3_cjs.createNodeWriteContext(
|
|
1427
1399
|
ctx.graphId,
|
|
1428
1400
|
ctx.registry,
|
|
1429
1401
|
lock
|
|
@@ -1431,8 +1403,8 @@ async function executeNodeDeleteBatch(ctx, kind, ids, backend) {
|
|
|
1431
1403
|
let affectedCount = 0;
|
|
1432
1404
|
for (const id of ids) {
|
|
1433
1405
|
const preflight = await target.getNode(ctx.graphId, kind, id);
|
|
1434
|
-
if (!preflight || !
|
|
1435
|
-
await
|
|
1406
|
+
if (!preflight || !chunk5PRKMB24_cjs.isLiveNodeRow(preflight)) continue;
|
|
1407
|
+
await chunk3KOY4FH3_cjs.applyNodeSoftDelete(
|
|
1436
1408
|
writeContext,
|
|
1437
1409
|
{
|
|
1438
1410
|
existing: preflight,
|
|
@@ -1456,7 +1428,7 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
|
|
|
1456
1428
|
const gate = await backend.getNode(ctx.graphId, kind, id);
|
|
1457
1429
|
if (!gate) return;
|
|
1458
1430
|
const opContext = ctx.createOperationContext("delete", "node", kind, id);
|
|
1459
|
-
return
|
|
1431
|
+
return chunkJFRT7S3B_cjs.runHookedWriteOperation(
|
|
1460
1432
|
ctx,
|
|
1461
1433
|
opContext,
|
|
1462
1434
|
backend,
|
|
@@ -1464,8 +1436,8 @@ async function executeNodeHardDelete(ctx, kind, id, backend) {
|
|
|
1464
1436
|
const identity = ctx.identity;
|
|
1465
1437
|
if (identity !== void 0) await identity.lock(target);
|
|
1466
1438
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1467
|
-
await
|
|
1468
|
-
|
|
1439
|
+
await chunk3KOY4FH3_cjs.applyNodeHardDelete(
|
|
1440
|
+
chunk3KOY4FH3_cjs.createNodeWriteContext(ctx.graphId, ctx.registry, lock),
|
|
1469
1441
|
{
|
|
1470
1442
|
kind,
|
|
1471
1443
|
id,
|
|
@@ -1484,7 +1456,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1484
1456
|
const ifExists = options?.ifExists ?? "return";
|
|
1485
1457
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1486
1458
|
const nodeKind = registration.type;
|
|
1487
|
-
const validatedProps =
|
|
1459
|
+
const validatedProps = chunkJFRT7S3B_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1488
1460
|
kind,
|
|
1489
1461
|
operation: "create"
|
|
1490
1462
|
});
|
|
@@ -1567,7 +1539,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
1567
1539
|
async function executeNodeFindByConstraint(ctx, kind, constraintName, props, backend) {
|
|
1568
1540
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
1569
1541
|
const nodeKind = registration.type;
|
|
1570
|
-
const validatedProps =
|
|
1542
|
+
const validatedProps = chunkJFRT7S3B_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
1571
1543
|
kind,
|
|
1572
1544
|
operation: "create"
|
|
1573
1545
|
});
|
|
@@ -1604,7 +1576,7 @@ async function executeNodeFindByConstraint(ctx, kind, constraintName, props, bac
|
|
|
1604
1576
|
function validateAndComputeKeys(nodeKind, kind, constraint, items) {
|
|
1605
1577
|
const validated = [];
|
|
1606
1578
|
for (const item of items) {
|
|
1607
|
-
const validatedProps =
|
|
1579
|
+
const validatedProps = chunkJFRT7S3B_cjs.validateNodeProps(nodeKind.schema, item.props, {
|
|
1608
1580
|
kind,
|
|
1609
1581
|
operation: "create"
|
|
1610
1582
|
});
|
|
@@ -1891,7 +1863,7 @@ function capMatchesPerGroup(matches, limitPerInput) {
|
|
|
1891
1863
|
return capped;
|
|
1892
1864
|
}
|
|
1893
1865
|
async function hydrateNodesById(backend, graphId, kind, ids) {
|
|
1894
|
-
const rowsById = await
|
|
1866
|
+
const rowsById = await chunkEZEEWCFJ_cjs.getNodeRowsByIds(backend, graphId, kind, ids);
|
|
1895
1867
|
const nodesById = /* @__PURE__ */ new Map();
|
|
1896
1868
|
for (const [id, row] of rowsById) {
|
|
1897
1869
|
if (row.deleted_at !== void 0) continue;
|
|
@@ -2042,5 +2014,5 @@ exports.rowToNode = rowToNode;
|
|
|
2042
2014
|
exports.rowToNodeMeta = rowToNodeMeta;
|
|
2043
2015
|
exports.validityEndAfterMutation = validityEndAfterMutation;
|
|
2044
2016
|
exports.withAlreadyExistsTranslation = withAlreadyExistsTranslation;
|
|
2045
|
-
//# sourceMappingURL=chunk-
|
|
2046
|
-
//# sourceMappingURL=chunk-
|
|
2017
|
+
//# sourceMappingURL=chunk-JB6T4GLL.cjs.map
|
|
2018
|
+
//# sourceMappingURL=chunk-JB6T4GLL.cjs.map
|