@nicia-ai/typegraph 0.67.1 → 0.68.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/CHANGELOG.md +26 -0
- package/dist/backend/postgres/pglite-store.cjs +1 -1
- package/dist/backend/postgres/pglite-store.js +1 -1
- package/dist/backend/sqlite/local-store.cjs +1 -1
- package/dist/backend/sqlite/local-store.js +1 -1
- package/dist/{chunk-T3VU3YRQ.cjs → chunk-6GUBF5TF.cjs} +24 -18
- package/dist/chunk-6GUBF5TF.cjs.map +1 -0
- package/dist/{chunk-55DGFZYC.js → chunk-EJYBHBIB.js} +3 -3
- package/dist/{chunk-55DGFZYC.js.map → chunk-EJYBHBIB.js.map} +1 -1
- package/dist/{chunk-WY3IFEKV.cjs → chunk-IFTYHOEE.cjs} +13 -5
- package/dist/chunk-IFTYHOEE.cjs.map +1 -0
- package/dist/{chunk-RTPMG6LQ.js → chunk-JVKHJQ6Q.js} +13 -5
- package/dist/chunk-JVKHJQ6Q.js.map +1 -0
- package/dist/{chunk-FS2GVO2T.cjs → chunk-OBEYH22Q.cjs} +159 -159
- package/dist/{chunk-FS2GVO2T.cjs.map → chunk-OBEYH22Q.cjs.map} +1 -1
- package/dist/{chunk-7YJHUY4T.js → chunk-VUYODTHL.js} +10 -5
- package/dist/chunk-VUYODTHL.js.map +1 -0
- package/dist/graph-merge/index.cjs +540 -22
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +317 -9
- package/dist/graph-merge/index.d.ts +317 -9
- package/dist/graph-merge/index.js +512 -8
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/index.cjs +43 -43
- package/dist/index.js +2 -2
- package/dist/interchange/index.cjs +25 -25
- package/dist/interchange/index.js +2 -2
- package/dist/{local-store-impl-GI6S4J6B.cjs → local-store-impl-INNRHDK3.cjs} +5 -5
- package/dist/{local-store-impl-GI6S4J6B.cjs.map → local-store-impl-INNRHDK3.cjs.map} +1 -1
- package/dist/{local-store-impl-CCMWTLGY.js → local-store-impl-VGC3OKCA.js} +4 -4
- package/dist/{local-store-impl-CCMWTLGY.js.map → local-store-impl-VGC3OKCA.js.map} +1 -1
- package/dist/{pglite-store-impl-HAPAJUIO.cjs → pglite-store-impl-KDS4NRMC.cjs} +5 -5
- package/dist/{pglite-store-impl-HAPAJUIO.cjs.map → pglite-store-impl-KDS4NRMC.cjs.map} +1 -1
- package/dist/{pglite-store-impl-HDLFOZWS.js → pglite-store-impl-LJDF2EUF.js} +4 -4
- package/dist/{pglite-store-impl-HDLFOZWS.js.map → pglite-store-impl-LJDF2EUF.js.map} +1 -1
- package/package.json +1 -1
- package/dist/chunk-7YJHUY4T.js.map +0 -1
- package/dist/chunk-RTPMG6LQ.js.map +0 -1
- package/dist/chunk-T3VU3YRQ.cjs.map +0 -1
- package/dist/chunk-WY3IFEKV.cjs.map +0 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
var chunk76OB5RSH_cjs = require('./chunk-76OB5RSH.cjs');
|
|
4
4
|
var chunk2XQYRCPM_cjs = require('./chunk-2XQYRCPM.cjs');
|
|
5
|
-
var
|
|
5
|
+
var chunkIFTYHOEE_cjs = require('./chunk-IFTYHOEE.cjs');
|
|
6
6
|
var chunkVNJMM2QQ_cjs = require('./chunk-VNJMM2QQ.cjs');
|
|
7
7
|
var chunkI7SBZJI2_cjs = require('./chunk-I7SBZJI2.cjs');
|
|
8
8
|
var chunkG7OKJDMG_cjs = require('./chunk-G7OKJDMG.cjs');
|
|
@@ -4531,7 +4531,7 @@ function neighborOutputNames() {
|
|
|
4531
4531
|
];
|
|
4532
4532
|
}
|
|
4533
4533
|
function mapEdge(row) {
|
|
4534
|
-
return
|
|
4534
|
+
return chunkIFTYHOEE_cjs.rowToEdge({
|
|
4535
4535
|
id: String(row["edge_id"]),
|
|
4536
4536
|
kind: String(row["edge_kind"]),
|
|
4537
4537
|
from_kind: String(row["edge_from_kind"]),
|
|
@@ -4559,7 +4559,7 @@ function mapEdge(row) {
|
|
|
4559
4559
|
});
|
|
4560
4560
|
}
|
|
4561
4561
|
function mapNode(row) {
|
|
4562
|
-
return
|
|
4562
|
+
return chunkIFTYHOEE_cjs.rowToNode({
|
|
4563
4563
|
id: String(row["node_id"]),
|
|
4564
4564
|
kind: String(row["node_kind"]),
|
|
4565
4565
|
props: row["node_props"],
|
|
@@ -5561,7 +5561,7 @@ function mapSubgraphNodeRow(row, projectionPlan) {
|
|
|
5561
5561
|
const kindPlan = projectionPlan.projectedKinds.get(row.kind);
|
|
5562
5562
|
if (kindPlan === void 0) {
|
|
5563
5563
|
const normalizedRow = normalizeSubgraphRowTimestamps(row);
|
|
5564
|
-
return
|
|
5564
|
+
return chunkIFTYHOEE_cjs.rowToNode({
|
|
5565
5565
|
...normalizedRow,
|
|
5566
5566
|
props: normalizeProps(normalizedRow.props)
|
|
5567
5567
|
});
|
|
@@ -5571,7 +5571,7 @@ function mapSubgraphNodeRow(row, projectionPlan) {
|
|
|
5571
5571
|
id: row.id
|
|
5572
5572
|
};
|
|
5573
5573
|
if (kindPlan.includeMeta) {
|
|
5574
|
-
projectedNode["meta"] =
|
|
5574
|
+
projectedNode["meta"] = chunkIFTYHOEE_cjs.rowToNodeMeta(normalizeSubgraphRowTimestamps(row));
|
|
5575
5575
|
}
|
|
5576
5576
|
applyProjectedFields(projectedNode, row, kindPlan);
|
|
5577
5577
|
return projectedNode;
|
|
@@ -5580,7 +5580,7 @@ function mapSubgraphEdgeRow(row, projectionPlan) {
|
|
|
5580
5580
|
const kindPlan = projectionPlan.projectedKinds.get(row.kind);
|
|
5581
5581
|
if (kindPlan === void 0) {
|
|
5582
5582
|
const normalizedRow = normalizeSubgraphRowTimestamps(row);
|
|
5583
|
-
return
|
|
5583
|
+
return chunkIFTYHOEE_cjs.rowToEdge({
|
|
5584
5584
|
...normalizedRow,
|
|
5585
5585
|
props: normalizeProps(normalizedRow.props)
|
|
5586
5586
|
});
|
|
@@ -5594,7 +5594,7 @@ function mapSubgraphEdgeRow(row, projectionPlan) {
|
|
|
5594
5594
|
toId: row.to_id
|
|
5595
5595
|
};
|
|
5596
5596
|
if (kindPlan.includeMeta) {
|
|
5597
|
-
projectedEdge["meta"] =
|
|
5597
|
+
projectedEdge["meta"] = chunkIFTYHOEE_cjs.rowToEdgeMeta(normalizeSubgraphRowTimestamps(row));
|
|
5598
5598
|
}
|
|
5599
5599
|
applyProjectedFields(projectedEdge, row, kindPlan);
|
|
5600
5600
|
return projectedEdge;
|
|
@@ -16151,7 +16151,7 @@ async function executeHybridSearch(ctx, nodeKind, options) {
|
|
|
16151
16151
|
...candidates === void 0 ? {} : { candidates }
|
|
16152
16152
|
});
|
|
16153
16153
|
return rows.map((row, index) => {
|
|
16154
|
-
const typedNode =
|
|
16154
|
+
const typedNode = chunkIFTYHOEE_cjs.rowToNode(row.node);
|
|
16155
16155
|
return {
|
|
16156
16156
|
node: typedNode,
|
|
16157
16157
|
score: row.fusedScore,
|
|
@@ -16430,13 +16430,13 @@ async function fetchNodesByIds(backend, batchPointRead, graphId, nodeKind, ids)
|
|
|
16430
16430
|
const rows = await bound.getNodes(graphId, nodeKind, ids);
|
|
16431
16431
|
for (const row of rows) {
|
|
16432
16432
|
if (row.deleted_at !== void 0) continue;
|
|
16433
|
-
map.set(row.id,
|
|
16433
|
+
map.set(row.id, chunkIFTYHOEE_cjs.rowToNode(row));
|
|
16434
16434
|
}
|
|
16435
16435
|
return map;
|
|
16436
16436
|
}
|
|
16437
16437
|
for (const id of ids) {
|
|
16438
16438
|
const row = await backend.getNode(graphId, nodeKind, id);
|
|
16439
|
-
if (row && row.deleted_at === void 0) map.set(row.id,
|
|
16439
|
+
if (row && row.deleted_at === void 0) map.set(row.id, chunkIFTYHOEE_cjs.rowToNode(row));
|
|
16440
16440
|
}
|
|
16441
16441
|
return map;
|
|
16442
16442
|
}
|
|
@@ -20440,18 +20440,18 @@ function lowerBoundRequiresWrite(requested, stored) {
|
|
|
20440
20440
|
return requestedValidFrom !== void 0 && requestedValidFrom !== null && !chunkL4L4AV6F_cjs.isCanonicalIsoDate(requestedValidFrom);
|
|
20441
20441
|
}
|
|
20442
20442
|
function upsertWindowChanges(requested, current) {
|
|
20443
|
-
return lowerBoundRequiresWrite(requested, current.valid_from) || requested?.clearValidTo === true &&
|
|
20443
|
+
return lowerBoundRequiresWrite(requested, current.valid_from) || requested?.clearValidTo === true && chunkIFTYHOEE_cjs.validityEndAfterMutation(requested, current.valid_to) !== current.valid_to || requested?.clearValidTo === true && requested.validTo !== void 0 || windowFieldChanges("validTo", requested?.validTo, current.valid_to);
|
|
20444
20444
|
}
|
|
20445
20445
|
function windowAfterUpsertCreate(requested) {
|
|
20446
20446
|
return {
|
|
20447
20447
|
valid_from: requested.validFrom === null ? void 0 : requested.validFrom ?? UNKNOWN_VALIDITY_LOWER_BOUND,
|
|
20448
|
-
valid_to:
|
|
20448
|
+
valid_to: chunkIFTYHOEE_cjs.validityEndAfterMutation(requested, void 0)
|
|
20449
20449
|
};
|
|
20450
20450
|
}
|
|
20451
20451
|
function windowAfterUpsertUpdate(current, requested) {
|
|
20452
20452
|
return {
|
|
20453
20453
|
valid_from: current.valid_from,
|
|
20454
|
-
valid_to:
|
|
20454
|
+
valid_to: chunkIFTYHOEE_cjs.validityEndAfterMutation(requested, current.valid_to)
|
|
20455
20455
|
};
|
|
20456
20456
|
}
|
|
20457
20457
|
function shouldCoalesceUpsert(existing, options, runDirtyCheck) {
|
|
@@ -20767,13 +20767,13 @@ function createEdgeCollection(config) {
|
|
|
20767
20767
|
async bulkUpsertById(items) {
|
|
20768
20768
|
if (items.length === 0) return [];
|
|
20769
20769
|
for (const item of items) {
|
|
20770
|
-
|
|
20770
|
+
chunkIFTYHOEE_cjs.assertValidityEndMutation(item, {
|
|
20771
20771
|
entityType: "edge",
|
|
20772
20772
|
kind,
|
|
20773
20773
|
id: item.id
|
|
20774
20774
|
});
|
|
20775
20775
|
if (item.clearValidTo === true) {
|
|
20776
|
-
|
|
20776
|
+
chunkIFTYHOEE_cjs.assertClearValidToSupported(backend, "edge");
|
|
20777
20777
|
}
|
|
20778
20778
|
}
|
|
20779
20779
|
const upsertAll = async (target) => {
|
|
@@ -20946,7 +20946,7 @@ function createEdgeCollection(config) {
|
|
|
20946
20946
|
}
|
|
20947
20947
|
return { results: results2, mutations: toCreate.length + toUpdate.length };
|
|
20948
20948
|
};
|
|
20949
|
-
const { results, mutations } = await
|
|
20949
|
+
const { results, mutations } = await chunkIFTYHOEE_cjs.runResolvedMutationSetConverging(
|
|
20950
20950
|
"edge",
|
|
20951
20951
|
backend,
|
|
20952
20952
|
() => chunk6JRVV2SS_cjs.runOptionallyInTransaction(backend, (target) => upsertAll(target))
|
|
@@ -20976,7 +20976,7 @@ function createEdgeCollection(config) {
|
|
|
20976
20976
|
return result === void 0 ? void 0 : narrowEdge(result);
|
|
20977
20977
|
},
|
|
20978
20978
|
async getOrCreateByEndpoints(from, to, props, options) {
|
|
20979
|
-
|
|
20979
|
+
chunkIFTYHOEE_cjs.assertValidityEndMutation(options ?? {}, {
|
|
20980
20980
|
entityType: "edge",
|
|
20981
20981
|
kind
|
|
20982
20982
|
});
|
|
@@ -21011,7 +21011,7 @@ function createEdgeCollection(config) {
|
|
|
21011
21011
|
async bulkGetOrCreateByEndpoints(items, options) {
|
|
21012
21012
|
if (items.length === 0) return [];
|
|
21013
21013
|
for (const item of items) {
|
|
21014
|
-
|
|
21014
|
+
chunkIFTYHOEE_cjs.assertValidityEndMutation(item, {
|
|
21015
21015
|
entityType: "edge",
|
|
21016
21016
|
kind
|
|
21017
21017
|
});
|
|
@@ -21383,13 +21383,13 @@ function createNodeCollection(config) {
|
|
|
21383
21383
|
return this.upsertByIdFromRecord(id, props, options);
|
|
21384
21384
|
},
|
|
21385
21385
|
async upsertByIdFromRecord(id, data, options) {
|
|
21386
|
-
|
|
21386
|
+
chunkIFTYHOEE_cjs.assertValidityEndMutation(options ?? {}, {
|
|
21387
21387
|
entityType: "node",
|
|
21388
21388
|
kind,
|
|
21389
21389
|
id
|
|
21390
21390
|
});
|
|
21391
21391
|
if (options?.clearValidTo === true) {
|
|
21392
|
-
|
|
21392
|
+
chunkIFTYHOEE_cjs.assertClearValidToSupported(backend, "node");
|
|
21393
21393
|
}
|
|
21394
21394
|
const existing = await backend.getNode(graphId, kind, id);
|
|
21395
21395
|
const coalesces = (row) => {
|
|
@@ -21462,7 +21462,7 @@ function createNodeCollection(config) {
|
|
|
21462
21462
|
await config.maybeRefreshStatisticsAfterBulk?.(attempt.value.length);
|
|
21463
21463
|
return narrowNodes(attempt.value);
|
|
21464
21464
|
}
|
|
21465
|
-
const results = await
|
|
21465
|
+
const results = await chunkIFTYHOEE_cjs.runResolvedMutationSetConverging(
|
|
21466
21466
|
"node",
|
|
21467
21467
|
backend,
|
|
21468
21468
|
() => chunk6JRVV2SS_cjs.runOptionallyInTransaction(backend, async (target) => {
|
|
@@ -21513,13 +21513,13 @@ function createNodeCollection(config) {
|
|
|
21513
21513
|
async bulkUpsertById(items) {
|
|
21514
21514
|
if (items.length === 0) return [];
|
|
21515
21515
|
for (const item of items) {
|
|
21516
|
-
|
|
21516
|
+
chunkIFTYHOEE_cjs.assertValidityEndMutation(item, {
|
|
21517
21517
|
entityType: "node",
|
|
21518
21518
|
kind,
|
|
21519
21519
|
id: item.id
|
|
21520
21520
|
});
|
|
21521
21521
|
if (item.clearValidTo === true) {
|
|
21522
|
-
|
|
21522
|
+
chunkIFTYHOEE_cjs.assertClearValidToSupported(backend, "node");
|
|
21523
21523
|
}
|
|
21524
21524
|
}
|
|
21525
21525
|
const upsertAll = async (target) => {
|
|
@@ -21659,7 +21659,7 @@ function createNodeCollection(config) {
|
|
|
21659
21659
|
}
|
|
21660
21660
|
return { results: results2, mutations: toCreate.length + toUpdate.length };
|
|
21661
21661
|
};
|
|
21662
|
-
const { results, mutations } = await
|
|
21662
|
+
const { results, mutations } = await chunkIFTYHOEE_cjs.runResolvedMutationSetConverging(
|
|
21663
21663
|
"node",
|
|
21664
21664
|
backend,
|
|
21665
21665
|
() => chunk6JRVV2SS_cjs.runOptionallyInTransaction(backend, (target) => upsertAll(target))
|
|
@@ -23368,7 +23368,7 @@ async function validateAndPrepareEdgeCreate(ctx, input, id, backend, options) {
|
|
|
23368
23368
|
kind,
|
|
23369
23369
|
operation: "create"
|
|
23370
23370
|
});
|
|
23371
|
-
const matchIdentity =
|
|
23371
|
+
const matchIdentity = chunkIFTYHOEE_cjs.resolveEdgeMatchIdentityStorage(
|
|
23372
23372
|
registration.matchIdentity,
|
|
23373
23373
|
{
|
|
23374
23374
|
fromKind,
|
|
@@ -23392,7 +23392,7 @@ async function validateAndPrepareEdgeCreate(ctx, input, id, backend, options) {
|
|
|
23392
23392
|
backend
|
|
23393
23393
|
};
|
|
23394
23394
|
if (options?.validateCardinality ?? true) {
|
|
23395
|
-
await
|
|
23395
|
+
await chunkIFTYHOEE_cjs.checkCardinalityConstraint(
|
|
23396
23396
|
constraintContext,
|
|
23397
23397
|
kind,
|
|
23398
23398
|
cardinality,
|
|
@@ -23444,7 +23444,7 @@ function createdEdgeResult(edge) {
|
|
|
23444
23444
|
return { outcome: "created", edge };
|
|
23445
23445
|
}
|
|
23446
23446
|
function foundEdgeResult(row) {
|
|
23447
|
-
return { outcome: "found", edge:
|
|
23447
|
+
return { outcome: "found", edge: chunkIFTYHOEE_cjs.rowToEdge(row), row };
|
|
23448
23448
|
}
|
|
23449
23449
|
function edgeCreateDidWrite(result) {
|
|
23450
23450
|
return result.outcome === "created";
|
|
@@ -23508,13 +23508,13 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
|
23508
23508
|
convergesDynamically: convergeOn !== void 0 && !durableConvergence,
|
|
23509
23509
|
cardinality: edgeCardinality(ctx, kind)
|
|
23510
23510
|
} : void 0;
|
|
23511
|
-
const schemaFenceInFirstWrite = candidate !== void 0 &&
|
|
23512
|
-
const autocommitSingleStatement = autocommitBackend !== void 0 && candidate !== void 0 &&
|
|
23513
|
-
const plan =
|
|
23514
|
-
convergeOn === void 0 || durableConvergence ?
|
|
23511
|
+
const schemaFenceInFirstWrite = candidate !== void 0 && chunkIFTYHOEE_cjs.canFuseSchemaFenceInFirstWrite({ kind: "edge", candidate });
|
|
23512
|
+
const autocommitSingleStatement = autocommitBackend !== void 0 && candidate !== void 0 && chunkIFTYHOEE_cjs.isAutocommitSingleStatementWrite({ kind: "edge", candidate });
|
|
23513
|
+
const plan = chunkIFTYHOEE_cjs.edgeWritePlan(
|
|
23514
|
+
convergeOn === void 0 || durableConvergence ? chunkIFTYHOEE_cjs.edgeWriteNeedsConstraintFence(edgeCardinality(ctx, kind)) : "edgeMatchKeyConvergence"
|
|
23515
23515
|
);
|
|
23516
23516
|
const rowWork = async (session, target, _overlaidSession, lock, transactionMode) => {
|
|
23517
|
-
const targetBackend =
|
|
23517
|
+
const targetBackend = chunkIFTYHOEE_cjs.unfencedTarget(target);
|
|
23518
23518
|
const fuseSchemaFenceInFirstWrite = schemaFenceInFirstWrite && chunk6JRVV2SS_cjs.isSchemaFencedInsertEligible(targetBackend) && !chunk6B3LQUYG_cjs.hasLeasedSchemaFence(ctx, targetBackend);
|
|
23519
23519
|
if (schemaFenceInFirstWrite && !fuseSchemaFenceInFirstWrite) {
|
|
23520
23520
|
await chunk6B3LQUYG_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
@@ -23524,7 +23524,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
|
23524
23524
|
await chunk6B3LQUYG_cjs.diagnoseFusedSchemaFenceNoRow(ctx, targetBackend);
|
|
23525
23525
|
const directInteractiveAutocommit = autocommitSingleStatement && transactionMode === "none" && targetBackend.capabilities.execution.interactiveTransactions;
|
|
23526
23526
|
if (directInteractiveAutocommit) {
|
|
23527
|
-
throw new
|
|
23527
|
+
throw new chunkIFTYHOEE_cjs.AutocommitWriteRequiresTransaction();
|
|
23528
23528
|
}
|
|
23529
23529
|
if (transactionMode !== "none") {
|
|
23530
23530
|
await chunk6B3LQUYG_cjs.lockSchemaVersionForStoreWrite(ctx, targetBackend);
|
|
@@ -23591,7 +23591,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
|
23591
23591
|
match: durableMatchIdentity === void 0 ? { kind: "dynamic", ...chunkBXHAPCQG_cjs.requireDefined(convergeOn) } : { kind: "durable", identity: durableMatchIdentity }
|
|
23592
23592
|
};
|
|
23593
23593
|
const result = lock.coordination === void 0 && command.match.kind === "dynamic" ? {
|
|
23594
|
-
outcome: "unsupported"} : await
|
|
23594
|
+
outcome: "unsupported"} : await chunkIFTYHOEE_cjs.withAlreadyExistsTranslation(
|
|
23595
23595
|
"edge",
|
|
23596
23596
|
() => chunk6JRVV2SS_cjs.executeAuthoritativeGraphCommand(
|
|
23597
23597
|
target.commands,
|
|
@@ -23603,7 +23603,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
|
23603
23603
|
if (durableMatchIdentity !== void 0 && work2.claim !== void 0) {
|
|
23604
23604
|
await chunkG7OKJDMG_cjs.claimEdgeCardinality(target, ctx.claimsVerdict(), work2.claim);
|
|
23605
23605
|
}
|
|
23606
|
-
return createdEdgeResult(
|
|
23606
|
+
return createdEdgeResult(chunkIFTYHOEE_cjs.rowToEdge(result.row));
|
|
23607
23607
|
}
|
|
23608
23608
|
if (result.outcome === "found") {
|
|
23609
23609
|
if (command.match.kind === "dynamic") {
|
|
@@ -23710,7 +23710,7 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
|
23710
23710
|
...usesFusedCardinalityInsert && fusedWork.claim !== void 0 ? { cardinalityClaim: fusedWork.claim } : {}
|
|
23711
23711
|
}
|
|
23712
23712
|
};
|
|
23713
|
-
const fusedResult = await
|
|
23713
|
+
const fusedResult = await chunkIFTYHOEE_cjs.withAlreadyExistsTranslation(
|
|
23714
23714
|
"edge",
|
|
23715
23715
|
() => session.createEdgeWithPlan(fusedCommand)
|
|
23716
23716
|
);
|
|
@@ -23718,20 +23718,20 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
|
23718
23718
|
if (fuseSchemaFenceInFirstWrite) {
|
|
23719
23719
|
chunk6B3LQUYG_cjs.memoizeLeasedSchemaFence(ctx, targetBackend);
|
|
23720
23720
|
}
|
|
23721
|
-
return createdEdgeResult(
|
|
23721
|
+
return createdEdgeResult(chunkIFTYHOEE_cjs.rowToEdge(fusedResult.row));
|
|
23722
23722
|
}
|
|
23723
23723
|
prepared = await diagnoseFusedCreateNoRow(true);
|
|
23724
23724
|
}
|
|
23725
23725
|
const work = edgeInsertWork(prepared);
|
|
23726
|
-
const row = await
|
|
23726
|
+
const row = await chunkIFTYHOEE_cjs.withAlreadyExistsTranslation("edge", async () => {
|
|
23727
23727
|
if (shouldReturnRow) return session.createEdge(work);
|
|
23728
23728
|
await session.createEdgeNoReturn(work);
|
|
23729
23729
|
return;
|
|
23730
23730
|
});
|
|
23731
|
-
return createdEdgeResult(row === void 0 ? void 0 :
|
|
23731
|
+
return createdEdgeResult(row === void 0 ? void 0 : chunkIFTYHOEE_cjs.rowToEdge(row));
|
|
23732
23732
|
};
|
|
23733
23733
|
if (autocommitSingleStatement) {
|
|
23734
|
-
return
|
|
23734
|
+
return chunkIFTYHOEE_cjs.runAutocommitSingleStatementWritePlan(
|
|
23735
23735
|
ctx,
|
|
23736
23736
|
opContext,
|
|
23737
23737
|
plan,
|
|
@@ -23744,12 +23744,12 @@ async function executeEdgeCreateInternal(ctx, input, backend, options) {
|
|
|
23744
23744
|
);
|
|
23745
23745
|
}
|
|
23746
23746
|
if (options?.skipHooks === true) {
|
|
23747
|
-
return
|
|
23747
|
+
return chunkIFTYHOEE_cjs.runWritePlan(ctx, plan, backend, rowWork, {
|
|
23748
23748
|
schemaFenceInFirstWrite,
|
|
23749
23749
|
didWrite: edgeCreateDidWrite
|
|
23750
23750
|
});
|
|
23751
23751
|
}
|
|
23752
|
-
return
|
|
23752
|
+
return chunkIFTYHOEE_cjs.runHookedWritePlan(ctx, opContext, plan, backend, rowWork, {
|
|
23753
23753
|
schemaFenceInFirstWrite,
|
|
23754
23754
|
didWrite: edgeCreateDidWrite
|
|
23755
23755
|
});
|
|
@@ -23799,7 +23799,7 @@ async function prepareEdgeBatchCreates(ctx, inputs, backend) {
|
|
|
23799
23799
|
backend: validationBackend,
|
|
23800
23800
|
registerPendingEdgeForCardinality,
|
|
23801
23801
|
seedEndpointRow
|
|
23802
|
-
} =
|
|
23802
|
+
} = chunkIFTYHOEE_cjs.createEdgeBatchValidationBackend(backend);
|
|
23803
23803
|
await primeEdgeBatchValidationCache(ctx, inputs, backend, seedEndpointRow);
|
|
23804
23804
|
const preparedCreates = [];
|
|
23805
23805
|
for (const input of inputs) {
|
|
@@ -23948,7 +23948,7 @@ async function assertAtomicEdgeBatchCardinality(ctx, inputs, backend) {
|
|
|
23948
23948
|
const errors = await Promise.all(
|
|
23949
23949
|
window.map(async (input) => {
|
|
23950
23950
|
try {
|
|
23951
|
-
await
|
|
23951
|
+
await chunkIFTYHOEE_cjs.checkCardinalityConstraint(
|
|
23952
23952
|
constraintContext,
|
|
23953
23953
|
input.kind,
|
|
23954
23954
|
edgeCardinality(ctx, input.kind),
|
|
@@ -23977,7 +23977,7 @@ async function runAtomicEdgeBatchProgram(ctx, inputs, preparation, backend, atom
|
|
|
23977
23977
|
graphId: ctx.graphId,
|
|
23978
23978
|
expectedVersion: chunkBXHAPCQG_cjs.requireDefined(ctx.schemaVersion)
|
|
23979
23979
|
};
|
|
23980
|
-
const result = await
|
|
23980
|
+
const result = await chunkIFTYHOEE_cjs.withAlreadyExistsTranslation("edge", async () => {
|
|
23981
23981
|
try {
|
|
23982
23982
|
if (resultMode === "count") {
|
|
23983
23983
|
return await atomicExecutor({
|
|
@@ -24035,7 +24035,7 @@ async function runAtomicEdgeBatchProgram(ctx, inputs, preparation, backend, atom
|
|
|
24035
24035
|
return result;
|
|
24036
24036
|
}
|
|
24037
24037
|
function assertDurableBatchRows(work, rows) {
|
|
24038
|
-
const outcomes =
|
|
24038
|
+
const outcomes = chunkIFTYHOEE_cjs.classifyDurableEdgeBatchOutcomes(
|
|
24039
24039
|
work.map((item) => item.params),
|
|
24040
24040
|
rows
|
|
24041
24041
|
);
|
|
@@ -24059,7 +24059,7 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
24059
24059
|
if (inputs.length === 0) {
|
|
24060
24060
|
return;
|
|
24061
24061
|
}
|
|
24062
|
-
const atomicExecutor =
|
|
24062
|
+
const atomicExecutor = chunkIFTYHOEE_cjs.resolveAtomicEdgeBatchExecutor({
|
|
24063
24063
|
backend,
|
|
24064
24064
|
graph: ctx.graph,
|
|
24065
24065
|
inputs,
|
|
@@ -24083,9 +24083,9 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
24083
24083
|
);
|
|
24084
24084
|
return;
|
|
24085
24085
|
}
|
|
24086
|
-
await
|
|
24086
|
+
await chunkIFTYHOEE_cjs.runWritePlan(
|
|
24087
24087
|
ctx,
|
|
24088
|
-
|
|
24088
|
+
chunkIFTYHOEE_cjs.edgeWritePlan(batchFencesConstraintProbe(ctx, inputs)),
|
|
24089
24089
|
backend,
|
|
24090
24090
|
async (session, target) => {
|
|
24091
24091
|
const { batchInsertWork } = await prepareEdgeBatchCreates(
|
|
@@ -24102,7 +24102,7 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
24102
24102
|
await executeEdgeCreateInternal(
|
|
24103
24103
|
ctx,
|
|
24104
24104
|
input,
|
|
24105
|
-
|
|
24105
|
+
chunkIFTYHOEE_cjs.nestedManagedWriteTarget(target),
|
|
24106
24106
|
{
|
|
24107
24107
|
returnRow: false,
|
|
24108
24108
|
skipHooks: true
|
|
@@ -24111,14 +24111,14 @@ async function executeEdgeCreateNoReturnBatch(ctx, inputs, backend) {
|
|
|
24111
24111
|
}
|
|
24112
24112
|
return;
|
|
24113
24113
|
}
|
|
24114
|
-
const rows = await
|
|
24114
|
+
const rows = await chunkIFTYHOEE_cjs.withAlreadyExistsTranslation(
|
|
24115
24115
|
"edge",
|
|
24116
24116
|
() => chunkBXHAPCQG_cjs.requireDefined(session.createEdgesDurable)(batchInsertWork)
|
|
24117
24117
|
);
|
|
24118
24118
|
assertDurableBatchRows(batchInsertWork, rows);
|
|
24119
24119
|
return;
|
|
24120
24120
|
}
|
|
24121
|
-
await
|
|
24121
|
+
await chunkIFTYHOEE_cjs.withAlreadyExistsTranslation(
|
|
24122
24122
|
"edge",
|
|
24123
24123
|
() => session.createEdgesNoReturn(batchInsertWork)
|
|
24124
24124
|
);
|
|
@@ -24129,7 +24129,7 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
|
|
|
24129
24129
|
if (inputs.length === 0) {
|
|
24130
24130
|
return [];
|
|
24131
24131
|
}
|
|
24132
|
-
const atomicExecutor =
|
|
24132
|
+
const atomicExecutor = chunkIFTYHOEE_cjs.resolveAtomicEdgeBatchExecutor({
|
|
24133
24133
|
backend,
|
|
24134
24134
|
graph: ctx.graph,
|
|
24135
24135
|
inputs,
|
|
@@ -24151,11 +24151,11 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
|
|
|
24151
24151
|
atomicExecutor,
|
|
24152
24152
|
"rows"
|
|
24153
24153
|
);
|
|
24154
|
-
return rows.map((row) =>
|
|
24154
|
+
return rows.map((row) => chunkIFTYHOEE_cjs.rowToEdge(row));
|
|
24155
24155
|
}
|
|
24156
|
-
return
|
|
24156
|
+
return chunkIFTYHOEE_cjs.runWritePlan(
|
|
24157
24157
|
ctx,
|
|
24158
|
-
|
|
24158
|
+
chunkIFTYHOEE_cjs.edgeWritePlan(batchFencesConstraintProbe(ctx, inputs)),
|
|
24159
24159
|
backend,
|
|
24160
24160
|
async (session, target) => {
|
|
24161
24161
|
const { batchInsertWork } = await prepareEdgeBatchCreates(
|
|
@@ -24173,7 +24173,7 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
|
|
|
24173
24173
|
const result = await executeEdgeCreateInternal(
|
|
24174
24174
|
ctx,
|
|
24175
24175
|
input,
|
|
24176
|
-
|
|
24176
|
+
chunkIFTYHOEE_cjs.nestedManagedWriteTarget(target),
|
|
24177
24177
|
{ returnRow: true, skipHooks: true }
|
|
24178
24178
|
);
|
|
24179
24179
|
if (result.outcome !== "created") {
|
|
@@ -24192,24 +24192,24 @@ async function executeEdgeCreateBatch(ctx, inputs, backend) {
|
|
|
24192
24192
|
}
|
|
24193
24193
|
return fallbackRows;
|
|
24194
24194
|
}
|
|
24195
|
-
const rows2 = await
|
|
24195
|
+
const rows2 = await chunkIFTYHOEE_cjs.withAlreadyExistsTranslation(
|
|
24196
24196
|
"edge",
|
|
24197
24197
|
() => chunkBXHAPCQG_cjs.requireDefined(session.createEdgesDurable)(batchInsertWork)
|
|
24198
24198
|
);
|
|
24199
24199
|
assertDurableBatchRows(batchInsertWork, rows2);
|
|
24200
|
-
return rows2.map((row) =>
|
|
24200
|
+
return rows2.map((row) => chunkIFTYHOEE_cjs.rowToEdge(row));
|
|
24201
24201
|
}
|
|
24202
|
-
const rows = await
|
|
24202
|
+
const rows = await chunkIFTYHOEE_cjs.withAlreadyExistsTranslation(
|
|
24203
24203
|
"edge",
|
|
24204
24204
|
() => session.createEdges(batchInsertWork)
|
|
24205
24205
|
);
|
|
24206
|
-
return rows.map((row) =>
|
|
24206
|
+
return rows.map((row) => chunkIFTYHOEE_cjs.rowToEdge(row));
|
|
24207
24207
|
}
|
|
24208
24208
|
);
|
|
24209
24209
|
}
|
|
24210
24210
|
function batchFencesConstraintProbe(ctx, inputs) {
|
|
24211
24211
|
for (const input of inputs) {
|
|
24212
|
-
const reason =
|
|
24212
|
+
const reason = chunkIFTYHOEE_cjs.edgeWriteNeedsConstraintFence(
|
|
24213
24213
|
edgeCardinality(ctx, input.kind)
|
|
24214
24214
|
);
|
|
24215
24215
|
if (reason !== void 0) return reason;
|
|
@@ -24223,7 +24223,7 @@ function computeEdgeUpdate(ctx, kind, id, existingProps, inputProps) {
|
|
|
24223
24223
|
{ ...existingProps, ...inputProps },
|
|
24224
24224
|
{ kind, operation: "update", id }
|
|
24225
24225
|
);
|
|
24226
|
-
const identityRefusal =
|
|
24226
|
+
const identityRefusal = chunkIFTYHOEE_cjs.edgeMatchIdentityUpdateRefusal({
|
|
24227
24227
|
identity: registration.matchIdentity,
|
|
24228
24228
|
kind,
|
|
24229
24229
|
id,
|
|
@@ -24259,7 +24259,7 @@ function edgeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps) {
|
|
|
24259
24259
|
}
|
|
24260
24260
|
async function performEdgeUpdate(ctx, input, session, target, options, resolvedExisting) {
|
|
24261
24261
|
const id = input.id;
|
|
24262
|
-
|
|
24262
|
+
chunkIFTYHOEE_cjs.assertValidityEndMutation(input, {
|
|
24263
24263
|
entityType: "edge",
|
|
24264
24264
|
kind: input.identity.kind,
|
|
24265
24265
|
id
|
|
@@ -24285,7 +24285,7 @@ async function performEdgeUpdate(ctx, input, session, target, options, resolvedE
|
|
|
24285
24285
|
const preservesLiveLowerBound = options?.clearDeleted !== true && chunkL4L4AV6F_cjs.preservesImmutableLowerBound(input.onImmutableLowerBound);
|
|
24286
24286
|
const appliedValidFrom = preservesLiveLowerBound ? void 0 : statedValidFrom;
|
|
24287
24287
|
const validTo = chunkL4L4AV6F_cjs.validateOptionalCanonicalIsoDate(input.validTo, "validTo");
|
|
24288
|
-
const effectiveValidTo = options?.clearDeleted === true && appliedValidFrom !== void 0 ? validTo :
|
|
24288
|
+
const effectiveValidTo = options?.clearDeleted === true && appliedValidFrom !== void 0 ? validTo : chunkIFTYHOEE_cjs.validityEndAfterMutation(
|
|
24289
24289
|
input.clearValidTo === true ? { clearValidTo: true } : validTo === void 0 ? {} : { validTo },
|
|
24290
24290
|
existing.valid_to
|
|
24291
24291
|
);
|
|
@@ -24294,7 +24294,7 @@ async function performEdgeUpdate(ctx, input, session, target, options, resolvedE
|
|
|
24294
24294
|
let reentryClaim;
|
|
24295
24295
|
const reentersActivePopulation = cardinality === "oneActive" && effectiveValidTo === void 0 && (existing.deleted_at !== void 0 || existing.valid_to !== void 0);
|
|
24296
24296
|
if (reentersLivePopulation || reentersActivePopulation) {
|
|
24297
|
-
await
|
|
24297
|
+
await chunkIFTYHOEE_cjs.checkCardinalityConstraint(
|
|
24298
24298
|
{
|
|
24299
24299
|
graphId: ctx.graphId,
|
|
24300
24300
|
registry: ctx.registry,
|
|
@@ -24355,10 +24355,10 @@ async function performEdgeUpdate(ctx, input, session, target, options, resolvedE
|
|
|
24355
24355
|
// "Did this write assert any window state?" is one predicate with one
|
|
24356
24356
|
// owner, consulted here and by the fence appliers that carry it, rather
|
|
24357
24357
|
// than re-derived from the params the diagnosis never sees.
|
|
24358
|
-
|
|
24358
|
+
chunkIFTYHOEE_cjs.assertsStoredWindowState(fences),
|
|
24359
24359
|
() => session.reviseEdge(work, fences)
|
|
24360
24360
|
);
|
|
24361
|
-
return
|
|
24361
|
+
return chunkIFTYHOEE_cjs.rowToEdge(row);
|
|
24362
24362
|
}
|
|
24363
24363
|
var EDGE_UPDATE_ATTEMPTS = 2;
|
|
24364
24364
|
async function performEdgeUpdateConverging(ctx, input, session, target, options, resolvedExisting) {
|
|
@@ -24394,7 +24394,7 @@ function resolveAtomicEdgeUpdateExecutor(ctx, entries, backend) {
|
|
|
24394
24394
|
)) {
|
|
24395
24395
|
return;
|
|
24396
24396
|
}
|
|
24397
|
-
return
|
|
24397
|
+
return chunkIFTYHOEE_cjs.resolveAtomicEdgeResolvedUpdateBatchExecutor({
|
|
24398
24398
|
backend,
|
|
24399
24399
|
graph: ctx.graph,
|
|
24400
24400
|
schemaVersion: ctx.schemaVersion,
|
|
@@ -24418,7 +24418,7 @@ async function executeEdgeUpdate(ctx, input, backend) {
|
|
|
24418
24418
|
);
|
|
24419
24419
|
const opContext = ctx.createOperationContext("update", "edge", gate.kind, id);
|
|
24420
24420
|
if (input.clearValidTo === true) {
|
|
24421
|
-
|
|
24421
|
+
chunkIFTYHOEE_cjs.assertClearValidToSupported(backend, "edge");
|
|
24422
24422
|
}
|
|
24423
24423
|
const atomicEntry = {
|
|
24424
24424
|
input,
|
|
@@ -24431,7 +24431,7 @@ async function executeEdgeUpdate(ctx, input, backend) {
|
|
|
24431
24431
|
backend
|
|
24432
24432
|
);
|
|
24433
24433
|
if (atomicExecutor !== void 0) {
|
|
24434
|
-
return
|
|
24434
|
+
return chunkIFTYHOEE_cjs.runAtomicProgramWithHooks(
|
|
24435
24435
|
ctx,
|
|
24436
24436
|
opContext,
|
|
24437
24437
|
async () => {
|
|
@@ -24443,36 +24443,36 @@ async function executeEdgeUpdate(ctx, input, backend) {
|
|
|
24443
24443
|
);
|
|
24444
24444
|
return chunkBXHAPCQG_cjs.requireDefined(edges[0]);
|
|
24445
24445
|
},
|
|
24446
|
-
|
|
24446
|
+
chunkIFTYHOEE_cjs.writeResultAlwaysChanges
|
|
24447
24447
|
);
|
|
24448
24448
|
}
|
|
24449
|
-
return
|
|
24449
|
+
return chunkIFTYHOEE_cjs.runHookedWritePlan(
|
|
24450
24450
|
ctx,
|
|
24451
24451
|
opContext,
|
|
24452
24452
|
// An in-place props update on a live edge re-derives no constraint verdict.
|
|
24453
24453
|
// Clearing an `oneActive` edge's end DOES: it re-admits the row to the
|
|
24454
24454
|
// counted active population.
|
|
24455
|
-
|
|
24456
|
-
input.clearValidTo === true && edgeCardinality(ctx, gate.kind) === "oneActive" ?
|
|
24455
|
+
chunkIFTYHOEE_cjs.edgeWritePlan(
|
|
24456
|
+
input.clearValidTo === true && edgeCardinality(ctx, gate.kind) === "oneActive" ? chunkIFTYHOEE_cjs.edgeWriteNeedsConstraintFence("oneActive") : void 0
|
|
24457
24457
|
),
|
|
24458
24458
|
backend,
|
|
24459
24459
|
(session, target) => performEdgeUpdateConverging(ctx, input, session, target),
|
|
24460
|
-
{ didWrite:
|
|
24460
|
+
{ didWrite: chunkIFTYHOEE_cjs.writeResultAlwaysChanges }
|
|
24461
24461
|
);
|
|
24462
24462
|
}
|
|
24463
24463
|
async function executeEdgeUpsertUpdateWithOutcome(ctx, input, backend, options) {
|
|
24464
24464
|
if (input.clearValidTo === true) {
|
|
24465
|
-
|
|
24465
|
+
chunkIFTYHOEE_cjs.assertClearValidToSupported(backend, "edge");
|
|
24466
24466
|
}
|
|
24467
|
-
return
|
|
24467
|
+
return chunkIFTYHOEE_cjs.runWritePlan(
|
|
24468
24468
|
ctx,
|
|
24469
24469
|
// An in-place props update re-derives no constraint verdict: endpoints
|
|
24470
24470
|
// are immutable, so cardinality cannot change under it. A coalescing upsert
|
|
24471
24471
|
// converges on a match key no database key backs; a resurrect or a cleared
|
|
24472
24472
|
// end re-admits the row to the counted population its cardinality
|
|
24473
24473
|
// constrains.
|
|
24474
|
-
|
|
24475
|
-
options?.coalesceUnchanged === true ? "edgeMatchKeyConvergence" : input.clearValidTo === true || options?.clearDeleted === true ?
|
|
24474
|
+
chunkIFTYHOEE_cjs.edgeWritePlan(
|
|
24475
|
+
options?.coalesceUnchanged === true ? "edgeMatchKeyConvergence" : input.clearValidTo === true || options?.clearDeleted === true ? chunkIFTYHOEE_cjs.edgeWriteNeedsConstraintFence(edgeCardinality(ctx, input.identity.kind)) : void 0
|
|
24476
24476
|
),
|
|
24477
24477
|
backend,
|
|
24478
24478
|
async (session, target) => {
|
|
@@ -24496,7 +24496,7 @@ async function executeEdgeUpsertUpdateWithOutcome(ctx, input, backend, options)
|
|
|
24496
24496
|
input.props
|
|
24497
24497
|
);
|
|
24498
24498
|
if (shouldCoalesceUpsert(existing, input, runDirtyCheck)) {
|
|
24499
|
-
return { edge:
|
|
24499
|
+
return { edge: chunkIFTYHOEE_cjs.rowToEdge(existing), wrote: false };
|
|
24500
24500
|
}
|
|
24501
24501
|
}
|
|
24502
24502
|
}
|
|
@@ -24525,10 +24525,10 @@ async function executeEdgeUpsertUpdate(ctx, input, backend, options) {
|
|
|
24525
24525
|
}
|
|
24526
24526
|
async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
|
|
24527
24527
|
if (creates.length === 0 || updates.length === 0) {
|
|
24528
|
-
return
|
|
24528
|
+
return chunkIFTYHOEE_cjs.unsupportedResolvedMutationSet();
|
|
24529
24529
|
}
|
|
24530
24530
|
const firstUpdate = chunkBXHAPCQG_cjs.requireDefined(updates[0]);
|
|
24531
|
-
const executor =
|
|
24531
|
+
const executor = chunkIFTYHOEE_cjs.resolveAtomicEdgeResolvedMutationSetExecutor({
|
|
24532
24532
|
backend,
|
|
24533
24533
|
graph: ctx.graph,
|
|
24534
24534
|
schemaVersion: ctx.schemaVersion,
|
|
@@ -24538,18 +24538,18 @@ async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
|
|
|
24538
24538
|
creates,
|
|
24539
24539
|
updateCount: updates.length
|
|
24540
24540
|
});
|
|
24541
|
-
if (executor === void 0) return
|
|
24541
|
+
if (executor === void 0) return chunkIFTYHOEE_cjs.unsupportedResolvedMutationSet();
|
|
24542
24542
|
const ids = /* @__PURE__ */ new Set([
|
|
24543
24543
|
...creates.map((input) => chunkBXHAPCQG_cjs.requireDefined(input.id)),
|
|
24544
24544
|
...updates.map((entry2) => entry2.input.id)
|
|
24545
24545
|
]);
|
|
24546
24546
|
if (ids.size !== creates.length + updates.length) {
|
|
24547
|
-
return
|
|
24547
|
+
return chunkIFTYHOEE_cjs.unsupportedResolvedMutationSet();
|
|
24548
24548
|
}
|
|
24549
24549
|
if (updates.some(
|
|
24550
24550
|
(entry2) => entry2.clearDeleted || entry2.existing === void 0 || entry2.input.validFrom !== void 0 || entry2.input.validTo !== void 0 || entry2.input.clearValidTo === true
|
|
24551
24551
|
)) {
|
|
24552
|
-
return
|
|
24552
|
+
return chunkIFTYHOEE_cjs.unsupportedResolvedMutationSet();
|
|
24553
24553
|
}
|
|
24554
24554
|
const preparation = await prepareAtomicEdgeBatchCreates(
|
|
24555
24555
|
ctx,
|
|
@@ -24579,7 +24579,7 @@ async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
|
|
|
24579
24579
|
);
|
|
24580
24580
|
return { existing, props: validatedProps };
|
|
24581
24581
|
});
|
|
24582
|
-
const result = await
|
|
24582
|
+
const result = await chunkIFTYHOEE_cjs.withAlreadyExistsTranslation("edge", async () => {
|
|
24583
24583
|
try {
|
|
24584
24584
|
return await executor({
|
|
24585
24585
|
kind: "resolved-set",
|
|
@@ -24604,7 +24604,7 @@ async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
|
|
|
24604
24604
|
});
|
|
24605
24605
|
if (result.created.length === 0 && result.updated.length === 0) {
|
|
24606
24606
|
await chunk6B3LQUYG_cjs.diagnoseFusedSchemaFenceNoRow(ctx, backend);
|
|
24607
|
-
throw new
|
|
24607
|
+
throw new chunkIFTYHOEE_cjs.ResolvedMutationSetMoved("edge", executor);
|
|
24608
24608
|
}
|
|
24609
24609
|
if (result.created.length !== creates.length || result.updated.length !== updates.length) {
|
|
24610
24610
|
throw new chunk7XYPLAPL_cjs.CompilerInvariantError(
|
|
@@ -24614,12 +24614,12 @@ async function executeEdgeResolvedMutationSet(ctx, creates, updates, backend) {
|
|
|
24614
24614
|
chunk6B3LQUYG_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
24615
24615
|
const createdById = new Map(result.created.map((row) => [row.id, row]));
|
|
24616
24616
|
const updatedById = new Map(result.updated.map((row) => [row.id, row]));
|
|
24617
|
-
return
|
|
24617
|
+
return chunkIFTYHOEE_cjs.appliedResolvedMutationSet({
|
|
24618
24618
|
created: creates.map(
|
|
24619
|
-
(input) =>
|
|
24619
|
+
(input) => chunkIFTYHOEE_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(createdById.get(chunkBXHAPCQG_cjs.requireDefined(input.id))))
|
|
24620
24620
|
),
|
|
24621
24621
|
updated: updates.map(
|
|
24622
|
-
(entry2) =>
|
|
24622
|
+
(entry2) => chunkIFTYHOEE_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(updatedById.get(entry2.input.id)))
|
|
24623
24623
|
)
|
|
24624
24624
|
});
|
|
24625
24625
|
}
|
|
@@ -24627,7 +24627,7 @@ async function executeEdgeUpsertUpdateBatch(ctx, entries, backend) {
|
|
|
24627
24627
|
if (entries.length === 0) return [];
|
|
24628
24628
|
for (const entry2 of entries) {
|
|
24629
24629
|
if (entry2.input.clearValidTo === true) {
|
|
24630
|
-
|
|
24630
|
+
chunkIFTYHOEE_cjs.assertClearValidToSupported(backend, "edge");
|
|
24631
24631
|
}
|
|
24632
24632
|
}
|
|
24633
24633
|
const first = chunkBXHAPCQG_cjs.requireDefined(entries[0]);
|
|
@@ -24644,10 +24644,10 @@ async function executeEdgeUpsertUpdateBatch(ctx, entries, backend) {
|
|
|
24644
24644
|
const needsConstraintFence = entries.some(
|
|
24645
24645
|
(entry2) => entry2.clearDeleted || entry2.input.clearValidTo === true
|
|
24646
24646
|
);
|
|
24647
|
-
return
|
|
24647
|
+
return chunkIFTYHOEE_cjs.runWritePlan(
|
|
24648
24648
|
ctx,
|
|
24649
|
-
|
|
24650
|
-
needsConstraintFence ?
|
|
24649
|
+
chunkIFTYHOEE_cjs.edgeWritePlan(
|
|
24650
|
+
needsConstraintFence ? chunkIFTYHOEE_cjs.edgeWriteNeedsConstraintFence(
|
|
24651
24651
|
edgeCardinality(ctx, first.input.identity.kind)
|
|
24652
24652
|
) : void 0
|
|
24653
24653
|
),
|
|
@@ -24671,11 +24671,11 @@ async function executeEdgeUpsertUpdateBatch(ctx, entries, backend) {
|
|
|
24671
24671
|
}
|
|
24672
24672
|
return edges;
|
|
24673
24673
|
},
|
|
24674
|
-
{ didWrite:
|
|
24674
|
+
{ didWrite: chunkIFTYHOEE_cjs.writeResultAlwaysChanges }
|
|
24675
24675
|
);
|
|
24676
24676
|
}
|
|
24677
24677
|
async function executeAtomicEdgeResolvedUpdates(ctx, entries, backend, atomicExecutor) {
|
|
24678
|
-
const maxAttempts =
|
|
24678
|
+
const maxAttempts = chunkIFTYHOEE_cjs.atomicResolvedUpdateAttemptBudget(
|
|
24679
24679
|
entries.length,
|
|
24680
24680
|
EDGE_UPDATE_ATTEMPTS
|
|
24681
24681
|
);
|
|
@@ -24723,7 +24723,7 @@ async function executeAtomicEdgeResolvedUpdates(ctx, entries, backend, atomicExe
|
|
|
24723
24723
|
chunk6B3LQUYG_cjs.memoizeLeasedSchemaFence(ctx, backend);
|
|
24724
24724
|
const returned = new Map(rows.map((row) => [row.id, row]));
|
|
24725
24725
|
return entries.map(
|
|
24726
|
-
(entry2) =>
|
|
24726
|
+
(entry2) => chunkIFTYHOEE_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(returned.get(entry2.input.id)))
|
|
24727
24727
|
);
|
|
24728
24728
|
}
|
|
24729
24729
|
if (rows.length > 0) {
|
|
@@ -24769,7 +24769,7 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
|
|
|
24769
24769
|
);
|
|
24770
24770
|
if (gate.deleted_at) return;
|
|
24771
24771
|
const opContext = ctx.createOperationContext("delete", "edge", gate.kind, id);
|
|
24772
|
-
const atomicExecutor =
|
|
24772
|
+
const atomicExecutor = chunkIFTYHOEE_cjs.resolveAtomicEdgeDeleteBatchExecutor({
|
|
24773
24773
|
backend,
|
|
24774
24774
|
graph: ctx.graph,
|
|
24775
24775
|
expectedKind,
|
|
@@ -24779,7 +24779,7 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
|
|
|
24779
24779
|
revisionTrackingEnabled: ctx.revisionTrackingEnabled
|
|
24780
24780
|
});
|
|
24781
24781
|
if (atomicExecutor !== void 0) {
|
|
24782
|
-
await
|
|
24782
|
+
await chunkIFTYHOEE_cjs.runAtomicProgramWithHooks(
|
|
24783
24783
|
ctx,
|
|
24784
24784
|
opContext,
|
|
24785
24785
|
() => executeAtomicEdgeDeletes(
|
|
@@ -24793,11 +24793,11 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
|
|
|
24793
24793
|
);
|
|
24794
24794
|
return;
|
|
24795
24795
|
}
|
|
24796
|
-
return
|
|
24796
|
+
return chunkIFTYHOEE_cjs.runHookedWritePlan(
|
|
24797
24797
|
ctx,
|
|
24798
24798
|
opContext,
|
|
24799
24799
|
// A soft delete decides nothing a concurrent write could invalidate.
|
|
24800
|
-
|
|
24800
|
+
chunkIFTYHOEE_cjs.edgeWritePlan(void 0),
|
|
24801
24801
|
backend,
|
|
24802
24802
|
async (session) => {
|
|
24803
24803
|
await session.retireEdge({ id, kind: expectedKind });
|
|
@@ -24805,7 +24805,7 @@ async function executeEdgeDelete(ctx, expectedKind, id, backend) {
|
|
|
24805
24805
|
);
|
|
24806
24806
|
}
|
|
24807
24807
|
async function executeEdgeDeleteBatch(ctx, expectedKind, ids, backend) {
|
|
24808
|
-
const atomicExecutor =
|
|
24808
|
+
const atomicExecutor = chunkIFTYHOEE_cjs.resolveAtomicEdgeDeleteBatchExecutor({
|
|
24809
24809
|
backend,
|
|
24810
24810
|
graph: ctx.graph,
|
|
24811
24811
|
expectedKind,
|
|
@@ -24824,9 +24824,9 @@ async function executeEdgeDeleteBatch(ctx, expectedKind, ids, backend) {
|
|
|
24824
24824
|
);
|
|
24825
24825
|
return;
|
|
24826
24826
|
}
|
|
24827
|
-
await
|
|
24827
|
+
await chunkIFTYHOEE_cjs.runWritePlan(
|
|
24828
24828
|
ctx,
|
|
24829
|
-
|
|
24829
|
+
chunkIFTYHOEE_cjs.edgeWritePlan(void 0),
|
|
24830
24830
|
backend,
|
|
24831
24831
|
async (session, target) => {
|
|
24832
24832
|
const rowsById = await chunk6B3LQUYG_cjs.getEdgeRowsByIds(
|
|
@@ -24868,7 +24868,7 @@ async function executeAtomicEdgeDeletes(ctx, expectedKind, ids, backend, atomicE
|
|
|
24868
24868
|
expectedVersion: chunkBXHAPCQG_cjs.requireDefined(ctx.schemaVersion)
|
|
24869
24869
|
}
|
|
24870
24870
|
});
|
|
24871
|
-
await
|
|
24871
|
+
await chunkIFTYHOEE_cjs.assertAtomicDeleteSchemaFenceMatched(
|
|
24872
24872
|
result.schemaFenceMatched,
|
|
24873
24873
|
ctx,
|
|
24874
24874
|
backend,
|
|
@@ -24910,10 +24910,10 @@ async function executeEdgeHardDelete(ctx, expectedKind, id, backend) {
|
|
|
24910
24910
|
"hardDelete"
|
|
24911
24911
|
);
|
|
24912
24912
|
const opContext = ctx.createOperationContext("delete", "edge", gate.kind, id);
|
|
24913
|
-
return
|
|
24913
|
+
return chunkIFTYHOEE_cjs.runHookedWritePlan(
|
|
24914
24914
|
ctx,
|
|
24915
24915
|
opContext,
|
|
24916
|
-
|
|
24916
|
+
chunkIFTYHOEE_cjs.edgeWritePlan(void 0),
|
|
24917
24917
|
backend,
|
|
24918
24918
|
async (session) => {
|
|
24919
24919
|
await session.purgeEdge({
|
|
@@ -24982,7 +24982,7 @@ function findMatchingEdge(rows, matchOn, inputProps) {
|
|
|
24982
24982
|
if (matchOn.length > 0) {
|
|
24983
24983
|
const rowProps = chunk6JRVV2SS_cjs.rowPropsToObject(row.props);
|
|
24984
24984
|
const matches = matchOn.every(
|
|
24985
|
-
(field2) =>
|
|
24985
|
+
(field2) => chunkIFTYHOEE_cjs.canonicalPersistedJsonValue(chunkBXHAPCQG_cjs.readOwnProperty(rowProps, field2)) === chunkIFTYHOEE_cjs.canonicalPersistedJsonValue(chunkBXHAPCQG_cjs.readOwnProperty(inputProps, field2))
|
|
24986
24986
|
);
|
|
24987
24987
|
if (!matches) continue;
|
|
24988
24988
|
}
|
|
@@ -25003,7 +25003,7 @@ function assertEdgeMatchKey(row, matchOn, matchProps) {
|
|
|
25003
25003
|
}
|
|
25004
25004
|
async function executeEdgeFindByEndpoints(ctx, kind, fromKind, fromId, toKind, toId, backend, options) {
|
|
25005
25005
|
const matchOn = options?.matchOn ?? [];
|
|
25006
|
-
const matchProps =
|
|
25006
|
+
const matchProps = chunkIFTYHOEE_cjs.normalizePersistedEdgeMatchProps(options?.props ?? {});
|
|
25007
25007
|
const registration = getEdgeRegistration(ctx.graph, kind);
|
|
25008
25008
|
const edgeKind = registration.type;
|
|
25009
25009
|
if (matchOn.length > 0) {
|
|
@@ -25023,9 +25023,9 @@ async function executeEdgeFindByEndpoints(ctx, kind, fromKind, fromId, toKind, t
|
|
|
25023
25023
|
...options?.asOf !== void 0 && { asOf: options.asOf }
|
|
25024
25024
|
});
|
|
25025
25025
|
if (candidateRows.length === 0) return void 0;
|
|
25026
|
-
if (matchOn.length === 0) return
|
|
25026
|
+
if (matchOn.length === 0) return chunkIFTYHOEE_cjs.rowToEdge(chunkBXHAPCQG_cjs.requireDefined(candidateRows[0]));
|
|
25027
25027
|
const { liveRow } = findMatchingEdge(candidateRows, matchOn, matchProps);
|
|
25028
|
-
return liveRow === void 0 ? void 0 :
|
|
25028
|
+
return liveRow === void 0 ? void 0 : chunkIFTYHOEE_cjs.rowToEdge(liveRow);
|
|
25029
25029
|
}
|
|
25030
25030
|
function defersEndpointWindowOrdering(ifExists, onImmutableLowerBound) {
|
|
25031
25031
|
return ifExists === "update" && chunkL4L4AV6F_cjs.preservesImmutableLowerBound(onImmutableLowerBound);
|
|
@@ -25050,15 +25050,15 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
|
|
|
25050
25050
|
registration.matchIdentity?.fields,
|
|
25051
25051
|
options?.matchOn
|
|
25052
25052
|
);
|
|
25053
|
-
|
|
25053
|
+
chunkIFTYHOEE_cjs.assertValidityEndMutation(options ?? {}, { entityType: "edge", kind });
|
|
25054
25054
|
if (options?.clearValidTo === true) {
|
|
25055
|
-
|
|
25055
|
+
chunkIFTYHOEE_cjs.assertClearValidToSupported(backend, "edge");
|
|
25056
25056
|
}
|
|
25057
25057
|
const validatedProps = chunk6B3LQUYG_cjs.validateEdgeProps(edgeKind.schema, props, {
|
|
25058
25058
|
kind,
|
|
25059
25059
|
operation: "create"
|
|
25060
25060
|
});
|
|
25061
|
-
const matchProps =
|
|
25061
|
+
const matchProps = chunkIFTYHOEE_cjs.normalizePersistedEdgeMatchProps(validatedProps);
|
|
25062
25062
|
validateMatchOnFields(edgeKind.schema, matchOn, kind);
|
|
25063
25063
|
const validFrom = chunkL4L4AV6F_cjs.validateStatedValidityLowerBound(
|
|
25064
25064
|
options?.validFrom,
|
|
@@ -25102,7 +25102,7 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
|
|
|
25102
25102
|
);
|
|
25103
25103
|
if (currentLiveRow !== void 0) {
|
|
25104
25104
|
assertEndpointClearCanApply(ifExists, options?.clearValidTo, kind);
|
|
25105
|
-
return { edge:
|
|
25105
|
+
return { edge: chunkIFTYHOEE_cjs.rowToEdge(currentLiveRow), action: "found" };
|
|
25106
25106
|
}
|
|
25107
25107
|
initialCandidateRead = {
|
|
25108
25108
|
rows: currentRows,
|
|
@@ -25119,7 +25119,7 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
|
|
|
25119
25119
|
if (!isDeleted) {
|
|
25120
25120
|
if (ifExists === "return") {
|
|
25121
25121
|
assertEndpointClearCanApply(ifExists, options?.clearValidTo, kind);
|
|
25122
|
-
return { edge:
|
|
25122
|
+
return { edge: chunkIFTYHOEE_cjs.rowToEdge(matchedRow), action: "found" };
|
|
25123
25123
|
}
|
|
25124
25124
|
const outcome = await executeEdgeUpsertUpdateWithOutcome(
|
|
25125
25125
|
ctx,
|
|
@@ -25327,15 +25327,15 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
25327
25327
|
validateMatchOnFields(edgeKind.schema, matchOn, kind);
|
|
25328
25328
|
const validated = [];
|
|
25329
25329
|
for (const item of items) {
|
|
25330
|
-
|
|
25330
|
+
chunkIFTYHOEE_cjs.assertValidityEndMutation(item, { entityType: "edge", kind });
|
|
25331
25331
|
if (item.clearValidTo === true) {
|
|
25332
|
-
|
|
25332
|
+
chunkIFTYHOEE_cjs.assertClearValidToSupported(backend, "edge");
|
|
25333
25333
|
}
|
|
25334
25334
|
const validatedProps = chunk6B3LQUYG_cjs.validateEdgeProps(edgeKind.schema, item.props, {
|
|
25335
25335
|
kind,
|
|
25336
25336
|
operation: "create"
|
|
25337
25337
|
});
|
|
25338
|
-
const matchProps =
|
|
25338
|
+
const matchProps = chunkIFTYHOEE_cjs.normalizePersistedEdgeMatchProps(validatedProps);
|
|
25339
25339
|
const validFrom = chunkL4L4AV6F_cjs.validateStatedValidityLowerBound(
|
|
25340
25340
|
item.validFrom,
|
|
25341
25341
|
"validFrom"
|
|
@@ -25348,7 +25348,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
25348
25348
|
validTo
|
|
25349
25349
|
);
|
|
25350
25350
|
}
|
|
25351
|
-
const compositeKey =
|
|
25351
|
+
const compositeKey = chunkIFTYHOEE_cjs.buildEdgeMatchKey({
|
|
25352
25352
|
fromKind: item.fromKind,
|
|
25353
25353
|
fromId: item.fromId,
|
|
25354
25354
|
toKind: item.toKind,
|
|
@@ -25379,7 +25379,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
25379
25379
|
}
|
|
25380
25380
|
});
|
|
25381
25381
|
}
|
|
25382
|
-
const atomicConvergenceExecutor =
|
|
25382
|
+
const atomicConvergenceExecutor = chunkIFTYHOEE_cjs.resolveAtomicEdgeConvergenceExecutor({
|
|
25383
25383
|
backend,
|
|
25384
25384
|
graph: ctx.graph,
|
|
25385
25385
|
schemaVersion: ctx.schemaVersion,
|
|
@@ -25405,7 +25405,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
25405
25405
|
ctx.registry
|
|
25406
25406
|
);
|
|
25407
25407
|
if (endpointError) throw endpointError;
|
|
25408
|
-
const matchIdentity =
|
|
25408
|
+
const matchIdentity = chunkIFTYHOEE_cjs.resolveEdgeMatchIdentityStorage(
|
|
25409
25409
|
registration.matchIdentity,
|
|
25410
25410
|
{
|
|
25411
25411
|
fromKind: entry2.fromKind,
|
|
@@ -25484,7 +25484,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
25484
25484
|
for (const [nativeIndex, nativeResult] of nativeResults.entries()) {
|
|
25485
25485
|
const nativeEntry = chunkBXHAPCQG_cjs.requireDefined(nativeEntries[nativeIndex]);
|
|
25486
25486
|
const result = {
|
|
25487
|
-
edge:
|
|
25487
|
+
edge: chunkIFTYHOEE_cjs.rowToEdge(nativeResult.row),
|
|
25488
25488
|
action: nativeResult.outcome
|
|
25489
25489
|
};
|
|
25490
25490
|
results[nativeEntry.index] = result;
|
|
@@ -25656,7 +25656,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
25656
25656
|
const found = Array.from({ length: items.length });
|
|
25657
25657
|
for (const entry2 of partition.toFetch) {
|
|
25658
25658
|
assertEndpointClearCanApply(ifExists, entry2.clearValidTo, kind);
|
|
25659
|
-
found[entry2.index] = { edge:
|
|
25659
|
+
found[entry2.index] = { edge: chunkIFTYHOEE_cjs.rowToEdge(entry2.row), action: "found" };
|
|
25660
25660
|
}
|
|
25661
25661
|
for (const { index, sourceIndex } of partition.duplicateOf) {
|
|
25662
25662
|
found[index] = {
|
|
@@ -25673,15 +25673,15 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
25673
25673
|
if (found !== void 0) return found;
|
|
25674
25674
|
}
|
|
25675
25675
|
function runBatch() {
|
|
25676
|
-
return
|
|
25676
|
+
return chunkIFTYHOEE_cjs.runWritePlan(
|
|
25677
25677
|
ctx,
|
|
25678
25678
|
// A bulk getOrCreate always converges on a match key no database key
|
|
25679
25679
|
// backs, whatever its cardinality — the same reason the single-item path
|
|
25680
25680
|
// fences unconditionally.
|
|
25681
|
-
|
|
25681
|
+
chunkIFTYHOEE_cjs.edgeWritePlan("edgeMatchKeyConvergence"),
|
|
25682
25682
|
backend,
|
|
25683
25683
|
async (session, target, _overlaidSession, lock) => {
|
|
25684
|
-
const rawTarget =
|
|
25684
|
+
const rawTarget = chunkIFTYHOEE_cjs.nestedManagedWriteTarget(target);
|
|
25685
25685
|
const { toCreate, toFetch, duplicateOf } = partitionEntries(
|
|
25686
25686
|
await fetchRowsByEndpoint(target)
|
|
25687
25687
|
);
|
|
@@ -25759,7 +25759,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
25759
25759
|
if (entry2.isDeleted) continue;
|
|
25760
25760
|
assertEndpointClearCanApply(ifExists, entry2.clearValidTo, kind);
|
|
25761
25761
|
results[entry2.index] = {
|
|
25762
|
-
edge:
|
|
25762
|
+
edge: chunkIFTYHOEE_cjs.rowToEdge(entry2.row),
|
|
25763
25763
|
action: "found"
|
|
25764
25764
|
};
|
|
25765
25765
|
}
|
|
@@ -25794,7 +25794,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
25794
25794
|
} else {
|
|
25795
25795
|
assertEndpointClearCanApply(ifExists, entry2.clearValidTo, kind);
|
|
25796
25796
|
results[entry2.index] = {
|
|
25797
|
-
edge:
|
|
25797
|
+
edge: chunkIFTYHOEE_cjs.rowToEdge(entry2.row),
|
|
25798
25798
|
action: "found"
|
|
25799
25799
|
};
|
|
25800
25800
|
}
|
|
@@ -26073,7 +26073,7 @@ function createRecordedReadService(params) {
|
|
|
26073
26073
|
kind,
|
|
26074
26074
|
ids,
|
|
26075
26075
|
coordinate,
|
|
26076
|
-
toEntity: (row) =>
|
|
26076
|
+
toEntity: (row) => chunkIFTYHOEE_cjs.rowToNode(mapRecordedNodeRow(row))
|
|
26077
26077
|
});
|
|
26078
26078
|
}
|
|
26079
26079
|
function edgeGetByIds(kind, ids, coordinate) {
|
|
@@ -26088,7 +26088,7 @@ function createRecordedReadService(params) {
|
|
|
26088
26088
|
kind,
|
|
26089
26089
|
ids,
|
|
26090
26090
|
coordinate,
|
|
26091
|
-
toEntity: (row) =>
|
|
26091
|
+
toEntity: (row) => chunkIFTYHOEE_cjs.rowToEdge(mapRecordedEdgeRow(row))
|
|
26092
26092
|
});
|
|
26093
26093
|
}
|
|
26094
26094
|
function nodeScan(kind, coordinate, options) {
|
|
@@ -26103,7 +26103,7 @@ function createRecordedReadService(params) {
|
|
|
26103
26103
|
kind,
|
|
26104
26104
|
coordinate,
|
|
26105
26105
|
options,
|
|
26106
|
-
toEntity: (row) =>
|
|
26106
|
+
toEntity: (row) => chunkIFTYHOEE_cjs.rowToNode(mapRecordedNodeRow(row))
|
|
26107
26107
|
});
|
|
26108
26108
|
}
|
|
26109
26109
|
function edgeScan(kind, coordinate, options) {
|
|
@@ -26118,7 +26118,7 @@ function createRecordedReadService(params) {
|
|
|
26118
26118
|
kind,
|
|
26119
26119
|
coordinate,
|
|
26120
26120
|
options,
|
|
26121
|
-
toEntity: (row) =>
|
|
26121
|
+
toEntity: (row) => chunkIFTYHOEE_cjs.rowToEdge(mapRecordedEdgeRow(row))
|
|
26122
26122
|
});
|
|
26123
26123
|
}
|
|
26124
26124
|
return {
|
|
@@ -27503,13 +27503,13 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
27503
27503
|
#buildNodeOperations(ctx) {
|
|
27504
27504
|
return {
|
|
27505
27505
|
defaultTemporalMode: this.#graph.defaults.temporalMode,
|
|
27506
|
-
rowToNode: (row) =>
|
|
27506
|
+
rowToNode: (row) => chunkIFTYHOEE_cjs.rowToNode(row),
|
|
27507
27507
|
maybeRefreshStatisticsAfterBulk: (rowCount) => this.#maybeRefreshStatisticsAfterBulk(rowCount),
|
|
27508
|
-
executeCreate: (input, backend) =>
|
|
27509
|
-
executeCreateBatch: (inputs, backend, options) =>
|
|
27510
|
-
executeCreateNoReturnBatch: (inputs, backend) =>
|
|
27511
|
-
executeUpdate: (input, backend, options) =>
|
|
27512
|
-
executeNodeSetUpdate: (kind, patch, candidateIds, candidateIdColumn, backend, options) =>
|
|
27508
|
+
executeCreate: (input, backend) => chunkIFTYHOEE_cjs.executeNodeCreate(ctx, input, backend),
|
|
27509
|
+
executeCreateBatch: (inputs, backend, options) => chunkIFTYHOEE_cjs.executeNodeCreateBatch(ctx, inputs, backend, options),
|
|
27510
|
+
executeCreateNoReturnBatch: (inputs, backend) => chunkIFTYHOEE_cjs.executeNodeCreateNoReturnBatch(ctx, inputs, backend),
|
|
27511
|
+
executeUpdate: (input, backend, options) => chunkIFTYHOEE_cjs.executeNodeUpdate(ctx, { ...input, id: input.id }, backend, options),
|
|
27512
|
+
executeNodeSetUpdate: (kind, patch, candidateIds, candidateIdColumn, backend, options) => chunkIFTYHOEE_cjs.executeNodeSetUpdate(
|
|
27513
27513
|
ctx,
|
|
27514
27514
|
kind,
|
|
27515
27515
|
patch,
|
|
@@ -27518,20 +27518,20 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
27518
27518
|
backend,
|
|
27519
27519
|
options
|
|
27520
27520
|
),
|
|
27521
|
-
executeUpsertUpdateBatch: (entries, backend) =>
|
|
27522
|
-
executeResolvedMutationSet: (creates, updates, backend) =>
|
|
27523
|
-
prepareReplacement: (kind, props) =>
|
|
27524
|
-
executeReplacementBatch: (kind, items, backend) =>
|
|
27521
|
+
executeUpsertUpdateBatch: (entries, backend) => chunkIFTYHOEE_cjs.executeNodeUpsertUpdateBatch(ctx, entries, backend),
|
|
27522
|
+
executeResolvedMutationSet: (creates, updates, backend) => chunkIFTYHOEE_cjs.executeNodeResolvedMutationSet(ctx, creates, updates, backend),
|
|
27523
|
+
prepareReplacement: (kind, props) => chunkIFTYHOEE_cjs.prepareNodeReplacement(ctx, kind, props),
|
|
27524
|
+
executeReplacementBatch: (kind, items, backend) => chunkIFTYHOEE_cjs.executeNodeReplacementBatch(ctx, kind, items, backend),
|
|
27525
27525
|
// Present only when opted in; its absence is the coalesce off switch.
|
|
27526
27526
|
...ctx.coalesceUnchangedUpsertsEnabled && {
|
|
27527
|
-
upsertDirtyCheck: (kind, id, existingProps, inputProps) =>
|
|
27527
|
+
upsertDirtyCheck: (kind, id, existingProps, inputProps) => chunkIFTYHOEE_cjs.nodeUpsertDirtyCheck(ctx, kind, id, existingProps, inputProps)
|
|
27528
27528
|
},
|
|
27529
|
-
executeDelete: (kind, id, backend) =>
|
|
27530
|
-
executeDeleteBatch: (kind, ids, backend) =>
|
|
27531
|
-
executeHardDelete: (kind, id, backend) =>
|
|
27529
|
+
executeDelete: (kind, id, backend) => chunkIFTYHOEE_cjs.executeNodeDelete(ctx, kind, id, backend),
|
|
27530
|
+
executeDeleteBatch: (kind, ids, backend) => chunkIFTYHOEE_cjs.executeNodeDeleteBatch(ctx, kind, ids, backend),
|
|
27531
|
+
executeHardDelete: (kind, id, backend) => chunkIFTYHOEE_cjs.executeNodeHardDelete(ctx, kind, id, backend),
|
|
27532
27532
|
temporalRowMatcher: (options) => this.#temporalRowMatcher(options),
|
|
27533
27533
|
createQuery: () => this.query(),
|
|
27534
|
-
executeGetOrCreateByConstraint: (kind, constraintName, props, backend, options) =>
|
|
27534
|
+
executeGetOrCreateByConstraint: (kind, constraintName, props, backend, options) => chunkIFTYHOEE_cjs.executeNodeGetOrCreateByConstraint(
|
|
27535
27535
|
ctx,
|
|
27536
27536
|
kind,
|
|
27537
27537
|
constraintName,
|
|
@@ -27539,7 +27539,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
27539
27539
|
backend,
|
|
27540
27540
|
options
|
|
27541
27541
|
),
|
|
27542
|
-
executeBulkGetOrCreateByConstraint: (kind, constraintName, items, backend, options) =>
|
|
27542
|
+
executeBulkGetOrCreateByConstraint: (kind, constraintName, items, backend, options) => chunkIFTYHOEE_cjs.executeNodeBulkGetOrCreateByConstraint(
|
|
27543
27543
|
ctx,
|
|
27544
27544
|
kind,
|
|
27545
27545
|
constraintName,
|
|
@@ -27547,15 +27547,15 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
27547
27547
|
backend,
|
|
27548
27548
|
options
|
|
27549
27549
|
),
|
|
27550
|
-
executeFindByConstraint: (kind, constraintName, props, backend) =>
|
|
27551
|
-
executeBulkFindByConstraint: (kind, constraintName, items, backend) =>
|
|
27550
|
+
executeFindByConstraint: (kind, constraintName, props, backend) => chunkIFTYHOEE_cjs.executeNodeFindByConstraint(ctx, kind, constraintName, props, backend),
|
|
27551
|
+
executeBulkFindByConstraint: (kind, constraintName, items, backend) => chunkIFTYHOEE_cjs.executeNodeBulkFindByConstraint(
|
|
27552
27552
|
ctx,
|
|
27553
27553
|
kind,
|
|
27554
27554
|
constraintName,
|
|
27555
27555
|
items,
|
|
27556
27556
|
backend
|
|
27557
27557
|
),
|
|
27558
|
-
executeBulkFindByIndex: (kind, indexName, items, backend, options) =>
|
|
27558
|
+
executeBulkFindByIndex: (kind, indexName, items, backend, options) => chunkIFTYHOEE_cjs.executeNodeBulkFindByIndex(
|
|
27559
27559
|
ctx,
|
|
27560
27560
|
kind,
|
|
27561
27561
|
indexName,
|
|
@@ -27574,7 +27574,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
27574
27574
|
#buildEdgeOperations(ctx) {
|
|
27575
27575
|
return {
|
|
27576
27576
|
defaultTemporalMode: this.#graph.defaults.temporalMode,
|
|
27577
|
-
rowToEdge: (row) =>
|
|
27577
|
+
rowToEdge: (row) => chunkIFTYHOEE_cjs.rowToEdge(row),
|
|
27578
27578
|
maybeRefreshStatisticsAfterBulk: (rowCount) => this.#maybeRefreshStatisticsAfterBulk(rowCount),
|
|
27579
27579
|
executeCreate: (input, backend) => executeEdgeCreate(ctx, input, backend),
|
|
27580
27580
|
executeCreateBatch: (inputs, backend) => executeEdgeCreateBatch(ctx, inputs, backend),
|
|
@@ -28212,7 +28212,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
28212
28212
|
});
|
|
28213
28213
|
const edgesBySource = /* @__PURE__ */ new Map();
|
|
28214
28214
|
for (const row of rows) {
|
|
28215
|
-
const edge =
|
|
28215
|
+
const edge = chunkIFTYHOEE_cjs.rowToEdge(row);
|
|
28216
28216
|
const key = side === "from" ? `${edge.fromKind}\0${edge.fromId}` : `${edge.toKind}\0${edge.toId}`;
|
|
28217
28217
|
const bucket = edgesBySource.get(key);
|
|
28218
28218
|
if (bucket === void 0) edgesBySource.set(key, [edge]);
|
|
@@ -28879,7 +28879,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
28879
28879
|
}
|
|
28880
28880
|
for (const row of rows) receiptRecorder?.recordNode(row.kind, 1);
|
|
28881
28881
|
return rows.map(
|
|
28882
|
-
(row) =>
|
|
28882
|
+
(row) => chunkIFTYHOEE_cjs.rowToNode(row)
|
|
28883
28883
|
);
|
|
28884
28884
|
}
|
|
28885
28885
|
/**
|
|
@@ -29060,7 +29060,7 @@ var StoreImplementation = class _StoreImplementation {
|
|
|
29060
29060
|
if (!includeTombstoned && row.deleted_at !== void 0) continue;
|
|
29061
29061
|
loadedByReference.set(
|
|
29062
29062
|
chunkEBQX7MYL_cjs.refKey({ kind, id: row.id }),
|
|
29063
|
-
|
|
29063
|
+
chunkIFTYHOEE_cjs.rowToNode(row)
|
|
29064
29064
|
);
|
|
29065
29065
|
}
|
|
29066
29066
|
})
|
|
@@ -31237,5 +31237,5 @@ exports.min = min;
|
|
|
31237
31237
|
exports.offsetFragment = offsetFragment;
|
|
31238
31238
|
exports.orderByFragment = orderByFragment;
|
|
31239
31239
|
exports.sum = sum;
|
|
31240
|
-
//# sourceMappingURL=chunk-
|
|
31241
|
-
//# sourceMappingURL=chunk-
|
|
31240
|
+
//# sourceMappingURL=chunk-OBEYH22Q.cjs.map
|
|
31241
|
+
//# sourceMappingURL=chunk-OBEYH22Q.cjs.map
|