@nicia-ai/typegraph 0.65.0 → 0.66.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 +33 -0
- package/dist/{atomic-mutation-program-BznZQ06C.d.ts → atomic-mutation-program-BhP75Qn0.d.ts} +1 -1
- package/dist/{atomic-mutation-program-Bfu5z-je.d.cts → atomic-mutation-program-DMdmc4s0.d.cts} +1 -1
- package/dist/backend/drizzle/engine/index.cjs +13 -13
- package/dist/backend/drizzle/engine/index.d.cts +9 -9
- package/dist/backend/drizzle/engine/index.d.ts +9 -9
- package/dist/backend/drizzle/engine/index.js +8 -8
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/index.cjs +91 -91
- package/dist/backend/index.d.cts +7 -7
- package/dist/backend/index.d.ts +7 -7
- package/dist/backend/index.js +8 -8
- package/dist/backend/postgres/index.cjs +23 -23
- package/dist/backend/postgres/index.d.cts +8 -8
- package/dist/backend/postgres/index.d.ts +8 -8
- package/dist/backend/postgres/index.js +8 -8
- package/dist/backend/postgres/pglite-store.cjs +1 -1
- package/dist/backend/postgres/pglite-store.d.cts +6 -6
- package/dist/backend/postgres/pglite-store.d.ts +6 -6
- package/dist/backend/postgres/pglite-store.js +1 -1
- package/dist/backend/postgres/pglite.cjs +10 -10
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +9 -9
- package/dist/backend/sqlite/index.cjs +21 -21
- package/dist/backend/sqlite/index.d.cts +7 -7
- package/dist/backend/sqlite/index.d.ts +7 -7
- package/dist/backend/sqlite/index.js +8 -8
- package/dist/backend/sqlite/libsql.cjs +14 -14
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +8 -8
- package/dist/backend/sqlite/local-store.cjs +1 -1
- package/dist/backend/sqlite/local-store.d.cts +6 -6
- package/dist/backend/sqlite/local-store.d.ts +6 -6
- package/dist/backend/sqlite/local-store.js +1 -1
- package/dist/backend/sqlite/local.cjs +10 -10
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +9 -9
- package/dist/{chunk-PFXNQFFY.js → chunk-2DJKHZQ4.js} +75 -8
- package/dist/chunk-2DJKHZQ4.js.map +1 -0
- package/dist/{chunk-337ONI2I.js → chunk-3SUZXB5X.js} +146 -80
- package/dist/chunk-3SUZXB5X.js.map +1 -0
- package/dist/{chunk-4VTCIEK3.js → chunk-4TQOIBWH.js} +3 -3
- package/dist/{chunk-4VTCIEK3.js.map → chunk-4TQOIBWH.js.map} +1 -1
- package/dist/{chunk-JRWKRBI5.cjs → chunk-5JOCIMQ3.cjs} +6 -6
- package/dist/{chunk-JRWKRBI5.cjs.map → chunk-5JOCIMQ3.cjs.map} +1 -1
- package/dist/{chunk-BWQA3POT.cjs → chunk-6B3LQUYG.cjs} +206 -138
- package/dist/chunk-6B3LQUYG.cjs.map +1 -0
- package/dist/{chunk-RQPCUHIH.js → chunk-6ECNYQDW.js} +3 -3
- package/dist/{chunk-RQPCUHIH.js.map → chunk-6ECNYQDW.js.map} +1 -1
- package/dist/{chunk-OLB75LRQ.js → chunk-6GKKAQMW.js} +5 -5
- package/dist/{chunk-OLB75LRQ.js.map → chunk-6GKKAQMW.js.map} +1 -1
- package/dist/{chunk-OC5ROP7V.cjs → chunk-6JRVV2SS.cjs} +8 -2
- package/dist/chunk-6JRVV2SS.cjs.map +1 -0
- package/dist/{chunk-DSX3P4S5.cjs → chunk-76OB5RSH.cjs} +6 -6
- package/dist/{chunk-DSX3P4S5.cjs.map → chunk-76OB5RSH.cjs.map} +1 -1
- package/dist/{chunk-DHRLOQLQ.cjs → chunk-7LQTDGV5.cjs} +11 -11
- package/dist/{chunk-DHRLOQLQ.cjs.map → chunk-7LQTDGV5.cjs.map} +1 -1
- package/dist/{chunk-Q25QYSOH.js → chunk-7YJHUY4T.js} +9 -9
- package/dist/{chunk-Q25QYSOH.js.map → chunk-7YJHUY4T.js.map} +1 -1
- package/dist/{chunk-JERQGJKG.cjs → chunk-ANMCKLZQ.cjs} +18 -18
- package/dist/{chunk-JERQGJKG.cjs.map → chunk-ANMCKLZQ.cjs.map} +1 -1
- package/dist/{chunk-BBOMNH44.js → chunk-BABP4D5B.js} +3 -3
- package/dist/{chunk-BBOMNH44.js.map → chunk-BABP4D5B.js.map} +1 -1
- package/dist/{chunk-EVGZ2TRQ.js → chunk-BE75G3M5.js} +3 -3
- package/dist/{chunk-EVGZ2TRQ.js.map → chunk-BE75G3M5.js.map} +1 -1
- package/dist/{chunk-FXGZT3WO.cjs → chunk-BX42F7IJ.cjs} +41 -41
- package/dist/{chunk-FXGZT3WO.cjs.map → chunk-BX42F7IJ.cjs.map} +1 -1
- package/dist/{chunk-G6T23JU7.js → chunk-CDKNGCE7.js} +3 -3
- package/dist/{chunk-G6T23JU7.js.map → chunk-CDKNGCE7.js.map} +1 -1
- package/dist/{chunk-BNTJ5YFO.cjs → chunk-EACDHXJL.cjs} +4 -4
- package/dist/{chunk-BNTJ5YFO.cjs.map → chunk-EACDHXJL.cjs.map} +1 -1
- package/dist/{chunk-SNDJUTMB.cjs → chunk-EBQX7MYL.cjs} +72 -72
- package/dist/{chunk-SNDJUTMB.cjs.map → chunk-EBQX7MYL.cjs.map} +1 -1
- package/dist/{chunk-GKSAEUX6.js → chunk-FXOFJ4FS.js} +7 -7
- package/dist/{chunk-GKSAEUX6.js.map → chunk-FXOFJ4FS.js.map} +1 -1
- package/dist/{chunk-ZOWRACZQ.cjs → chunk-G7OKJDMG.cjs} +5 -5
- package/dist/{chunk-ZOWRACZQ.cjs.map → chunk-G7OKJDMG.cjs.map} +1 -1
- package/dist/{chunk-MKJPBSID.cjs → chunk-I7SBZJI2.cjs} +4 -4
- package/dist/{chunk-MKJPBSID.cjs.map → chunk-I7SBZJI2.cjs.map} +1 -1
- package/dist/{chunk-H346QK3V.cjs → chunk-K7YACILO.cjs} +9 -9
- package/dist/{chunk-H346QK3V.cjs.map → chunk-K7YACILO.cjs.map} +1 -1
- package/dist/{chunk-3KWF25MF.cjs → chunk-MN325MG4.cjs} +313 -246
- package/dist/chunk-MN325MG4.cjs.map +1 -0
- package/dist/{chunk-KDNRACRG.cjs → chunk-MRUOOAIQ.cjs} +4 -4
- package/dist/{chunk-KDNRACRG.cjs.map → chunk-MRUOOAIQ.cjs.map} +1 -1
- package/dist/{chunk-HTSJTWUT.js → chunk-OF63ZHSD.js} +4 -4
- package/dist/{chunk-HTSJTWUT.js.map → chunk-OF63ZHSD.js.map} +1 -1
- package/dist/{chunk-NGA3THGU.cjs → chunk-QR7W37HG.cjs} +14 -14
- package/dist/{chunk-NGA3THGU.cjs.map → chunk-QR7W37HG.cjs.map} +1 -1
- package/dist/{chunk-QFEO4M5W.js → chunk-RTPMG6LQ.js} +11 -11
- package/dist/{chunk-QFEO4M5W.js.map → chunk-RTPMG6LQ.js.map} +1 -1
- package/dist/{chunk-PFD4NUYV.js → chunk-SSDHR2C2.js} +3 -3
- package/dist/{chunk-PFD4NUYV.js.map → chunk-SSDHR2C2.js.map} +1 -1
- package/dist/{chunk-THK3SCQA.js → chunk-SYXTWPX6.js} +5 -5
- package/dist/{chunk-THK3SCQA.js.map → chunk-SYXTWPX6.js.map} +1 -1
- package/dist/{chunk-XSLQYGNR.cjs → chunk-T3VU3YRQ.cjs} +69 -69
- package/dist/{chunk-XSLQYGNR.cjs.map → chunk-T3VU3YRQ.cjs.map} +1 -1
- package/dist/{chunk-MIBWA6HX.js → chunk-TR7QTODF.js} +213 -33
- package/dist/chunk-TR7QTODF.js.map +1 -0
- package/dist/{chunk-AD3NLSV5.js → chunk-TU22BFMP.js} +8 -2
- package/dist/chunk-TU22BFMP.js.map +1 -0
- package/dist/{chunk-WTMSUIRO.js → chunk-UFKYMQJ5.js} +3 -3
- package/dist/{chunk-WTMSUIRO.js.map → chunk-UFKYMQJ5.js.map} +1 -1
- package/dist/{chunk-35LDKSMM.cjs → chunk-VNJMM2QQ.cjs} +30 -30
- package/dist/{chunk-35LDKSMM.cjs.map → chunk-VNJMM2QQ.cjs.map} +1 -1
- package/dist/{chunk-53ZEBIMD.js → chunk-WB55URNM.js} +6 -6
- package/dist/{chunk-53ZEBIMD.js.map → chunk-WB55URNM.js.map} +1 -1
- package/dist/{chunk-L2GBVYRU.cjs → chunk-WWSYGZED.cjs} +11 -11
- package/dist/{chunk-L2GBVYRU.cjs.map → chunk-WWSYGZED.cjs.map} +1 -1
- package/dist/{chunk-D2JPOFRZ.cjs → chunk-WY3IFEKV.cjs} +191 -191
- package/dist/{chunk-D2JPOFRZ.cjs.map → chunk-WY3IFEKV.cjs.map} +1 -1
- package/dist/{chunk-3RSFLZ7A.cjs → chunk-Y4X6ODVY.cjs} +943 -763
- package/dist/chunk-Y4X6ODVY.cjs.map +1 -0
- package/dist/{chunk-VZRXXABW.js → chunk-YHMXF7OZ.js} +5 -5
- package/dist/{chunk-VZRXXABW.js.map → chunk-YHMXF7OZ.js.map} +1 -1
- package/dist/{chunk-VROJKWZ7.js → chunk-ZONDBN6H.js} +5 -5
- package/dist/{chunk-VROJKWZ7.js.map → chunk-ZONDBN6H.js.map} +1 -1
- package/dist/core/index.d.cts +3 -3
- package/dist/core/index.d.ts +3 -3
- package/dist/{ddl-DvW9aobX.d.ts → ddl-2q7xLM1X.d.ts} +3 -3
- package/dist/{ddl-BjuXbPfw.d.cts → ddl-D_09BfbN.d.cts} +3 -3
- package/dist/graph-extension/index.d.cts +2 -2
- package/dist/graph-extension/index.d.ts +2 -2
- package/dist/graph-merge/index.cjs +156 -156
- package/dist/graph-merge/index.d.cts +7 -7
- package/dist/graph-merge/index.d.ts +7 -7
- package/dist/graph-merge/index.js +14 -14
- package/dist/{graph-templates-1vMqlPsu.d.cts → graph-templates-B5Q7oYAA.d.cts} +2 -2
- package/dist/{graph-templates-Y52w16dH.d.ts → graph-templates-D9N-Z9kw.d.ts} +2 -2
- package/dist/index.cjs +99 -99
- package/dist/index.d.cts +10 -10
- package/dist/index.d.ts +10 -10
- package/dist/index.js +18 -18
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/{ingestion-import-target-CCKeXZbW.d.ts → ingestion-import-target-B8EU6ug2.d.ts} +1 -1
- package/dist/{ingestion-import-target-774QRgkF.d.cts → ingestion-import-target-C5sHNFJF.d.cts} +1 -1
- package/dist/interchange/index.cjs +34 -34
- package/dist/interchange/index.d.cts +7 -7
- package/dist/interchange/index.d.ts +7 -7
- package/dist/interchange/index.js +11 -11
- package/dist/{local-store-impl-DFKS7QTV.js → local-store-impl-ERPNYOCL.js} +18 -18
- package/dist/{local-store-impl-DFKS7QTV.js.map → local-store-impl-ERPNYOCL.js.map} +1 -1
- package/dist/{local-store-impl-3E4VLFCI.cjs → local-store-impl-OUINMCYI.cjs} +22 -22
- package/dist/{local-store-impl-3E4VLFCI.cjs.map → local-store-impl-OUINMCYI.cjs.map} +1 -1
- package/dist/{pglite-store-impl-N63GGBU2.js → pglite-store-impl-DUJBQZS5.js} +18 -18
- package/dist/{pglite-store-impl-N63GGBU2.js.map → pglite-store-impl-DUJBQZS5.js.map} +1 -1
- package/dist/{pglite-store-impl-T75O3LVQ.cjs → pglite-store-impl-Z3SOOP75.cjs} +22 -22
- package/dist/{pglite-store-impl-T75O3LVQ.cjs.map → pglite-store-impl-Z3SOOP75.cjs.map} +1 -1
- package/dist/{postgres-C9gitL71.d.ts → postgres-BbTYW3b_.d.ts} +3 -3
- package/dist/{postgres-BONrXHb4.d.cts → postgres-DOBXcZVg.d.cts} +1 -1
- package/dist/{postgres-DAFRdnTr.d.ts → postgres-DhZixg92.d.ts} +1 -1
- package/dist/{postgres-2FYdVYCm.d.cts → postgres-Dp3MpyJt.d.cts} +3 -3
- package/dist/{profile-CAD65CqS.d.ts → profile-Ch5SSewK.d.ts} +8 -8
- package/dist/{profile-Bmcg07Ki.d.cts → profile-DppApFgt.d.cts} +8 -8
- package/dist/profiler/index.d.cts +8 -8
- package/dist/profiler/index.d.ts +8 -8
- package/dist/provenance/index.cjs +22 -22
- package/dist/provenance/index.d.cts +6 -6
- package/dist/provenance/index.d.ts +6 -6
- package/dist/provenance/index.js +6 -6
- package/dist/{repair-validity-windows-CinP91t7.d.cts → repair-validity-windows-CpP_GpIx.d.cts} +1 -1
- package/dist/{repair-validity-windows-BJz4nffP.d.ts → repair-validity-windows-lfe275bY.d.ts} +1 -1
- package/dist/{resolve-DgOSlXx_.d.ts → resolve-CoYqHqno.d.cts} +7 -2
- package/dist/{resolve-DQXSEN_A.d.cts → resolve-DV0Iposp.d.ts} +7 -2
- package/dist/schema/index.cjs +37 -37
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +7 -7
- package/dist/{searchable-DMdCwkXO.d.cts → searchable-C7Xt6g45.d.cts} +1 -1
- package/dist/{searchable-BPRF0Bah.d.ts → searchable-KKXrPet3.d.ts} +1 -1
- package/dist/{sqlite-DgbYa-1Y.d.cts → sqlite-BkQM9ZeI.d.cts} +1 -1
- package/dist/{sqlite-Co_uIpfs.d.cts → sqlite-BpRtjC36.d.cts} +3 -3
- package/dist/{sqlite-DcDAAYow.d.ts → sqlite-CH0Zq0Qv.d.ts} +3 -3
- package/dist/{sqlite-UlG5prJQ.d.ts → sqlite-CcCSeXGg.d.ts} +1 -1
- package/dist/{store-HxoFyQMu.d.cts → store-3nfPQK5j.d.cts} +30 -7
- package/dist/{store-C9T1c9Az.d.ts → store-C8ZPl7OW.d.ts} +30 -7
- package/dist/{types-CRCyg1fJ.d.cts → types-BynPp5kU.d.cts} +18 -2
- package/dist/{types-CRCyg1fJ.d.ts → types-BynPp5kU.d.ts} +18 -2
- package/dist/{types-Dg_prBqC.d.ts → types-C9YwrkSe.d.ts} +1 -1
- package/dist/{types-B5AUesS1.d.cts → types-JG-4CG6P.d.cts} +1 -1
- package/dist/{where-gRyc3jj_.d.cts → where-D1gBDqQ_.d.cts} +1 -1
- package/dist/{where-D-NDKMPw.d.ts → where-D2GqMFp-.d.ts} +1 -1
- package/package.json +1 -1
- package/dist/chunk-337ONI2I.js.map +0 -1
- package/dist/chunk-3KWF25MF.cjs.map +0 -1
- package/dist/chunk-3RSFLZ7A.cjs.map +0 -1
- package/dist/chunk-AD3NLSV5.js.map +0 -1
- package/dist/chunk-BWQA3POT.cjs.map +0 -1
- package/dist/chunk-MIBWA6HX.js.map +0 -1
- package/dist/chunk-OC5ROP7V.cjs.map +0 -1
- package/dist/chunk-PFXNQFFY.js.map +0 -1
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunk6B3LQUYG_cjs = require('./chunk-6B3LQUYG.cjs');
|
|
4
|
+
var chunk5JOCIMQ3_cjs = require('./chunk-5JOCIMQ3.cjs');
|
|
5
|
+
var chunk6JRVV2SS_cjs = require('./chunk-6JRVV2SS.cjs');
|
|
6
6
|
var chunk5ICDVLI3_cjs = require('./chunk-5ICDVLI3.cjs');
|
|
7
7
|
var chunkL4L4AV6F_cjs = require('./chunk-L4L4AV6F.cjs');
|
|
8
8
|
var chunkDOADEZA6_cjs = require('./chunk-DOADEZA6.cjs');
|
|
@@ -99,7 +99,7 @@ function spanningDifferentAssertion(assertions, first, second) {
|
|
|
99
99
|
// src/identity/sql-target.ts
|
|
100
100
|
var MAX_REFERENCE_CHUNK_SIZE = 200;
|
|
101
101
|
function identityChunkSize(target, input) {
|
|
102
|
-
const parameterLimit =
|
|
102
|
+
const parameterLimit = chunk6B3LQUYG_cjs.recordedBindParamBudget(target);
|
|
103
103
|
const chunkSize = Math.floor(
|
|
104
104
|
(parameterLimit - input.fixedParameters) / input.parametersPerItem
|
|
105
105
|
);
|
|
@@ -145,7 +145,7 @@ async function executeIdentityStatement(target, statement) {
|
|
|
145
145
|
try {
|
|
146
146
|
await target.executeStatement(chunkXPSPDFKO_cjs.asCompiledStatementSql(statement));
|
|
147
147
|
} catch (error) {
|
|
148
|
-
if (!
|
|
148
|
+
if (!chunk6JRVV2SS_cjs.isSqliteStaleSnapshotError(error)) throw error;
|
|
149
149
|
throw identityWriterSlotError(error);
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -198,8 +198,8 @@ function publicNodeRef(ref) {
|
|
|
198
198
|
}
|
|
199
199
|
var IDENTITY_ADVISORY_LOCK_NAMESPACE = "typegraph:identity";
|
|
200
200
|
async function lockIdentityGraph(target, graphId) {
|
|
201
|
-
const plan =
|
|
202
|
-
const fence =
|
|
201
|
+
const plan = chunk6JRVV2SS_cjs.resolveWriteFencePlan(target);
|
|
202
|
+
const fence = chunk6JRVV2SS_cjs.requireWriteFence(plan, "identity graph lock", "keyed");
|
|
203
203
|
switch (fence.kind) {
|
|
204
204
|
case "lock":
|
|
205
205
|
case "row": {
|
|
@@ -217,8 +217,8 @@ async function lockIdentityGraph(target, graphId) {
|
|
|
217
217
|
}
|
|
218
218
|
}
|
|
219
219
|
async function lockIdentityEnablementNodes(target, schema) {
|
|
220
|
-
const plan =
|
|
221
|
-
const fence =
|
|
220
|
+
const plan = chunk6JRVV2SS_cjs.resolveWriteFencePlan(target);
|
|
221
|
+
const fence = chunk6JRVV2SS_cjs.requireWriteFence(plan, "identity enablement drain", "drain");
|
|
222
222
|
switch (fence.kind) {
|
|
223
223
|
case "lock":
|
|
224
224
|
case "row": {
|
|
@@ -227,7 +227,7 @@ async function lockIdentityEnablementNodes(target, schema) {
|
|
|
227
227
|
}
|
|
228
228
|
await executeIdentityStatement(
|
|
229
229
|
target,
|
|
230
|
-
|
|
230
|
+
chunk6JRVV2SS_cjs.requireFenceLockTables(fence, "lockIdentityEnablementNodes")(
|
|
231
231
|
[schema.tables.nodes],
|
|
232
232
|
"share"
|
|
233
233
|
)
|
|
@@ -241,10 +241,10 @@ async function lockIdentityEnablementNodes(target, schema) {
|
|
|
241
241
|
}
|
|
242
242
|
}
|
|
243
243
|
async function loadNodeSnapshot(target, schema, graphId, coordinate) {
|
|
244
|
-
const sqlCoordinate =
|
|
244
|
+
const sqlCoordinate = chunk6B3LQUYG_cjs.identitySqlCoordinate(coordinate, chunkL4L4AV6F_cjs.nowIso());
|
|
245
245
|
const rows = await target.execute(
|
|
246
246
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(
|
|
247
|
-
|
|
247
|
+
chunk6B3LQUYG_cjs.identityNodeSnapshotSource(schema, graphId, sqlCoordinate)
|
|
248
248
|
)
|
|
249
249
|
);
|
|
250
250
|
return rows.map((row) => ({
|
|
@@ -270,7 +270,7 @@ async function loadCurrentStructuralClasses(target, schema, graphId, references)
|
|
|
270
270
|
});
|
|
271
271
|
if (uniqueReferences.length > chunkSize) {
|
|
272
272
|
const combined = /* @__PURE__ */ new Map();
|
|
273
|
-
for (const refChunk of
|
|
273
|
+
for (const refChunk of chunk5JOCIMQ3_cjs.chunk(uniqueReferences, chunkSize)) {
|
|
274
274
|
const classes2 = await loadCurrentStructuralClasses(
|
|
275
275
|
target,
|
|
276
276
|
schema,
|
|
@@ -334,7 +334,7 @@ async function loadCurrentStructuralClassComponents(target, schema, graphId, ref
|
|
|
334
334
|
parametersPerItem: 2
|
|
335
335
|
});
|
|
336
336
|
const combined = /* @__PURE__ */ new Map();
|
|
337
|
-
for (const refChunk of
|
|
337
|
+
for (const refChunk of chunk5JOCIMQ3_cjs.chunk(uniqueReferences, chunkSize)) {
|
|
338
338
|
const seedRows = chunkXPSPDFKO_cjs.sql.join(
|
|
339
339
|
refChunk.map((ref) => chunkXPSPDFKO_cjs.sql`(${ref.kind}, ${ref.id})`),
|
|
340
340
|
chunkXPSPDFKO_cjs.sql`, `
|
|
@@ -383,7 +383,7 @@ async function loadCurrentStructuralClassComponents(target, schema, graphId, ref
|
|
|
383
383
|
}
|
|
384
384
|
async function loadCurrentVisibleMembers(target, schema, graphId, ref) {
|
|
385
385
|
const now = chunkL4L4AV6F_cjs.nowIso();
|
|
386
|
-
const coordinate =
|
|
386
|
+
const coordinate = chunk6B3LQUYG_cjs.identitySqlCoordinate(void 0, now);
|
|
387
387
|
const rows = await target.execute(
|
|
388
388
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
389
389
|
WITH anchor AS (
|
|
@@ -409,7 +409,7 @@ async function loadCurrentVisibleMembers(target, schema, graphId, ref) {
|
|
|
409
409
|
WHERE n.graph_id = ${graphId}
|
|
410
410
|
AND n.kind = m.kind
|
|
411
411
|
AND n.id = m.id
|
|
412
|
-
AND ${
|
|
412
|
+
AND ${chunk6B3LQUYG_cjs.identityNodeVisibilitySql(coordinate, "n")}
|
|
413
413
|
`)
|
|
414
414
|
);
|
|
415
415
|
const members = rows.map((row) => ({ kind: row.kind, id: row.id })).toSorted((left, right) => compareReferences(left, right));
|
|
@@ -444,7 +444,7 @@ async function loadHistoricalClasses(target, schema, graphId, references, coordi
|
|
|
444
444
|
});
|
|
445
445
|
if (uniqueReferences.length > chunkSize) {
|
|
446
446
|
const combined = /* @__PURE__ */ new Map();
|
|
447
|
-
for (const refChunk of
|
|
447
|
+
for (const refChunk of chunk5JOCIMQ3_cjs.chunk(uniqueReferences, chunkSize)) {
|
|
448
448
|
const classes = await loadHistoricalClasses(
|
|
449
449
|
target,
|
|
450
450
|
schema,
|
|
@@ -458,18 +458,18 @@ async function loadHistoricalClasses(target, schema, graphId, references, coordi
|
|
|
458
458
|
return combined;
|
|
459
459
|
}
|
|
460
460
|
const currentInstant = chunkL4L4AV6F_cjs.nowIso();
|
|
461
|
-
const sqlCoordinate =
|
|
461
|
+
const sqlCoordinate = chunk6B3LQUYG_cjs.identitySqlCoordinate(coordinate, currentInstant);
|
|
462
462
|
const seeds = chunkXPSPDFKO_cjs.sql.join(
|
|
463
463
|
uniqueReferences.map((ref) => chunkXPSPDFKO_cjs.sql`(${ref.kind}, ${ref.id})`),
|
|
464
464
|
chunkXPSPDFKO_cjs.sql`, `
|
|
465
465
|
);
|
|
466
|
-
const reconstruction =
|
|
466
|
+
const reconstruction = chunk6B3LQUYG_cjs.historicalIdentityReconstructionCtes({
|
|
467
467
|
schema,
|
|
468
468
|
graphId,
|
|
469
469
|
coordinate: sqlCoordinate,
|
|
470
470
|
seedSource: chunkXPSPDFKO_cjs.sql`VALUES ${seeds}`,
|
|
471
471
|
sameIdAcrossKinds,
|
|
472
|
-
recursiveTraversal:
|
|
472
|
+
recursiveTraversal: chunk6JRVV2SS_cjs.resolveRecursiveTraversal(target.capabilities)
|
|
473
473
|
});
|
|
474
474
|
const rows = await target.execute(
|
|
475
475
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
@@ -477,7 +477,7 @@ async function loadHistoricalClasses(target, schema, graphId, references, coordi
|
|
|
477
477
|
${reconstruction}
|
|
478
478
|
SELECT member.seed_kind, member.seed_id,
|
|
479
479
|
member.kind AS member_kind, member.id AS member_id,
|
|
480
|
-
CASE WHEN ${
|
|
480
|
+
CASE WHEN ${chunk6B3LQUYG_cjs.identityNodeVisibilitySql(sqlCoordinate, "n")}
|
|
481
481
|
THEN 1 ELSE 0 END AS is_visible
|
|
482
482
|
FROM identity_members member
|
|
483
483
|
JOIN node_snapshot n ON n.kind = member.kind AND n.id = member.id
|
|
@@ -528,10 +528,10 @@ function visibleMembersAtCoordinate(ctx, ref) {
|
|
|
528
528
|
);
|
|
529
529
|
}
|
|
530
530
|
async function loadAssertions(target, schema, graphId, coordinate, currentInstant) {
|
|
531
|
-
const source =
|
|
531
|
+
const source = chunk6B3LQUYG_cjs.identityAssertionSnapshotSource(
|
|
532
532
|
schema,
|
|
533
533
|
graphId,
|
|
534
|
-
|
|
534
|
+
chunk6B3LQUYG_cjs.identitySqlCoordinate(coordinate, currentInstant),
|
|
535
535
|
void 0
|
|
536
536
|
);
|
|
537
537
|
const rows = await target.execute(
|
|
@@ -557,7 +557,7 @@ async function loadAssertionsTouching(target, schema, graphId, references, coord
|
|
|
557
557
|
});
|
|
558
558
|
if (references.length > chunkSize) {
|
|
559
559
|
const byId = /* @__PURE__ */ new Map();
|
|
560
|
-
for (const refChunk of
|
|
560
|
+
for (const refChunk of chunk5JOCIMQ3_cjs.chunk(references, chunkSize)) {
|
|
561
561
|
const assertions = await loadAssertionsTouching(
|
|
562
562
|
target,
|
|
563
563
|
schema,
|
|
@@ -570,10 +570,10 @@ async function loadAssertionsTouching(target, schema, graphId, references, coord
|
|
|
570
570
|
}
|
|
571
571
|
return [...byId.values()];
|
|
572
572
|
}
|
|
573
|
-
const source =
|
|
573
|
+
const source = chunk6B3LQUYG_cjs.identityAssertionSnapshotSource(
|
|
574
574
|
schema,
|
|
575
575
|
graphId,
|
|
576
|
-
|
|
576
|
+
chunk6B3LQUYG_cjs.identitySqlCoordinate(coordinate, chunkL4L4AV6F_cjs.nowIso()),
|
|
577
577
|
relation
|
|
578
578
|
);
|
|
579
579
|
const aMatches = referenceCondition(
|
|
@@ -588,7 +588,7 @@ async function loadAssertionsTouching(target, schema, graphId, references, coord
|
|
|
588
588
|
);
|
|
589
589
|
const rows = await target.execute(
|
|
590
590
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
591
|
-
SELECT ${
|
|
591
|
+
SELECT ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
592
592
|
FROM (${source}) identity_assertions
|
|
593
593
|
WHERE ${aMatches} OR ${bMatches}
|
|
594
594
|
`)
|
|
@@ -1036,7 +1036,7 @@ async function loadLiveReferences(target, schema, graphId, references) {
|
|
|
1036
1036
|
});
|
|
1037
1037
|
if (references.length > chunkSize) {
|
|
1038
1038
|
const byKey = /* @__PURE__ */ new Map();
|
|
1039
|
-
for (const refChunk of
|
|
1039
|
+
for (const refChunk of chunk5JOCIMQ3_cjs.chunk(references, chunkSize)) {
|
|
1040
1040
|
const live = await loadLiveReferences(target, schema, graphId, refChunk);
|
|
1041
1041
|
for (const ref of live) byKey.set(refKey(ref), ref);
|
|
1042
1042
|
}
|
|
@@ -1074,7 +1074,7 @@ async function requireStructuralEndpoints(target, schema, graphId, references) {
|
|
|
1074
1074
|
parametersPerItem: 2
|
|
1075
1075
|
});
|
|
1076
1076
|
const presentKeys = /* @__PURE__ */ new Set();
|
|
1077
|
-
for (const refChunk of
|
|
1077
|
+
for (const refChunk of chunk5JOCIMQ3_cjs.chunk(unique, chunkSize)) {
|
|
1078
1078
|
const matches = referenceCondition(chunkXPSPDFKO_cjs.sql`kind`, chunkXPSPDFKO_cjs.sql`id`, refChunk);
|
|
1079
1079
|
const rows = await target.execute(
|
|
1080
1080
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
@@ -1139,7 +1139,7 @@ async function deleteSeparationForClassKeys(target, schema, graphId, classKeys)
|
|
|
1139
1139
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
1140
1140
|
parametersPerItem: 2
|
|
1141
1141
|
});
|
|
1142
|
-
for (const keyChunk of
|
|
1142
|
+
for (const keyChunk of chunk5JOCIMQ3_cjs.chunk(unique, chunkSize)) {
|
|
1143
1143
|
const keyList = chunkXPSPDFKO_cjs.sql.join(
|
|
1144
1144
|
keyChunk.map((key) => chunkXPSPDFKO_cjs.sql`${key}`),
|
|
1145
1145
|
chunkXPSPDFKO_cjs.sql`, `
|
|
@@ -1206,7 +1206,7 @@ async function probeSeparationPair(target, schema, graphId, pair) {
|
|
|
1206
1206
|
pairSeparated: countOf(row, "pair_rows") > 0
|
|
1207
1207
|
};
|
|
1208
1208
|
} catch (error) {
|
|
1209
|
-
if (!
|
|
1209
|
+
if (!chunk6JRVV2SS_cjs.isMissingTableError(error)) throw error;
|
|
1210
1210
|
throw separationUnreadableError(graphId, schema, error);
|
|
1211
1211
|
}
|
|
1212
1212
|
}
|
|
@@ -1267,7 +1267,7 @@ async function hasLiveDifferentAssertions(target, schema, graphId, registry) {
|
|
|
1267
1267
|
if (!await probeAnyLiveDifferent(target, schema, graphId)) return false;
|
|
1268
1268
|
const activeKinds = [...identityActiveKinds(registry)];
|
|
1269
1269
|
if (activeKinds.length === 0) return false;
|
|
1270
|
-
const kindChunks =
|
|
1270
|
+
const kindChunks = chunk5JOCIMQ3_cjs.chunk(activeKinds, owedProbeChunkSize(target));
|
|
1271
1271
|
for (const first of kindChunks) {
|
|
1272
1272
|
for (const second of kindChunks) {
|
|
1273
1273
|
if (await probeOwedSeparation(target, schema, graphId, [first, second])) {
|
|
@@ -1323,10 +1323,10 @@ function owedProbeChunkSize(target) {
|
|
|
1323
1323
|
});
|
|
1324
1324
|
}
|
|
1325
1325
|
function liveDifferentSource(schema, graphId) {
|
|
1326
|
-
return
|
|
1326
|
+
return chunk6B3LQUYG_cjs.identityAssertionSnapshotSource(
|
|
1327
1327
|
schema,
|
|
1328
1328
|
graphId,
|
|
1329
|
-
|
|
1329
|
+
chunk6B3LQUYG_cjs.identitySqlCoordinate(void 0, chunkL4L4AV6F_cjs.nowIso()),
|
|
1330
1330
|
"different"
|
|
1331
1331
|
);
|
|
1332
1332
|
}
|
|
@@ -1355,7 +1355,7 @@ async function insertSeparationRows(target, schema, graphId, projection) {
|
|
|
1355
1355
|
maxItems: MAX_SEPARATION_INSERT_CHUNK_SIZE,
|
|
1356
1356
|
parametersPerItem: 3
|
|
1357
1357
|
});
|
|
1358
|
-
for (const pairChunk of
|
|
1358
|
+
for (const pairChunk of chunk5JOCIMQ3_cjs.chunk(projection.pairs, chunkSize)) {
|
|
1359
1359
|
const values = pairChunk.map(
|
|
1360
1360
|
(pair) => chunkXPSPDFKO_cjs.sql`(${graphId}, ${pair.low}, ${pair.high})`
|
|
1361
1361
|
);
|
|
@@ -1515,7 +1515,7 @@ async function validateCurrentRelation(ctx, target, relation, operation, a, b) {
|
|
|
1515
1515
|
async function currentAssertionForPair(target, schema, graphId, relation, a, b) {
|
|
1516
1516
|
const rows = await target.execute(
|
|
1517
1517
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
1518
|
-
SELECT ${
|
|
1518
|
+
SELECT ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
1519
1519
|
FROM ${schema.identityAssertionsTable}
|
|
1520
1520
|
WHERE graph_id = ${graphId}
|
|
1521
1521
|
AND rel = ${relation}
|
|
@@ -1534,7 +1534,7 @@ async function assertionForExactWindow(target, schema, graphId, relation, a, b,
|
|
|
1534
1534
|
const validToMatch = window.validTo === void 0 ? chunkXPSPDFKO_cjs.sql`valid_to IS NULL` : chunkXPSPDFKO_cjs.sql`valid_to = ${window.validTo}`;
|
|
1535
1535
|
const rows = await target.execute(
|
|
1536
1536
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
1537
|
-
SELECT ${
|
|
1537
|
+
SELECT ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
1538
1538
|
FROM ${schema.identityAssertionsTable}
|
|
1539
1539
|
WHERE graph_id = ${graphId}
|
|
1540
1540
|
AND rel = ${relation}
|
|
@@ -1566,7 +1566,7 @@ async function insertAssertion(target, schema, graphId, relation, a, b, operatio
|
|
|
1566
1566
|
function buildAssertionRow(graphId, relation, a, b, timestamp, options) {
|
|
1567
1567
|
return {
|
|
1568
1568
|
graph_id: graphId,
|
|
1569
|
-
id: options?.id ??
|
|
1569
|
+
id: options?.id ?? chunk6B3LQUYG_cjs.generateId(),
|
|
1570
1570
|
rel: relation,
|
|
1571
1571
|
a_kind: a.kind,
|
|
1572
1572
|
a_id: a.id,
|
|
@@ -1621,7 +1621,7 @@ function windowOverlapSql(alias, lowerBoundary, upperBoundary) {
|
|
|
1621
1621
|
`;
|
|
1622
1622
|
}
|
|
1623
1623
|
async function loadIdentityWindowLedger(input) {
|
|
1624
|
-
|
|
1624
|
+
chunk6JRVV2SS_cjs.assertRecursiveTraversal(
|
|
1625
1625
|
input.recursiveTraversal,
|
|
1626
1626
|
"identity window ledger read"
|
|
1627
1627
|
);
|
|
@@ -1656,7 +1656,7 @@ async function loadIdentityWindowLedger(input) {
|
|
|
1656
1656
|
parametersPerItem: 2
|
|
1657
1657
|
});
|
|
1658
1658
|
const rows = [];
|
|
1659
|
-
for (const referenceChunk of
|
|
1659
|
+
for (const referenceChunk of chunk5JOCIMQ3_cjs.chunk(references, seedChunkSize)) {
|
|
1660
1660
|
const seedRows = chunkXPSPDFKO_cjs.sql.join(
|
|
1661
1661
|
referenceChunk.map(
|
|
1662
1662
|
(reference) => chunkXPSPDFKO_cjs.sql`(${reference.kind}, ${reference.id})`
|
|
@@ -1735,7 +1735,7 @@ async function loadIdentityWindowLedger(input) {
|
|
|
1735
1735
|
WHERE assertion.graph_id = ${graphId}
|
|
1736
1736
|
AND ${windowOverlapSql("assertion", lowerBoundary, upperBoundary)}
|
|
1737
1737
|
)
|
|
1738
|
-
SELECT 'assertion' AS row_type, ${
|
|
1738
|
+
SELECT 'assertion' AS row_type, ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS},
|
|
1739
1739
|
NULL AS node_kind, NULL AS node_id,
|
|
1740
1740
|
NULL AS node_created_at, NULL AS node_deleted_at
|
|
1741
1741
|
FROM selected_assertions
|
|
@@ -1881,7 +1881,7 @@ async function createIdentityWindowValidator(ctx, target, requests, operationIns
|
|
|
1881
1881
|
requests,
|
|
1882
1882
|
operationInstant,
|
|
1883
1883
|
sameIdAcrossKinds: ctx.sameIdAcrossKinds,
|
|
1884
|
-
recursiveTraversal:
|
|
1884
|
+
recursiveTraversal: chunk6JRVV2SS_cjs.resolveRecursiveTraversal(target.capabilities)
|
|
1885
1885
|
});
|
|
1886
1886
|
if (ignoredAssertionIds.size > 0) {
|
|
1887
1887
|
const retained = ledger.assertions.filter(
|
|
@@ -1927,7 +1927,7 @@ async function insertAssertionRows(target, schema, rows) {
|
|
|
1927
1927
|
maxItems: MAX_ASSERTION_INSERT_CHUNK_SIZE,
|
|
1928
1928
|
parametersPerItem: 14
|
|
1929
1929
|
});
|
|
1930
|
-
for (const rowChunk of
|
|
1930
|
+
for (const rowChunk of chunk5JOCIMQ3_cjs.chunk(rows, chunkSize)) {
|
|
1931
1931
|
const values = rowChunk.map(
|
|
1932
1932
|
(row) => chunkXPSPDFKO_cjs.sql`
|
|
1933
1933
|
(
|
|
@@ -1944,7 +1944,7 @@ async function insertAssertionRows(target, schema, rows) {
|
|
|
1944
1944
|
await executeIdentityStatement(
|
|
1945
1945
|
target,
|
|
1946
1946
|
chunkXPSPDFKO_cjs.sql`
|
|
1947
|
-
INSERT INTO ${schema.identityAssertionsTable} (${
|
|
1947
|
+
INSERT INTO ${schema.identityAssertionsTable} (${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}) VALUES ${chunkXPSPDFKO_cjs.sql.join(values, chunkXPSPDFKO_cjs.sql`, `)}
|
|
1948
1948
|
`
|
|
1949
1949
|
);
|
|
1950
1950
|
}
|
|
@@ -1958,14 +1958,14 @@ async function loadAssertionsByIds(target, schema, graphId, ids) {
|
|
|
1958
1958
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
1959
1959
|
parametersPerItem: 1
|
|
1960
1960
|
});
|
|
1961
|
-
for (const idChunk of
|
|
1961
|
+
for (const idChunk of chunk5JOCIMQ3_cjs.chunk(uniqueIds, chunkSize)) {
|
|
1962
1962
|
const idList = chunkXPSPDFKO_cjs.sql.join(
|
|
1963
1963
|
idChunk.map((id) => chunkXPSPDFKO_cjs.sql`${id}`),
|
|
1964
1964
|
chunkXPSPDFKO_cjs.sql`, `
|
|
1965
1965
|
);
|
|
1966
1966
|
const rows = await target.execute(
|
|
1967
1967
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
1968
|
-
SELECT ${
|
|
1968
|
+
SELECT ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
1969
1969
|
FROM ${schema.identityAssertionsTable}
|
|
1970
1970
|
WHERE graph_id = ${graphId} AND id IN (${idList})
|
|
1971
1971
|
`)
|
|
@@ -1987,7 +1987,7 @@ async function loadCurrentClassAnchors(target, schema, graphId, references) {
|
|
|
1987
1987
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
1988
1988
|
parametersPerItem: 2
|
|
1989
1989
|
});
|
|
1990
|
-
for (const refChunk of
|
|
1990
|
+
for (const refChunk of chunk5JOCIMQ3_cjs.chunk(uniqueReferences, chunkSize)) {
|
|
1991
1991
|
const seedRows = chunkXPSPDFKO_cjs.sql.join(
|
|
1992
1992
|
refChunk.map((ref) => chunkXPSPDFKO_cjs.sql`(${ref.kind}, ${ref.id})`),
|
|
1993
1993
|
chunkXPSPDFKO_cjs.sql`, `
|
|
@@ -2121,7 +2121,7 @@ async function insertClosureComponents(target, schema, graphId, components) {
|
|
|
2121
2121
|
maxItems: MAX_CLOSURE_INSERT_CHUNK_SIZE,
|
|
2122
2122
|
parametersPerItem: 5
|
|
2123
2123
|
});
|
|
2124
|
-
for (const valueChunk of
|
|
2124
|
+
for (const valueChunk of chunk5JOCIMQ3_cjs.chunk(values, chunkSize)) {
|
|
2125
2125
|
await executeIdentityStatement(
|
|
2126
2126
|
target,
|
|
2127
2127
|
chunkXPSPDFKO_cjs.sql`
|
|
@@ -2164,7 +2164,7 @@ async function replaceAffectedClosure(target, schema, graphId, references, sameI
|
|
|
2164
2164
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
2165
2165
|
parametersPerItem: 2
|
|
2166
2166
|
});
|
|
2167
|
-
for (const affectedChunk of
|
|
2167
|
+
for (const affectedChunk of chunk5JOCIMQ3_cjs.chunk(affected, chunkSize)) {
|
|
2168
2168
|
const matches = referenceCondition(
|
|
2169
2169
|
chunkXPSPDFKO_cjs.sql`member_kind`,
|
|
2170
2170
|
chunkXPSPDFKO_cjs.sql`member_id`,
|
|
@@ -2597,7 +2597,7 @@ async function bulkAssertWindowedPairs(ctx, target, relation, pairs, touch, oper
|
|
|
2597
2597
|
async function findCurrentAssertionById(target, schema, graphId, id) {
|
|
2598
2598
|
const rows = await target.execute(
|
|
2599
2599
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
2600
|
-
SELECT ${
|
|
2600
|
+
SELECT ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
2601
2601
|
FROM ${schema.identityAssertionsTable}
|
|
2602
2602
|
WHERE graph_id = ${graphId}
|
|
2603
2603
|
AND id = ${id}
|
|
@@ -2641,14 +2641,14 @@ async function retractCurrentAssertions(ctx, target, ids, touch, resolveValidTo)
|
|
|
2641
2641
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
2642
2642
|
parametersPerItem: 1
|
|
2643
2643
|
});
|
|
2644
|
-
for (const idChunk of
|
|
2644
|
+
for (const idChunk of chunk5JOCIMQ3_cjs.chunk(uniqueIds, readChunkSize)) {
|
|
2645
2645
|
const placeholders = chunkXPSPDFKO_cjs.sql.join(
|
|
2646
2646
|
idChunk.map((id) => chunkXPSPDFKO_cjs.sql`${id}`),
|
|
2647
2647
|
chunkXPSPDFKO_cjs.sql`, `
|
|
2648
2648
|
);
|
|
2649
2649
|
const rows = await target.execute(
|
|
2650
2650
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
2651
|
-
SELECT ${
|
|
2651
|
+
SELECT ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
2652
2652
|
FROM ${ctx.schema.identityAssertionsTable}
|
|
2653
2653
|
WHERE graph_id = ${ctx.graphId}
|
|
2654
2654
|
AND id IN (${placeholders})
|
|
@@ -2675,7 +2675,7 @@ async function retractCurrentAssertions(ctx, target, ids, touch, resolveValidTo)
|
|
|
2675
2675
|
parametersPerItem: 1
|
|
2676
2676
|
});
|
|
2677
2677
|
for (const [validTo, ids2] of byValidTo) {
|
|
2678
|
-
for (const idChunk of
|
|
2678
|
+
for (const idChunk of chunk5JOCIMQ3_cjs.chunk(ids2, updateChunkSize)) {
|
|
2679
2679
|
const placeholders = chunkXPSPDFKO_cjs.sql.join(
|
|
2680
2680
|
idChunk.map((id) => chunkXPSPDFKO_cjs.sql`${id}`),
|
|
2681
2681
|
chunkXPSPDFKO_cjs.sql`, `
|
|
@@ -2749,7 +2749,7 @@ async function retractPlannedAssertions(ctx, target, retractions, touch) {
|
|
|
2749
2749
|
}
|
|
2750
2750
|
async function runIdentityMutation(ctx, fn) {
|
|
2751
2751
|
const touchedBox = { touched: false };
|
|
2752
|
-
return
|
|
2752
|
+
return chunk6B3LQUYG_cjs.runInWriteTransaction(
|
|
2753
2753
|
{
|
|
2754
2754
|
graphId: ctx.graphId,
|
|
2755
2755
|
schemaVersion: ctx.schemaVersion,
|
|
@@ -2761,7 +2761,7 @@ async function runIdentityMutation(ctx, fn) {
|
|
|
2761
2761
|
async (target) => {
|
|
2762
2762
|
touchedBox.touched = false;
|
|
2763
2763
|
await lockIdentityGraph(target, ctx.graphId);
|
|
2764
|
-
return
|
|
2764
|
+
return chunk6B3LQUYG_cjs.withRecordedIdentityMutationTarget(
|
|
2765
2765
|
target,
|
|
2766
2766
|
(rawTarget, touch) => fn(
|
|
2767
2767
|
rawTarget,
|
|
@@ -3202,7 +3202,7 @@ function rethrowTaggedWithAssertion(error, assertionId, progress) {
|
|
|
3202
3202
|
async function importIdentityAssertionsIntoTarget(ctx, target, assertions, mode, ignoredAssertionIds = /* @__PURE__ */ new Set()) {
|
|
3203
3203
|
let created = 0;
|
|
3204
3204
|
let skipped = 0;
|
|
3205
|
-
await
|
|
3205
|
+
await chunk6B3LQUYG_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget, touch) => {
|
|
3206
3206
|
const operationInstant = chunkL4L4AV6F_cjs.nowIso();
|
|
3207
3207
|
const normalized = assertions.map((assertion) => ({
|
|
3208
3208
|
assertion,
|
|
@@ -3435,13 +3435,13 @@ async function applyIdentityChangesForContext(ctx, retractions, assertions) {
|
|
|
3435
3435
|
// src/identity/service-maintenance.ts
|
|
3436
3436
|
function requireAtomicIdentityBackend(backend, graphId) {
|
|
3437
3437
|
if (!backend.capabilities.execution.interactiveTransactions) {
|
|
3438
|
-
const verdict =
|
|
3438
|
+
const verdict = chunk5JOCIMQ3_cjs.resolveBatchWriteVerdict(backend, { needs: "identity" });
|
|
3439
3439
|
throw new chunk7XYPLAPL_cjs.ConfigurationError(
|
|
3440
|
-
"Operational Identity requires atomic transaction support." +
|
|
3440
|
+
"Operational Identity requires atomic transaction support." + chunk5JOCIMQ3_cjs.batchRefusalSuffix(verdict),
|
|
3441
3441
|
{
|
|
3442
3442
|
code: "IDENTITY_REQUIRES_ATOMIC_BACKEND",
|
|
3443
3443
|
graphId,
|
|
3444
|
-
...
|
|
3444
|
+
...chunk5JOCIMQ3_cjs.batchRefusalDetails(verdict)
|
|
3445
3445
|
}
|
|
3446
3446
|
);
|
|
3447
3447
|
}
|
|
@@ -3457,7 +3457,7 @@ async function rebuildIdentityClosureForContext(ctx) {
|
|
|
3457
3457
|
requireAtomicIdentityBackend(ctx.backend, ctx.graphId);
|
|
3458
3458
|
async function rebuildAtTarget(target) {
|
|
3459
3459
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3460
|
-
await
|
|
3460
|
+
await chunk6B3LQUYG_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget) => {
|
|
3461
3461
|
const activeKinds = identityActiveKinds(ctx.registry);
|
|
3462
3462
|
const snapshot = await loadSnapshot(
|
|
3463
3463
|
rawTarget,
|
|
@@ -3649,7 +3649,7 @@ async function assertAffectedIdentityClassesConsistent(ctx, target, seeds) {
|
|
|
3649
3649
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3650
3650
|
const observed = await findAffectedClassInconsistency(ctx, target, seeds);
|
|
3651
3651
|
if (observed === void 0) return;
|
|
3652
|
-
await
|
|
3652
|
+
await chunk6B3LQUYG_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget) => {
|
|
3653
3653
|
await replaceClosure(
|
|
3654
3654
|
rawTarget,
|
|
3655
3655
|
ctx.schema,
|
|
@@ -3672,14 +3672,14 @@ async function deleteAssertionsTouchingKinds(target, schema, graphId, kinds, tou
|
|
|
3672
3672
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
3673
3673
|
parametersPerItem: 2
|
|
3674
3674
|
});
|
|
3675
|
-
for (const kindChunk of
|
|
3675
|
+
for (const kindChunk of chunk5JOCIMQ3_cjs.chunk(removedKinds, kindChunkSize)) {
|
|
3676
3676
|
const kindList2 = chunkXPSPDFKO_cjs.sql.join(
|
|
3677
3677
|
kindChunk.map((kind) => chunkXPSPDFKO_cjs.sql`${kind}`),
|
|
3678
3678
|
chunkXPSPDFKO_cjs.sql`, `
|
|
3679
3679
|
);
|
|
3680
3680
|
const rows = await target.execute(
|
|
3681
3681
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
3682
|
-
SELECT ${
|
|
3682
|
+
SELECT ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
3683
3683
|
FROM ${schema.identityAssertionsTable}
|
|
3684
3684
|
WHERE graph_id = ${graphId}
|
|
3685
3685
|
AND (a_kind IN (${kindList2}) OR b_kind IN (${kindList2}))
|
|
@@ -3696,7 +3696,7 @@ async function deleteAssertionsTouchingKinds(target, schema, graphId, kinds, tou
|
|
|
3696
3696
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
3697
3697
|
parametersPerItem: 1
|
|
3698
3698
|
});
|
|
3699
|
-
for (const idChunk of
|
|
3699
|
+
for (const idChunk of chunk5JOCIMQ3_cjs.chunk(ids, idChunkSize)) {
|
|
3700
3700
|
const idList = chunkXPSPDFKO_cjs.sql.join(
|
|
3701
3701
|
idChunk.map((id) => chunkXPSPDFKO_cjs.sql`${id}`),
|
|
3702
3702
|
chunkXPSPDFKO_cjs.sql`, `
|
|
@@ -3720,7 +3720,7 @@ async function hasAssertionsTouchingKinds(target, schema, graphId, kinds) {
|
|
|
3720
3720
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
3721
3721
|
parametersPerItem: 2
|
|
3722
3722
|
});
|
|
3723
|
-
for (const kindChunk of
|
|
3723
|
+
for (const kindChunk of chunk5JOCIMQ3_cjs.chunk(probedKinds, kindChunkSize)) {
|
|
3724
3724
|
const kindList2 = chunkXPSPDFKO_cjs.sql.join(
|
|
3725
3725
|
kindChunk.map((kind) => chunkXPSPDFKO_cjs.sql`${kind}`),
|
|
3726
3726
|
chunkXPSPDFKO_cjs.sql`, `
|
|
@@ -3790,7 +3790,7 @@ async function liveNodeKindsSharingIds(ctx, target, ids) {
|
|
|
3790
3790
|
maxItems: MAX_REFERENCE_CHUNK_SIZE,
|
|
3791
3791
|
parametersPerItem: 1
|
|
3792
3792
|
});
|
|
3793
|
-
for (const idChunk of
|
|
3793
|
+
for (const idChunk of chunk5JOCIMQ3_cjs.chunk(uniqueIds, chunkSize)) {
|
|
3794
3794
|
const idList = chunkXPSPDFKO_cjs.sql.join(
|
|
3795
3795
|
idChunk.map((id) => chunkXPSPDFKO_cjs.sql`${id}`),
|
|
3796
3796
|
chunkXPSPDFKO_cjs.sql`, `
|
|
@@ -3816,7 +3816,7 @@ async function liveNodeKindsSharingIds(ctx, target, ids) {
|
|
|
3816
3816
|
async function foldIdentityForCreatedNodes(ctx, target, references) {
|
|
3817
3817
|
if (references.length === 0 || ctx.sameIdAcrossKinds === "ignore") return;
|
|
3818
3818
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3819
|
-
await
|
|
3819
|
+
await chunk6B3LQUYG_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget) => {
|
|
3820
3820
|
const liveKindsById = await liveNodeKindsSharingIds(
|
|
3821
3821
|
ctx,
|
|
3822
3822
|
rawTarget,
|
|
@@ -3884,7 +3884,7 @@ async function readNodeDeletionInstant(target, schema, graphId, ref) {
|
|
|
3884
3884
|
async function requireNodeValidityEndCompatible(ctx, target, ref, validTo) {
|
|
3885
3885
|
const rows = await target.execute(
|
|
3886
3886
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
3887
|
-
SELECT ${
|
|
3887
|
+
SELECT ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
3888
3888
|
FROM ${ctx.schema.identityAssertionsTable}
|
|
3889
3889
|
WHERE graph_id = ${ctx.graphId}
|
|
3890
3890
|
AND deleted_at IS NULL
|
|
@@ -3911,7 +3911,7 @@ async function requireNodeValidityEndCompatible(ctx, target, ref, validTo) {
|
|
|
3911
3911
|
}
|
|
3912
3912
|
async function detachIdentityForNode(ctx, target, ref, mode) {
|
|
3913
3913
|
await lockIdentityGraph(target, ctx.graphId);
|
|
3914
|
-
await
|
|
3914
|
+
await chunk6B3LQUYG_cjs.withRecordedIdentityMutationTarget(target, async (rawTarget, touch) => {
|
|
3915
3915
|
const touchesNode = chunkXPSPDFKO_cjs.sql`
|
|
3916
3916
|
(
|
|
3917
3917
|
(a_kind = ${ref.kind} AND a_id = ${ref.id})
|
|
@@ -3921,7 +3921,7 @@ async function detachIdentityForNode(ctx, target, ref, mode) {
|
|
|
3921
3921
|
const scope = mode === "hard" ? chunkXPSPDFKO_cjs.sql`` : chunkXPSPDFKO_cjs.sql`AND valid_to IS NULL AND deleted_at IS NULL`;
|
|
3922
3922
|
const rows = await rawTarget.execute(
|
|
3923
3923
|
chunkXPSPDFKO_cjs.asCompiledRowsSql(chunkXPSPDFKO_cjs.sql`
|
|
3924
|
-
SELECT ${
|
|
3924
|
+
SELECT ${chunk6B3LQUYG_cjs.IDENTITY_ASSERTION_COLUMNS}
|
|
3925
3925
|
FROM ${ctx.schema.identityAssertionsTable}
|
|
3926
3926
|
WHERE graph_id = ${ctx.graphId}
|
|
3927
3927
|
${scope}
|
|
@@ -4033,5 +4033,5 @@ exports.requireNodeValidityEndCompatible = requireNodeValidityEndCompatible;
|
|
|
4033
4033
|
exports.separationRebuildRequired = separationRebuildRequired;
|
|
4034
4034
|
exports.toTransferAssertion = toTransferAssertion;
|
|
4035
4035
|
exports.validateIdentityForContext = validateIdentityForContext;
|
|
4036
|
-
//# sourceMappingURL=chunk-
|
|
4037
|
-
//# sourceMappingURL=chunk-
|
|
4036
|
+
//# sourceMappingURL=chunk-EBQX7MYL.cjs.map
|
|
4037
|
+
//# sourceMappingURL=chunk-EBQX7MYL.cjs.map
|