@nicia-ai/typegraph 0.3.0 → 0.4.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/index.cjs +6 -6
- package/dist/backend/drizzle/index.d.cts +1 -1
- package/dist/backend/drizzle/index.d.ts +1 -1
- package/dist/backend/drizzle/index.js +4 -4
- package/dist/backend/drizzle/postgres.cjs +4 -4
- package/dist/backend/drizzle/postgres.d.cts +2 -2
- package/dist/backend/drizzle/postgres.d.ts +2 -2
- package/dist/backend/drizzle/postgres.js +3 -3
- package/dist/backend/drizzle/sqlite.cjs +4 -4
- package/dist/backend/drizzle/sqlite.d.cts +1 -1
- package/dist/backend/drizzle/sqlite.d.ts +1 -1
- package/dist/backend/drizzle/sqlite.js +3 -3
- package/dist/backend/postgres/index.cjs +4 -4
- package/dist/backend/postgres/index.d.cts +1 -1
- package/dist/backend/postgres/index.d.ts +1 -1
- package/dist/backend/postgres/index.js +3 -3
- package/dist/backend/sqlite/index.cjs +6 -6
- package/dist/backend/sqlite/index.d.cts +1 -1
- package/dist/backend/sqlite/index.d.ts +1 -1
- package/dist/backend/sqlite/index.js +4 -4
- package/dist/{chunk-OYL2SGBD.cjs → chunk-44SXEVF4.cjs} +18 -2
- package/dist/chunk-44SXEVF4.cjs.map +1 -0
- package/dist/{chunk-SFY2PPOY.cjs → chunk-7RVSDXT3.cjs} +50 -10
- package/dist/chunk-7RVSDXT3.cjs.map +1 -0
- package/dist/{chunk-ZJHQZZT2.cjs → chunk-K2ROKOK3.cjs} +6 -6
- package/dist/{chunk-ZJHQZZT2.cjs.map → chunk-K2ROKOK3.cjs.map} +1 -1
- package/dist/{chunk-DD6ONEBN.cjs → chunk-LDM2AFKZ.cjs} +12 -12
- package/dist/{chunk-DD6ONEBN.cjs.map → chunk-LDM2AFKZ.cjs.map} +1 -1
- package/dist/{chunk-V7CS2MDB.cjs → chunk-LUARLSYT.cjs} +18 -18
- package/dist/chunk-LUARLSYT.cjs.map +1 -0
- package/dist/{chunk-NP4G4ZKM.js → chunk-M5SOQ7UV.js} +4 -4
- package/dist/{chunk-NP4G4ZKM.js.map → chunk-M5SOQ7UV.js.map} +1 -1
- package/dist/{chunk-CMHFS34N.cjs → chunk-NYDXJGA3.cjs} +16 -16
- package/dist/{chunk-CMHFS34N.cjs.map → chunk-NYDXJGA3.cjs.map} +1 -1
- package/dist/{chunk-WE5BKYNB.js → chunk-Q6PXIKRQ.js} +3 -3
- package/dist/chunk-Q6PXIKRQ.js.map +1 -0
- package/dist/{chunk-O5XPCJLF.js → chunk-SJ2QMDXY.js} +18 -3
- package/dist/chunk-SJ2QMDXY.js.map +1 -0
- package/dist/{chunk-XDTYTNYL.js → chunk-TGDFBLGS.js} +3 -3
- package/dist/{chunk-XDTYTNYL.js.map → chunk-TGDFBLGS.js.map} +1 -1
- package/dist/{chunk-F2BZSEFE.js → chunk-ZO2FRJ2U.js} +4 -4
- package/dist/{chunk-F2BZSEFE.js.map → chunk-ZO2FRJ2U.js.map} +1 -1
- package/dist/{chunk-4HARSV2G.js → chunk-ZQGOBVXZ.js} +43 -3
- package/dist/chunk-ZQGOBVXZ.js.map +1 -0
- package/dist/{index-Dkicw49A.d.ts → index-DyrR_d-H.d.cts} +9 -1
- package/dist/{index-Dkicw49A.d.cts → index-DyrR_d-H.d.ts} +9 -1
- package/dist/index.cjs +893 -218
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +7 -7
- package/dist/index.d.ts +7 -7
- package/dist/index.js +687 -16
- package/dist/index.js.map +1 -1
- package/dist/interchange/index.cjs +7 -7
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/interchange/index.js +2 -2
- package/dist/{manager-Jc5Btay9.d.cts → manager-0NysX4s6.d.cts} +1 -1
- package/dist/{manager-e9LXthrx.d.ts → manager-DFKe7ql3.d.ts} +1 -1
- package/dist/profiler/index.d.cts +3 -3
- package/dist/profiler/index.d.ts +3 -3
- package/dist/schema/index.cjs +22 -22
- package/dist/schema/index.d.cts +5 -5
- package/dist/schema/index.d.ts +5 -5
- package/dist/schema/index.js +4 -4
- package/dist/{store-nbBybLWP.d.cts → store-DhoA5uRc.d.cts} +93 -7
- package/dist/{store-DM3Tk3Pw.d.ts → store-SiovWEYA.d.ts} +93 -7
- package/dist/{types-Cdbi4hcx.d.ts → types-6EKrWTs9.d.ts} +14 -0
- package/dist/{types-DDP0MGBF.d.cts → types-BUy-pHKH.d.cts} +14 -0
- package/package.json +2 -2
- package/dist/chunk-4HARSV2G.js.map +0 -1
- package/dist/chunk-O5XPCJLF.js.map +0 -1
- package/dist/chunk-OYL2SGBD.cjs.map +0 -1
- package/dist/chunk-SFY2PPOY.cjs.map +0 -1
- package/dist/chunk-V7CS2MDB.cjs.map +0 -1
- package/dist/chunk-WE5BKYNB.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
3
|
+
var chunkK2ROKOK3_cjs = require('../chunk-K2ROKOK3.cjs');
|
|
4
|
+
require('../chunk-44SXEVF4.cjs');
|
|
5
5
|
var zod = require('zod');
|
|
6
6
|
|
|
7
7
|
var FORMAT_VERSION = "1.0";
|
|
@@ -121,8 +121,8 @@ async function exportGraph(store, options) {
|
|
|
121
121
|
const graph = store.graph;
|
|
122
122
|
const graphId = store.graphId;
|
|
123
123
|
const backend = store.backend;
|
|
124
|
-
const nodeKindsToExport = options_.nodeKinds ??
|
|
125
|
-
const edgeKindsToExport = options_.edgeKinds ??
|
|
124
|
+
const nodeKindsToExport = options_.nodeKinds ?? chunkK2ROKOK3_cjs.getNodeKinds(graph);
|
|
125
|
+
const edgeKindsToExport = options_.edgeKinds ?? chunkK2ROKOK3_cjs.getEdgeKinds(graph);
|
|
126
126
|
const nodes = [];
|
|
127
127
|
for (const kind of nodeKindsToExport) {
|
|
128
128
|
const kindNodes = await exportNodesOfKind(backend, graphId, kind, options_);
|
|
@@ -136,7 +136,7 @@ async function exportGraph(store, options) {
|
|
|
136
136
|
const schemaVersion = await backend.getActiveSchema(graphId);
|
|
137
137
|
return {
|
|
138
138
|
formatVersion: FORMAT_VERSION,
|
|
139
|
-
exportedAt:
|
|
139
|
+
exportedAt: chunkK2ROKOK3_cjs.nowIso(),
|
|
140
140
|
source: {
|
|
141
141
|
type: "typegraph-export",
|
|
142
142
|
graphId,
|
|
@@ -284,7 +284,7 @@ async function importGraph(store, data, options) {
|
|
|
284
284
|
}
|
|
285
285
|
function buildNodeSchemaMap(graph) {
|
|
286
286
|
const map = /* @__PURE__ */ new Map();
|
|
287
|
-
for (const kindName of
|
|
287
|
+
for (const kindName of chunkK2ROKOK3_cjs.getNodeKinds(graph)) {
|
|
288
288
|
const registration = graph.nodes[kindName];
|
|
289
289
|
map.set(kindName, {
|
|
290
290
|
registration,
|
|
@@ -295,7 +295,7 @@ function buildNodeSchemaMap(graph) {
|
|
|
295
295
|
}
|
|
296
296
|
function buildEdgeSchemaMap(graph) {
|
|
297
297
|
const map = /* @__PURE__ */ new Map();
|
|
298
|
-
for (const kindName of
|
|
298
|
+
for (const kindName of chunkK2ROKOK3_cjs.getEdgeKinds(graph)) {
|
|
299
299
|
const registration = graph.edges[kindName];
|
|
300
300
|
map.set(kindName, {
|
|
301
301
|
registration,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { G as GraphDef } from '../manager-
|
|
3
|
-
import { S as Store } from '../store-
|
|
2
|
+
import { G as GraphDef } from '../manager-0NysX4s6.cjs';
|
|
3
|
+
import { S as Store } from '../store-DhoA5uRc.cjs';
|
|
4
4
|
import '../types-DTJEu_-h.cjs';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-BUy-pHKH.cjs';
|
|
6
6
|
import 'drizzle-orm';
|
|
7
7
|
import '../types-BRzHlhKC.cjs';
|
|
8
8
|
import '../ast-D-3bOanX.cjs';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { G as GraphDef } from '../manager-
|
|
3
|
-
import { S as Store } from '../store-
|
|
2
|
+
import { G as GraphDef } from '../manager-DFKe7ql3.js';
|
|
3
|
+
import { S as Store } from '../store-SiovWEYA.js';
|
|
4
4
|
import '../types-DTJEu_-h.js';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-6EKrWTs9.js';
|
|
6
6
|
import 'drizzle-orm';
|
|
7
7
|
import '../types-BRzHlhKC.js';
|
|
8
8
|
import '../ast-CXFx6bF6.js';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { getNodeKinds, getEdgeKinds, nowIso } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { getNodeKinds, getEdgeKinds, nowIso } from '../chunk-TGDFBLGS.js';
|
|
2
|
+
import '../chunk-SJ2QMDXY.js';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
|
|
5
5
|
var FORMAT_VERSION = "1.0";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as NodeRegistration, b as EdgeRegistration, D as DeleteBehavior, T as TemporalMode, N as NodeType, c as EdgeTypeWithEndpoints, G as GraphDefaults, A as AnyEdgeType } from './types-DTJEu_-h.cjs';
|
|
2
|
-
import { O as OntologyRelation, S as SerializedNodeDef, a as SerializedEdgeDef, e as SerializedSchema, G as GraphBackend, i as SchemaVersionRow } from './types-
|
|
2
|
+
import { O as OntologyRelation, S as SerializedNodeDef, a as SerializedEdgeDef, e as SerializedSchema, G as GraphBackend, i as SchemaVersionRow } from './types-BUy-pHKH.cjs';
|
|
3
3
|
|
|
4
4
|
/** Brand key for GraphDef */
|
|
5
5
|
declare const GRAPH_DEF_BRAND: "__graphDef";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { a as NodeRegistration, b as EdgeRegistration, D as DeleteBehavior, T as TemporalMode, N as NodeType, c as EdgeTypeWithEndpoints, G as GraphDefaults, A as AnyEdgeType } from './types-DTJEu_-h.js';
|
|
2
|
-
import { O as OntologyRelation, S as SerializedNodeDef, a as SerializedEdgeDef, e as SerializedSchema, G as GraphBackend, i as SchemaVersionRow } from './types-
|
|
2
|
+
import { O as OntologyRelation, S as SerializedNodeDef, a as SerializedEdgeDef, e as SerializedSchema, G as GraphBackend, i as SchemaVersionRow } from './types-6EKrWTs9.js';
|
|
3
3
|
|
|
4
4
|
/** Brand key for GraphDef */
|
|
5
5
|
declare const GRAPH_DEF_BRAND: "__graphDef";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { G as GraphDef } from '../manager-
|
|
1
|
+
import { G as GraphDef } from '../manager-0NysX4s6.cjs';
|
|
2
2
|
import { Q as QueryAst } from '../ast-D-3bOanX.cjs';
|
|
3
|
-
import { S as Store } from '../store-
|
|
3
|
+
import { S as Store } from '../store-DhoA5uRc.cjs';
|
|
4
4
|
import { P as ProfilerOptions, a as ProfileReport } from '../types-BL1GyVku.cjs';
|
|
5
5
|
export { D as DeclaredIndex, I as IndexRecommendation, b as ProfileSummary, c as PropertyAccessStats, d as PropertyPath, R as RecommendationPriority, U as UsageContext } from '../types-BL1GyVku.cjs';
|
|
6
6
|
import '../types-DTJEu_-h.cjs';
|
|
7
7
|
import 'zod';
|
|
8
|
-
import '../types-
|
|
8
|
+
import '../types-BUy-pHKH.cjs';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
10
|
import '../types-BRzHlhKC.cjs';
|
|
11
11
|
|
package/dist/profiler/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { G as GraphDef } from '../manager-
|
|
1
|
+
import { G as GraphDef } from '../manager-DFKe7ql3.js';
|
|
2
2
|
import { Q as QueryAst } from '../ast-CXFx6bF6.js';
|
|
3
|
-
import { S as Store } from '../store-
|
|
3
|
+
import { S as Store } from '../store-SiovWEYA.js';
|
|
4
4
|
import { P as ProfilerOptions, a as ProfileReport } from '../types-DCGa53O2.js';
|
|
5
5
|
export { D as DeclaredIndex, I as IndexRecommendation, b as ProfileSummary, c as PropertyAccessStats, d as PropertyPath, R as RecommendationPriority, U as UsageContext } from '../types-DCGa53O2.js';
|
|
6
6
|
import '../types-DTJEu_-h.js';
|
|
7
7
|
import 'zod';
|
|
8
|
-
import '../types-
|
|
8
|
+
import '../types-6EKrWTs9.js';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
10
|
import '../types-BRzHlhKC.js';
|
|
11
11
|
|
package/dist/schema/index.cjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
require('../chunk-
|
|
5
|
-
require('../chunk-
|
|
3
|
+
var chunkLDM2AFKZ_cjs = require('../chunk-LDM2AFKZ.cjs');
|
|
4
|
+
require('../chunk-K2ROKOK3.cjs');
|
|
5
|
+
require('../chunk-44SXEVF4.cjs');
|
|
6
6
|
|
|
7
7
|
// src/schema/deserializer.ts
|
|
8
8
|
function deserializeSchema(schema) {
|
|
@@ -42,7 +42,7 @@ function buildRegistryFromClosures(schema) {
|
|
|
42
42
|
const edgeImplyingClosure = recordToMap(closures.edgeImplyingClosure);
|
|
43
43
|
const nodeKinds = /* @__PURE__ */ new Map();
|
|
44
44
|
const edgeKinds = /* @__PURE__ */ new Map();
|
|
45
|
-
return new
|
|
45
|
+
return new chunkLDM2AFKZ_cjs.KindRegistry(nodeKinds, edgeKinds, {
|
|
46
46
|
subClassAncestors,
|
|
47
47
|
subClassDescendants,
|
|
48
48
|
broaderClosure,
|
|
@@ -70,75 +70,75 @@ function simpleRecordToMap(record) {
|
|
|
70
70
|
|
|
71
71
|
Object.defineProperty(exports, "computeSchemaDiff", {
|
|
72
72
|
enumerable: true,
|
|
73
|
-
get: function () { return
|
|
73
|
+
get: function () { return chunkLDM2AFKZ_cjs.computeSchemaDiff; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "computeSchemaHash", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunkLDM2AFKZ_cjs.computeSchemaHash; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "createValidationError", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunkLDM2AFKZ_cjs.createValidationError; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "deserializeWherePredicate", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunkLDM2AFKZ_cjs.deserializeWherePredicate; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "ensureSchema", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunkLDM2AFKZ_cjs.ensureSchema; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "getActiveSchema", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunkLDM2AFKZ_cjs.getActiveSchema; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "getMigrationActions", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunkLDM2AFKZ_cjs.getMigrationActions; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "getSchemaChanges", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunkLDM2AFKZ_cjs.getSchemaChanges; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "initializeSchema", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunkLDM2AFKZ_cjs.initializeSchema; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "isBackwardsCompatible", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunkLDM2AFKZ_cjs.isBackwardsCompatible; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "isSchemaInitialized", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunkLDM2AFKZ_cjs.isSchemaInitialized; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "migrateSchema", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunkLDM2AFKZ_cjs.migrateSchema; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "rollbackSchema", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunkLDM2AFKZ_cjs.rollbackSchema; }
|
|
122
122
|
});
|
|
123
123
|
Object.defineProperty(exports, "serializeSchema", {
|
|
124
124
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunkLDM2AFKZ_cjs.serializeSchema; }
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "validateEdgeProps", {
|
|
128
128
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunkLDM2AFKZ_cjs.validateEdgeProps; }
|
|
130
130
|
});
|
|
131
131
|
Object.defineProperty(exports, "validateNodeProps", {
|
|
132
132
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunkLDM2AFKZ_cjs.validateNodeProps; }
|
|
134
134
|
});
|
|
135
135
|
Object.defineProperty(exports, "validateProps", {
|
|
136
136
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunkLDM2AFKZ_cjs.validateProps; }
|
|
138
138
|
});
|
|
139
139
|
Object.defineProperty(exports, "wrapZodError", {
|
|
140
140
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunkLDM2AFKZ_cjs.wrapZodError; }
|
|
142
142
|
});
|
|
143
143
|
exports.deserializeSchema = deserializeSchema;
|
|
144
144
|
//# sourceMappingURL=index.cjs.map
|
package/dist/schema/index.d.cts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { K as KindRegistry, G as GraphDef } from '../manager-
|
|
2
|
-
export { C as ChangeSeverity, a as ChangeType, E as EdgeChange, M as MigrationHookContext, N as NodeChange, O as OntologyChange, S as SchemaDiff, b as SchemaManagerOptions, c as SchemaValidationResult, d as computeSchemaDiff, e as ensureSchema, g as getActiveSchema, f as getMigrationActions, h as getSchemaChanges, i as initializeSchema, j as isBackwardsCompatible, k as isSchemaInitialized, m as migrateSchema, r as rollbackSchema } from '../manager-
|
|
3
|
-
import { S as SerializedNodeDef, a as SerializedEdgeDef, b as SerializedMetaEdge, c as SerializedOntologyRelation, d as SerializedClosures, e as SerializedSchema, f as SchemaHash } from '../types-
|
|
4
|
-
export { J as JsonSchema, g as SerializedOntology, h as SerializedUniqueConstraint } from '../types-
|
|
1
|
+
import { K as KindRegistry, G as GraphDef } from '../manager-0NysX4s6.cjs';
|
|
2
|
+
export { C as ChangeSeverity, a as ChangeType, E as EdgeChange, M as MigrationHookContext, N as NodeChange, O as OntologyChange, S as SchemaDiff, b as SchemaManagerOptions, c as SchemaValidationResult, d as computeSchemaDiff, e as ensureSchema, g as getActiveSchema, f as getMigrationActions, h as getSchemaChanges, i as initializeSchema, j as isBackwardsCompatible, k as isSchemaInitialized, m as migrateSchema, r as rollbackSchema } from '../manager-0NysX4s6.cjs';
|
|
3
|
+
import { S as SerializedNodeDef, a as SerializedEdgeDef, b as SerializedMetaEdge, c as SerializedOntologyRelation, d as SerializedClosures, e as SerializedSchema, f as SchemaHash } from '../types-BUy-pHKH.cjs';
|
|
4
|
+
export { J as JsonSchema, g as SerializedOntology, h as SerializedUniqueConstraint } from '../types-BUy-pHKH.cjs';
|
|
5
5
|
import { ZodType, ZodError } from 'zod';
|
|
6
|
-
import { V as ValidationIssue, a as ValidationError } from '../index-
|
|
6
|
+
import { V as ValidationIssue, a as ValidationError } from '../index-DyrR_d-H.cjs';
|
|
7
7
|
import '../types-DTJEu_-h.cjs';
|
|
8
8
|
import 'drizzle-orm';
|
|
9
9
|
import '../types-BRzHlhKC.cjs';
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { K as KindRegistry, G as GraphDef } from '../manager-
|
|
2
|
-
export { C as ChangeSeverity, a as ChangeType, E as EdgeChange, M as MigrationHookContext, N as NodeChange, O as OntologyChange, S as SchemaDiff, b as SchemaManagerOptions, c as SchemaValidationResult, d as computeSchemaDiff, e as ensureSchema, g as getActiveSchema, f as getMigrationActions, h as getSchemaChanges, i as initializeSchema, j as isBackwardsCompatible, k as isSchemaInitialized, m as migrateSchema, r as rollbackSchema } from '../manager-
|
|
3
|
-
import { S as SerializedNodeDef, a as SerializedEdgeDef, b as SerializedMetaEdge, c as SerializedOntologyRelation, d as SerializedClosures, e as SerializedSchema, f as SchemaHash } from '../types-
|
|
4
|
-
export { J as JsonSchema, g as SerializedOntology, h as SerializedUniqueConstraint } from '../types-
|
|
1
|
+
import { K as KindRegistry, G as GraphDef } from '../manager-DFKe7ql3.js';
|
|
2
|
+
export { C as ChangeSeverity, a as ChangeType, E as EdgeChange, M as MigrationHookContext, N as NodeChange, O as OntologyChange, S as SchemaDiff, b as SchemaManagerOptions, c as SchemaValidationResult, d as computeSchemaDiff, e as ensureSchema, g as getActiveSchema, f as getMigrationActions, h as getSchemaChanges, i as initializeSchema, j as isBackwardsCompatible, k as isSchemaInitialized, m as migrateSchema, r as rollbackSchema } from '../manager-DFKe7ql3.js';
|
|
3
|
+
import { S as SerializedNodeDef, a as SerializedEdgeDef, b as SerializedMetaEdge, c as SerializedOntologyRelation, d as SerializedClosures, e as SerializedSchema, f as SchemaHash } from '../types-6EKrWTs9.js';
|
|
4
|
+
export { J as JsonSchema, g as SerializedOntology, h as SerializedUniqueConstraint } from '../types-6EKrWTs9.js';
|
|
5
5
|
import { ZodType, ZodError } from 'zod';
|
|
6
|
-
import { V as ValidationIssue, a as ValidationError } from '../index-
|
|
6
|
+
import { V as ValidationIssue, a as ValidationError } from '../index-DyrR_d-H.js';
|
|
7
7
|
import '../types-DTJEu_-h.js';
|
|
8
8
|
import 'drizzle-orm';
|
|
9
9
|
import '../types-BRzHlhKC.js';
|
package/dist/schema/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { KindRegistry } from '../chunk-
|
|
2
|
-
export { computeSchemaDiff, computeSchemaHash, createValidationError, deserializeWherePredicate, ensureSchema, getActiveSchema, getMigrationActions, getSchemaChanges, initializeSchema, isBackwardsCompatible, isSchemaInitialized, migrateSchema, rollbackSchema, serializeSchema, validateEdgeProps, validateNodeProps, validateProps, wrapZodError } from '../chunk-
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
1
|
+
import { KindRegistry } from '../chunk-M5SOQ7UV.js';
|
|
2
|
+
export { computeSchemaDiff, computeSchemaHash, createValidationError, deserializeWherePredicate, ensureSchema, getActiveSchema, getMigrationActions, getSchemaChanges, initializeSchema, isBackwardsCompatible, isSchemaInitialized, migrateSchema, rollbackSchema, serializeSchema, validateEdgeProps, validateNodeProps, validateProps, wrapZodError } from '../chunk-M5SOQ7UV.js';
|
|
3
|
+
import '../chunk-TGDFBLGS.js';
|
|
4
|
+
import '../chunk-SJ2QMDXY.js';
|
|
5
5
|
|
|
6
6
|
// src/schema/deserializer.ts
|
|
7
7
|
function deserializeSchema(schema) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as SqlSchema, G as GraphBackend } from './types-
|
|
2
|
-
import { K as KindRegistry, G as GraphDef, b as SchemaManagerOptions, c as SchemaValidationResult } from './manager-
|
|
1
|
+
import { k as SqlSchema, G as GraphBackend } from './types-BUy-pHKH.cjs';
|
|
2
|
+
import { K as KindRegistry, G as GraphDef, b as SchemaManagerOptions, c as SchemaValidationResult } from './manager-0NysX4s6.cjs';
|
|
3
3
|
import { N as NodeType, A as AnyEdgeType, T as TemporalMode, E as EdgeType, b as EdgeRegistration, g as NodeId } from './types-DTJEu_-h.cjs';
|
|
4
4
|
import { V as ValueType, i as PredicateExpression, k as VectorMetricType, Q as QueryAst, J as JsonPointer, F as FieldRef, P as ParameterRef, d as JsonPointerInput, T as TraversalExpansion, l as Traversal, N as NodePredicate, m as ProjectedField, O as OrderSpec, G as GroupBySpec, o as RecursiveCyclePolicy, q as TraversalDirection, A as AggregateExpr, r as SelectiveField, s as ComposableQuery, t as SetOperationType, u as SetOperation, S as SortDirection } from './ast-D-3bOanX.cjs';
|
|
5
5
|
import { SQL } from 'drizzle-orm';
|
|
@@ -724,7 +724,7 @@ type OperationHookContext = HookContext & Readonly<{
|
|
|
724
724
|
/**
|
|
725
725
|
* Observability hooks for monitoring store operations.
|
|
726
726
|
*
|
|
727
|
-
* Note: Batch operations (`bulkCreate`, `bulkInsert`, `
|
|
727
|
+
* Note: Batch operations (`bulkCreate`, `bulkInsert`, `bulkUpsertById`) skip
|
|
728
728
|
* per-item operation hooks for throughput. Query hooks still fire normally.
|
|
729
729
|
*
|
|
730
730
|
* @example
|
|
@@ -776,6 +776,47 @@ type StoreOptions = Readonly<{
|
|
|
776
776
|
traversalExpansion?: TraversalExpansion;
|
|
777
777
|
}>;
|
|
778
778
|
}>;
|
|
779
|
+
/**
|
|
780
|
+
* Behavior when a get-or-create operation matches an existing record.
|
|
781
|
+
*/
|
|
782
|
+
type IfExistsMode = "return" | "update";
|
|
783
|
+
/**
|
|
784
|
+
* Action taken by a get-or-create operation.
|
|
785
|
+
*/
|
|
786
|
+
type GetOrCreateAction = "created" | "found" | "updated" | "resurrected";
|
|
787
|
+
/**
|
|
788
|
+
* Result of a node getOrCreateByConstraint operation.
|
|
789
|
+
*/
|
|
790
|
+
type NodeGetOrCreateByConstraintResult<N extends NodeType> = Readonly<{
|
|
791
|
+
node: Node<N>;
|
|
792
|
+
action: GetOrCreateAction;
|
|
793
|
+
}>;
|
|
794
|
+
/**
|
|
795
|
+
* Options for node getOrCreateByConstraint operations.
|
|
796
|
+
*/
|
|
797
|
+
type NodeGetOrCreateByConstraintOptions = Readonly<{
|
|
798
|
+
/** Existing record behavior. Default: "return" */
|
|
799
|
+
ifExists?: IfExistsMode;
|
|
800
|
+
}>;
|
|
801
|
+
/**
|
|
802
|
+
* Result of an edge getOrCreateByEndpoints operation.
|
|
803
|
+
*/
|
|
804
|
+
type EdgeGetOrCreateByEndpointsResult<E extends AnyEdgeType> = Readonly<{
|
|
805
|
+
edge: Edge<E>;
|
|
806
|
+
action: GetOrCreateAction;
|
|
807
|
+
}>;
|
|
808
|
+
/**
|
|
809
|
+
* Options for edge getOrCreateByEndpoints operations.
|
|
810
|
+
*/
|
|
811
|
+
type EdgeGetOrCreateByEndpointsOptions<E extends AnyEdgeType> = Readonly<{
|
|
812
|
+
/**
|
|
813
|
+
* Edge property fields to include in the match key alongside the (from, to) endpoints.
|
|
814
|
+
* Default: `[]` — match on endpoints only.
|
|
815
|
+
*/
|
|
816
|
+
matchOn?: readonly (keyof z.input<E["schema"]>)[];
|
|
817
|
+
/** Existing record behavior. Default: "return" */
|
|
818
|
+
ifExists?: IfExistsMode;
|
|
819
|
+
}>;
|
|
779
820
|
/**
|
|
780
821
|
* A collection of nodes of a specific type.
|
|
781
822
|
*
|
|
@@ -831,7 +872,7 @@ type NodeCollection<N extends NodeType> = Readonly<{
|
|
|
831
872
|
* If a node with the given ID exists, updates it with the provided props.
|
|
832
873
|
* Otherwise, creates a new node with that ID.
|
|
833
874
|
*/
|
|
834
|
-
|
|
875
|
+
upsertById: (id: string, props: z.input<N["schema"]>, options?: Readonly<{
|
|
835
876
|
validFrom?: string;
|
|
836
877
|
validTo?: string;
|
|
837
878
|
}>) => Promise<Node<N>>;
|
|
@@ -853,7 +894,7 @@ type NodeCollection<N extends NodeType> = Readonly<{
|
|
|
853
894
|
* For each item, if a node with the given ID exists, updates it.
|
|
854
895
|
* Otherwise, creates a new node with that ID.
|
|
855
896
|
*/
|
|
856
|
-
|
|
897
|
+
bulkUpsertById: (items: readonly Readonly<{
|
|
857
898
|
id: string;
|
|
858
899
|
props: z.input<N["schema"]>;
|
|
859
900
|
validFrom?: string;
|
|
@@ -879,6 +920,27 @@ type NodeCollection<N extends NodeType> = Readonly<{
|
|
|
879
920
|
* that don't exist.
|
|
880
921
|
*/
|
|
881
922
|
bulkDelete: (ids: readonly NodeId<N>[]) => Promise<void>;
|
|
923
|
+
/**
|
|
924
|
+
* Get an existing node by uniqueness constraint, or create a new one.
|
|
925
|
+
*
|
|
926
|
+
* Looks up a node by the named constraint key computed from `props`.
|
|
927
|
+
* If found, returns it (optionally updating with `ifExists: "update"`).
|
|
928
|
+
* If not found, creates a new node. Soft-deleted matches are always resurrected.
|
|
929
|
+
*
|
|
930
|
+
* @param constraintName - Name of the uniqueness constraint to match on
|
|
931
|
+
* @param props - Full properties for create, or merge source for update
|
|
932
|
+
* @param options - Existing record behavior (default: "return")
|
|
933
|
+
*/
|
|
934
|
+
getOrCreateByConstraint: (constraintName: string, props: z.input<N["schema"]>, options?: NodeGetOrCreateByConstraintOptions) => Promise<NodeGetOrCreateByConstraintResult<N>>;
|
|
935
|
+
/**
|
|
936
|
+
* Batch version of getOrCreateByConstraint.
|
|
937
|
+
*
|
|
938
|
+
* Results are returned in the same order as the input items.
|
|
939
|
+
* Atomic when the backend supports transactions.
|
|
940
|
+
*/
|
|
941
|
+
bulkGetOrCreateByConstraint: (constraintName: string, items: readonly Readonly<{
|
|
942
|
+
props: z.input<N["schema"]>;
|
|
943
|
+
}>[], options?: NodeGetOrCreateByConstraintOptions) => Promise<NodeGetOrCreateByConstraintResult<N>[]>;
|
|
882
944
|
}>;
|
|
883
945
|
/**
|
|
884
946
|
* Reference to a node endpoint (kind and id).
|
|
@@ -1011,7 +1073,7 @@ type EdgeCollection<E extends AnyEdgeType, From extends NodeType = NodeType, To
|
|
|
1011
1073
|
* For each item, if an edge with the given ID exists, updates it.
|
|
1012
1074
|
* Otherwise, creates a new edge with that ID.
|
|
1013
1075
|
*/
|
|
1014
|
-
|
|
1076
|
+
bulkUpsertById: (items: readonly Readonly<{
|
|
1015
1077
|
id: string;
|
|
1016
1078
|
from: TypedNodeRef<From>;
|
|
1017
1079
|
to: TypedNodeRef<To>;
|
|
@@ -1041,6 +1103,30 @@ type EdgeCollection<E extends AnyEdgeType, From extends NodeType = NodeType, To
|
|
|
1041
1103
|
* that don't exist.
|
|
1042
1104
|
*/
|
|
1043
1105
|
bulkDelete: (ids: readonly string[]) => Promise<void>;
|
|
1106
|
+
/**
|
|
1107
|
+
* Get an existing edge by endpoints and optional property fields, or create a new one.
|
|
1108
|
+
*
|
|
1109
|
+
* Matches edges of this kind between `(from, to)`. When `matchOn` specifies
|
|
1110
|
+
* property fields, only edges whose properties match on those fields are considered.
|
|
1111
|
+
* Soft-deleted matches are resurrected when cardinality allows.
|
|
1112
|
+
*
|
|
1113
|
+
* @param from - Source node
|
|
1114
|
+
* @param to - Target node
|
|
1115
|
+
* @param props - Full properties for create, or merge source for update
|
|
1116
|
+
* @param options - Match criteria and conflict resolution
|
|
1117
|
+
*/
|
|
1118
|
+
getOrCreateByEndpoints: (from: TypedNodeRef<From>, to: TypedNodeRef<To>, props: z.input<E["schema"]>, options?: EdgeGetOrCreateByEndpointsOptions<E>) => Promise<EdgeGetOrCreateByEndpointsResult<E>>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Batch version of getOrCreateByEndpoints.
|
|
1121
|
+
*
|
|
1122
|
+
* Results are returned in the same order as the input items.
|
|
1123
|
+
* Atomic when the backend supports transactions.
|
|
1124
|
+
*/
|
|
1125
|
+
bulkGetOrCreateByEndpoints: (items: readonly Readonly<{
|
|
1126
|
+
from: TypedNodeRef<From>;
|
|
1127
|
+
to: TypedNodeRef<To>;
|
|
1128
|
+
props: z.input<E["schema"]>;
|
|
1129
|
+
}>[], options?: EdgeGetOrCreateByEndpointsOptions<E>) => Promise<EdgeGetOrCreateByEndpointsResult<E>[]>;
|
|
1044
1130
|
}>;
|
|
1045
1131
|
/**
|
|
1046
1132
|
* Extract the union of 'from' node types from an EdgeRegistration.
|
|
@@ -1817,4 +1903,4 @@ declare function createStore<G extends GraphDef>(graph: G, backend: GraphBackend
|
|
|
1817
1903
|
*/
|
|
1818
1904
|
declare function createStoreWithSchema<G extends GraphDef>(graph: G, backend: GraphBackend, options?: StoreOptions & SchemaManagerOptions): Promise<[Store<G>, SchemaValidationResult]>;
|
|
1819
1905
|
|
|
1820
|
-
export {
|
|
1906
|
+
export { exists as $, type AliasMap as A, type SelectableNode as B, type CreateQueryBuilderOptions as C, type StoreHooks as D, type EdgeAliasMap as E, type FieldAccessor as F, type GetOrCreateAction as G, type HookContext as H, type IfExistsMode as I, type StoreOptions as J, type StreamOptions as K, type TransactionContext as L, type TypedEdgeCollection as M, type Node as N, type OperationHookContext as O, type PaginateOptions as P, QueryBuilder as Q, type RecursiveTraversalOptions as R, Store as S, TraversalBuilder as T, type TypedNodeRef as U, UnionableQuery as V, type UpdateEdgeInput as W, type UpdateNodeInput as X, createStore as Y, createStoreWithSchema as Z, embedding as _, type AggregateResult as a, fieldRef as a0, getEmbeddingDimensions as a1, inSubquery as a2, isEmbeddingSchema as a3, isParameterRef as a4, notExists as a5, notInSubquery as a6, param as a7, type CreateEdgeInput as b, type CreateNodeInput as c, type Edge as d, type EdgeAccessor as e, type EdgeCollection as f, type EdgeGetOrCreateByEndpointsOptions as g, type EdgeGetOrCreateByEndpointsResult as h, type EmbeddingSchema as i, type EmbeddingValue as j, ExecutableAggregateQuery as k, ExecutableQuery as l, type NodeAccessor as m, type NodeAlias as n, type NodeCollection as o, type NodeGetOrCreateByConstraintOptions as p, type NodeGetOrCreateByConstraintResult as q, type NodeRef as r, type PaginatedResult as s, type Predicate as t, PreparedQuery as u, type PropsAccessor as v, type QueryHookContext as w, type QueryOptions as x, type SelectContext as y, type SelectableEdge as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { k as SqlSchema, G as GraphBackend } from './types-
|
|
2
|
-
import { K as KindRegistry, G as GraphDef, b as SchemaManagerOptions, c as SchemaValidationResult } from './manager-
|
|
1
|
+
import { k as SqlSchema, G as GraphBackend } from './types-6EKrWTs9.js';
|
|
2
|
+
import { K as KindRegistry, G as GraphDef, b as SchemaManagerOptions, c as SchemaValidationResult } from './manager-DFKe7ql3.js';
|
|
3
3
|
import { N as NodeType, A as AnyEdgeType, T as TemporalMode, E as EdgeType, b as EdgeRegistration, g as NodeId } from './types-DTJEu_-h.js';
|
|
4
4
|
import { V as ValueType, i as PredicateExpression, k as VectorMetricType, Q as QueryAst, J as JsonPointer, F as FieldRef, P as ParameterRef, d as JsonPointerInput, T as TraversalExpansion, l as Traversal, N as NodePredicate, m as ProjectedField, O as OrderSpec, G as GroupBySpec, o as RecursiveCyclePolicy, q as TraversalDirection, A as AggregateExpr, r as SelectiveField, s as ComposableQuery, t as SetOperationType, u as SetOperation, S as SortDirection } from './ast-CXFx6bF6.js';
|
|
5
5
|
import { SQL } from 'drizzle-orm';
|
|
@@ -724,7 +724,7 @@ type OperationHookContext = HookContext & Readonly<{
|
|
|
724
724
|
/**
|
|
725
725
|
* Observability hooks for monitoring store operations.
|
|
726
726
|
*
|
|
727
|
-
* Note: Batch operations (`bulkCreate`, `bulkInsert`, `
|
|
727
|
+
* Note: Batch operations (`bulkCreate`, `bulkInsert`, `bulkUpsertById`) skip
|
|
728
728
|
* per-item operation hooks for throughput. Query hooks still fire normally.
|
|
729
729
|
*
|
|
730
730
|
* @example
|
|
@@ -776,6 +776,47 @@ type StoreOptions = Readonly<{
|
|
|
776
776
|
traversalExpansion?: TraversalExpansion;
|
|
777
777
|
}>;
|
|
778
778
|
}>;
|
|
779
|
+
/**
|
|
780
|
+
* Behavior when a get-or-create operation matches an existing record.
|
|
781
|
+
*/
|
|
782
|
+
type IfExistsMode = "return" | "update";
|
|
783
|
+
/**
|
|
784
|
+
* Action taken by a get-or-create operation.
|
|
785
|
+
*/
|
|
786
|
+
type GetOrCreateAction = "created" | "found" | "updated" | "resurrected";
|
|
787
|
+
/**
|
|
788
|
+
* Result of a node getOrCreateByConstraint operation.
|
|
789
|
+
*/
|
|
790
|
+
type NodeGetOrCreateByConstraintResult<N extends NodeType> = Readonly<{
|
|
791
|
+
node: Node<N>;
|
|
792
|
+
action: GetOrCreateAction;
|
|
793
|
+
}>;
|
|
794
|
+
/**
|
|
795
|
+
* Options for node getOrCreateByConstraint operations.
|
|
796
|
+
*/
|
|
797
|
+
type NodeGetOrCreateByConstraintOptions = Readonly<{
|
|
798
|
+
/** Existing record behavior. Default: "return" */
|
|
799
|
+
ifExists?: IfExistsMode;
|
|
800
|
+
}>;
|
|
801
|
+
/**
|
|
802
|
+
* Result of an edge getOrCreateByEndpoints operation.
|
|
803
|
+
*/
|
|
804
|
+
type EdgeGetOrCreateByEndpointsResult<E extends AnyEdgeType> = Readonly<{
|
|
805
|
+
edge: Edge<E>;
|
|
806
|
+
action: GetOrCreateAction;
|
|
807
|
+
}>;
|
|
808
|
+
/**
|
|
809
|
+
* Options for edge getOrCreateByEndpoints operations.
|
|
810
|
+
*/
|
|
811
|
+
type EdgeGetOrCreateByEndpointsOptions<E extends AnyEdgeType> = Readonly<{
|
|
812
|
+
/**
|
|
813
|
+
* Edge property fields to include in the match key alongside the (from, to) endpoints.
|
|
814
|
+
* Default: `[]` — match on endpoints only.
|
|
815
|
+
*/
|
|
816
|
+
matchOn?: readonly (keyof z.input<E["schema"]>)[];
|
|
817
|
+
/** Existing record behavior. Default: "return" */
|
|
818
|
+
ifExists?: IfExistsMode;
|
|
819
|
+
}>;
|
|
779
820
|
/**
|
|
780
821
|
* A collection of nodes of a specific type.
|
|
781
822
|
*
|
|
@@ -831,7 +872,7 @@ type NodeCollection<N extends NodeType> = Readonly<{
|
|
|
831
872
|
* If a node with the given ID exists, updates it with the provided props.
|
|
832
873
|
* Otherwise, creates a new node with that ID.
|
|
833
874
|
*/
|
|
834
|
-
|
|
875
|
+
upsertById: (id: string, props: z.input<N["schema"]>, options?: Readonly<{
|
|
835
876
|
validFrom?: string;
|
|
836
877
|
validTo?: string;
|
|
837
878
|
}>) => Promise<Node<N>>;
|
|
@@ -853,7 +894,7 @@ type NodeCollection<N extends NodeType> = Readonly<{
|
|
|
853
894
|
* For each item, if a node with the given ID exists, updates it.
|
|
854
895
|
* Otherwise, creates a new node with that ID.
|
|
855
896
|
*/
|
|
856
|
-
|
|
897
|
+
bulkUpsertById: (items: readonly Readonly<{
|
|
857
898
|
id: string;
|
|
858
899
|
props: z.input<N["schema"]>;
|
|
859
900
|
validFrom?: string;
|
|
@@ -879,6 +920,27 @@ type NodeCollection<N extends NodeType> = Readonly<{
|
|
|
879
920
|
* that don't exist.
|
|
880
921
|
*/
|
|
881
922
|
bulkDelete: (ids: readonly NodeId<N>[]) => Promise<void>;
|
|
923
|
+
/**
|
|
924
|
+
* Get an existing node by uniqueness constraint, or create a new one.
|
|
925
|
+
*
|
|
926
|
+
* Looks up a node by the named constraint key computed from `props`.
|
|
927
|
+
* If found, returns it (optionally updating with `ifExists: "update"`).
|
|
928
|
+
* If not found, creates a new node. Soft-deleted matches are always resurrected.
|
|
929
|
+
*
|
|
930
|
+
* @param constraintName - Name of the uniqueness constraint to match on
|
|
931
|
+
* @param props - Full properties for create, or merge source for update
|
|
932
|
+
* @param options - Existing record behavior (default: "return")
|
|
933
|
+
*/
|
|
934
|
+
getOrCreateByConstraint: (constraintName: string, props: z.input<N["schema"]>, options?: NodeGetOrCreateByConstraintOptions) => Promise<NodeGetOrCreateByConstraintResult<N>>;
|
|
935
|
+
/**
|
|
936
|
+
* Batch version of getOrCreateByConstraint.
|
|
937
|
+
*
|
|
938
|
+
* Results are returned in the same order as the input items.
|
|
939
|
+
* Atomic when the backend supports transactions.
|
|
940
|
+
*/
|
|
941
|
+
bulkGetOrCreateByConstraint: (constraintName: string, items: readonly Readonly<{
|
|
942
|
+
props: z.input<N["schema"]>;
|
|
943
|
+
}>[], options?: NodeGetOrCreateByConstraintOptions) => Promise<NodeGetOrCreateByConstraintResult<N>[]>;
|
|
882
944
|
}>;
|
|
883
945
|
/**
|
|
884
946
|
* Reference to a node endpoint (kind and id).
|
|
@@ -1011,7 +1073,7 @@ type EdgeCollection<E extends AnyEdgeType, From extends NodeType = NodeType, To
|
|
|
1011
1073
|
* For each item, if an edge with the given ID exists, updates it.
|
|
1012
1074
|
* Otherwise, creates a new edge with that ID.
|
|
1013
1075
|
*/
|
|
1014
|
-
|
|
1076
|
+
bulkUpsertById: (items: readonly Readonly<{
|
|
1015
1077
|
id: string;
|
|
1016
1078
|
from: TypedNodeRef<From>;
|
|
1017
1079
|
to: TypedNodeRef<To>;
|
|
@@ -1041,6 +1103,30 @@ type EdgeCollection<E extends AnyEdgeType, From extends NodeType = NodeType, To
|
|
|
1041
1103
|
* that don't exist.
|
|
1042
1104
|
*/
|
|
1043
1105
|
bulkDelete: (ids: readonly string[]) => Promise<void>;
|
|
1106
|
+
/**
|
|
1107
|
+
* Get an existing edge by endpoints and optional property fields, or create a new one.
|
|
1108
|
+
*
|
|
1109
|
+
* Matches edges of this kind between `(from, to)`. When `matchOn` specifies
|
|
1110
|
+
* property fields, only edges whose properties match on those fields are considered.
|
|
1111
|
+
* Soft-deleted matches are resurrected when cardinality allows.
|
|
1112
|
+
*
|
|
1113
|
+
* @param from - Source node
|
|
1114
|
+
* @param to - Target node
|
|
1115
|
+
* @param props - Full properties for create, or merge source for update
|
|
1116
|
+
* @param options - Match criteria and conflict resolution
|
|
1117
|
+
*/
|
|
1118
|
+
getOrCreateByEndpoints: (from: TypedNodeRef<From>, to: TypedNodeRef<To>, props: z.input<E["schema"]>, options?: EdgeGetOrCreateByEndpointsOptions<E>) => Promise<EdgeGetOrCreateByEndpointsResult<E>>;
|
|
1119
|
+
/**
|
|
1120
|
+
* Batch version of getOrCreateByEndpoints.
|
|
1121
|
+
*
|
|
1122
|
+
* Results are returned in the same order as the input items.
|
|
1123
|
+
* Atomic when the backend supports transactions.
|
|
1124
|
+
*/
|
|
1125
|
+
bulkGetOrCreateByEndpoints: (items: readonly Readonly<{
|
|
1126
|
+
from: TypedNodeRef<From>;
|
|
1127
|
+
to: TypedNodeRef<To>;
|
|
1128
|
+
props: z.input<E["schema"]>;
|
|
1129
|
+
}>[], options?: EdgeGetOrCreateByEndpointsOptions<E>) => Promise<EdgeGetOrCreateByEndpointsResult<E>[]>;
|
|
1044
1130
|
}>;
|
|
1045
1131
|
/**
|
|
1046
1132
|
* Extract the union of 'from' node types from an EdgeRegistration.
|
|
@@ -1817,4 +1903,4 @@ declare function createStore<G extends GraphDef>(graph: G, backend: GraphBackend
|
|
|
1817
1903
|
*/
|
|
1818
1904
|
declare function createStoreWithSchema<G extends GraphDef>(graph: G, backend: GraphBackend, options?: StoreOptions & SchemaManagerOptions): Promise<[Store<G>, SchemaValidationResult]>;
|
|
1819
1905
|
|
|
1820
|
-
export {
|
|
1906
|
+
export { exists as $, type AliasMap as A, type SelectableNode as B, type CreateQueryBuilderOptions as C, type StoreHooks as D, type EdgeAliasMap as E, type FieldAccessor as F, type GetOrCreateAction as G, type HookContext as H, type IfExistsMode as I, type StoreOptions as J, type StreamOptions as K, type TransactionContext as L, type TypedEdgeCollection as M, type Node as N, type OperationHookContext as O, type PaginateOptions as P, QueryBuilder as Q, type RecursiveTraversalOptions as R, Store as S, TraversalBuilder as T, type TypedNodeRef as U, UnionableQuery as V, type UpdateEdgeInput as W, type UpdateNodeInput as X, createStore as Y, createStoreWithSchema as Z, embedding as _, type AggregateResult as a, fieldRef as a0, getEmbeddingDimensions as a1, inSubquery as a2, isEmbeddingSchema as a3, isParameterRef as a4, notExists as a5, notInSubquery as a6, param as a7, type CreateEdgeInput as b, type CreateNodeInput as c, type Edge as d, type EdgeAccessor as e, type EdgeCollection as f, type EdgeGetOrCreateByEndpointsOptions as g, type EdgeGetOrCreateByEndpointsResult as h, type EmbeddingSchema as i, type EmbeddingValue as j, ExecutableAggregateQuery as k, ExecutableQuery as l, type NodeAccessor as m, type NodeAlias as n, type NodeCollection as o, type NodeGetOrCreateByConstraintOptions as p, type NodeGetOrCreateByConstraintResult as q, type NodeRef as r, type PaginatedResult as s, type Predicate as t, PreparedQuery as u, type PropsAccessor as v, type QueryHookContext as w, type QueryOptions as x, type SelectContext as y, type SelectableEdge as z };
|
|
@@ -572,6 +572,7 @@ type GraphBackend = Readonly<{
|
|
|
572
572
|
insertUnique: (params: InsertUniqueParams) => Promise<void>;
|
|
573
573
|
deleteUnique: (params: DeleteUniqueParams) => Promise<void>;
|
|
574
574
|
checkUnique: (params: CheckUniqueParams) => Promise<UniqueRow | undefined>;
|
|
575
|
+
checkUniqueBatch?: (params: CheckUniqueBatchParams) => Promise<readonly UniqueRow[]>;
|
|
575
576
|
getActiveSchema: (graphId: string) => Promise<SchemaVersionRow | undefined>;
|
|
576
577
|
getSchemaVersion: (graphId: string, version: number) => Promise<SchemaVersionRow | undefined>;
|
|
577
578
|
insertSchema: (params: InsertSchemaParams) => Promise<SchemaVersionRow>;
|
|
@@ -621,6 +622,19 @@ type CheckUniqueParams = Readonly<{
|
|
|
621
622
|
nodeKind: string;
|
|
622
623
|
constraintName: string;
|
|
623
624
|
key: string;
|
|
625
|
+
/** If true, also returns soft-deleted entries. Used by get-or-create operations. */
|
|
626
|
+
includeDeleted?: boolean;
|
|
627
|
+
}>;
|
|
628
|
+
/**
|
|
629
|
+
* Parameters for batch-checking unique constraints.
|
|
630
|
+
*/
|
|
631
|
+
type CheckUniqueBatchParams = Readonly<{
|
|
632
|
+
graphId: string;
|
|
633
|
+
nodeKind: string;
|
|
634
|
+
constraintName: string;
|
|
635
|
+
keys: readonly string[];
|
|
636
|
+
/** If true, also returns soft-deleted entries. Used by get-or-create operations. */
|
|
637
|
+
includeDeleted?: boolean;
|
|
624
638
|
}>;
|
|
625
639
|
/**
|
|
626
640
|
* Parameters for inserting a schema version.
|