@nicia-ai/typegraph 0.47.0 → 0.49.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/backend/drizzle/indexes.d.cts +1 -1
- package/dist/backend/drizzle/indexes.d.ts +1 -1
- package/dist/backend/index.cjs +27 -19
- package/dist/backend/index.d.cts +37 -55
- package/dist/backend/index.d.ts +37 -55
- package/dist/backend/index.js +4 -4
- package/dist/backend/postgres/index.cjs +7 -7
- package/dist/backend/postgres/index.d.cts +21 -7
- package/dist/backend/postgres/index.d.ts +21 -7
- package/dist/backend/postgres/index.js +6 -6
- package/dist/backend/postgres/pglite-store.cjs +17 -17
- package/dist/backend/postgres/pglite-store.d.cts +8 -8
- package/dist/backend/postgres/pglite-store.d.ts +8 -8
- package/dist/backend/postgres/pglite-store.js +14 -14
- package/dist/backend/postgres/pglite.cjs +8 -8
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +7 -7
- package/dist/backend/sqlite/index.cjs +7 -7
- package/dist/backend/sqlite/index.d.cts +20 -7
- package/dist/backend/sqlite/index.d.ts +20 -7
- package/dist/backend/sqlite/index.js +6 -6
- package/dist/backend/sqlite/libsql.cjs +8 -8
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +6 -6
- package/dist/backend/sqlite/local-store.cjs +18 -18
- package/dist/backend/sqlite/local-store.d.cts +8 -8
- package/dist/backend/sqlite/local-store.d.ts +8 -8
- package/dist/backend/sqlite/local-store.js +15 -15
- package/dist/backend/sqlite/local.cjs +9 -9
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +7 -7
- package/dist/{chunk-5FBRVORR.cjs → chunk-2O4PCIZ6.cjs} +8 -7
- package/dist/chunk-2O4PCIZ6.cjs.map +1 -0
- package/dist/{chunk-6KFLYYOC.cjs → chunk-2QGYQBS2.cjs} +5 -5
- package/dist/{chunk-6KFLYYOC.cjs.map → chunk-2QGYQBS2.cjs.map} +1 -1
- package/dist/{chunk-XYBQI6LE.js → chunk-2TYSSBU5.js} +6 -6
- package/dist/{chunk-XYBQI6LE.js.map → chunk-2TYSSBU5.js.map} +1 -1
- package/dist/{chunk-6JVZSOHQ.cjs → chunk-3FPR224C.cjs} +26 -26
- package/dist/{chunk-6JVZSOHQ.cjs.map → chunk-3FPR224C.cjs.map} +1 -1
- package/dist/{chunk-U5EDAVOJ.cjs → chunk-3G5W2U2L.cjs} +82 -51
- package/dist/chunk-3G5W2U2L.cjs.map +1 -0
- package/dist/{chunk-MFZR4QKM.cjs → chunk-3KOY4FH3.cjs} +181 -4
- package/dist/chunk-3KOY4FH3.cjs.map +1 -0
- package/dist/{chunk-UPAJHMW3.cjs → chunk-3QNZ5SAJ.cjs} +55 -58
- package/dist/chunk-3QNZ5SAJ.cjs.map +1 -0
- package/dist/{chunk-NG2RB5WL.js → chunk-5K2BKEBD.js} +18 -3
- package/dist/chunk-5K2BKEBD.js.map +1 -0
- package/dist/chunk-5PRKMB24.cjs +124 -0
- package/dist/chunk-5PRKMB24.cjs.map +1 -0
- package/dist/chunk-6LN7FIVU.js +107 -0
- package/dist/chunk-6LN7FIVU.js.map +1 -0
- package/dist/{chunk-M35DF33T.js → chunk-7LZJNLA5.js} +29 -16
- package/dist/chunk-7LZJNLA5.js.map +1 -0
- package/dist/{chunk-I4G3SQPF.cjs → chunk-7UOLHNWC.cjs} +7 -7
- package/dist/chunk-7UOLHNWC.cjs.map +1 -0
- package/dist/{chunk-DJZTXBWY.js → chunk-BRRP76WO.js} +71 -30
- package/dist/chunk-BRRP76WO.js.map +1 -0
- package/dist/{chunk-5FT3TLPK.js → chunk-D4QLTJSM.js} +16 -13
- package/dist/chunk-D4QLTJSM.js.map +1 -0
- package/dist/{chunk-XY5OMOJD.js → chunk-DZAICA5J.js} +3 -3
- package/dist/{chunk-XY5OMOJD.js.map → chunk-DZAICA5J.js.map} +1 -1
- package/dist/{chunk-OIFSOPSR.cjs → chunk-EZEEWCFJ.cjs} +38 -156
- package/dist/chunk-EZEEWCFJ.cjs.map +1 -0
- package/dist/{chunk-AMMWA76F.cjs → chunk-FA2AFWLP.cjs} +6 -6
- package/dist/{chunk-AMMWA76F.cjs.map → chunk-FA2AFWLP.cjs.map} +1 -1
- package/dist/{chunk-FNOMT74T.js → chunk-I4GAZH5Z.js} +180 -5
- package/dist/chunk-I4GAZH5Z.js.map +1 -0
- package/dist/{chunk-WGX7JH7E.cjs → chunk-JB6T4GLL.cjs} +106 -134
- package/dist/chunk-JB6T4GLL.cjs.map +1 -0
- package/dist/{chunk-MX4DHSQP.cjs → chunk-JFRT7S3B.cjs} +92 -98
- package/dist/chunk-JFRT7S3B.cjs.map +1 -0
- package/dist/{chunk-5UMTUOM5.js → chunk-JPD2CTC3.js} +5 -4
- package/dist/chunk-JPD2CTC3.js.map +1 -0
- package/dist/{chunk-SE6EGQSD.js → chunk-KF6K7TGH.js} +38 -66
- package/dist/chunk-KF6K7TGH.js.map +1 -0
- package/dist/{chunk-QS3NQZVC.js → chunk-LTXQOEIC.js} +44 -14
- package/dist/chunk-LTXQOEIC.js.map +1 -0
- package/dist/{chunk-ZHNXLS3C.js → chunk-NACVVDWB.js} +208 -8
- package/dist/chunk-NACVVDWB.js.map +1 -0
- package/dist/{chunk-AVGUJWVX.js → chunk-S5TERQVW.js} +15 -132
- package/dist/chunk-S5TERQVW.js.map +1 -0
- package/dist/chunk-SIT26LAZ.cjs +614 -0
- package/dist/chunk-SIT26LAZ.cjs.map +1 -0
- package/dist/{chunk-BR7SHKGM.cjs → chunk-SR725PWF.cjs} +548 -507
- package/dist/chunk-SR725PWF.cjs.map +1 -0
- package/dist/{chunk-425IZOQ5.cjs → chunk-TQHGE7UC.cjs} +20 -2
- package/dist/chunk-TQHGE7UC.cjs.map +1 -0
- package/dist/{chunk-GYUJZARH.cjs → chunk-TUNPBZY3.cjs} +4 -4
- package/dist/{chunk-GYUJZARH.cjs.map → chunk-TUNPBZY3.cjs.map} +1 -1
- package/dist/chunk-UGHG7PGX.js +592 -0
- package/dist/chunk-UGHG7PGX.js.map +1 -0
- package/dist/{chunk-BCQ76AXA.cjs → chunk-UGHQV7MP.cjs} +107 -94
- package/dist/chunk-UGHQV7MP.cjs.map +1 -0
- package/dist/{chunk-KABFHAL7.cjs → chunk-UMGZDVOA.cjs} +213 -12
- package/dist/chunk-UMGZDVOA.cjs.map +1 -0
- package/dist/{chunk-6FWSNSRE.js → chunk-WIC7DRXW.js} +4 -4
- package/dist/chunk-WIC7DRXW.js.map +1 -0
- package/dist/{chunk-LEWHMOUY.js → chunk-YIURNGXI.js} +4 -4
- package/dist/{chunk-LEWHMOUY.js.map → chunk-YIURNGXI.js.map} +1 -1
- package/dist/{chunk-EP4RUYD6.js → chunk-YVF2EM7B.js} +3 -3
- package/dist/{chunk-EP4RUYD6.js.map → chunk-YVF2EM7B.js.map} +1 -1
- package/dist/{chunk-EMIB2RXD.cjs → chunk-YYUHLYM2.cjs} +99 -96
- package/dist/chunk-YYUHLYM2.cjs.map +1 -0
- package/dist/{chunk-KH7XW7VV.js → chunk-Z2JCLZFJ.js} +25 -28
- package/dist/chunk-Z2JCLZFJ.js.map +1 -0
- package/dist/{chunk-NNQ6A3RM.js → chunk-ZFMCDJGB.js} +7 -12
- package/dist/chunk-ZFMCDJGB.js.map +1 -0
- package/dist/core/index.cjs +6 -6
- package/dist/core/index.d.cts +4 -4
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +2 -2
- package/dist/ddl-BL1NZLMY.d.cts +78 -0
- package/dist/ddl-D_oW-EVO.d.ts +78 -0
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-merge/index.cjs +357 -191
- package/dist/graph-merge/index.cjs.map +1 -1
- package/dist/graph-merge/index.d.cts +68 -15
- package/dist/graph-merge/index.d.ts +68 -15
- package/dist/graph-merge/index.js +197 -32
- package/dist/graph-merge/index.js.map +1 -1
- package/dist/{index-CHTv4XMZ.d.cts → index-COs_z6nV.d.cts} +2 -2
- package/dist/{index-CzoJ3MUw.d.ts → index-D7d1u2gr.d.ts} +2 -2
- package/dist/index.cjs +90 -86
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -12
- package/dist/index.d.ts +12 -12
- package/dist/index.js +13 -13
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/ingestion-import-target-XPxZYw89.d.cts +17 -0
- package/dist/ingestion-import-target-dNeL7iAv.d.ts +17 -0
- package/dist/interchange/index.cjs +38 -38
- package/dist/interchange/index.d.cts +15 -12
- package/dist/interchange/index.d.ts +15 -12
- package/dist/interchange/index.js +10 -10
- package/dist/{manager-DlY1vlla.d.cts → manager-CYaff3n3.d.cts} +2 -2
- package/dist/{manager-B6sOQzcQ.d.ts → manager-D9eRT_ns.d.ts} +2 -2
- package/dist/{materialize-indexes-DQL4xcpf.d.ts → materialize-indexes-DJ3ykH59.d.ts} +1 -1
- package/dist/{materialize-indexes-sskhp-c_.d.cts → materialize-indexes-DTtAnvfY.d.cts} +1 -1
- package/dist/{postgres-BXy_nyMs.d.cts → postgres-CcL4bAHS.d.ts} +1 -1
- package/dist/{postgres-B6YOUcaK.d.ts → postgres-DMj39MEu.d.cts} +1 -1
- package/dist/profiler/index.d.cts +9 -9
- package/dist/profiler/index.d.ts +9 -9
- package/dist/provenance/index.cjs +25 -26
- package/dist/provenance/index.cjs.map +1 -1
- package/dist/provenance/index.d.cts +7 -7
- package/dist/provenance/index.d.ts +7 -7
- package/dist/provenance/index.js +9 -10
- package/dist/provenance/index.js.map +1 -1
- package/dist/repair-validity-windows-BFNZvd_H.d.cts +166 -0
- package/dist/repair-validity-windows-DlUSqwCg.d.ts +166 -0
- package/dist/schema/index.cjs +35 -35
- package/dist/schema/index.d.cts +6 -6
- package/dist/schema/index.d.ts +6 -6
- package/dist/schema/index.js +8 -8
- package/dist/{searchable-D9gMiwcS.d.ts → searchable-DHJMh_nj.d.cts} +1 -1
- package/dist/{searchable-0Cn_lY8U.d.cts → searchable-bpE1bBfc.d.ts} +1 -1
- package/dist/{sqlite-DioSxaPe.d.cts → sqlite-D7Oz0SQh.d.ts} +1 -1
- package/dist/{sqlite-ClXuBYAj.d.ts → sqlite-YppHrNFb.d.cts} +1 -1
- package/dist/{store-5j-w5onJ.d.ts → store-DRrFCx5x.d.ts} +122 -27
- package/dist/{store-CFedKGU5.d.cts → store-bphCSo7z.d.cts} +122 -27
- package/dist/{temporal-CjO9FH1l.d.ts → temporal-5GqpYCk2.d.cts} +1 -1
- package/dist/{temporal-Ce1pG0S1.d.cts → temporal-CbnLzTmM.d.ts} +1 -1
- package/dist/{types-DKkMJZjR.d.cts → types-BqFZTQmV.d.cts} +29 -4
- package/dist/{types-DKkMJZjR.d.ts → types-BqFZTQmV.d.ts} +29 -4
- package/dist/{types-BrdOFu48.d.ts → types-Bx74kaTt.d.ts} +1 -1
- package/dist/{types-oj_OGAaZ.d.cts → types-CXAhpW-c.d.cts} +1 -1
- package/dist/{where-D1wKCJ4Q.d.cts → where-DI_Fqz-X.d.cts} +1 -1
- package/dist/{where-C8w2627G.d.ts → where-O-k2wgYm.d.ts} +1 -1
- package/package.json +2 -3
- package/dist/chunk-3HGRTCDU.cjs +0 -269
- package/dist/chunk-3HGRTCDU.cjs.map +0 -1
- package/dist/chunk-425IZOQ5.cjs.map +0 -1
- package/dist/chunk-5FBRVORR.cjs.map +0 -1
- package/dist/chunk-5FT3TLPK.js.map +0 -1
- package/dist/chunk-5UMTUOM5.js.map +0 -1
- package/dist/chunk-6FWSNSRE.js.map +0 -1
- package/dist/chunk-AVGUJWVX.js.map +0 -1
- package/dist/chunk-BCQ76AXA.cjs.map +0 -1
- package/dist/chunk-BR7SHKGM.cjs.map +0 -1
- package/dist/chunk-DJZTXBWY.js.map +0 -1
- package/dist/chunk-EMIB2RXD.cjs.map +0 -1
- package/dist/chunk-FNOMT74T.js.map +0 -1
- package/dist/chunk-I4G3SQPF.cjs.map +0 -1
- package/dist/chunk-JR6SX5RH.cjs +0 -268
- package/dist/chunk-JR6SX5RH.cjs.map +0 -1
- package/dist/chunk-KABFHAL7.cjs.map +0 -1
- package/dist/chunk-KH7XW7VV.js.map +0 -1
- package/dist/chunk-M35DF33T.js.map +0 -1
- package/dist/chunk-MFZR4QKM.cjs.map +0 -1
- package/dist/chunk-MX4DHSQP.cjs.map +0 -1
- package/dist/chunk-NAZ2RA4L.js +0 -254
- package/dist/chunk-NAZ2RA4L.js.map +0 -1
- package/dist/chunk-NG2RB5WL.js.map +0 -1
- package/dist/chunk-NNQ6A3RM.js.map +0 -1
- package/dist/chunk-OIFSOPSR.cjs.map +0 -1
- package/dist/chunk-QS3NQZVC.js.map +0 -1
- package/dist/chunk-SE6EGQSD.js.map +0 -1
- package/dist/chunk-SHSSRCFR.js +0 -246
- package/dist/chunk-SHSSRCFR.js.map +0 -1
- package/dist/chunk-U5EDAVOJ.cjs.map +0 -1
- package/dist/chunk-UPAJHMW3.cjs.map +0 -1
- package/dist/chunk-WGX7JH7E.cjs.map +0 -1
- package/dist/chunk-ZHNXLS3C.js.map +0 -1
- package/dist/ddl-CprnMXJ-.d.ts +0 -38
- package/dist/ddl-DJA7Lci5.d.cts +0 -38
|
@@ -1,19 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var
|
|
3
|
+
var chunkJB6T4GLL_cjs = require('./chunk-JB6T4GLL.cjs');
|
|
4
|
+
var chunk3KOY4FH3_cjs = require('./chunk-3KOY4FH3.cjs');
|
|
5
|
+
var chunkJFRT7S3B_cjs = require('./chunk-JFRT7S3B.cjs');
|
|
6
|
+
var chunkEZEEWCFJ_cjs = require('./chunk-EZEEWCFJ.cjs');
|
|
7
|
+
var chunkSIT26LAZ_cjs = require('./chunk-SIT26LAZ.cjs');
|
|
8
|
+
var chunk5PRKMB24_cjs = require('./chunk-5PRKMB24.cjs');
|
|
7
9
|
var chunkBFUOME67_cjs = require('./chunk-BFUOME67.cjs');
|
|
8
10
|
var chunkFQPEMEWX_cjs = require('./chunk-FQPEMEWX.cjs');
|
|
9
|
-
var
|
|
11
|
+
var chunkTQHGE7UC_cjs = require('./chunk-TQHGE7UC.cjs');
|
|
10
12
|
var chunkMRDBBHIZ_cjs = require('./chunk-MRDBBHIZ.cjs');
|
|
11
13
|
var chunkN66HCGCY_cjs = require('./chunk-N66HCGCY.cjs');
|
|
12
14
|
var zod = require('zod');
|
|
13
15
|
|
|
14
16
|
var FORMAT_VERSION = "2.0";
|
|
15
17
|
var AcceptedFormatVersionSchema = zod.z.enum(["1.0", "2.0"]);
|
|
16
|
-
var ValidityTimestampSchema = zod.z.iso.datetime().refine((value) =>
|
|
18
|
+
var ValidityTimestampSchema = zod.z.iso.datetime().refine((value) => chunkTQHGE7UC_cjs.isCanonicalIsoDate(value), {
|
|
17
19
|
message: "Expected canonical UTC ISO 8601 (YYYY-MM-DDTHH:mm:ss.sssZ); convert with new Date(value).toISOString()."
|
|
18
20
|
});
|
|
19
21
|
var InterchangeNodeSchema = zod.z.object({
|
|
@@ -22,10 +24,13 @@ var InterchangeNodeSchema = zod.z.object({
|
|
|
22
24
|
properties: zod.z.record(zod.z.string(), zod.z.unknown()),
|
|
23
25
|
/**
|
|
24
26
|
* `undefined` (key absent): not requested (`includeTemporal: false`) —
|
|
25
|
-
* import defaults it to the import's own creation timestamp
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
27
|
+
* import defaults it to the import's own creation timestamp, UNLESS the
|
|
28
|
+
* record states a `validTo` at or before that instant, in which case the row
|
|
29
|
+
* is imported with no lower bound ("ended at T, start unknown") rather than
|
|
30
|
+
* one after its own end (issue #407). `null`: requested and confirmed the row
|
|
31
|
+
* has no lower bound (e.g. a legacy row predating the "omitted validFrom
|
|
32
|
+
* defaults to creation time" fix) — import preserves that open-left validity
|
|
33
|
+
* instead of re-stamping it.
|
|
29
34
|
*/
|
|
30
35
|
validFrom: ValidityTimestampSchema.nullable().optional(),
|
|
31
36
|
validTo: ValidityTimestampSchema.optional(),
|
|
@@ -235,6 +240,29 @@ var ExportStreamOptionsSchema = ExportOptionsSchema.extend({
|
|
|
235
240
|
batchSize: zod.z.number().int().positive().default(1e3)
|
|
236
241
|
});
|
|
237
242
|
|
|
243
|
+
// src/interchange/ingestion-import-target.ts
|
|
244
|
+
var INGESTION_IMPORT_TARGETS = /* @__PURE__ */ new WeakMap();
|
|
245
|
+
function registerIngestionImportTarget(handle, store) {
|
|
246
|
+
INGESTION_IMPORT_TARGETS.set(handle, store);
|
|
247
|
+
}
|
|
248
|
+
function resolveIngestionImportTarget(target) {
|
|
249
|
+
const registeredStore = INGESTION_IMPORT_TARGETS.get(target);
|
|
250
|
+
if (registeredStore !== void 0) return registeredStore;
|
|
251
|
+
try {
|
|
252
|
+
chunk3KOY4FH3_cjs.storeBackend(target);
|
|
253
|
+
return target;
|
|
254
|
+
} catch (error) {
|
|
255
|
+
throw new chunkMRDBBHIZ_cjs.ConfigurationError(
|
|
256
|
+
"Interchange import received an unrecognized ingestion target",
|
|
257
|
+
{ target: "unregistered-ingestion-target" },
|
|
258
|
+
{
|
|
259
|
+
cause: error,
|
|
260
|
+
suggestion: "Pass a Store or the exact handle returned by ingestionBranch() from this TypeGraph installation."
|
|
261
|
+
}
|
|
262
|
+
);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
|
|
238
266
|
// src/interchange/stream-source.ts
|
|
239
267
|
var EXPORT_STREAM_BACKENDS = /* @__PURE__ */ new WeakMap();
|
|
240
268
|
function markExportStreamBackend(stream, backend) {
|
|
@@ -246,7 +274,8 @@ function exportStreamBackend(stream) {
|
|
|
246
274
|
}
|
|
247
275
|
|
|
248
276
|
// src/interchange/import.ts
|
|
249
|
-
async function importGraph(
|
|
277
|
+
async function importGraph(target, data, rawOptions) {
|
|
278
|
+
const store = resolveIngestionImportTarget(target);
|
|
250
279
|
const options = ImportOptionsSchema.parse(rawOptions);
|
|
251
280
|
return withImportStreamLease(
|
|
252
281
|
store,
|
|
@@ -254,8 +283,8 @@ async function importGraph(store, data, rawOptions) {
|
|
|
254
283
|
);
|
|
255
284
|
}
|
|
256
285
|
async function withImportStreamLease(store, run) {
|
|
257
|
-
const lease =
|
|
258
|
-
|
|
286
|
+
const lease = chunkSIT26LAZ_cjs.acquireSerializedStreamLease(
|
|
287
|
+
chunk3KOY4FH3_cjs.storeBackend(store),
|
|
259
288
|
"import-stream"
|
|
260
289
|
);
|
|
261
290
|
if (!lease.acquired) {
|
|
@@ -278,13 +307,13 @@ async function importGraphData(store, data, options) {
|
|
|
278
307
|
const errors = [];
|
|
279
308
|
const graph = store.graph;
|
|
280
309
|
const graphId = store.graphId;
|
|
281
|
-
const backend =
|
|
282
|
-
const runtime =
|
|
310
|
+
const backend = chunk3KOY4FH3_cjs.storeBackend(store);
|
|
311
|
+
const runtime = chunk3KOY4FH3_cjs.storeRuntime(store);
|
|
283
312
|
const registry = store.registry;
|
|
284
313
|
const nodeSchemas = buildNodeSchemaMap(graph);
|
|
285
314
|
const edgeSchemas = buildEdgeSchemaMap(graph);
|
|
286
315
|
const importedNodeIds = /* @__PURE__ */ new Set();
|
|
287
|
-
await
|
|
316
|
+
await chunkJFRT7S3B_cjs.runInWriteTransaction(
|
|
288
317
|
{
|
|
289
318
|
graphId,
|
|
290
319
|
schemaVersion: store.introspect().schemaVersion,
|
|
@@ -344,11 +373,12 @@ async function importGraphData(store, data, options) {
|
|
|
344
373
|
errors
|
|
345
374
|
};
|
|
346
375
|
}
|
|
347
|
-
async function importGraphStream(
|
|
376
|
+
async function importGraphStream(target, chunks, rawOptions) {
|
|
377
|
+
const store = resolveIngestionImportTarget(target);
|
|
348
378
|
const options = ImportOptionsSchema.parse(rawOptions);
|
|
349
379
|
const sourceBackend = exportStreamBackend(chunks);
|
|
350
|
-
const targetBackend =
|
|
351
|
-
const contention = sourceBackend === void 0 ? void 0 :
|
|
380
|
+
const targetBackend = chunk3KOY4FH3_cjs.storeBackend(store);
|
|
381
|
+
const contention = sourceBackend === void 0 ? void 0 : chunkSIT26LAZ_cjs.snapshotExportContention(sourceBackend, targetBackend);
|
|
352
382
|
if (contention !== void 0) {
|
|
353
383
|
throw serializedStreamRefusal({
|
|
354
384
|
graphId: store.graphId,
|
|
@@ -365,7 +395,7 @@ async function importGraphStream(store, chunks, rawOptions) {
|
|
|
365
395
|
try {
|
|
366
396
|
for await (const chunk of chunks) {
|
|
367
397
|
if (releaseImportLease === void 0) {
|
|
368
|
-
const lease =
|
|
398
|
+
const lease = chunkSIT26LAZ_cjs.acquireSerializedStreamLease(
|
|
369
399
|
targetBackend,
|
|
370
400
|
"import-stream"
|
|
371
401
|
);
|
|
@@ -604,7 +634,7 @@ function asIdentityImportError(assertions, graphId, error) {
|
|
|
604
634
|
}
|
|
605
635
|
function taggedAssertion(assertions, error) {
|
|
606
636
|
if (typeof error !== "object" || error === null) return void 0;
|
|
607
|
-
const id = error[
|
|
637
|
+
const id = error[chunkJFRT7S3B_cjs.IDENTITY_IMPORT_FAILED_ASSERTION];
|
|
608
638
|
if (typeof id !== "string") return void 0;
|
|
609
639
|
return assertions.find((candidate) => candidate.id === id);
|
|
610
640
|
}
|
|
@@ -635,7 +665,7 @@ function identityImportProgress(error) {
|
|
|
635
665
|
if (typeof error !== "object" || error === null) {
|
|
636
666
|
return { created: 0, skipped: 0 };
|
|
637
667
|
}
|
|
638
|
-
const progress = error[
|
|
668
|
+
const progress = error[chunkJFRT7S3B_cjs.IDENTITY_IMPORT_PROGRESS];
|
|
639
669
|
if (typeof progress !== "object" || progress === null || !("created" in progress) || typeof progress.created !== "number" || !("skipped" in progress) || typeof progress.skipped !== "number") {
|
|
640
670
|
return { created: 0, skipped: 0 };
|
|
641
671
|
}
|
|
@@ -837,8 +867,8 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
837
867
|
registerAppliedNodeUpdate,
|
|
838
868
|
seedNodeRow,
|
|
839
869
|
seedUniqueRow
|
|
840
|
-
} =
|
|
841
|
-
await
|
|
870
|
+
} = chunkJB6T4GLL_cjs.createNodeBatchValidationBackend(graphId, registry, backend);
|
|
871
|
+
await chunkJB6T4GLL_cjs.primeBatchValidationCaches(
|
|
842
872
|
{ graphId, registry },
|
|
843
873
|
candidates.map((candidate) => candidate.draft),
|
|
844
874
|
backend,
|
|
@@ -859,7 +889,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
859
889
|
case "skip": {
|
|
860
890
|
record(node, {
|
|
861
891
|
status: "skipped",
|
|
862
|
-
liveTarget:
|
|
892
|
+
liveTarget: chunk5PRKMB24_cjs.isLiveNodeRow(existing)
|
|
863
893
|
});
|
|
864
894
|
break;
|
|
865
895
|
}
|
|
@@ -871,7 +901,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
871
901
|
break;
|
|
872
902
|
}
|
|
873
903
|
case "update": {
|
|
874
|
-
if (!
|
|
904
|
+
if (!chunk5PRKMB24_cjs.isLiveNodeRow(existing)) {
|
|
875
905
|
record(node, { status: "skipped", liveTarget: false });
|
|
876
906
|
break;
|
|
877
907
|
}
|
|
@@ -906,7 +936,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
906
936
|
registerAppliedNodeUpdate(
|
|
907
937
|
node.kind,
|
|
908
938
|
node.id,
|
|
909
|
-
|
|
939
|
+
chunk5PRKMB24_cjs.rowPropsToObject(existing.props),
|
|
910
940
|
props,
|
|
911
941
|
uniqueConstraints
|
|
912
942
|
);
|
|
@@ -921,7 +951,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
921
951
|
continue;
|
|
922
952
|
}
|
|
923
953
|
const uniquenessResult = await catchUniquenessError(
|
|
924
|
-
() =>
|
|
954
|
+
() => chunk3KOY4FH3_cjs.checkUniquenessConstraints(
|
|
925
955
|
{ graphId, registry, backend: validationBackend },
|
|
926
956
|
node.kind,
|
|
927
957
|
node.id,
|
|
@@ -948,7 +978,7 @@ async function processNodeSlice(backend, graphId, registry, batch, schemas, opti
|
|
|
948
978
|
} else {
|
|
949
979
|
await backend.insertNodesBatch(insertParamsList);
|
|
950
980
|
}
|
|
951
|
-
await
|
|
981
|
+
await chunk3KOY4FH3_cjs.applyNodeInsertSideEffectsBatch(
|
|
952
982
|
writeContext,
|
|
953
983
|
accepted.map((candidate) => ({
|
|
954
984
|
kind: candidate.node.kind,
|
|
@@ -1003,7 +1033,7 @@ var NODE_UPDATE_TARGET_CHANGED_CODE = "INTERCHANGE_NODE_UPDATE_TARGET_CHANGED";
|
|
|
1003
1033
|
async function updateImportedNode(writeContext, backend, node, args) {
|
|
1004
1034
|
try {
|
|
1005
1035
|
const result = await catchUniquenessError(
|
|
1006
|
-
() =>
|
|
1036
|
+
() => chunk3KOY4FH3_cjs.applyNodeUpdate(
|
|
1007
1037
|
writeContext,
|
|
1008
1038
|
{
|
|
1009
1039
|
existing: args.existing,
|
|
@@ -1084,12 +1114,12 @@ function windowErrorOf(assert) {
|
|
|
1084
1114
|
}
|
|
1085
1115
|
function validateValidityWindow(entity) {
|
|
1086
1116
|
return windowErrorOf(() => {
|
|
1087
|
-
|
|
1117
|
+
chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(
|
|
1088
1118
|
entity.validFrom ?? void 0,
|
|
1089
1119
|
"validFrom"
|
|
1090
1120
|
);
|
|
1091
|
-
|
|
1092
|
-
|
|
1121
|
+
chunkTQHGE7UC_cjs.validateOptionalCanonicalIsoDate(entity.validTo, "validTo");
|
|
1122
|
+
chunkTQHGE7UC_cjs.assertOrderedValidityWindow(
|
|
1093
1123
|
`${entity.kind} "${entity.id}"`,
|
|
1094
1124
|
entity.validFrom ?? void 0,
|
|
1095
1125
|
entity.validTo
|
|
@@ -1098,7 +1128,7 @@ function validateValidityWindow(entity) {
|
|
|
1098
1128
|
}
|
|
1099
1129
|
function validateUpdateValidityWindow(entity, storedValidFrom) {
|
|
1100
1130
|
const verdict = windowResultOf(
|
|
1101
|
-
() =>
|
|
1131
|
+
() => chunkTQHGE7UC_cjs.assertWritableValidityWindow(
|
|
1102
1132
|
`${entity.kind} "${entity.id}"`,
|
|
1103
1133
|
entity.validFrom ?? void 0,
|
|
1104
1134
|
{
|
|
@@ -1137,7 +1167,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
|
|
|
1137
1167
|
if (existing) {
|
|
1138
1168
|
switch (options.onConflict) {
|
|
1139
1169
|
case "skip": {
|
|
1140
|
-
return { status: "skipped", liveTarget:
|
|
1170
|
+
return { status: "skipped", liveTarget: chunk5PRKMB24_cjs.isLiveNodeRow(existing) };
|
|
1141
1171
|
}
|
|
1142
1172
|
case "error": {
|
|
1143
1173
|
return {
|
|
@@ -1146,7 +1176,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
|
|
|
1146
1176
|
};
|
|
1147
1177
|
}
|
|
1148
1178
|
case "update": {
|
|
1149
|
-
if (!
|
|
1179
|
+
if (!chunk5PRKMB24_cjs.isLiveNodeRow(existing)) {
|
|
1150
1180
|
return { status: "skipped", liveTarget: false };
|
|
1151
1181
|
}
|
|
1152
1182
|
const updateWindow = validateUpdateValidityWindow(
|
|
@@ -1176,7 +1206,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
|
|
|
1176
1206
|
}
|
|
1177
1207
|
}
|
|
1178
1208
|
const uniquenessResult = await catchUniquenessError(
|
|
1179
|
-
() =>
|
|
1209
|
+
() => chunk3KOY4FH3_cjs.checkUniquenessConstraints(
|
|
1180
1210
|
{ graphId, registry, backend },
|
|
1181
1211
|
node.kind,
|
|
1182
1212
|
node.id,
|
|
@@ -1195,7 +1225,7 @@ async function processNode(backend, graphId, registry, node, schemas, options, l
|
|
|
1195
1225
|
...node.validFrom !== void 0 && { validFrom: node.validFrom },
|
|
1196
1226
|
...node.validTo !== void 0 && { validTo: node.validTo }
|
|
1197
1227
|
});
|
|
1198
|
-
await
|
|
1228
|
+
await chunk3KOY4FH3_cjs.applyNodeInsertSideEffects(
|
|
1199
1229
|
writeContext,
|
|
1200
1230
|
{
|
|
1201
1231
|
kind: node.kind,
|
|
@@ -1330,7 +1360,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1330
1360
|
for (const [kind, ids] of idsByKind) {
|
|
1331
1361
|
const rows = await backend.getNodes(graphId, kind, [...ids]);
|
|
1332
1362
|
for (const row of rows) {
|
|
1333
|
-
if (
|
|
1363
|
+
if (chunk5PRKMB24_cjs.isLiveNodeRow(row)) {
|
|
1334
1364
|
liveEndpointKeys.add(makeNodeKey(kind, row.id));
|
|
1335
1365
|
}
|
|
1336
1366
|
}
|
|
@@ -1341,7 +1371,7 @@ async function processEdgeSlice(backend, graphId, registry, batch, edgeSchemas,
|
|
|
1341
1371
|
if (importedNodeIds.has(key)) return true;
|
|
1342
1372
|
if (checkedEndpointKeys.has(key)) return liveEndpointKeys.has(key);
|
|
1343
1373
|
const row = await backend.getNode(graphId, endpoint.kind, endpoint.id);
|
|
1344
|
-
return row !== void 0 &&
|
|
1374
|
+
return row !== void 0 && chunk5PRKMB24_cjs.isLiveNodeRow(row);
|
|
1345
1375
|
};
|
|
1346
1376
|
const existingById = /* @__PURE__ */ new Map();
|
|
1347
1377
|
if (candidates.length > 0 && backend.getEdges !== void 0) {
|
|
@@ -1502,7 +1532,7 @@ async function processEdge(backend, graphId, registry, edge, edgeSchemas, nodeSc
|
|
|
1502
1532
|
edge.from.kind,
|
|
1503
1533
|
edge.from.id
|
|
1504
1534
|
);
|
|
1505
|
-
if (fromExists === void 0 || !
|
|
1535
|
+
if (fromExists === void 0 || !chunk5PRKMB24_cjs.isLiveNodeRow(fromExists)) {
|
|
1506
1536
|
return {
|
|
1507
1537
|
status: "error",
|
|
1508
1538
|
error: `From node not found: ${edge.from.kind}:${edge.from.id}`
|
|
@@ -1511,7 +1541,7 @@ async function processEdge(backend, graphId, registry, edge, edgeSchemas, nodeSc
|
|
|
1511
1541
|
}
|
|
1512
1542
|
if (!importedNodeIds.has(toKey)) {
|
|
1513
1543
|
const toExists = await backend.getNode(graphId, edge.to.kind, edge.to.id);
|
|
1514
|
-
if (toExists === void 0 || !
|
|
1544
|
+
if (toExists === void 0 || !chunk5PRKMB24_cjs.isLiveNodeRow(toExists)) {
|
|
1515
1545
|
return {
|
|
1516
1546
|
status: "error",
|
|
1517
1547
|
error: `To node not found: ${edge.to.kind}:${edge.to.id}`
|
|
@@ -1648,7 +1678,7 @@ function formatZodError(error) {
|
|
|
1648
1678
|
}).join("; ");
|
|
1649
1679
|
}
|
|
1650
1680
|
function makeNodeKey(kind, id) {
|
|
1651
|
-
return
|
|
1681
|
+
return chunkEZEEWCFJ_cjs.encodeTupleKey([kind, id]);
|
|
1652
1682
|
}
|
|
1653
1683
|
|
|
1654
1684
|
// src/interchange/export.ts
|
|
@@ -1691,7 +1721,7 @@ async function exportGraph(store, options) {
|
|
|
1691
1721
|
};
|
|
1692
1722
|
}
|
|
1693
1723
|
function exportGraphStream(store, options) {
|
|
1694
|
-
const backend =
|
|
1724
|
+
const backend = chunk3KOY4FH3_cjs.storeBackend(store);
|
|
1695
1725
|
return markExportStreamBackend(
|
|
1696
1726
|
exportGraphStreamFromBackend(store, backend, options),
|
|
1697
1727
|
backend
|
|
@@ -1839,7 +1869,7 @@ function exportStreamCancelled(phase, graphId, signal, framed) {
|
|
|
1839
1869
|
);
|
|
1840
1870
|
}
|
|
1841
1871
|
function claimSnapshotExportLeaseOrRefuse(graphId, backend) {
|
|
1842
|
-
const lease =
|
|
1872
|
+
const lease = chunkSIT26LAZ_cjs.acquireSerializedStreamLease(backend, "export-snapshot");
|
|
1843
1873
|
if (!lease.acquired) {
|
|
1844
1874
|
throw serializedStreamRefusal({
|
|
1845
1875
|
graphId,
|
|
@@ -1858,7 +1888,7 @@ async function produceExportChunks(store, backend, options, emit) {
|
|
|
1858
1888
|
type: "header",
|
|
1859
1889
|
header: {
|
|
1860
1890
|
formatVersion: FORMAT_VERSION,
|
|
1861
|
-
exportedAt:
|
|
1891
|
+
exportedAt: chunkTQHGE7UC_cjs.nowIso(),
|
|
1862
1892
|
source: {
|
|
1863
1893
|
type: "typegraph-export",
|
|
1864
1894
|
graphId,
|
|
@@ -1895,7 +1925,7 @@ async function produceExportChunks(store, backend, options, emit) {
|
|
|
1895
1925
|
if (store.graph.identity === void 0) return;
|
|
1896
1926
|
let after;
|
|
1897
1927
|
for (; ; ) {
|
|
1898
|
-
const page = await
|
|
1928
|
+
const page = await chunk3KOY4FH3_cjs.storeRuntime(store).readIdentityAssertionPageAtTarget(
|
|
1899
1929
|
backend,
|
|
1900
1930
|
options.identityMode,
|
|
1901
1931
|
{
|
|
@@ -2044,7 +2074,7 @@ async function* exportNodeChunks(backend, graphId, kind, options) {
|
|
|
2044
2074
|
const node = {
|
|
2045
2075
|
kind: row.kind,
|
|
2046
2076
|
id: row.id,
|
|
2047
|
-
properties:
|
|
2077
|
+
properties: chunk5PRKMB24_cjs.rowPropsToObject(row.props)
|
|
2048
2078
|
};
|
|
2049
2079
|
if (options.includeTemporal) {
|
|
2050
2080
|
const validFrom = (
|
|
@@ -2094,7 +2124,7 @@ async function* exportEdgeChunks(backend, graphId, kind, options) {
|
|
|
2094
2124
|
kind: row.to_kind,
|
|
2095
2125
|
id: row.to_id
|
|
2096
2126
|
},
|
|
2097
|
-
properties:
|
|
2127
|
+
properties: chunk5PRKMB24_cjs.rowPropsToObject(row.props)
|
|
2098
2128
|
};
|
|
2099
2129
|
if (options.includeTemporal) {
|
|
2100
2130
|
const validFrom = (
|
|
@@ -2142,7 +2172,8 @@ exports.exportGraphStream = exportGraphStream;
|
|
|
2142
2172
|
exports.exportStreamBackend = exportStreamBackend;
|
|
2143
2173
|
exports.importGraph = importGraph;
|
|
2144
2174
|
exports.importGraphStream = importGraphStream;
|
|
2175
|
+
exports.registerIngestionImportTarget = registerIngestionImportTarget;
|
|
2145
2176
|
exports.serializedStreamRefusal = serializedStreamRefusal;
|
|
2146
2177
|
exports.withImportStreamLease = withImportStreamLease;
|
|
2147
|
-
//# sourceMappingURL=chunk-
|
|
2148
|
-
//# sourceMappingURL=chunk-
|
|
2178
|
+
//# sourceMappingURL=chunk-3G5W2U2L.cjs.map
|
|
2179
|
+
//# sourceMappingURL=chunk-3G5W2U2L.cjs.map
|