@nicia-ai/typegraph 0.29.0 → 0.31.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/README.md +39 -0
- package/dist/backend/postgres/index.cjs +21 -20
- package/dist/backend/postgres/index.d.cts +6 -6
- package/dist/backend/postgres/index.d.ts +6 -6
- package/dist/backend/postgres/index.js +11 -10
- package/dist/backend/postgres/pglite.cjs +16 -15
- package/dist/backend/postgres/pglite.cjs.map +1 -1
- package/dist/backend/postgres/pglite.d.cts +3 -3
- package/dist/backend/postgres/pglite.d.ts +3 -3
- package/dist/backend/postgres/pglite.js +11 -10
- package/dist/backend/postgres/pglite.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +18 -18
- package/dist/backend/sqlite/index.d.cts +12 -7
- package/dist/backend/sqlite/index.d.ts +12 -7
- package/dist/backend/sqlite/index.js +9 -9
- 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 +10 -10
- package/dist/backend/sqlite/local.cjs +17 -16
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +9 -3
- package/dist/backend/sqlite/local.d.ts +9 -3
- package/dist/backend/sqlite/local.js +12 -11
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-7KLVFWXR.js → chunk-2HZGWCB4.js} +121 -497
- package/dist/chunk-2HZGWCB4.js.map +1 -0
- package/dist/chunk-2YMGNYXY.js +40 -0
- package/dist/chunk-2YMGNYXY.js.map +1 -0
- package/dist/chunk-2ZY4K43M.js +90 -0
- package/dist/chunk-2ZY4K43M.js.map +1 -0
- package/dist/chunk-3EUKJEQ3.js +77 -0
- package/dist/chunk-3EUKJEQ3.js.map +1 -0
- package/dist/chunk-3JBJEYWE.cjs +604 -0
- package/dist/chunk-3JBJEYWE.cjs.map +1 -0
- package/dist/{chunk-A4H6QMV4.js → chunk-4A4GUZTQ.js} +15 -11
- package/dist/chunk-4A4GUZTQ.js.map +1 -0
- package/dist/{chunk-F2Q76CQ4.cjs → chunk-54JVNOAQ.cjs} +5 -37
- package/dist/chunk-54JVNOAQ.cjs.map +1 -0
- package/dist/{chunk-KGAJ5HFO.cjs → chunk-5CN7B4CZ.cjs} +17 -98
- package/dist/chunk-5CN7B4CZ.cjs.map +1 -0
- package/dist/{chunk-XTQHSOIC.cjs → chunk-5DTPBFX5.cjs} +88 -87
- package/dist/chunk-5DTPBFX5.cjs.map +1 -0
- package/dist/chunk-6G35I3VW.cjs +40 -0
- package/dist/chunk-6G35I3VW.cjs.map +1 -0
- package/dist/{chunk-UPBXUOW7.cjs → chunk-6RMLO5O4.cjs} +19 -64
- package/dist/chunk-6RMLO5O4.cjs.map +1 -0
- package/dist/chunk-6SA7UIQJ.cjs +94 -0
- package/dist/chunk-6SA7UIQJ.cjs.map +1 -0
- package/dist/chunk-6ZR4QC3O.cjs +12 -0
- package/dist/{chunk-Q3ZZLU3O.cjs.map → chunk-6ZR4QC3O.cjs.map} +1 -1
- package/dist/chunk-73KASJGO.cjs +52 -0
- package/dist/chunk-73KASJGO.cjs.map +1 -0
- package/dist/{chunk-R2LA6MKR.cjs → chunk-7JGLPAFV.cjs} +8 -8
- package/dist/{chunk-R2LA6MKR.cjs.map → chunk-7JGLPAFV.cjs.map} +1 -1
- package/dist/chunk-A3W7QG7K.js +45 -0
- package/dist/chunk-A3W7QG7K.js.map +1 -0
- package/dist/{chunk-Q5ASTPM4.cjs → chunk-ASYQDPPU.cjs} +19 -19
- package/dist/{chunk-Q5ASTPM4.cjs.map → chunk-ASYQDPPU.cjs.map} +1 -1
- package/dist/{chunk-IE2TPFBT.js → chunk-ATTXBMAX.js} +4 -74
- package/dist/chunk-ATTXBMAX.js.map +1 -0
- package/dist/chunk-AW4A3P5A.cjs +51 -0
- package/dist/chunk-AW4A3P5A.cjs.map +1 -0
- package/dist/{chunk-ZYQEXGYC.cjs → chunk-CIINW6PS.cjs} +92 -87
- package/dist/chunk-CIINW6PS.cjs.map +1 -0
- package/dist/{chunk-UP4QAJND.cjs → chunk-FLOI7QOT.cjs} +66 -65
- package/dist/chunk-FLOI7QOT.cjs.map +1 -0
- package/dist/{chunk-7V335GHG.cjs → chunk-FLRCVI2G.cjs} +12 -2
- package/dist/chunk-FLRCVI2G.cjs.map +1 -0
- package/dist/{chunk-HKN622O4.js → chunk-GKFWM3DS.js} +4 -32
- package/dist/chunk-GKFWM3DS.js.map +1 -0
- package/dist/chunk-HTGDWIDE.cjs +89 -0
- package/dist/chunk-HTGDWIDE.cjs.map +1 -0
- package/dist/{chunk-OGUH56BB.js → chunk-IJORSAC3.js} +6 -42
- package/dist/chunk-IJORSAC3.js.map +1 -0
- package/dist/{chunk-G6P3OVDY.cjs → chunk-JIEJCTDS.cjs} +18 -2
- package/dist/chunk-JIEJCTDS.cjs.map +1 -0
- package/dist/{chunk-NZ5PMBTG.js → chunk-K5P5OZXS.js} +12 -3
- package/dist/chunk-K5P5OZXS.js.map +1 -0
- package/dist/{chunk-HM6XMR3E.cjs → chunk-KTIEB7VH.cjs} +42 -32
- package/dist/chunk-KTIEB7VH.cjs.map +1 -0
- package/dist/chunk-LJLMDDCW.js +282 -0
- package/dist/chunk-LJLMDDCW.js.map +1 -0
- package/dist/{chunk-Z36W5WUM.js → chunk-MAQJYNJR.js} +3 -3
- package/dist/{chunk-Z36W5WUM.js.map → chunk-MAQJYNJR.js.map} +1 -1
- package/dist/{chunk-N3VVQDMA.js → chunk-MXE2U3EX.js} +3 -3
- package/dist/{chunk-N3VVQDMA.js.map → chunk-MXE2U3EX.js.map} +1 -1
- package/dist/{chunk-4K6IHUW6.cjs → chunk-N2MBPTAF.cjs} +14 -14
- package/dist/{chunk-4K6IHUW6.cjs.map → chunk-N2MBPTAF.cjs.map} +1 -1
- package/dist/{chunk-CUZGBWFT.js → chunk-O4VUR6SI.js} +3 -3
- package/dist/{chunk-CUZGBWFT.js.map → chunk-O4VUR6SI.js.map} +1 -1
- package/dist/chunk-RZ4DH4E7.cjs +15832 -0
- package/dist/chunk-RZ4DH4E7.cjs.map +1 -0
- package/dist/chunk-SAJSMR2B.js +35 -0
- package/dist/chunk-SAJSMR2B.js.map +1 -0
- package/dist/{chunk-RU5BBUU2.cjs → chunk-SFFJ2IKN.cjs} +71 -67
- package/dist/chunk-SFFJ2IKN.cjs.map +1 -0
- package/dist/{chunk-Y52UNT66.js → chunk-STP7QVUB.js} +8 -7
- package/dist/chunk-STP7QVUB.js.map +1 -0
- package/dist/chunk-THX25XW6.js +590 -0
- package/dist/chunk-THX25XW6.js.map +1 -0
- package/dist/{chunk-MB363HT5.js → chunk-TQOYM4LN.js} +18 -3
- package/dist/chunk-TQOYM4LN.js.map +1 -0
- package/dist/chunk-UIFEEPME.js +15787 -0
- package/dist/chunk-UIFEEPME.js.map +1 -0
- package/dist/{chunk-GPUNAJFH.js → chunk-UJ4V3YUQ.js} +3 -3
- package/dist/{chunk-GPUNAJFH.js.map → chunk-UJ4V3YUQ.js.map} +1 -1
- package/dist/{chunk-C2RWFIYP.cjs → chunk-V4IQYOQ4.cjs} +127 -511
- package/dist/chunk-V4IQYOQ4.cjs.map +1 -0
- package/dist/chunk-VMEWZU2N.cjs +287 -0
- package/dist/chunk-VMEWZU2N.cjs.map +1 -0
- package/dist/{chunk-3DTLDGIM.js → chunk-VZX2KSY3.js} +14 -9
- package/dist/chunk-VZX2KSY3.js.map +1 -0
- package/dist/{chunk-BMDF2S7S.js → chunk-WYTUF3QO.js} +3 -3
- package/dist/{chunk-BMDF2S7S.js.map → chunk-WYTUF3QO.js.map} +1 -1
- package/dist/{chunk-MRMD7S7E.js → chunk-XKJQQQVR.js} +9 -8
- package/dist/chunk-XKJQQQVR.js.map +1 -0
- package/dist/{chunk-SFNUHFON.js → chunk-YCV72E6L.js} +25 -19
- package/dist/chunk-YCV72E6L.js.map +1 -0
- package/dist/{chunk-VGU26WIU.cjs → chunk-YQGLVWB2.cjs} +4 -4
- package/dist/{chunk-VGU26WIU.cjs.map → chunk-YQGLVWB2.cjs.map} +1 -1
- package/dist/{ddl-BwH00BB6.d.ts → ddl-BJcPrB4L.d.ts} +3 -3
- package/dist/{ddl-D3o-RmsV.d.cts → ddl-CPZ7mB7X.d.cts} +3 -3
- package/dist/{extension-types-CwHV-Uk4.d.ts → extension-types-D1k0inWU.d.cts} +1 -1
- package/dist/{extension-types-CwHV-Uk4.d.cts → extension-types-D1k0inWU.d.ts} +1 -1
- package/dist/graph-extension/index.cjs +19 -19
- package/dist/graph-extension/index.d.cts +5 -16
- package/dist/graph-extension/index.d.ts +5 -16
- package/dist/graph-extension/index.js +4 -4
- package/dist/graph-merge/index.cjs +3822 -0
- package/dist/graph-merge/index.cjs.map +1 -0
- package/dist/graph-merge/index.d.cts +1191 -0
- package/dist/graph-merge/index.d.ts +1191 -0
- package/dist/graph-merge/index.js +3791 -0
- package/dist/graph-merge/index.js.map +1 -0
- package/dist/{index-CapHwi1a.d.ts → index-BEK0VtNB.d.ts} +11 -3
- package/dist/{index-jPPexxM5.d.cts → index-C8sSTErx.d.cts} +11 -3
- package/dist/index.cjs +365 -15732
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -11
- package/dist/index.d.ts +12 -11
- package/dist/index.js +27 -15533
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +32 -28
- package/dist/indexes/index.d.cts +5 -5
- package/dist/indexes/index.d.ts +5 -5
- package/dist/indexes/index.js +8 -4
- package/dist/interchange/index.cjs +50 -593
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +5 -5
- package/dist/interchange/index.d.ts +5 -5
- package/dist/interchange/index.js +3 -589
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-BUugwCYz.d.ts → manager-By-WEd8M.d.ts} +3 -3
- package/dist/{manager-DpIpn1HQ.d.cts → manager-Np7VVSlE.d.cts} +3 -3
- package/dist/{materialize-indexes-lkawaDor.d.ts → materialize-indexes-CAGhqPHQ.d.ts} +1 -1
- package/dist/{materialize-indexes-oanE3RU0.d.cts → materialize-indexes-DEYkU-wr.d.cts} +1 -1
- package/dist/{postgres-CQL9UIn2.d.cts → postgres-4J2tmauh.d.cts} +1 -1
- package/dist/{postgres-CcRLaxz0.d.ts → postgres-BdIb7tS_.d.ts} +1 -1
- package/dist/profiler/index.cjs +9 -9
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +2 -2
- package/dist/result-DWo6mUVz.d.cts +37 -0
- package/dist/result-DWo6mUVz.d.ts +37 -0
- package/dist/schema/index.cjs +33 -32
- package/dist/schema/index.cjs.map +1 -1
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +10 -9
- package/dist/schema/index.js.map +1 -1
- package/dist/{sqlite-Rj3xu4It.d.cts → sqlite-Gatk_iw_.d.cts} +1 -1
- package/dist/{sqlite-CZDFUfHS.d.ts → sqlite-aM_PAz-O.d.ts} +1 -1
- package/dist/{store-B43FpOVX.d.cts → store-DuCbdqsh.d.cts} +84 -44
- package/dist/{store-De0Y33wP.d.ts → store-MloRPwb9.d.ts} +84 -44
- package/dist/{types-DXCSyxac.d.cts → types-BKQljXom.d.ts} +18 -2
- package/dist/{types-CmAT-Z47.d.ts → types-C1CYxWrL.d.cts} +18 -2
- package/dist/{types-Bwlp_yvu.d.cts → types-DoByHGyU.d.cts} +2 -2
- package/dist/{types-B5GSeE3t.d.ts → types-K3vpaJAL.d.ts} +2 -2
- package/dist/{where-CP4qGIHd.d.ts → where-Dt49bvo6.d.ts} +2 -2
- package/dist/{where-2dsyYt3d.d.cts → where-DydZjGOb.d.cts} +2 -2
- package/package.json +6 -1
- package/dist/chunk-3DTLDGIM.js.map +0 -1
- package/dist/chunk-7KLVFWXR.js.map +0 -1
- package/dist/chunk-7V335GHG.cjs.map +0 -1
- package/dist/chunk-A4H6QMV4.js.map +0 -1
- package/dist/chunk-C2RWFIYP.cjs.map +0 -1
- package/dist/chunk-F2Q76CQ4.cjs.map +0 -1
- package/dist/chunk-G6P3OVDY.cjs.map +0 -1
- package/dist/chunk-HKN622O4.js.map +0 -1
- package/dist/chunk-HM6XMR3E.cjs.map +0 -1
- package/dist/chunk-IE2TPFBT.js.map +0 -1
- package/dist/chunk-KGAJ5HFO.cjs.map +0 -1
- package/dist/chunk-MB363HT5.js.map +0 -1
- package/dist/chunk-MRMD7S7E.js.map +0 -1
- package/dist/chunk-NZ5PMBTG.js.map +0 -1
- package/dist/chunk-OGUH56BB.js.map +0 -1
- package/dist/chunk-Q3ZZLU3O.cjs +0 -12
- package/dist/chunk-RU5BBUU2.cjs.map +0 -1
- package/dist/chunk-SFNUHFON.js.map +0 -1
- package/dist/chunk-UP4QAJND.cjs.map +0 -1
- package/dist/chunk-UPBXUOW7.cjs.map +0 -1
- package/dist/chunk-XTQHSOIC.cjs.map +0 -1
- package/dist/chunk-Y52UNT66.js.map +0 -1
- package/dist/chunk-ZYQEXGYC.cjs.map +0 -1
|
@@ -1,30 +1,31 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
6
|
-
var chunkUPBXUOW7_cjs = require('./chunk-UPBXUOW7.cjs');
|
|
7
|
-
var chunkVGU26WIU_cjs = require('./chunk-VGU26WIU.cjs');
|
|
3
|
+
var chunk7JGLPAFV_cjs = require('./chunk-7JGLPAFV.cjs');
|
|
4
|
+
var chunk6RMLO5O4_cjs = require('./chunk-6RMLO5O4.cjs');
|
|
5
|
+
var chunkYQGLVWB2_cjs = require('./chunk-YQGLVWB2.cjs');
|
|
8
6
|
var chunkZFWNO3GE_cjs = require('./chunk-ZFWNO3GE.cjs');
|
|
9
|
-
var
|
|
7
|
+
var chunkKTIEB7VH_cjs = require('./chunk-KTIEB7VH.cjs');
|
|
8
|
+
var chunkRP7YITHX_cjs = require('./chunk-RP7YITHX.cjs');
|
|
9
|
+
var chunk73KASJGO_cjs = require('./chunk-73KASJGO.cjs');
|
|
10
|
+
var chunkJIEJCTDS_cjs = require('./chunk-JIEJCTDS.cjs');
|
|
10
11
|
var zod = require('zod');
|
|
11
12
|
|
|
12
13
|
// src/core/node.ts
|
|
13
14
|
function validateSchemaKeys(schema, name) {
|
|
14
|
-
|
|
15
|
+
chunkKTIEB7VH_cjs.assertSchemaKeysAreFree(
|
|
15
16
|
"Node",
|
|
16
17
|
name,
|
|
17
18
|
Object.keys(schema.shape),
|
|
18
|
-
|
|
19
|
+
chunkKTIEB7VH_cjs.RESERVED_NODE_KEYS
|
|
19
20
|
);
|
|
20
21
|
}
|
|
21
22
|
function defineNode(name, options) {
|
|
22
23
|
validateSchemaKeys(options.schema, name);
|
|
23
24
|
if (options.annotations !== void 0) {
|
|
24
|
-
|
|
25
|
+
chunkKTIEB7VH_cjs.assertJsonValue(options.annotations, "annotations", `Node "${name}"`);
|
|
25
26
|
}
|
|
26
27
|
return Object.freeze({
|
|
27
|
-
[
|
|
28
|
+
[chunk7JGLPAFV_cjs.NODE_TYPE_BRAND]: true,
|
|
28
29
|
kind: name,
|
|
29
30
|
schema: options.schema,
|
|
30
31
|
description: options.description,
|
|
@@ -33,21 +34,21 @@ function defineNode(name, options) {
|
|
|
33
34
|
}
|
|
34
35
|
var EMPTY_SCHEMA = zod.z.object({});
|
|
35
36
|
function validateSchemaKeys2(schema, name) {
|
|
36
|
-
|
|
37
|
+
chunkKTIEB7VH_cjs.assertSchemaKeysAreFree(
|
|
37
38
|
"Edge",
|
|
38
39
|
name,
|
|
39
40
|
Object.keys(schema.shape),
|
|
40
|
-
|
|
41
|
+
chunkKTIEB7VH_cjs.RESERVED_EDGE_KEYS
|
|
41
42
|
);
|
|
42
43
|
}
|
|
43
44
|
function defineEdge(name, options) {
|
|
44
45
|
const schema = options?.schema ?? EMPTY_SCHEMA;
|
|
45
46
|
validateSchemaKeys2(schema, name);
|
|
46
47
|
if (options?.annotations !== void 0) {
|
|
47
|
-
|
|
48
|
+
chunkKTIEB7VH_cjs.assertJsonValue(options.annotations, "annotations", `Edge "${name}"`);
|
|
48
49
|
}
|
|
49
50
|
return Object.freeze({
|
|
50
|
-
[
|
|
51
|
+
[chunk7JGLPAFV_cjs.EDGE_TYPE_BRAND]: true,
|
|
51
52
|
kind: name,
|
|
52
53
|
schema,
|
|
53
54
|
description: options?.description,
|
|
@@ -84,7 +85,7 @@ function createMetaEdge(name, properties) {
|
|
|
84
85
|
}
|
|
85
86
|
});
|
|
86
87
|
}
|
|
87
|
-
var subClassOfMetaEdge = createMetaEdge(
|
|
88
|
+
var subClassOfMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_SUB_CLASS_OF, {
|
|
88
89
|
transitive: true,
|
|
89
90
|
inference: "subsumption",
|
|
90
91
|
description: "Type inheritance (Podcast subClassOf Media)"
|
|
@@ -96,9 +97,9 @@ function subClassOf(child, parent) {
|
|
|
96
97
|
to: parent
|
|
97
98
|
};
|
|
98
99
|
}
|
|
99
|
-
var broaderMetaEdge = createMetaEdge(
|
|
100
|
+
var broaderMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_BROADER, {
|
|
100
101
|
transitive: true,
|
|
101
|
-
inverse:
|
|
102
|
+
inverse: chunkKTIEB7VH_cjs.META_EDGE_NARROWER,
|
|
102
103
|
inference: "hierarchy",
|
|
103
104
|
description: "Broader concept (ML broader AI)"
|
|
104
105
|
});
|
|
@@ -109,9 +110,9 @@ function broader(narrowerConcept, broaderConcept) {
|
|
|
109
110
|
to: broaderConcept
|
|
110
111
|
};
|
|
111
112
|
}
|
|
112
|
-
var narrowerMetaEdge = createMetaEdge(
|
|
113
|
+
var narrowerMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_NARROWER, {
|
|
113
114
|
transitive: true,
|
|
114
|
-
inverse:
|
|
115
|
+
inverse: chunkKTIEB7VH_cjs.META_EDGE_BROADER,
|
|
115
116
|
inference: "hierarchy",
|
|
116
117
|
description: "Narrower concept (AI narrower ML)"
|
|
117
118
|
});
|
|
@@ -122,7 +123,7 @@ function narrower(broaderConcept, narrowerConcept) {
|
|
|
122
123
|
to: narrowerConcept
|
|
123
124
|
};
|
|
124
125
|
}
|
|
125
|
-
var relatedToMetaEdge = createMetaEdge(
|
|
126
|
+
var relatedToMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_RELATED_TO, {
|
|
126
127
|
symmetric: true,
|
|
127
128
|
inference: "association",
|
|
128
129
|
description: "Non-hierarchical association"
|
|
@@ -134,7 +135,7 @@ function relatedTo(conceptA, conceptB) {
|
|
|
134
135
|
to: conceptB
|
|
135
136
|
};
|
|
136
137
|
}
|
|
137
|
-
var equivalentToMetaEdge = createMetaEdge(
|
|
138
|
+
var equivalentToMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_EQUIVALENT_TO, {
|
|
138
139
|
symmetric: true,
|
|
139
140
|
transitive: true,
|
|
140
141
|
inference: "substitution",
|
|
@@ -147,7 +148,7 @@ function equivalentTo(kindA, kindBOrIri) {
|
|
|
147
148
|
to: kindBOrIri
|
|
148
149
|
};
|
|
149
150
|
}
|
|
150
|
-
var sameAsMetaEdge = createMetaEdge(
|
|
151
|
+
var sameAsMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_SAME_AS, {
|
|
151
152
|
symmetric: true,
|
|
152
153
|
transitive: true,
|
|
153
154
|
inference: "substitution",
|
|
@@ -160,7 +161,7 @@ function sameAs(kindA, kindBOrIri) {
|
|
|
160
161
|
to: kindBOrIri
|
|
161
162
|
};
|
|
162
163
|
}
|
|
163
|
-
var differentFromMetaEdge = createMetaEdge(
|
|
164
|
+
var differentFromMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_DIFFERENT_FROM, {
|
|
164
165
|
symmetric: true,
|
|
165
166
|
inference: "constraint",
|
|
166
167
|
description: "Explicitly different individuals"
|
|
@@ -172,7 +173,7 @@ function differentFrom(kindA, kindB) {
|
|
|
172
173
|
to: kindB
|
|
173
174
|
};
|
|
174
175
|
}
|
|
175
|
-
var disjointWithMetaEdge = createMetaEdge(
|
|
176
|
+
var disjointWithMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_DISJOINT_WITH, {
|
|
176
177
|
symmetric: true,
|
|
177
178
|
inference: "constraint",
|
|
178
179
|
description: "Mutually exclusive types"
|
|
@@ -184,9 +185,9 @@ function disjointWith(kindA, kindB) {
|
|
|
184
185
|
to: kindB
|
|
185
186
|
};
|
|
186
187
|
}
|
|
187
|
-
var partOfMetaEdge = createMetaEdge(
|
|
188
|
+
var partOfMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_PART_OF, {
|
|
188
189
|
transitive: true,
|
|
189
|
-
inverse:
|
|
190
|
+
inverse: chunkKTIEB7VH_cjs.META_EDGE_HAS_PART,
|
|
190
191
|
inference: "composition",
|
|
191
192
|
description: "X is part of Y"
|
|
192
193
|
});
|
|
@@ -197,9 +198,9 @@ function partOf(part, whole) {
|
|
|
197
198
|
to: whole
|
|
198
199
|
};
|
|
199
200
|
}
|
|
200
|
-
var hasPartMetaEdge = createMetaEdge(
|
|
201
|
+
var hasPartMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_HAS_PART, {
|
|
201
202
|
transitive: true,
|
|
202
|
-
inverse:
|
|
203
|
+
inverse: chunkKTIEB7VH_cjs.META_EDGE_PART_OF,
|
|
203
204
|
inference: "composition",
|
|
204
205
|
description: "Y has part X"
|
|
205
206
|
});
|
|
@@ -210,12 +211,12 @@ function hasPart(whole, part) {
|
|
|
210
211
|
to: part
|
|
211
212
|
};
|
|
212
213
|
}
|
|
213
|
-
var inverseOfMetaEdge = createMetaEdge(
|
|
214
|
+
var inverseOfMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_INVERSE_OF, {
|
|
214
215
|
symmetric: true,
|
|
215
216
|
inference: "none",
|
|
216
217
|
description: "Edge A is inverse of edge B"
|
|
217
218
|
});
|
|
218
|
-
var impliesMetaEdge = createMetaEdge(
|
|
219
|
+
var impliesMetaEdge = createMetaEdge(chunkKTIEB7VH_cjs.META_EDGE_IMPLIES, {
|
|
219
220
|
transitive: true,
|
|
220
221
|
inference: "none",
|
|
221
222
|
description: "Edge A implies edge B exists"
|
|
@@ -804,7 +805,7 @@ var KindRegistry = class {
|
|
|
804
805
|
* Checks if child is a subclass of parent (directly or transitively).
|
|
805
806
|
*/
|
|
806
807
|
isSubClassOf(child, parent) {
|
|
807
|
-
return
|
|
808
|
+
return chunkKTIEB7VH_cjs.isReachable(this.subClassAncestors, child, parent);
|
|
808
809
|
}
|
|
809
810
|
/**
|
|
810
811
|
* Expands a kind to include all its subclasses.
|
|
@@ -831,13 +832,13 @@ var KindRegistry = class {
|
|
|
831
832
|
* Checks if narrowerConcept is narrower than broaderConcept.
|
|
832
833
|
*/
|
|
833
834
|
isNarrowerThan(narrowerConcept, broaderConcept) {
|
|
834
|
-
return
|
|
835
|
+
return chunkKTIEB7VH_cjs.isReachable(this.broaderClosure, narrowerConcept, broaderConcept);
|
|
835
836
|
}
|
|
836
837
|
/**
|
|
837
838
|
* Checks if broaderConcept is broader than narrowerConcept.
|
|
838
839
|
*/
|
|
839
840
|
isBroaderThan(broaderConcept, narrowerConcept) {
|
|
840
|
-
return
|
|
841
|
+
return chunkKTIEB7VH_cjs.isReachable(this.narrowerClosure, broaderConcept, narrowerConcept);
|
|
841
842
|
}
|
|
842
843
|
/**
|
|
843
844
|
* Expands to include all narrower concepts.
|
|
@@ -901,7 +902,7 @@ var KindRegistry = class {
|
|
|
901
902
|
* Checks if part is part of whole (directly or transitively).
|
|
902
903
|
*/
|
|
903
904
|
isPartOf(part, whole) {
|
|
904
|
-
return
|
|
905
|
+
return chunkKTIEB7VH_cjs.isReachable(this.partOfClosure, part, whole);
|
|
905
906
|
}
|
|
906
907
|
/**
|
|
907
908
|
* Gets all wholes that contain this part.
|
|
@@ -1012,57 +1013,57 @@ function computeClosuresFromOntology(ontology) {
|
|
|
1012
1013
|
const fromName = getKindName(relation.from);
|
|
1013
1014
|
const toName = getKindName(relation.to);
|
|
1014
1015
|
switch (relation.metaEdge.name) {
|
|
1015
|
-
case
|
|
1016
|
+
case chunkKTIEB7VH_cjs.META_EDGE_SUB_CLASS_OF: {
|
|
1016
1017
|
subClassRelations.push([fromName, toName]);
|
|
1017
1018
|
break;
|
|
1018
1019
|
}
|
|
1019
|
-
case
|
|
1020
|
+
case chunkKTIEB7VH_cjs.META_EDGE_BROADER: {
|
|
1020
1021
|
broaderRelations.push([fromName, toName]);
|
|
1021
1022
|
break;
|
|
1022
1023
|
}
|
|
1023
|
-
case
|
|
1024
|
+
case chunkKTIEB7VH_cjs.META_EDGE_NARROWER: {
|
|
1024
1025
|
broaderRelations.push([toName, fromName]);
|
|
1025
1026
|
break;
|
|
1026
1027
|
}
|
|
1027
|
-
case
|
|
1028
|
-
case
|
|
1028
|
+
case chunkKTIEB7VH_cjs.META_EDGE_EQUIVALENT_TO:
|
|
1029
|
+
case chunkKTIEB7VH_cjs.META_EDGE_SAME_AS: {
|
|
1029
1030
|
equivalentRelations.push([fromName, toName]);
|
|
1030
1031
|
break;
|
|
1031
1032
|
}
|
|
1032
|
-
case
|
|
1033
|
+
case chunkKTIEB7VH_cjs.META_EDGE_DISJOINT_WITH: {
|
|
1033
1034
|
disjointRelations.push([fromName, toName]);
|
|
1034
1035
|
break;
|
|
1035
1036
|
}
|
|
1036
|
-
case
|
|
1037
|
+
case chunkKTIEB7VH_cjs.META_EDGE_PART_OF: {
|
|
1037
1038
|
partOfRelations.push([fromName, toName]);
|
|
1038
1039
|
break;
|
|
1039
1040
|
}
|
|
1040
|
-
case
|
|
1041
|
+
case chunkKTIEB7VH_cjs.META_EDGE_HAS_PART: {
|
|
1041
1042
|
partOfRelations.push([toName, fromName]);
|
|
1042
1043
|
break;
|
|
1043
1044
|
}
|
|
1044
|
-
case
|
|
1045
|
+
case chunkKTIEB7VH_cjs.META_EDGE_INVERSE_OF: {
|
|
1045
1046
|
inverseOfRelations.push([fromName, toName]);
|
|
1046
1047
|
break;
|
|
1047
1048
|
}
|
|
1048
|
-
case
|
|
1049
|
+
case chunkKTIEB7VH_cjs.META_EDGE_IMPLIES: {
|
|
1049
1050
|
impliesRelations.push([fromName, toName]);
|
|
1050
1051
|
break;
|
|
1051
1052
|
}
|
|
1052
1053
|
}
|
|
1053
1054
|
}
|
|
1054
|
-
const subClassAncestors =
|
|
1055
|
-
const subClassDescendants =
|
|
1056
|
-
const broaderClosure =
|
|
1057
|
-
const narrowerClosure =
|
|
1055
|
+
const subClassAncestors = chunkKTIEB7VH_cjs.computeTransitiveClosure(subClassRelations);
|
|
1056
|
+
const subClassDescendants = chunkKTIEB7VH_cjs.invertClosure(subClassAncestors);
|
|
1057
|
+
const broaderClosure = chunkKTIEB7VH_cjs.computeTransitiveClosure(broaderRelations);
|
|
1058
|
+
const narrowerClosure = chunkKTIEB7VH_cjs.invertClosure(broaderClosure);
|
|
1058
1059
|
const equivalenceSets = computeEquivalenceSets(equivalentRelations);
|
|
1059
1060
|
const iriToKind = computeIriMapping(equivalentRelations);
|
|
1060
1061
|
const disjointPairs = computeDisjointPairs(disjointRelations);
|
|
1061
|
-
const partOfClosure =
|
|
1062
|
-
const hasPartClosure =
|
|
1062
|
+
const partOfClosure = chunkKTIEB7VH_cjs.computeTransitiveClosure(partOfRelations);
|
|
1063
|
+
const hasPartClosure = chunkKTIEB7VH_cjs.invertClosure(partOfClosure);
|
|
1063
1064
|
const edgeInverses = computeEdgeInverses(inverseOfRelations);
|
|
1064
|
-
const edgeImplicationsClosure =
|
|
1065
|
-
const edgeImplyingClosure =
|
|
1065
|
+
const edgeImplicationsClosure = chunkKTIEB7VH_cjs.computeTransitiveClosure(impliesRelations);
|
|
1066
|
+
const edgeImplyingClosure = chunkKTIEB7VH_cjs.invertClosure(edgeImplicationsClosure);
|
|
1066
1067
|
return {
|
|
1067
1068
|
subClassAncestors,
|
|
1068
1069
|
subClassDescendants,
|
|
@@ -1166,7 +1167,7 @@ function serializeSchema(graph, version) {
|
|
|
1166
1167
|
return {
|
|
1167
1168
|
graphId: graph.id,
|
|
1168
1169
|
version,
|
|
1169
|
-
generatedAt:
|
|
1170
|
+
generatedAt: chunk7JGLPAFV_cjs.nowIso(),
|
|
1170
1171
|
nodes,
|
|
1171
1172
|
edges,
|
|
1172
1173
|
ontology,
|
|
@@ -1197,7 +1198,7 @@ function serializeDeprecatedKinds(set) {
|
|
|
1197
1198
|
function canonicalExtension(document) {
|
|
1198
1199
|
if (document === void 0) return void 0;
|
|
1199
1200
|
if (document.version === void 0) return document;
|
|
1200
|
-
if (document.version !==
|
|
1201
|
+
if (document.version !== chunkKTIEB7VH_cjs.LEGACY_GRAPH_EXTENSION_VERSION) return document;
|
|
1201
1202
|
const { version: _omit, ...rest } = document;
|
|
1202
1203
|
return rest;
|
|
1203
1204
|
}
|
|
@@ -1271,7 +1272,7 @@ function serializeEdgeIndexDeclaration(declaration) {
|
|
|
1271
1272
|
}
|
|
1272
1273
|
function serializeNodes(graph) {
|
|
1273
1274
|
const result = {};
|
|
1274
|
-
for (const kindName of
|
|
1275
|
+
for (const kindName of chunk7JGLPAFV_cjs.getNodeKinds(graph)) {
|
|
1275
1276
|
const registration = graph.nodes[kindName];
|
|
1276
1277
|
if (registration === void 0) continue;
|
|
1277
1278
|
result[kindName] = serializeNodeDef(registration);
|
|
@@ -1339,7 +1340,7 @@ function deserializeWherePredicate(serialized) {
|
|
|
1339
1340
|
}
|
|
1340
1341
|
function serializeEdges(graph) {
|
|
1341
1342
|
const result = {};
|
|
1342
|
-
for (const kindName of
|
|
1343
|
+
for (const kindName of chunk7JGLPAFV_cjs.getEdgeKinds(graph)) {
|
|
1343
1344
|
const registration = graph.edges[kindName];
|
|
1344
1345
|
if (registration === void 0) continue;
|
|
1345
1346
|
result[kindName] = serializeEdgeDef(registration);
|
|
@@ -1488,7 +1489,7 @@ async function computeSchemaHash(schema) {
|
|
|
1488
1489
|
...schema.deprecatedKinds === void 0 ? {} : { deprecatedKinds: schema.deprecatedKinds }
|
|
1489
1490
|
};
|
|
1490
1491
|
const json = JSON.stringify(hashable, chunkRP7YITHX_cjs.sortedReplacer);
|
|
1491
|
-
return
|
|
1492
|
+
return chunk73KASJGO_cjs.sha256Hex(json);
|
|
1492
1493
|
}
|
|
1493
1494
|
var COMPILE_NODE_CACHE = /* @__PURE__ */ new Map();
|
|
1494
1495
|
var COMPILE_EDGE_SCHEMA_CACHE = /* @__PURE__ */ new WeakMap();
|
|
@@ -1536,7 +1537,7 @@ function compileNode(kindName, document) {
|
|
|
1536
1537
|
const schema = buildObjectSchema(document.properties);
|
|
1537
1538
|
const type = defineNode(
|
|
1538
1539
|
kindName,
|
|
1539
|
-
|
|
1540
|
+
chunkKTIEB7VH_cjs.compactUndefined({
|
|
1540
1541
|
schema,
|
|
1541
1542
|
description: document.description,
|
|
1542
1543
|
annotations: document.annotations
|
|
@@ -1560,7 +1561,7 @@ function compileEdge(kindName, document, nodeTypeByName) {
|
|
|
1560
1561
|
(name) => nodeTypeByName.get(name) ?? name
|
|
1561
1562
|
);
|
|
1562
1563
|
return Object.freeze(
|
|
1563
|
-
|
|
1564
|
+
chunkKTIEB7VH_cjs.compactUndefined({
|
|
1564
1565
|
kindName,
|
|
1565
1566
|
schema,
|
|
1566
1567
|
description: document.description,
|
|
@@ -1604,7 +1605,7 @@ function compileProperty(property) {
|
|
|
1604
1605
|
}
|
|
1605
1606
|
function compileStringProperty(property) {
|
|
1606
1607
|
if (property.searchable !== void 0) {
|
|
1607
|
-
return applyStringRefinements(
|
|
1608
|
+
return applyStringRefinements(chunkYQGLVWB2_cjs.searchable(property.searchable), property);
|
|
1608
1609
|
}
|
|
1609
1610
|
if (property.format === void 0) {
|
|
1610
1611
|
return applyStringRefinements(zod.z.string(), property);
|
|
@@ -1694,7 +1695,7 @@ function makeWherePredicate(field, op) {
|
|
|
1694
1695
|
};
|
|
1695
1696
|
}
|
|
1696
1697
|
var META_EDGE_BY_NAME = Object.fromEntries(
|
|
1697
|
-
|
|
1698
|
+
chunkKTIEB7VH_cjs.ALL_META_EDGE_NAMES.map((name) => [name, core[`${name}MetaEdge`]])
|
|
1698
1699
|
);
|
|
1699
1700
|
function compileOntologyRelation(relation, nodeTypeByName) {
|
|
1700
1701
|
const metaEdge = META_EDGE_BY_NAME[relation.metaEdge];
|
|
@@ -1733,7 +1734,7 @@ function mergeGraphExtension(graph, document) {
|
|
|
1733
1734
|
if (graph.extension !== void 0 && chunkRP7YITHX_cjs.canonicalEqual(unionDocument, existingDocument)) {
|
|
1734
1735
|
return graph;
|
|
1735
1736
|
}
|
|
1736
|
-
const validatedUnion =
|
|
1737
|
+
const validatedUnion = chunkKTIEB7VH_cjs.unwrap(chunkKTIEB7VH_cjs.validateGraphExtension(unionDocument));
|
|
1737
1738
|
const compiled = compileGraphExtension(validatedUnion);
|
|
1738
1739
|
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = extensionKindNames(existingDocument);
|
|
1739
1740
|
const nodeKinds = /* @__PURE__ */ new Map();
|
|
@@ -1785,7 +1786,7 @@ function mergeGraphExtension(graph, document) {
|
|
|
1785
1786
|
});
|
|
1786
1787
|
const type = defineEdge(
|
|
1787
1788
|
edge.kindName,
|
|
1788
|
-
|
|
1789
|
+
chunkKTIEB7VH_cjs.compactUndefined({
|
|
1789
1790
|
schema: edge.schema,
|
|
1790
1791
|
description: edge.description,
|
|
1791
1792
|
annotations: edge.annotations,
|
|
@@ -1835,7 +1836,7 @@ function deriveGraphExtensionVectorIndexes(compiledNodes) {
|
|
|
1835
1836
|
...compiled.unique.length === 0 ? {} : { unique: [...compiled.unique] }
|
|
1836
1837
|
};
|
|
1837
1838
|
}
|
|
1838
|
-
return
|
|
1839
|
+
return chunk7JGLPAFV_cjs.autoDeriveVectorIndexes(registrations).map(
|
|
1839
1840
|
(index) => Object.freeze({ ...index, origin: "runtime" })
|
|
1840
1841
|
);
|
|
1841
1842
|
}
|
|
@@ -1853,7 +1854,7 @@ function mergeIndexesWithGraphExtension(existing, runtimeIndexes, graphId) {
|
|
|
1853
1854
|
const runtimeRelational = runtimeIndexes.filter(
|
|
1854
1855
|
(index) => index.entity !== "vector"
|
|
1855
1856
|
);
|
|
1856
|
-
const vectorMerged =
|
|
1857
|
+
const vectorMerged = chunk7JGLPAFV_cjs.mergeVectorIndexes(compileTimeIndexes, runtimeVectors);
|
|
1857
1858
|
const merged = [...vectorMerged, ...runtimeRelational];
|
|
1858
1859
|
assertUniqueIndexNames(merged, graphId);
|
|
1859
1860
|
return merged;
|
|
@@ -1865,7 +1866,7 @@ function assertUniqueIndexNames(indexes, graphId) {
|
|
|
1865
1866
|
seen.add(index.name);
|
|
1866
1867
|
continue;
|
|
1867
1868
|
}
|
|
1868
|
-
throw new
|
|
1869
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
1869
1870
|
`Duplicate index name "${index.name}" after merging graph extension into graph "${graphId}". Index names must be unique within a graph.`,
|
|
1870
1871
|
{ graphId, indexName: index.name, code: "DUPLICATE_INDEX_NAME" },
|
|
1871
1872
|
{
|
|
@@ -1881,12 +1882,12 @@ function compileGraphExtensionRelationalIndexes(documents, nodeKinds, mergedEdge
|
|
|
1881
1882
|
if (document.entity === "node") {
|
|
1882
1883
|
const node = nodeKinds.get(document.kind);
|
|
1883
1884
|
if (node === void 0) {
|
|
1884
|
-
throw new
|
|
1885
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(document.kind, "node", {
|
|
1885
1886
|
graphId,
|
|
1886
1887
|
suggestion: "Declare the kind under `nodes` in this graph extension, or remove the index from `indexes`."
|
|
1887
1888
|
});
|
|
1888
1889
|
}
|
|
1889
|
-
const declaration2 =
|
|
1890
|
+
const declaration2 = chunk6RMLO5O4_cjs.defineNodeIndex(
|
|
1890
1891
|
node,
|
|
1891
1892
|
toNodeIndexConfig(document)
|
|
1892
1893
|
);
|
|
@@ -1895,12 +1896,12 @@ function compileGraphExtensionRelationalIndexes(documents, nodeKinds, mergedEdge
|
|
|
1895
1896
|
}
|
|
1896
1897
|
const edgeRegistration = mergedEdges[document.kind];
|
|
1897
1898
|
if (edgeRegistration === void 0) {
|
|
1898
|
-
throw new
|
|
1899
|
+
throw new chunkJIEJCTDS_cjs.KindNotFoundError(document.kind, "edge", {
|
|
1899
1900
|
graphId,
|
|
1900
1901
|
suggestion: "Declare the edge under `edges` in this graph extension, or remove the index from `indexes`."
|
|
1901
1902
|
});
|
|
1902
1903
|
}
|
|
1903
|
-
const declaration =
|
|
1904
|
+
const declaration = chunk6RMLO5O4_cjs.defineEdgeIndex(
|
|
1904
1905
|
edgeRegistration.type,
|
|
1905
1906
|
toEdgeIndexConfig(document)
|
|
1906
1907
|
);
|
|
@@ -1912,7 +1913,7 @@ function buildWhereCallback(where) {
|
|
|
1912
1913
|
return (props) => {
|
|
1913
1914
|
const builder = props[where.field];
|
|
1914
1915
|
if (builder === void 0) {
|
|
1915
|
-
throw new
|
|
1916
|
+
throw new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
1916
1917
|
`Graph-extension index \`where\` references unknown field "${where.field}".`,
|
|
1917
1918
|
{ field: where.field, code: "EXTENSION_INDEX_WHERE_UNKNOWN_FIELD" }
|
|
1918
1919
|
);
|
|
@@ -1921,7 +1922,7 @@ function buildWhereCallback(where) {
|
|
|
1921
1922
|
};
|
|
1922
1923
|
}
|
|
1923
1924
|
function toNodeIndexConfig(document) {
|
|
1924
|
-
return
|
|
1925
|
+
return chunkKTIEB7VH_cjs.compactUndefined({
|
|
1925
1926
|
fields: document.fields,
|
|
1926
1927
|
coveringFields: document.coveringFields,
|
|
1927
1928
|
unique: document.unique,
|
|
@@ -1931,7 +1932,7 @@ function toNodeIndexConfig(document) {
|
|
|
1931
1932
|
});
|
|
1932
1933
|
}
|
|
1933
1934
|
function toEdgeIndexConfig(document) {
|
|
1934
|
-
return
|
|
1935
|
+
return chunkKTIEB7VH_cjs.compactUndefined({
|
|
1935
1936
|
fields: document.fields,
|
|
1936
1937
|
coveringFields: document.coveringFields,
|
|
1937
1938
|
unique: document.unique,
|
|
@@ -1987,14 +1988,14 @@ function isEmptyExtension(extension) {
|
|
|
1987
1988
|
}
|
|
1988
1989
|
function assertNoCollision(kindName, entity, collides, graphId) {
|
|
1989
1990
|
if (!collides) return;
|
|
1990
|
-
throw new
|
|
1991
|
+
throw new chunkKTIEB7VH_cjs.KindCollisionError(kindName, entity, graphId);
|
|
1991
1992
|
}
|
|
1992
1993
|
function resolveEndpoints(entries, nodeKinds, context) {
|
|
1993
1994
|
return entries.map((entry) => {
|
|
1994
1995
|
if (typeof entry !== "string") return entry;
|
|
1995
1996
|
const resolved = nodeKinds.get(entry);
|
|
1996
1997
|
if (resolved === void 0) {
|
|
1997
|
-
throw new
|
|
1998
|
+
throw new chunkKTIEB7VH_cjs.GraphExtensionUnresolvedEndpointError(
|
|
1998
1999
|
context.edgeKind,
|
|
1999
2000
|
context.side,
|
|
2000
2001
|
entry,
|
|
@@ -2339,7 +2340,7 @@ function parseSerializedSchema(json) {
|
|
|
2339
2340
|
try {
|
|
2340
2341
|
parsed = JSON.parse(json);
|
|
2341
2342
|
} catch {
|
|
2342
|
-
throw new
|
|
2343
|
+
throw new chunkJIEJCTDS_cjs.DatabaseOperationError(
|
|
2343
2344
|
"Stored schema document is not valid JSON",
|
|
2344
2345
|
{ operation: "select", entity: "schema" }
|
|
2345
2346
|
);
|
|
@@ -2347,12 +2348,12 @@ function parseSerializedSchema(json) {
|
|
|
2347
2348
|
const result = serializedSchemaZod.safeParse(parsed);
|
|
2348
2349
|
if (!result.success) {
|
|
2349
2350
|
const issues = result.error.issues.map((issue) => `${issue.path.join(".")}: ${issue.message}`).join("; ");
|
|
2350
|
-
throw new
|
|
2351
|
+
throw new chunkJIEJCTDS_cjs.DatabaseOperationError(
|
|
2351
2352
|
`Stored schema document is malformed: ${issues}`,
|
|
2352
2353
|
{ operation: "select", entity: "schema" }
|
|
2353
2354
|
);
|
|
2354
2355
|
}
|
|
2355
|
-
const validated =
|
|
2356
|
+
const validated = chunkKTIEB7VH_cjs.freezeDeep(result.data);
|
|
2356
2357
|
if (PARSE_CACHE.size >= PARSE_CACHE_LIMIT) {
|
|
2357
2358
|
const oldest = PARSE_CACHE.keys().next().value;
|
|
2358
2359
|
if (oldest !== void 0) PARSE_CACHE.delete(oldest);
|
|
@@ -2458,7 +2459,7 @@ async function ensureSchema(backend, graph, options) {
|
|
|
2458
2459
|
}
|
|
2459
2460
|
const actions = getMigrationActions(diff);
|
|
2460
2461
|
if (throwOnBreaking) {
|
|
2461
|
-
throw new
|
|
2462
|
+
throw new chunkJIEJCTDS_cjs.MigrationError(
|
|
2462
2463
|
`Schema migration required: ${diff.summary}. ${actions.length} migration action(s) needed. Use getSchemaChanges() to review, then migrateSchema() to apply.`,
|
|
2463
2464
|
{
|
|
2464
2465
|
graphId: graph.id,
|
|
@@ -2494,7 +2495,7 @@ async function loadAndVerifyGraph(backend, graph) {
|
|
|
2494
2495
|
function schemaBehindError(graphId, fromVersion, diff) {
|
|
2495
2496
|
const actions = getMigrationActions(diff);
|
|
2496
2497
|
const qualifier = isBackwardsCompatible(diff) ? "safe auto-migration" : "breaking change";
|
|
2497
|
-
return new
|
|
2498
|
+
return new chunkJIEJCTDS_cjs.MigrationError(
|
|
2498
2499
|
`Schema verification failed for graph "${graphId}": ${diff.summary} (${qualifier}). ${actions.length} migration action(s) needed. The least-privilege runtime cannot migrate \u2014 run createStoreWithSchema(graph, adminBackend) under a privileged role (after any generated migration SQL, if you manage DDL externally) before attaching with createStore() / createVerifiedStore().`,
|
|
2499
2500
|
{
|
|
2500
2501
|
graphId,
|
|
@@ -2523,7 +2524,7 @@ async function readActiveSchemaPure(backend, graphId) {
|
|
|
2523
2524
|
return activeRow;
|
|
2524
2525
|
}
|
|
2525
2526
|
function schemaNotInitializedError(graphId, cause) {
|
|
2526
|
-
return new
|
|
2527
|
+
return new chunkJIEJCTDS_cjs.ConfigurationError(
|
|
2527
2528
|
`Cannot verify graph "${graphId}": no schema has been initialized. Run createStoreWithSchema(graph, adminBackend) once under a privileged role (which commits the schema_versions row and materializes contribution markers) before attaching with createStore() / createVerifiedStore(). Generated migration SQL creates the tables but does not initialize the schema row.`,
|
|
2528
2529
|
{ graphId },
|
|
2529
2530
|
{
|
|
@@ -2566,7 +2567,7 @@ async function commitNewSchemaVersion(backend, graph, currentVersion) {
|
|
|
2566
2567
|
async function rollbackSchema(backend, graphId, targetVersion) {
|
|
2567
2568
|
const activeRow = await backend.getActiveSchema(graphId);
|
|
2568
2569
|
if (activeRow === void 0) {
|
|
2569
|
-
throw new
|
|
2570
|
+
throw new chunkJIEJCTDS_cjs.MigrationError(
|
|
2570
2571
|
`Cannot rollback graph "${graphId}": no active schema version exists.`,
|
|
2571
2572
|
{ graphId, fromVersion: 0, toVersion: targetVersion }
|
|
2572
2573
|
);
|
|
@@ -2615,7 +2616,7 @@ function validateProps(schema, props, context) {
|
|
|
2615
2616
|
}
|
|
2616
2617
|
const issues = zodIssuesToValidationIssues(result.error);
|
|
2617
2618
|
const location = buildLocationString(context);
|
|
2618
|
-
throw new
|
|
2619
|
+
throw new chunkJIEJCTDS_cjs.ValidationError(
|
|
2619
2620
|
`Invalid ${context.entityType} props for ${location}: ${result.error.message}`,
|
|
2620
2621
|
{
|
|
2621
2622
|
entityType: context.entityType,
|
|
@@ -2642,7 +2643,7 @@ function validateEdgeProps(schema, props, context) {
|
|
|
2642
2643
|
function wrapZodError(error, context) {
|
|
2643
2644
|
const issues = zodIssuesToValidationIssues(error);
|
|
2644
2645
|
const location = buildLocationString(context);
|
|
2645
|
-
return new
|
|
2646
|
+
return new chunkJIEJCTDS_cjs.ValidationError(
|
|
2646
2647
|
`Validation failed for ${context.entityType} ${location}: ${error.message}`,
|
|
2647
2648
|
{
|
|
2648
2649
|
entityType: context.entityType,
|
|
@@ -2655,7 +2656,7 @@ function wrapZodError(error, context) {
|
|
|
2655
2656
|
);
|
|
2656
2657
|
}
|
|
2657
2658
|
function createValidationError(message, issues, context) {
|
|
2658
|
-
return new
|
|
2659
|
+
return new chunkJIEJCTDS_cjs.ValidationError(message, {
|
|
2659
2660
|
...context?.entityType !== void 0 && {
|
|
2660
2661
|
entityType: context.entityType
|
|
2661
2662
|
},
|
|
@@ -2717,5 +2718,5 @@ exports.validateEdgeProps = validateEdgeProps;
|
|
|
2717
2718
|
exports.validateNodeProps = validateNodeProps;
|
|
2718
2719
|
exports.validateProps = validateProps;
|
|
2719
2720
|
exports.wrapZodError = wrapZodError;
|
|
2720
|
-
//# sourceMappingURL=chunk-
|
|
2721
|
-
//# sourceMappingURL=chunk-
|
|
2721
|
+
//# sourceMappingURL=chunk-5DTPBFX5.cjs.map
|
|
2722
|
+
//# sourceMappingURL=chunk-5DTPBFX5.cjs.map
|