@nicia-ai/typegraph 0.14.0 → 0.16.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/postgres/index.cjs +32 -26
- package/dist/backend/postgres/index.cjs.map +1 -1
- package/dist/backend/postgres/index.d.cts +5 -5
- package/dist/backend/postgres/index.d.ts +5 -5
- package/dist/backend/postgres/index.js +14 -8
- package/dist/backend/postgres/index.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +12 -12
- package/dist/backend/sqlite/index.d.cts +5 -5
- package/dist/backend/sqlite/index.d.ts +5 -5
- package/dist/backend/sqlite/index.js +2 -2
- package/dist/backend/sqlite/local.cjs +5 -5
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +3 -3
- package/dist/backend/sqlite/local.d.ts +3 -3
- package/dist/backend/sqlite/local.js +5 -5
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-QFZ5QB2J.cjs → chunk-3HQLOKS5.cjs} +25 -3
- package/dist/chunk-3HQLOKS5.cjs.map +1 -0
- package/dist/{chunk-OEKH5PWL.cjs → chunk-56RQFK7U.cjs} +22 -15
- package/dist/chunk-56RQFK7U.cjs.map +1 -0
- package/dist/{chunk-KE2BL3JZ.cjs → chunk-CRMN2NOM.cjs} +179 -179
- package/dist/chunk-CRMN2NOM.cjs.map +1 -0
- package/dist/{chunk-BNIBR5U2.js → chunk-HWWF3FOP.js} +91 -91
- package/dist/chunk-HWWF3FOP.js.map +1 -0
- package/dist/{chunk-KLOSTZDQ.js → chunk-L4ON6RJF.js} +25 -3
- package/dist/chunk-L4ON6RJF.js.map +1 -0
- package/dist/{chunk-RVUEBUBH.js → chunk-XZBAGJJH.js} +15 -8
- package/dist/chunk-XZBAGJJH.js.map +1 -0
- package/dist/{ddl-BJg93HDN.d.cts → ddl-BBo2EcFc.d.cts} +2 -2
- package/dist/{ddl-CsfWcl_B.d.ts → ddl-D4jlcOH_.d.ts} +2 -2
- package/dist/index.cjs +92 -74
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -6
- package/dist/index.d.ts +6 -6
- package/dist/index.js +61 -43
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.d.cts +2 -2
- package/dist/indexes/index.d.ts +2 -2
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/{manager-oh2mTMvy.d.cts → manager-Bj1UEnhE.d.cts} +2 -2
- package/dist/{manager-qRSdnKEO.d.ts → manager-Chhrq1vl.d.ts} +2 -2
- package/dist/profiler/index.d.cts +3 -3
- package/dist/profiler/index.d.ts +3 -3
- package/dist/schema/index.cjs +20 -20
- package/dist/schema/index.d.cts +4 -4
- package/dist/schema/index.d.ts +4 -4
- package/dist/schema/index.js +2 -2
- package/dist/{sqlite-DVca_IIy.d.cts → sqlite-Blq-AhmK.d.ts} +1 -1
- package/dist/{sqlite-H01wIXvB.d.ts → sqlite-DE-6NWtC.d.cts} +1 -1
- package/dist/{store-B9ItxA-Q.d.ts → store-Bitii3qj.d.ts} +85 -16
- package/dist/{store-BJPIoe8u.d.cts → store-gTd_qa6u.d.cts} +85 -16
- package/dist/{types-Ckfwgv9l.d.cts → types-B3mmOMJV.d.cts} +8 -0
- package/dist/{types-C8Ra3ROE.d.cts → types-CZd2PEOc.d.cts} +8 -2
- package/dist/{types-CC8eB0PB.d.ts → types-Ceb01czq.d.ts} +8 -2
- package/dist/{types-5t_MIcvv.d.ts → types-ThB4cFLp.d.ts} +8 -0
- package/package.json +3 -3
- package/dist/chunk-BNIBR5U2.js.map +0 -1
- package/dist/chunk-KE2BL3JZ.cjs.map +0 -1
- package/dist/chunk-KLOSTZDQ.js.map +0 -1
- package/dist/chunk-OEKH5PWL.cjs.map +0 -1
- package/dist/chunk-QFZ5QB2J.cjs.map +0 -1
- package/dist/chunk-RVUEBUBH.js.map +0 -1
package/dist/indexes/index.d.cts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as SqlDialect, A as AnyEdgeType, N as NodeType } from '../types-DMzKq0d5.cjs';
|
|
2
|
-
import { E as EdgeIndex, T as TypeGraphIndex, N as NodeIndex, a as EdgeIndexConfig, b as NodeIndexConfig, I as IndexWhereExpression } from '../types-
|
|
3
|
-
export { c as EdgeIndexDirection, d as EdgeIndexWhereBuilder, e as IndexScope, f as IndexWhereFieldBuilder, g as IndexWhereInput, h as NodeIndexWhereBuilder, S as SystemColumnName } from '../types-
|
|
2
|
+
import { E as EdgeIndex, T as TypeGraphIndex, N as NodeIndex, a as EdgeIndexConfig, b as NodeIndexConfig, I as IndexWhereExpression } from '../types-CZd2PEOc.cjs';
|
|
3
|
+
export { c as EdgeIndexDirection, d as EdgeIndexWhereBuilder, e as IndexScope, f as IndexWhereFieldBuilder, g as IndexWhereInput, h as NodeIndexWhereBuilder, S as SystemColumnName } from '../types-CZd2PEOc.cjs';
|
|
4
4
|
import { SQLWrapper } from 'drizzle-orm';
|
|
5
5
|
import { IndexBuilder } from 'drizzle-orm/pg-core';
|
|
6
6
|
import { IndexBuilder as IndexBuilder$1 } from 'drizzle-orm/sqlite-core';
|
package/dist/indexes/index.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { S as SqlDialect, A as AnyEdgeType, N as NodeType } from '../types-DMzKq0d5.js';
|
|
2
|
-
import { E as EdgeIndex, T as TypeGraphIndex, N as NodeIndex, a as EdgeIndexConfig, b as NodeIndexConfig, I as IndexWhereExpression } from '../types-
|
|
3
|
-
export { c as EdgeIndexDirection, d as EdgeIndexWhereBuilder, e as IndexScope, f as IndexWhereFieldBuilder, g as IndexWhereInput, h as NodeIndexWhereBuilder, S as SystemColumnName } from '../types-
|
|
2
|
+
import { E as EdgeIndex, T as TypeGraphIndex, N as NodeIndex, a as EdgeIndexConfig, b as NodeIndexConfig, I as IndexWhereExpression } from '../types-Ceb01czq.js';
|
|
3
|
+
export { c as EdgeIndexDirection, d as EdgeIndexWhereBuilder, e as IndexScope, f as IndexWhereFieldBuilder, g as IndexWhereInput, h as NodeIndexWhereBuilder, S as SystemColumnName } from '../types-Ceb01czq.js';
|
|
4
4
|
import { SQLWrapper } from 'drizzle-orm';
|
|
5
5
|
import { IndexBuilder } from 'drizzle-orm/pg-core';
|
|
6
6
|
import { IndexBuilder as IndexBuilder$1 } from 'drizzle-orm/sqlite-core';
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { G as GraphDef } from '../manager-
|
|
3
|
-
import {
|
|
2
|
+
import { G as GraphDef } from '../manager-Bj1UEnhE.cjs';
|
|
3
|
+
import { Y as Store } from '../store-gTd_qa6u.cjs';
|
|
4
4
|
import '../types-DMzKq0d5.cjs';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-B3mmOMJV.cjs';
|
|
6
6
|
import 'drizzle-orm';
|
|
7
7
|
import '../ast-Bh2NDeaK.cjs';
|
|
8
8
|
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import { G as GraphDef } from '../manager-
|
|
3
|
-
import {
|
|
2
|
+
import { G as GraphDef } from '../manager-Chhrq1vl.js';
|
|
3
|
+
import { Y as Store } from '../store-Bitii3qj.js';
|
|
4
4
|
import '../types-DMzKq0d5.js';
|
|
5
|
-
import '../types-
|
|
5
|
+
import '../types-ThB4cFLp.js';
|
|
6
6
|
import 'drizzle-orm';
|
|
7
7
|
import '../ast-COMyNeMn.js';
|
|
8
8
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as NodeRegistration, d as EdgeRegistration, D as DeleteBehavior, T as TemporalMode, N as NodeType, A as AnyEdgeType, G as GraphDefaults } from './types-DMzKq0d5.cjs';
|
|
2
|
-
import { O as OntologyRelation, d as SerializedNodeDef, e as SerializedEdgeDef, j as SerializedSchema, G as GraphBackend, n as SchemaVersionRow } from './types-
|
|
2
|
+
import { O as OntologyRelation, d as SerializedNodeDef, e as SerializedEdgeDef, j as SerializedSchema, G as GraphBackend, n as SchemaVersionRow } from './types-B3mmOMJV.cjs';
|
|
3
3
|
|
|
4
4
|
/** Brand key for GraphDef */
|
|
5
5
|
declare const GRAPH_DEF_BRAND: "__graphDef";
|
|
@@ -492,4 +492,4 @@ declare function isSchemaInitialized(backend: GraphBackend, graphId: string): Pr
|
|
|
492
492
|
*/
|
|
493
493
|
declare function getSchemaChanges<G extends GraphDef>(backend: GraphBackend, graph: G): Promise<SchemaDiff | undefined>;
|
|
494
494
|
|
|
495
|
-
export { type AllEdgeTypes as A, type ChangeSeverity as C, type EdgeKinds as E, type GraphDef as G, KindRegistry as K, type MigrationHookContext as M, type NodeKinds as N, type OntologyChange as O, type SchemaManagerOptions as S, type AllNodeTypes as a, type GetEdgeType as b, type GetNodeType as c,
|
|
495
|
+
export { type AllEdgeTypes as A, type ChangeSeverity as C, type EdgeKinds as E, type GraphDef as G, KindRegistry as K, type MigrationHookContext as M, type NodeKinds as N, type OntologyChange as O, type SchemaManagerOptions as S, type AllNodeTypes as a, type GetEdgeType as b, type GetNodeType as c, type SchemaValidationResult as d, defineGraph as e, getNodeKinds as f, getEdgeKinds as g, type ChangeType as h, isGraphDef as i, type EdgeChange as j, type NodeChange as k, type SchemaDiff as l, computeSchemaDiff as m, ensureSchema as n, getActiveSchema as o, getMigrationActions as p, getSchemaChanges as q, initializeSchema as r, isBackwardsCompatible as s, isSchemaInitialized as t, migrateSchema as u, rollbackSchema as v };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { i as NodeRegistration, d as EdgeRegistration, D as DeleteBehavior, T as TemporalMode, N as NodeType, A as AnyEdgeType, G as GraphDefaults } from './types-DMzKq0d5.js';
|
|
2
|
-
import { O as OntologyRelation, d as SerializedNodeDef, e as SerializedEdgeDef, j as SerializedSchema, G as GraphBackend, n as SchemaVersionRow } from './types-
|
|
2
|
+
import { O as OntologyRelation, d as SerializedNodeDef, e as SerializedEdgeDef, j as SerializedSchema, G as GraphBackend, n as SchemaVersionRow } from './types-ThB4cFLp.js';
|
|
3
3
|
|
|
4
4
|
/** Brand key for GraphDef */
|
|
5
5
|
declare const GRAPH_DEF_BRAND: "__graphDef";
|
|
@@ -492,4 +492,4 @@ declare function isSchemaInitialized(backend: GraphBackend, graphId: string): Pr
|
|
|
492
492
|
*/
|
|
493
493
|
declare function getSchemaChanges<G extends GraphDef>(backend: GraphBackend, graph: G): Promise<SchemaDiff | undefined>;
|
|
494
494
|
|
|
495
|
-
export { type AllEdgeTypes as A, type ChangeSeverity as C, type EdgeKinds as E, type GraphDef as G, KindRegistry as K, type MigrationHookContext as M, type NodeKinds as N, type OntologyChange as O, type SchemaManagerOptions as S, type AllNodeTypes as a, type GetEdgeType as b, type GetNodeType as c,
|
|
495
|
+
export { type AllEdgeTypes as A, type ChangeSeverity as C, type EdgeKinds as E, type GraphDef as G, KindRegistry as K, type MigrationHookContext as M, type NodeKinds as N, type OntologyChange as O, type SchemaManagerOptions as S, type AllNodeTypes as a, type GetEdgeType as b, type GetNodeType as c, type SchemaValidationResult as d, defineGraph as e, getNodeKinds as f, getEdgeKinds as g, type ChangeType as h, isGraphDef as i, type EdgeChange as j, type NodeChange as k, type SchemaDiff as l, computeSchemaDiff as m, ensureSchema as n, getActiveSchema as o, getMigrationActions as p, getSchemaChanges as q, initializeSchema as r, isBackwardsCompatible as s, isSchemaInitialized as t, migrateSchema as u, rollbackSchema as v };
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { G as GraphDef } from '../manager-
|
|
1
|
+
import { G as GraphDef } from '../manager-Bj1UEnhE.cjs';
|
|
2
2
|
import { Q as QueryAst } from '../ast-Bh2NDeaK.cjs';
|
|
3
|
-
import {
|
|
3
|
+
import { Y as Store } from '../store-gTd_qa6u.cjs';
|
|
4
4
|
import { P as ProfilerOptions, a as ProfileReport } from '../types-CVtGFpB9.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-CVtGFpB9.cjs';
|
|
6
6
|
import '../types-DMzKq0d5.cjs';
|
|
7
7
|
import 'zod';
|
|
8
|
-
import '../types-
|
|
8
|
+
import '../types-B3mmOMJV.cjs';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
10
|
|
|
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-Chhrq1vl.js';
|
|
2
2
|
import { Q as QueryAst } from '../ast-COMyNeMn.js';
|
|
3
|
-
import {
|
|
3
|
+
import { Y as Store } from '../store-Bitii3qj.js';
|
|
4
4
|
import { P as ProfilerOptions, a as ProfileReport } from '../types-COPePE8_.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-COPePE8_.js';
|
|
6
6
|
import '../types-DMzKq0d5.js';
|
|
7
7
|
import 'zod';
|
|
8
|
-
import '../types-
|
|
8
|
+
import '../types-ThB4cFLp.js';
|
|
9
9
|
import 'drizzle-orm';
|
|
10
10
|
|
|
11
11
|
/**
|
package/dist/schema/index.cjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunk3HQLOKS5_cjs = require('../chunk-3HQLOKS5.cjs');
|
|
4
4
|
require('../chunk-NI2GV74U.cjs');
|
|
5
5
|
require('../chunk-44SXEVF4.cjs');
|
|
6
6
|
|
|
@@ -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 chunk3HQLOKS5_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 chunk3HQLOKS5_cjs.computeSchemaDiff; }
|
|
74
74
|
});
|
|
75
75
|
Object.defineProperty(exports, "computeSchemaHash", {
|
|
76
76
|
enumerable: true,
|
|
77
|
-
get: function () { return
|
|
77
|
+
get: function () { return chunk3HQLOKS5_cjs.computeSchemaHash; }
|
|
78
78
|
});
|
|
79
79
|
Object.defineProperty(exports, "createValidationError", {
|
|
80
80
|
enumerable: true,
|
|
81
|
-
get: function () { return
|
|
81
|
+
get: function () { return chunk3HQLOKS5_cjs.createValidationError; }
|
|
82
82
|
});
|
|
83
83
|
Object.defineProperty(exports, "deserializeWherePredicate", {
|
|
84
84
|
enumerable: true,
|
|
85
|
-
get: function () { return
|
|
85
|
+
get: function () { return chunk3HQLOKS5_cjs.deserializeWherePredicate; }
|
|
86
86
|
});
|
|
87
87
|
Object.defineProperty(exports, "ensureSchema", {
|
|
88
88
|
enumerable: true,
|
|
89
|
-
get: function () { return
|
|
89
|
+
get: function () { return chunk3HQLOKS5_cjs.ensureSchema; }
|
|
90
90
|
});
|
|
91
91
|
Object.defineProperty(exports, "getActiveSchema", {
|
|
92
92
|
enumerable: true,
|
|
93
|
-
get: function () { return
|
|
93
|
+
get: function () { return chunk3HQLOKS5_cjs.getActiveSchema; }
|
|
94
94
|
});
|
|
95
95
|
Object.defineProperty(exports, "getMigrationActions", {
|
|
96
96
|
enumerable: true,
|
|
97
|
-
get: function () { return
|
|
97
|
+
get: function () { return chunk3HQLOKS5_cjs.getMigrationActions; }
|
|
98
98
|
});
|
|
99
99
|
Object.defineProperty(exports, "getSchemaChanges", {
|
|
100
100
|
enumerable: true,
|
|
101
|
-
get: function () { return
|
|
101
|
+
get: function () { return chunk3HQLOKS5_cjs.getSchemaChanges; }
|
|
102
102
|
});
|
|
103
103
|
Object.defineProperty(exports, "initializeSchema", {
|
|
104
104
|
enumerable: true,
|
|
105
|
-
get: function () { return
|
|
105
|
+
get: function () { return chunk3HQLOKS5_cjs.initializeSchema; }
|
|
106
106
|
});
|
|
107
107
|
Object.defineProperty(exports, "isBackwardsCompatible", {
|
|
108
108
|
enumerable: true,
|
|
109
|
-
get: function () { return
|
|
109
|
+
get: function () { return chunk3HQLOKS5_cjs.isBackwardsCompatible; }
|
|
110
110
|
});
|
|
111
111
|
Object.defineProperty(exports, "isSchemaInitialized", {
|
|
112
112
|
enumerable: true,
|
|
113
|
-
get: function () { return
|
|
113
|
+
get: function () { return chunk3HQLOKS5_cjs.isSchemaInitialized; }
|
|
114
114
|
});
|
|
115
115
|
Object.defineProperty(exports, "migrateSchema", {
|
|
116
116
|
enumerable: true,
|
|
117
|
-
get: function () { return
|
|
117
|
+
get: function () { return chunk3HQLOKS5_cjs.migrateSchema; }
|
|
118
118
|
});
|
|
119
119
|
Object.defineProperty(exports, "rollbackSchema", {
|
|
120
120
|
enumerable: true,
|
|
121
|
-
get: function () { return
|
|
121
|
+
get: function () { return chunk3HQLOKS5_cjs.rollbackSchema; }
|
|
122
122
|
});
|
|
123
123
|
Object.defineProperty(exports, "serializeSchema", {
|
|
124
124
|
enumerable: true,
|
|
125
|
-
get: function () { return
|
|
125
|
+
get: function () { return chunk3HQLOKS5_cjs.serializeSchema; }
|
|
126
126
|
});
|
|
127
127
|
Object.defineProperty(exports, "validateEdgeProps", {
|
|
128
128
|
enumerable: true,
|
|
129
|
-
get: function () { return
|
|
129
|
+
get: function () { return chunk3HQLOKS5_cjs.validateEdgeProps; }
|
|
130
130
|
});
|
|
131
131
|
Object.defineProperty(exports, "validateNodeProps", {
|
|
132
132
|
enumerable: true,
|
|
133
|
-
get: function () { return
|
|
133
|
+
get: function () { return chunk3HQLOKS5_cjs.validateNodeProps; }
|
|
134
134
|
});
|
|
135
135
|
Object.defineProperty(exports, "validateProps", {
|
|
136
136
|
enumerable: true,
|
|
137
|
-
get: function () { return
|
|
137
|
+
get: function () { return chunk3HQLOKS5_cjs.validateProps; }
|
|
138
138
|
});
|
|
139
139
|
Object.defineProperty(exports, "wrapZodError", {
|
|
140
140
|
enumerable: true,
|
|
141
|
-
get: function () { return
|
|
141
|
+
get: function () { return chunk3HQLOKS5_cjs.wrapZodError; }
|
|
142
142
|
});
|
|
143
143
|
exports.deserializeSchema = deserializeSchema;
|
|
144
144
|
//# sourceMappingURL=index.cjs.map
|
package/dist/schema/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { K as KindRegistry, G as GraphDef } from '../manager-
|
|
2
|
-
export { C as ChangeSeverity, h as ChangeType, j as EdgeChange, M as MigrationHookContext, k as NodeChange, O as OntologyChange, l as SchemaDiff, S as SchemaManagerOptions,
|
|
3
|
-
import { d as SerializedNodeDef, e as SerializedEdgeDef, f as SerializedMetaEdge, g as SerializedOntologyRelation, h as SerializedClosures, j as SerializedSchema, k as SchemaHash } from '../types-
|
|
4
|
-
export { J as JsonSchema, l as SerializedOntology, m as SerializedUniqueConstraint } from '../types-
|
|
1
|
+
import { K as KindRegistry, G as GraphDef } from '../manager-Bj1UEnhE.cjs';
|
|
2
|
+
export { C as ChangeSeverity, h as ChangeType, j as EdgeChange, M as MigrationHookContext, k as NodeChange, O as OntologyChange, l as SchemaDiff, S as SchemaManagerOptions, d as SchemaValidationResult, m as computeSchemaDiff, n as ensureSchema, o as getActiveSchema, p as getMigrationActions, q as getSchemaChanges, r as initializeSchema, s as isBackwardsCompatible, t as isSchemaInitialized, u as migrateSchema, v as rollbackSchema } from '../manager-Bj1UEnhE.cjs';
|
|
3
|
+
import { d as SerializedNodeDef, e as SerializedEdgeDef, f as SerializedMetaEdge, g as SerializedOntologyRelation, h as SerializedClosures, j as SerializedSchema, k as SchemaHash } from '../types-B3mmOMJV.cjs';
|
|
4
|
+
export { J as JsonSchema, l as SerializedOntology, m as SerializedUniqueConstraint } from '../types-B3mmOMJV.cjs';
|
|
5
5
|
import { ZodType, ZodError } from 'zod';
|
|
6
6
|
import { k as ValidationIssue, V as ValidationError } from '../index-QTnQwakS.cjs';
|
|
7
7
|
import '../types-DMzKq0d5.cjs';
|
package/dist/schema/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { K as KindRegistry, G as GraphDef } from '../manager-
|
|
2
|
-
export { C as ChangeSeverity, h as ChangeType, j as EdgeChange, M as MigrationHookContext, k as NodeChange, O as OntologyChange, l as SchemaDiff, S as SchemaManagerOptions,
|
|
3
|
-
import { d as SerializedNodeDef, e as SerializedEdgeDef, f as SerializedMetaEdge, g as SerializedOntologyRelation, h as SerializedClosures, j as SerializedSchema, k as SchemaHash } from '../types-
|
|
4
|
-
export { J as JsonSchema, l as SerializedOntology, m as SerializedUniqueConstraint } from '../types-
|
|
1
|
+
import { K as KindRegistry, G as GraphDef } from '../manager-Chhrq1vl.js';
|
|
2
|
+
export { C as ChangeSeverity, h as ChangeType, j as EdgeChange, M as MigrationHookContext, k as NodeChange, O as OntologyChange, l as SchemaDiff, S as SchemaManagerOptions, d as SchemaValidationResult, m as computeSchemaDiff, n as ensureSchema, o as getActiveSchema, p as getMigrationActions, q as getSchemaChanges, r as initializeSchema, s as isBackwardsCompatible, t as isSchemaInitialized, u as migrateSchema, v as rollbackSchema } from '../manager-Chhrq1vl.js';
|
|
3
|
+
import { d as SerializedNodeDef, e as SerializedEdgeDef, f as SerializedMetaEdge, g as SerializedOntologyRelation, h as SerializedClosures, j as SerializedSchema, k as SchemaHash } from '../types-ThB4cFLp.js';
|
|
4
|
+
export { J as JsonSchema, l as SerializedOntology, m as SerializedUniqueConstraint } from '../types-ThB4cFLp.js';
|
|
5
5
|
import { ZodType, ZodError } from 'zod';
|
|
6
6
|
import { k as ValidationIssue, V as ValidationError } from '../index-QTnQwakS.js';
|
|
7
7
|
import '../types-DMzKq0d5.js';
|
package/dist/schema/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
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-
|
|
1
|
+
import { KindRegistry } from '../chunk-L4ON6RJF.js';
|
|
2
|
+
export { computeSchemaDiff, computeSchemaHash, createValidationError, deserializeWherePredicate, ensureSchema, getActiveSchema, getMigrationActions, getSchemaChanges, initializeSchema, isBackwardsCompatible, isSchemaInitialized, migrateSchema, rollbackSchema, serializeSchema, validateEdgeProps, validateNodeProps, validateProps, wrapZodError } from '../chunk-L4ON6RJF.js';
|
|
3
3
|
import '../chunk-IRFD3MEU.js';
|
|
4
4
|
import '../chunk-SJ2QMDXY.js';
|
|
5
5
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SqlSchema, G as GraphBackend, T as TransactionBackend, E as EdgeRow, N as NodeRow } from './types-
|
|
2
|
-
import { K as KindRegistry, G as GraphDef, E as EdgeKinds, N as NodeKinds, a as AllNodeTypes, S as SchemaManagerOptions,
|
|
1
|
+
import { S as SqlSchema, G as GraphBackend, T as TransactionBackend, E as EdgeRow, N as NodeRow } from './types-ThB4cFLp.js';
|
|
2
|
+
import { K as KindRegistry, G as GraphDef, E as EdgeKinds, N as NodeKinds, a as AllNodeTypes, S as SchemaManagerOptions, d as SchemaValidationResult } from './manager-Chhrq1vl.js';
|
|
3
3
|
import { S as SqlDialect, N as NodeType, A as AnyEdgeType, T as TemporalMode, E as EdgeType, d as EdgeRegistration, b as EdgeId, g as NodeId, i as NodeRegistration } from './types-DMzKq0d5.js';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { V as ValueType, i as PredicateExpression, k as VectorMetricType, Q as QueryAst, J as JsonPointer, F as FieldRef, P as ParameterRef, c 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-COMyNeMn.js';
|
|
@@ -1266,6 +1266,14 @@ type EdgeToTypes<R extends EdgeRegistration> = R["to"] extends readonly (infer N
|
|
|
1266
1266
|
* Extracts the edge type and from/to node types automatically.
|
|
1267
1267
|
*/
|
|
1268
1268
|
type TypedEdgeCollection<R extends EdgeRegistration> = EdgeCollection<R["type"], EdgeFromTypes<R> extends NodeType ? EdgeFromTypes<R> : NodeType, EdgeToTypes<R> extends NodeType ? EdgeToTypes<R> : NodeType>;
|
|
1269
|
+
/** Mapped type of all node collections for a graph. */
|
|
1270
|
+
type GraphNodeCollections<G extends GraphDef> = {
|
|
1271
|
+
[K in keyof G["nodes"] & string]-?: NodeCollection<G["nodes"][K]["type"], ConstraintNames<G["nodes"][K]>>;
|
|
1272
|
+
};
|
|
1273
|
+
/** Mapped type of all edge collections for a graph. */
|
|
1274
|
+
type GraphEdgeCollections<G extends GraphDef> = {
|
|
1275
|
+
[K in keyof G["edges"] & string]-?: TypedEdgeCollection<G["edges"][K]>;
|
|
1276
|
+
};
|
|
1269
1277
|
/**
|
|
1270
1278
|
* A typed transaction context with collection API.
|
|
1271
1279
|
*
|
|
@@ -1277,20 +1285,67 @@ type TypedEdgeCollection<R extends EdgeRegistration> = EdgeCollection<R["type"],
|
|
|
1277
1285
|
* await store.transaction(async (tx) => {
|
|
1278
1286
|
* const person = await tx.nodes.Person.create({ name: "Alice" });
|
|
1279
1287
|
* const company = await tx.nodes.Company.create({ name: "Acme" });
|
|
1280
|
-
* // Pass nodes directly - their kind and id properties are used
|
|
1281
1288
|
* await tx.edges.worksAt.create(person, company, { role: "Engineer" });
|
|
1282
1289
|
* });
|
|
1283
1290
|
* ```
|
|
1284
1291
|
*/
|
|
1285
1292
|
type TransactionContext<G extends GraphDef> = Readonly<{
|
|
1286
|
-
|
|
1293
|
+
nodes: GraphNodeCollections<G>;
|
|
1294
|
+
edges: GraphEdgeCollections<G>;
|
|
1295
|
+
}>;
|
|
1296
|
+
/**
|
|
1297
|
+
* A node collection with widened generics for runtime string-keyed access.
|
|
1298
|
+
*
|
|
1299
|
+
* This is the return type of `store.getNodeCollection(kind)`. It exposes
|
|
1300
|
+
* the full `NodeCollection` API but with `NodeType` and `string` constraint
|
|
1301
|
+
* names instead of the specific generic parameters, since the concrete type
|
|
1302
|
+
* is not known at compile time.
|
|
1303
|
+
*/
|
|
1304
|
+
type DynamicNodeCollection = NodeCollection<NodeType, string>;
|
|
1305
|
+
/**
|
|
1306
|
+
* An edge collection with widened generics for runtime string-keyed access.
|
|
1307
|
+
*
|
|
1308
|
+
* This is the return type of `store.getEdgeCollection(kind)`. It exposes
|
|
1309
|
+
* the full `EdgeCollection` API but with `NodeType` endpoint types, since
|
|
1310
|
+
* the concrete from/to types are not known at compile time.
|
|
1311
|
+
*/
|
|
1312
|
+
type DynamicEdgeCollection = EdgeCollection<AnyEdgeType, NodeType, NodeType>;
|
|
1313
|
+
/**
|
|
1314
|
+
* A type-level projection of a store's surface onto a subset of its
|
|
1315
|
+
* node and edge collections.
|
|
1316
|
+
*
|
|
1317
|
+
* Node collections are projected with constraint names erased (`never`),
|
|
1318
|
+
* so constraint-based methods like `findByConstraint` become uncallable.
|
|
1319
|
+
* This is intentional: unique constraints are graph-registration-level
|
|
1320
|
+
* details that differ between graphs sharing the same node types.
|
|
1321
|
+
*
|
|
1322
|
+
* @example
|
|
1323
|
+
* ```typescript
|
|
1324
|
+
* type CoreStore = StoreProjection<
|
|
1325
|
+
* typeof myGraph,
|
|
1326
|
+
* "Document" | "Chunk",
|
|
1327
|
+
* "hasChunk"
|
|
1328
|
+
* >;
|
|
1329
|
+
*
|
|
1330
|
+
* async function ingestChunk(
|
|
1331
|
+
* store: CoreStore,
|
|
1332
|
+
* document: Node<typeof Document>,
|
|
1333
|
+
* text: string,
|
|
1334
|
+
* ) {
|
|
1335
|
+
* const chunk = await store.nodes.Chunk.create({ text });
|
|
1336
|
+
* await store.edges.hasChunk.create(document, chunk);
|
|
1337
|
+
* return chunk;
|
|
1338
|
+
* }
|
|
1339
|
+
* ```
|
|
1340
|
+
*
|
|
1341
|
+
* Both `Store<G>` and `TransactionContext<G>` are structurally assignable
|
|
1342
|
+
* to a `StoreProjection` whose keys are a subset of `G`.
|
|
1343
|
+
*/
|
|
1344
|
+
type StoreProjection<G extends GraphDef, N extends keyof G["nodes"] & string = never, E extends keyof G["edges"] & string = never> = Readonly<{
|
|
1287
1345
|
nodes: {
|
|
1288
|
-
[K in
|
|
1289
|
-
};
|
|
1290
|
-
/** Edge collections for the transaction */
|
|
1291
|
-
edges: {
|
|
1292
|
-
[K in keyof G["edges"] & string]-?: TypedEdgeCollection<G["edges"][K]>;
|
|
1346
|
+
[K in N]-?: NodeCollection<G["nodes"][K]["type"], never>;
|
|
1293
1347
|
};
|
|
1348
|
+
edges: Pick<GraphEdgeCollections<G>, E>;
|
|
1294
1349
|
}>;
|
|
1295
1350
|
|
|
1296
1351
|
/**
|
|
@@ -2047,9 +2102,7 @@ declare class Store<G extends GraphDef> {
|
|
|
2047
2102
|
* const people = await store.nodes.Person.find({ limit: 10 });
|
|
2048
2103
|
* ```
|
|
2049
2104
|
*/
|
|
2050
|
-
get nodes():
|
|
2051
|
-
[K in keyof G["nodes"] & string]-?: NodeCollection<G["nodes"][K]["type"], ConstraintNames<G["nodes"][K]>>;
|
|
2052
|
-
};
|
|
2105
|
+
get nodes(): GraphNodeCollections<G>;
|
|
2053
2106
|
/**
|
|
2054
2107
|
* Edge collections for ergonomic CRUD operations.
|
|
2055
2108
|
*
|
|
@@ -2066,9 +2119,24 @@ declare class Store<G extends GraphDef> {
|
|
|
2066
2119
|
* const edges = await store.edges.worksAt.findFrom({ kind: "Person", id: person.id });
|
|
2067
2120
|
* ```
|
|
2068
2121
|
*/
|
|
2069
|
-
get edges():
|
|
2070
|
-
|
|
2071
|
-
|
|
2122
|
+
get edges(): GraphEdgeCollections<G>;
|
|
2123
|
+
/**
|
|
2124
|
+
* Returns the node collection for the given kind, or undefined if the kind
|
|
2125
|
+
* is not registered in this graph.
|
|
2126
|
+
*
|
|
2127
|
+
* Use this for runtime string-keyed access when the kind is not known at
|
|
2128
|
+
* compile time (e.g., iterating all kinds, resolving from edge metadata,
|
|
2129
|
+
* dynamic admin UIs).
|
|
2130
|
+
*/
|
|
2131
|
+
getNodeCollection(kind: string): DynamicNodeCollection | undefined;
|
|
2132
|
+
/**
|
|
2133
|
+
* Returns the edge collection for the given kind, or undefined if the kind
|
|
2134
|
+
* is not registered in this graph.
|
|
2135
|
+
*
|
|
2136
|
+
* Use this for runtime string-keyed access when the kind is not known at
|
|
2137
|
+
* compile time.
|
|
2138
|
+
*/
|
|
2139
|
+
getEdgeCollection(kind: string): DynamicEdgeCollection | undefined;
|
|
2072
2140
|
/**
|
|
2073
2141
|
* Creates a query builder for this store.
|
|
2074
2142
|
*
|
|
@@ -2216,6 +2284,7 @@ declare function createStore<G extends GraphDef>(graph: G, backend: GraphBackend
|
|
|
2216
2284
|
*
|
|
2217
2285
|
* This is the recommended way to create a store in production.
|
|
2218
2286
|
* It automatically:
|
|
2287
|
+
* - Creates base tables on a fresh database (if the backend supports bootstrapTables)
|
|
2219
2288
|
* - Initializes the schema on first run (version 1)
|
|
2220
2289
|
* - Auto-migrates safe changes (additive changes)
|
|
2221
2290
|
* - Throws MigrationError for breaking changes
|
|
@@ -2240,4 +2309,4 @@ declare function createStore<G extends GraphDef>(graph: G, backend: GraphBackend
|
|
|
2240
2309
|
*/
|
|
2241
2310
|
declare function createStoreWithSchema<G extends GraphDef>(graph: G, backend: GraphBackend, options?: StoreOptions & SchemaManagerOptions): Promise<[Store<G>, SchemaValidationResult]>;
|
|
2242
2311
|
|
|
2243
|
-
export { type
|
|
2312
|
+
export { type StoreProjection as $, type AliasMap as A, type BatchResults as B, type CreateQueryBuilderOptions as C, type DynamicEdgeCollection as D, type EdgeAliasMap as E, type FieldAccessor as F, type GetOrCreateAction as G, type HookContext as H, type IfExistsMode as I, type PaginatedResult as J, type Predicate as K, PreparedQuery as L, type PropsAccessor as M, type Node as N, type OperationHookContext as O, type PaginateOptions as P, QueryBuilder as Q, type QueryHookContext as R, type QueryOptions as S, TraversalBuilder as T, type RecursiveTraversalOptions as U, type SelectContext as V, type SelectableEdge as W, type SelectableNode as X, Store as Y, type StoreHooks as Z, type StoreOptions as _, type AggregateResult as a, type StreamOptions as a0, type SubgraphOptions as a1, type SubgraphResult as a2, type SubsetEdge as a3, type SubsetNode as a4, type TransactionContext as a5, type TypedEdgeCollection as a6, UnionableQuery as a7, type UpdateEdgeInput as a8, type UpdateNodeInput as a9, createStore as aa, createStoreWithSchema as ab, defineSubgraphProject as ac, embedding as ad, exists as ae, fieldRef as af, getEmbeddingDimensions as ag, inSubquery as ah, isEmbeddingSchema as ai, isParameterRef as aj, notExists as ak, notInSubquery as al, param as am, type AnyEdge as b, type AnyNode as c, type BatchableQuery as d, type ConstraintNames as e, type CreateEdgeInput as f, type CreateNodeInput as g, type DynamicNodeCollection as h, type Edge as i, type EdgeAccessor as j, type EdgeCollection as k, type EdgeFindByEndpointsOptions as l, type EdgeGetOrCreateByEndpointsOptions as m, type EdgeGetOrCreateByEndpointsResult as n, type EmbeddingSchema as o, type EmbeddingValue as p, ExecutableAggregateQuery as q, ExecutableQuery as r, type GraphEdgeCollections as s, type GraphNodeCollections as t, type NodeAccessor as u, type NodeAlias as v, type NodeCollection as w, type NodeGetOrCreateByConstraintOptions as x, type NodeGetOrCreateByConstraintResult as y, type NodeRef as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { S as SqlSchema, G as GraphBackend, T as TransactionBackend, E as EdgeRow, N as NodeRow } from './types-
|
|
2
|
-
import { K as KindRegistry, G as GraphDef, E as EdgeKinds, N as NodeKinds, a as AllNodeTypes, S as SchemaManagerOptions,
|
|
1
|
+
import { S as SqlSchema, G as GraphBackend, T as TransactionBackend, E as EdgeRow, N as NodeRow } from './types-B3mmOMJV.cjs';
|
|
2
|
+
import { K as KindRegistry, G as GraphDef, E as EdgeKinds, N as NodeKinds, a as AllNodeTypes, S as SchemaManagerOptions, d as SchemaValidationResult } from './manager-Bj1UEnhE.cjs';
|
|
3
3
|
import { S as SqlDialect, N as NodeType, A as AnyEdgeType, T as TemporalMode, E as EdgeType, d as EdgeRegistration, b as EdgeId, g as NodeId, i as NodeRegistration } from './types-DMzKq0d5.cjs';
|
|
4
4
|
import { z } from 'zod';
|
|
5
5
|
import { V as ValueType, i as PredicateExpression, k as VectorMetricType, Q as QueryAst, J as JsonPointer, F as FieldRef, P as ParameterRef, c 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-Bh2NDeaK.cjs';
|
|
@@ -1266,6 +1266,14 @@ type EdgeToTypes<R extends EdgeRegistration> = R["to"] extends readonly (infer N
|
|
|
1266
1266
|
* Extracts the edge type and from/to node types automatically.
|
|
1267
1267
|
*/
|
|
1268
1268
|
type TypedEdgeCollection<R extends EdgeRegistration> = EdgeCollection<R["type"], EdgeFromTypes<R> extends NodeType ? EdgeFromTypes<R> : NodeType, EdgeToTypes<R> extends NodeType ? EdgeToTypes<R> : NodeType>;
|
|
1269
|
+
/** Mapped type of all node collections for a graph. */
|
|
1270
|
+
type GraphNodeCollections<G extends GraphDef> = {
|
|
1271
|
+
[K in keyof G["nodes"] & string]-?: NodeCollection<G["nodes"][K]["type"], ConstraintNames<G["nodes"][K]>>;
|
|
1272
|
+
};
|
|
1273
|
+
/** Mapped type of all edge collections for a graph. */
|
|
1274
|
+
type GraphEdgeCollections<G extends GraphDef> = {
|
|
1275
|
+
[K in keyof G["edges"] & string]-?: TypedEdgeCollection<G["edges"][K]>;
|
|
1276
|
+
};
|
|
1269
1277
|
/**
|
|
1270
1278
|
* A typed transaction context with collection API.
|
|
1271
1279
|
*
|
|
@@ -1277,20 +1285,67 @@ type TypedEdgeCollection<R extends EdgeRegistration> = EdgeCollection<R["type"],
|
|
|
1277
1285
|
* await store.transaction(async (tx) => {
|
|
1278
1286
|
* const person = await tx.nodes.Person.create({ name: "Alice" });
|
|
1279
1287
|
* const company = await tx.nodes.Company.create({ name: "Acme" });
|
|
1280
|
-
* // Pass nodes directly - their kind and id properties are used
|
|
1281
1288
|
* await tx.edges.worksAt.create(person, company, { role: "Engineer" });
|
|
1282
1289
|
* });
|
|
1283
1290
|
* ```
|
|
1284
1291
|
*/
|
|
1285
1292
|
type TransactionContext<G extends GraphDef> = Readonly<{
|
|
1286
|
-
|
|
1293
|
+
nodes: GraphNodeCollections<G>;
|
|
1294
|
+
edges: GraphEdgeCollections<G>;
|
|
1295
|
+
}>;
|
|
1296
|
+
/**
|
|
1297
|
+
* A node collection with widened generics for runtime string-keyed access.
|
|
1298
|
+
*
|
|
1299
|
+
* This is the return type of `store.getNodeCollection(kind)`. It exposes
|
|
1300
|
+
* the full `NodeCollection` API but with `NodeType` and `string` constraint
|
|
1301
|
+
* names instead of the specific generic parameters, since the concrete type
|
|
1302
|
+
* is not known at compile time.
|
|
1303
|
+
*/
|
|
1304
|
+
type DynamicNodeCollection = NodeCollection<NodeType, string>;
|
|
1305
|
+
/**
|
|
1306
|
+
* An edge collection with widened generics for runtime string-keyed access.
|
|
1307
|
+
*
|
|
1308
|
+
* This is the return type of `store.getEdgeCollection(kind)`. It exposes
|
|
1309
|
+
* the full `EdgeCollection` API but with `NodeType` endpoint types, since
|
|
1310
|
+
* the concrete from/to types are not known at compile time.
|
|
1311
|
+
*/
|
|
1312
|
+
type DynamicEdgeCollection = EdgeCollection<AnyEdgeType, NodeType, NodeType>;
|
|
1313
|
+
/**
|
|
1314
|
+
* A type-level projection of a store's surface onto a subset of its
|
|
1315
|
+
* node and edge collections.
|
|
1316
|
+
*
|
|
1317
|
+
* Node collections are projected with constraint names erased (`never`),
|
|
1318
|
+
* so constraint-based methods like `findByConstraint` become uncallable.
|
|
1319
|
+
* This is intentional: unique constraints are graph-registration-level
|
|
1320
|
+
* details that differ between graphs sharing the same node types.
|
|
1321
|
+
*
|
|
1322
|
+
* @example
|
|
1323
|
+
* ```typescript
|
|
1324
|
+
* type CoreStore = StoreProjection<
|
|
1325
|
+
* typeof myGraph,
|
|
1326
|
+
* "Document" | "Chunk",
|
|
1327
|
+
* "hasChunk"
|
|
1328
|
+
* >;
|
|
1329
|
+
*
|
|
1330
|
+
* async function ingestChunk(
|
|
1331
|
+
* store: CoreStore,
|
|
1332
|
+
* document: Node<typeof Document>,
|
|
1333
|
+
* text: string,
|
|
1334
|
+
* ) {
|
|
1335
|
+
* const chunk = await store.nodes.Chunk.create({ text });
|
|
1336
|
+
* await store.edges.hasChunk.create(document, chunk);
|
|
1337
|
+
* return chunk;
|
|
1338
|
+
* }
|
|
1339
|
+
* ```
|
|
1340
|
+
*
|
|
1341
|
+
* Both `Store<G>` and `TransactionContext<G>` are structurally assignable
|
|
1342
|
+
* to a `StoreProjection` whose keys are a subset of `G`.
|
|
1343
|
+
*/
|
|
1344
|
+
type StoreProjection<G extends GraphDef, N extends keyof G["nodes"] & string = never, E extends keyof G["edges"] & string = never> = Readonly<{
|
|
1287
1345
|
nodes: {
|
|
1288
|
-
[K in
|
|
1289
|
-
};
|
|
1290
|
-
/** Edge collections for the transaction */
|
|
1291
|
-
edges: {
|
|
1292
|
-
[K in keyof G["edges"] & string]-?: TypedEdgeCollection<G["edges"][K]>;
|
|
1346
|
+
[K in N]-?: NodeCollection<G["nodes"][K]["type"], never>;
|
|
1293
1347
|
};
|
|
1348
|
+
edges: Pick<GraphEdgeCollections<G>, E>;
|
|
1294
1349
|
}>;
|
|
1295
1350
|
|
|
1296
1351
|
/**
|
|
@@ -2047,9 +2102,7 @@ declare class Store<G extends GraphDef> {
|
|
|
2047
2102
|
* const people = await store.nodes.Person.find({ limit: 10 });
|
|
2048
2103
|
* ```
|
|
2049
2104
|
*/
|
|
2050
|
-
get nodes():
|
|
2051
|
-
[K in keyof G["nodes"] & string]-?: NodeCollection<G["nodes"][K]["type"], ConstraintNames<G["nodes"][K]>>;
|
|
2052
|
-
};
|
|
2105
|
+
get nodes(): GraphNodeCollections<G>;
|
|
2053
2106
|
/**
|
|
2054
2107
|
* Edge collections for ergonomic CRUD operations.
|
|
2055
2108
|
*
|
|
@@ -2066,9 +2119,24 @@ declare class Store<G extends GraphDef> {
|
|
|
2066
2119
|
* const edges = await store.edges.worksAt.findFrom({ kind: "Person", id: person.id });
|
|
2067
2120
|
* ```
|
|
2068
2121
|
*/
|
|
2069
|
-
get edges():
|
|
2070
|
-
|
|
2071
|
-
|
|
2122
|
+
get edges(): GraphEdgeCollections<G>;
|
|
2123
|
+
/**
|
|
2124
|
+
* Returns the node collection for the given kind, or undefined if the kind
|
|
2125
|
+
* is not registered in this graph.
|
|
2126
|
+
*
|
|
2127
|
+
* Use this for runtime string-keyed access when the kind is not known at
|
|
2128
|
+
* compile time (e.g., iterating all kinds, resolving from edge metadata,
|
|
2129
|
+
* dynamic admin UIs).
|
|
2130
|
+
*/
|
|
2131
|
+
getNodeCollection(kind: string): DynamicNodeCollection | undefined;
|
|
2132
|
+
/**
|
|
2133
|
+
* Returns the edge collection for the given kind, or undefined if the kind
|
|
2134
|
+
* is not registered in this graph.
|
|
2135
|
+
*
|
|
2136
|
+
* Use this for runtime string-keyed access when the kind is not known at
|
|
2137
|
+
* compile time.
|
|
2138
|
+
*/
|
|
2139
|
+
getEdgeCollection(kind: string): DynamicEdgeCollection | undefined;
|
|
2072
2140
|
/**
|
|
2073
2141
|
* Creates a query builder for this store.
|
|
2074
2142
|
*
|
|
@@ -2216,6 +2284,7 @@ declare function createStore<G extends GraphDef>(graph: G, backend: GraphBackend
|
|
|
2216
2284
|
*
|
|
2217
2285
|
* This is the recommended way to create a store in production.
|
|
2218
2286
|
* It automatically:
|
|
2287
|
+
* - Creates base tables on a fresh database (if the backend supports bootstrapTables)
|
|
2219
2288
|
* - Initializes the schema on first run (version 1)
|
|
2220
2289
|
* - Auto-migrates safe changes (additive changes)
|
|
2221
2290
|
* - Throws MigrationError for breaking changes
|
|
@@ -2240,4 +2309,4 @@ declare function createStore<G extends GraphDef>(graph: G, backend: GraphBackend
|
|
|
2240
2309
|
*/
|
|
2241
2310
|
declare function createStoreWithSchema<G extends GraphDef>(graph: G, backend: GraphBackend, options?: StoreOptions & SchemaManagerOptions): Promise<[Store<G>, SchemaValidationResult]>;
|
|
2242
2311
|
|
|
2243
|
-
export { type
|
|
2312
|
+
export { type StoreProjection as $, type AliasMap as A, type BatchResults as B, type CreateQueryBuilderOptions as C, type DynamicEdgeCollection as D, type EdgeAliasMap as E, type FieldAccessor as F, type GetOrCreateAction as G, type HookContext as H, type IfExistsMode as I, type PaginatedResult as J, type Predicate as K, PreparedQuery as L, type PropsAccessor as M, type Node as N, type OperationHookContext as O, type PaginateOptions as P, QueryBuilder as Q, type QueryHookContext as R, type QueryOptions as S, TraversalBuilder as T, type RecursiveTraversalOptions as U, type SelectContext as V, type SelectableEdge as W, type SelectableNode as X, Store as Y, type StoreHooks as Z, type StoreOptions as _, type AggregateResult as a, type StreamOptions as a0, type SubgraphOptions as a1, type SubgraphResult as a2, type SubsetEdge as a3, type SubsetNode as a4, type TransactionContext as a5, type TypedEdgeCollection as a6, UnionableQuery as a7, type UpdateEdgeInput as a8, type UpdateNodeInput as a9, createStore as aa, createStoreWithSchema as ab, defineSubgraphProject as ac, embedding as ad, exists as ae, fieldRef as af, getEmbeddingDimensions as ag, inSubquery as ah, isEmbeddingSchema as ai, isParameterRef as aj, notExists as ak, notInSubquery as al, param as am, type AnyEdge as b, type AnyNode as c, type BatchableQuery as d, type ConstraintNames as e, type CreateEdgeInput as f, type CreateNodeInput as g, type DynamicNodeCollection as h, type Edge as i, type EdgeAccessor as j, type EdgeCollection as k, type EdgeFindByEndpointsOptions as l, type EdgeGetOrCreateByEndpointsOptions as m, type EdgeGetOrCreateByEndpointsResult as n, type EmbeddingSchema as o, type EmbeddingValue as p, ExecutableAggregateQuery as q, ExecutableQuery as r, type GraphEdgeCollections as s, type GraphNodeCollections as t, type NodeAccessor as u, type NodeAlias as v, type NodeCollection as w, type NodeGetOrCreateByConstraintOptions as x, type NodeGetOrCreateByConstraintResult as y, type NodeRef as z };
|
|
@@ -593,6 +593,14 @@ type GraphBackend = Readonly<{
|
|
|
593
593
|
* Intended for import-replacement workflows. No hooks, no per-row logic.
|
|
594
594
|
*/
|
|
595
595
|
clearGraph: (graphId: string) => Promise<void>;
|
|
596
|
+
/**
|
|
597
|
+
* Creates the base TypeGraph tables if they don't already exist.
|
|
598
|
+
*
|
|
599
|
+
* Called automatically by `createStoreWithSchema()` when a fresh database
|
|
600
|
+
* is detected. Users who manage DDL themselves via `createStore()` never
|
|
601
|
+
* hit this path.
|
|
602
|
+
*/
|
|
603
|
+
bootstrapTables?: () => Promise<void>;
|
|
596
604
|
execute: <T>(query: SQL) => Promise<readonly T[]>;
|
|
597
605
|
/** Execute pre-compiled SQL text with bound parameters. Available on sync SQLite and pg backends. */
|
|
598
606
|
executeRaw?: <T>(sqlText: string, params: readonly unknown[]) => Promise<readonly T[]>;
|