@nicia-ai/typegraph 0.46.0 → 0.46.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/index.cjs +5 -5
- package/dist/backend/index.js +2 -2
- package/dist/backend/postgres/pglite-store.cjs +8 -8
- package/dist/backend/postgres/pglite-store.d.cts +2 -2
- package/dist/backend/postgres/pglite-store.d.ts +2 -2
- package/dist/backend/postgres/pglite-store.js +7 -7
- package/dist/backend/sqlite/local-store.cjs +8 -8
- package/dist/backend/sqlite/local-store.d.cts +2 -2
- package/dist/backend/sqlite/local-store.d.ts +2 -2
- package/dist/backend/sqlite/local-store.js +7 -7
- package/dist/{chunk-CNV4TXJG.js → chunk-2Z2Z3ZD6.js} +3 -3
- package/dist/{chunk-CNV4TXJG.js.map → chunk-2Z2Z3ZD6.js.map} +1 -1
- package/dist/{chunk-N3257XE6.cjs → chunk-65E3XWGF.cjs} +21 -21
- package/dist/{chunk-N3257XE6.cjs.map → chunk-65E3XWGF.cjs.map} +1 -1
- package/dist/{chunk-ONU3HIED.cjs → chunk-CMWHLBVN.cjs} +29 -29
- package/dist/{chunk-ONU3HIED.cjs.map → chunk-CMWHLBVN.cjs.map} +1 -1
- package/dist/{chunk-XNLIZYRZ.cjs → chunk-DTVWX77L.cjs} +56 -56
- package/dist/{chunk-XNLIZYRZ.cjs.map → chunk-DTVWX77L.cjs.map} +1 -1
- package/dist/{chunk-JIVMTW7W.js → chunk-GF3KXUTW.js} +4 -4
- package/dist/{chunk-JIVMTW7W.js.map → chunk-GF3KXUTW.js.map} +1 -1
- package/dist/{chunk-QWX5YA3K.js → chunk-L65OU2U3.js} +11 -9
- package/dist/chunk-L65OU2U3.js.map +1 -0
- package/dist/{chunk-QLRESYPU.js → chunk-LGHCOKTT.js} +5 -5
- package/dist/{chunk-QLRESYPU.js.map → chunk-LGHCOKTT.js.map} +1 -1
- package/dist/{chunk-WEVQJ5LH.js → chunk-M3WP7RQZ.js} +2 -2
- package/dist/chunk-M3WP7RQZ.js.map +1 -0
- package/dist/{chunk-Q7Q4WSLJ.cjs → chunk-MCLYU6BN.cjs} +6 -2
- package/dist/chunk-MCLYU6BN.cjs.map +1 -0
- package/dist/{chunk-RJS7DECT.js → chunk-MZLPX2R7.js} +3 -3
- package/dist/{chunk-RJS7DECT.js.map → chunk-MZLPX2R7.js.map} +1 -1
- package/dist/{chunk-NQ6BRJBE.js → chunk-NLI2AVEF.js} +3 -3
- package/dist/{chunk-NQ6BRJBE.js.map → chunk-NLI2AVEF.js.map} +1 -1
- package/dist/{chunk-XMQSEJCF.cjs → chunk-PF6F5NLJ.cjs} +20 -20
- package/dist/{chunk-XMQSEJCF.cjs.map → chunk-PF6F5NLJ.cjs.map} +1 -1
- package/dist/{chunk-XDF2UPEQ.cjs → chunk-PNTCATDE.cjs} +431 -421
- package/dist/chunk-PNTCATDE.cjs.map +1 -0
- package/dist/{chunk-7GT72YHH.cjs → chunk-PT7RIRIZ.cjs} +66 -64
- package/dist/chunk-PT7RIRIZ.cjs.map +1 -0
- package/dist/{chunk-TTAITEPJ.cjs → chunk-Q3G6A4I3.cjs} +2 -2
- package/dist/chunk-Q3G6A4I3.cjs.map +1 -0
- package/dist/{chunk-7Z5OR7KO.js → chunk-S6PW7VV5.js} +19 -9
- package/dist/chunk-S6PW7VV5.js.map +1 -0
- package/dist/{chunk-XQSCL77R.cjs → chunk-VLT6PEWR.cjs} +4 -4
- package/dist/{chunk-XQSCL77R.cjs.map → chunk-VLT6PEWR.cjs.map} +1 -1
- package/dist/{chunk-OH5E5KIO.js → chunk-WQZLUGVR.js} +6 -6
- package/dist/{chunk-OH5E5KIO.js.map → chunk-WQZLUGVR.js.map} +1 -1
- package/dist/{chunk-DLNROMQ7.js → chunk-XL7SLCXS.js} +6 -3
- package/dist/chunk-XL7SLCXS.js.map +1 -0
- package/dist/{chunk-XNSI2FJO.cjs → chunk-YBQOHKHN.cjs} +8 -8
- package/dist/{chunk-XNSI2FJO.cjs.map → chunk-YBQOHKHN.cjs.map} +1 -1
- package/dist/core/index.cjs +5 -5
- package/dist/core/index.js +1 -1
- package/dist/graph-merge/index.cjs +149 -149
- package/dist/graph-merge/index.d.cts +1 -1
- package/dist/graph-merge/index.d.ts +1 -1
- package/dist/graph-merge/index.js +8 -8
- package/dist/index.cjs +79 -79
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +9 -9
- package/dist/interchange/index.cjs +34 -34
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/interchange/index.js +7 -7
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/provenance/index.cjs +16 -16
- package/dist/provenance/index.d.cts +1 -1
- package/dist/provenance/index.d.ts +1 -1
- package/dist/provenance/index.js +3 -3
- package/dist/schema/index.cjs +32 -32
- package/dist/schema/index.js +5 -5
- package/dist/{store-RwTJx8LX.d.cts → store-B0h6x7wo.d.cts} +12 -3
- package/dist/{store-DawaWWjJ.d.ts → store-ClQ-MZQS.d.ts} +12 -3
- package/package.json +3 -3
- package/dist/chunk-7GT72YHH.cjs.map +0 -1
- package/dist/chunk-7Z5OR7KO.js.map +0 -1
- package/dist/chunk-DLNROMQ7.js.map +0 -1
- package/dist/chunk-Q7Q4WSLJ.cjs.map +0 -1
- package/dist/chunk-QWX5YA3K.js.map +0 -1
- package/dist/chunk-TTAITEPJ.cjs.map +0 -1
- package/dist/chunk-WEVQJ5LH.js.map +0 -1
- package/dist/chunk-XDF2UPEQ.cjs.map +0 -1
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
var chunkBSFJMMV3_cjs = require('./chunk-BSFJMMV3.cjs');
|
|
4
4
|
var chunkNFCVHQ5P_cjs = require('./chunk-NFCVHQ5P.cjs');
|
|
5
5
|
var chunkXBYVV3MP_cjs = require('./chunk-XBYVV3MP.cjs');
|
|
6
|
-
var
|
|
6
|
+
var chunkMCLYU6BN_cjs = require('./chunk-MCLYU6BN.cjs');
|
|
7
7
|
var chunkVCRRKBLN_cjs = require('./chunk-VCRRKBLN.cjs');
|
|
8
8
|
var chunkRT5ZY4XA_cjs = require('./chunk-RT5ZY4XA.cjs');
|
|
9
9
|
var chunkNI72YOJB_cjs = require('./chunk-NI72YOJB.cjs');
|
|
@@ -15,7 +15,7 @@ var nanoid = require('nanoid');
|
|
|
15
15
|
var pinnedReadInstant;
|
|
16
16
|
function withPinnedReadInstant(emit) {
|
|
17
17
|
if (pinnedReadInstant !== void 0) return emit();
|
|
18
|
-
pinnedReadInstant =
|
|
18
|
+
pinnedReadInstant = chunkMCLYU6BN_cjs.nowIso();
|
|
19
19
|
try {
|
|
20
20
|
return emit();
|
|
21
21
|
} finally {
|
|
@@ -23,7 +23,7 @@ function withPinnedReadInstant(emit) {
|
|
|
23
23
|
}
|
|
24
24
|
}
|
|
25
25
|
function currentReadInstant() {
|
|
26
|
-
return chunkVCRRKBLN_cjs.sql`${pinnedReadInstant ??
|
|
26
|
+
return chunkVCRRKBLN_cjs.sql`${pinnedReadInstant ?? chunkMCLYU6BN_cjs.nowIso()}`;
|
|
27
27
|
}
|
|
28
28
|
var CURRENT_READ_INSTANT_PLACEHOLDER = "__typegraph_current_read_instant__";
|
|
29
29
|
function currentReadInstantPlaceholder() {
|
|
@@ -34,7 +34,7 @@ function currentReadInstantFor(mode) {
|
|
|
34
34
|
}
|
|
35
35
|
function compileTemporalFilter(options) {
|
|
36
36
|
const { mode, asOf, tableAlias, currentTimestamp, recordedAsOf } = options;
|
|
37
|
-
const recorded =
|
|
37
|
+
const recorded = chunkMCLYU6BN_cjs.optionalRecordedInstantParts(recordedAsOf, "recordedAsOf");
|
|
38
38
|
const prefix = tableAlias ? chunkVCRRKBLN_cjs.sql.raw(`${tableAlias}.`) : chunkVCRRKBLN_cjs.sql.raw("");
|
|
39
39
|
const deletedAt = chunkVCRRKBLN_cjs.sql`${prefix}deleted_at`;
|
|
40
40
|
const validFrom = chunkVCRRKBLN_cjs.sql`${prefix}valid_from`;
|
|
@@ -927,13 +927,13 @@ function failInvalidClock(value, cause) {
|
|
|
927
927
|
}
|
|
928
928
|
function recordedClockRevision(value) {
|
|
929
929
|
const revision = typeof value === "bigint" ? Number(value) : typeof value === "string" && /^\d+$/.test(value) ? Number(value) : value;
|
|
930
|
-
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < RECORDED_MIN_REVISION || revision >=
|
|
930
|
+
if (typeof revision !== "number" || !Number.isSafeInteger(revision) || revision < RECORDED_MIN_REVISION || revision >= chunkMCLYU6BN_cjs.RECORDED_MAX_REVISION) {
|
|
931
931
|
return failInvalidClock(value);
|
|
932
932
|
}
|
|
933
933
|
return revision;
|
|
934
934
|
}
|
|
935
935
|
function recordedClockWallTime(value) {
|
|
936
|
-
return
|
|
936
|
+
return chunkMCLYU6BN_cjs.canonicalizeDatabaseTimestamp(value) ?? failInvalidClock(value);
|
|
937
937
|
}
|
|
938
938
|
function recordedClockParts(row) {
|
|
939
939
|
const revision = recordedClockRevision(row.revision);
|
|
@@ -941,7 +941,7 @@ function recordedClockParts(row) {
|
|
|
941
941
|
return { revision, recordedAt: recordedClockWallTime(row.recorded_at) };
|
|
942
942
|
}
|
|
943
943
|
function nextRecordedCommitParts(previous) {
|
|
944
|
-
const wallTime =
|
|
944
|
+
const wallTime = chunkMCLYU6BN_cjs.nowIso();
|
|
945
945
|
if (previous === void 0) {
|
|
946
946
|
return { revision: 1, recordedAt: wallTime };
|
|
947
947
|
}
|
|
@@ -959,7 +959,7 @@ function nonDecreasingWallTime(current, previous) {
|
|
|
959
959
|
}
|
|
960
960
|
async function readRecordedClock(target, schema, graphId) {
|
|
961
961
|
const parts = await readRecordedClockParts(target, schema, graphId);
|
|
962
|
-
return parts === void 0 ? void 0 :
|
|
962
|
+
return parts === void 0 ? void 0 : chunkMCLYU6BN_cjs.createRecordedInstant(parts.revision, parts.recordedAt);
|
|
963
963
|
}
|
|
964
964
|
async function readRecordedClockParts(target, schema, graphId) {
|
|
965
965
|
const rows = await target.execute(
|
|
@@ -1069,18 +1069,18 @@ async function lockRecordedClock(target, schema, graphId, ownsWriteLock) {
|
|
|
1069
1069
|
}
|
|
1070
1070
|
async function allocateRecordedCommit(target, schema, graphId, ownsWriteLock, previousRevision) {
|
|
1071
1071
|
await lockRecordedClock(target, schema, graphId, ownsWriteLock);
|
|
1072
|
-
const previous = previousRevision === void 0 ? await readRecordedClockParts(target, schema, graphId) :
|
|
1072
|
+
const previous = previousRevision === void 0 ? await readRecordedClockParts(target, schema, graphId) : chunkMCLYU6BN_cjs.parseRecordedInstant(previousRevision, "previous recorded revision");
|
|
1073
1073
|
const { revision, recordedAt } = nextRecordedCommitParts(previous);
|
|
1074
|
-
if (revision >=
|
|
1074
|
+
if (revision >= chunkMCLYU6BN_cjs.RECORDED_MAX_REVISION) {
|
|
1075
1075
|
throw new chunkNI72YOJB_cjs.ConfigurationError(
|
|
1076
|
-
`Recorded commit clock reached the open revision sentinel ${
|
|
1076
|
+
`Recorded commit clock reached the open revision sentinel ${chunkMCLYU6BN_cjs.RECORDED_MAX_REVISION}`,
|
|
1077
1077
|
{ graphId, revision },
|
|
1078
1078
|
{
|
|
1079
1079
|
suggestion: "Start a new graph before exhausting the per-graph recorded revision space."
|
|
1080
1080
|
}
|
|
1081
1081
|
);
|
|
1082
1082
|
}
|
|
1083
|
-
const instant =
|
|
1083
|
+
const instant = chunkMCLYU6BN_cjs.createRecordedInstant(revision, recordedAt);
|
|
1084
1084
|
await writeRecordedClock(target, schema, graphId, { revision, recordedAt });
|
|
1085
1085
|
if (previousRevision !== void 0) {
|
|
1086
1086
|
await assertRecordedClockAdvanced(target, schema, graphId, revision);
|
|
@@ -1288,7 +1288,7 @@ function identitySqlCoordinate(coordinate, currentInstant) {
|
|
|
1288
1288
|
return {
|
|
1289
1289
|
validMode: coordinate?.valid.mode ?? "current",
|
|
1290
1290
|
validAsOf: coordinate?.valid.asOf,
|
|
1291
|
-
recorded:
|
|
1291
|
+
recorded: chunkMCLYU6BN_cjs.optionalRecordedInstantParts(
|
|
1292
1292
|
coordinate?.recorded?.asOf,
|
|
1293
1293
|
"recorded.asOf"
|
|
1294
1294
|
),
|
|
@@ -2272,7 +2272,7 @@ function recordedCommonCells() {
|
|
|
2272
2272
|
updated_at: (row) => chunkVCRRKBLN_cjs.sql`${row.updated_at}`,
|
|
2273
2273
|
deleted_at: (row) => chunkVCRRKBLN_cjs.sql`${sqlNull(row.deleted_at)}`,
|
|
2274
2274
|
recorded_from: (_row, recordedRevision) => chunkVCRRKBLN_cjs.sql`${recordedRevision}`,
|
|
2275
|
-
recorded_to: () => chunkVCRRKBLN_cjs.sql`${
|
|
2275
|
+
recorded_to: () => chunkVCRRKBLN_cjs.sql`${chunkMCLYU6BN_cjs.RECORDED_MAX_REVISION}`,
|
|
2276
2276
|
op: (_row, _recordedCommit, operation) => chunkVCRRKBLN_cjs.sql`${operation}`,
|
|
2277
2277
|
schema_version: () => chunkVCRRKBLN_cjs.sql`NULL`,
|
|
2278
2278
|
tx_id: () => chunkVCRRKBLN_cjs.sql`NULL`,
|
|
@@ -2307,7 +2307,7 @@ var recordedIdentityAssertionCells = {
|
|
|
2307
2307
|
ended_by_kind: (row) => chunkVCRRKBLN_cjs.sql`${row.ended_by_kind ?? chunkVCRRKBLN_cjs.sql.raw("NULL")}`,
|
|
2308
2308
|
ended_by_id: (row) => chunkVCRRKBLN_cjs.sql`${row.ended_by_id ?? chunkVCRRKBLN_cjs.sql.raw("NULL")}`,
|
|
2309
2309
|
recorded_from: (_row, recordedRevision) => chunkVCRRKBLN_cjs.sql`${recordedRevision}`,
|
|
2310
|
-
recorded_to: () => chunkVCRRKBLN_cjs.sql`${
|
|
2310
|
+
recorded_to: () => chunkVCRRKBLN_cjs.sql`${chunkMCLYU6BN_cjs.RECORDED_MAX_REVISION}`,
|
|
2311
2311
|
op: (_row, _recordedRevision, operation) => chunkVCRRKBLN_cjs.sql`${operation}`
|
|
2312
2312
|
};
|
|
2313
2313
|
function recordedValuesTuple(columns, cells, row, recordedRevision, operation) {
|
|
@@ -2400,7 +2400,7 @@ async function closeOpenReturning(target, table, graphId, ids, recordedRevision,
|
|
|
2400
2400
|
SET recorded_to = ${recordedRevision}
|
|
2401
2401
|
WHERE graph_id = ${graphId}
|
|
2402
2402
|
${kindFilter}
|
|
2403
|
-
AND recorded_to = ${
|
|
2403
|
+
AND recorded_to = ${chunkMCLYU6BN_cjs.RECORDED_MAX_REVISION}
|
|
2404
2404
|
AND id IN (${sqlValueList(ids)})
|
|
2405
2405
|
RETURNING id, deleted_at
|
|
2406
2406
|
`)
|
|
@@ -2535,7 +2535,7 @@ async function closeOpenByKind(target, table, graphId, kind, recordedRevision) {
|
|
|
2535
2535
|
SET recorded_to = ${recordedRevision}
|
|
2536
2536
|
WHERE graph_id = ${graphId}
|
|
2537
2537
|
AND kind = ${kind}
|
|
2538
|
-
AND recorded_to = ${
|
|
2538
|
+
AND recorded_to = ${chunkMCLYU6BN_cjs.RECORDED_MAX_REVISION}
|
|
2539
2539
|
`
|
|
2540
2540
|
);
|
|
2541
2541
|
}
|
|
@@ -2547,7 +2547,7 @@ async function closeOpenEdgesByNodeKind(target, schema, graphId, nodeKind, recor
|
|
|
2547
2547
|
SET recorded_to = ${recordedRevision}
|
|
2548
2548
|
WHERE graph_id = ${graphId}
|
|
2549
2549
|
AND (from_kind = ${nodeKind} OR to_kind = ${nodeKind})
|
|
2550
|
-
AND recorded_to = ${
|
|
2550
|
+
AND recorded_to = ${chunkMCLYU6BN_cjs.RECORDED_MAX_REVISION}
|
|
2551
2551
|
`
|
|
2552
2552
|
);
|
|
2553
2553
|
}
|
|
@@ -3286,5 +3286,5 @@ exports.uncapturedGraphWriteLock = uncapturedGraphWriteLock;
|
|
|
3286
3286
|
exports.withPinnedReadInstant = withPinnedReadInstant;
|
|
3287
3287
|
exports.withRecordedFlushObserver = withRecordedFlushObserver;
|
|
3288
3288
|
exports.withRecordedIdentityMutationTarget = withRecordedIdentityMutationTarget;
|
|
3289
|
-
//# sourceMappingURL=chunk-
|
|
3290
|
-
//# sourceMappingURL=chunk-
|
|
3289
|
+
//# sourceMappingURL=chunk-PF6F5NLJ.cjs.map
|
|
3290
|
+
//# sourceMappingURL=chunk-PF6F5NLJ.cjs.map
|