@nicia-ai/typegraph 0.26.0 → 0.28.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 +99 -57
- package/dist/backend/postgres/index.cjs.map +1 -1
- package/dist/backend/postgres/index.d.cts +4 -4
- package/dist/backend/postgres/index.d.ts +4 -4
- package/dist/backend/postgres/index.js +47 -5
- package/dist/backend/postgres/index.js.map +1 -1
- package/dist/backend/sqlite/index.cjs +13 -13
- package/dist/backend/sqlite/index.d.cts +5 -5
- package/dist/backend/sqlite/index.d.ts +5 -5
- package/dist/backend/sqlite/index.js +3 -3
- package/dist/backend/sqlite/libsql.cjs +6 -6
- package/dist/backend/sqlite/libsql.d.cts +2 -2
- package/dist/backend/sqlite/libsql.d.ts +2 -2
- package/dist/backend/sqlite/libsql.js +3 -3
- package/dist/backend/sqlite/local.cjs +7 -7
- package/dist/backend/sqlite/local.d.cts +2 -2
- package/dist/backend/sqlite/local.d.ts +2 -2
- package/dist/backend/sqlite/local.js +3 -3
- package/dist/{chunk-TVUARC7S.cjs → chunk-2E4VTD2E.cjs} +50 -22
- package/dist/chunk-2E4VTD2E.cjs.map +1 -0
- package/dist/{chunk-RVT2N4RF.cjs → chunk-33K3ZYFG.cjs} +46 -46
- package/dist/{chunk-RVT2N4RF.cjs.map → chunk-33K3ZYFG.cjs.map} +1 -1
- package/dist/{chunk-RF5EUQWS.js → chunk-DFHLG75V.js} +50 -22
- package/dist/chunk-DFHLG75V.js.map +1 -0
- package/dist/{chunk-DN4RUDF3.cjs → chunk-LYRUNG6E.cjs} +2 -2
- package/dist/chunk-LYRUNG6E.cjs.map +1 -0
- package/dist/{chunk-ENXJLDRK.js → chunk-PCHTTG42.js} +2 -2
- package/dist/chunk-PCHTTG42.js.map +1 -0
- package/dist/{chunk-DDVA4QBA.js → chunk-UKG7XHZ3.js} +4 -4
- package/dist/{chunk-DDVA4QBA.js.map → chunk-UKG7XHZ3.js.map} +1 -1
- package/dist/{chunk-3W6AIFT2.js → chunk-X53YKGHR.js} +74 -8
- package/dist/chunk-X53YKGHR.js.map +1 -0
- package/dist/{chunk-4TJI44WP.cjs → chunk-ZGEMI7MJ.cjs} +75 -7
- package/dist/chunk-ZGEMI7MJ.cjs.map +1 -0
- package/dist/{ddl-9kw8UADK.d.ts → ddl-0Ooc2dpL.d.ts} +2 -2
- package/dist/{ddl-Cw82BPM4.d.cts → ddl-Dza3kDrI.d.cts} +2 -2
- package/dist/index.cjs +100 -66
- 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 +40 -7
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.d.cts +4 -4
- package/dist/indexes/index.d.ts +4 -4
- package/dist/interchange/index.d.cts +3 -3
- package/dist/interchange/index.d.ts +3 -3
- package/dist/{manager-Aqzmztkb.d.cts → manager-c1MGaVVR.d.cts} +35 -11
- package/dist/{manager-C3LxzPcX.d.ts → manager-ehLTTNq0.d.ts} +35 -11
- package/dist/profiler/index.d.cts +5 -5
- package/dist/profiler/index.d.ts +5 -5
- package/dist/schema/index.cjs +28 -24
- 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-GKvcDPVn.d.ts → sqlite-BxZUPbyD.d.ts} +1 -1
- package/dist/{sqlite-BvSEbybu.d.cts → sqlite-mvpXjEeB.d.cts} +1 -1
- package/dist/{store-DbQLsSor.d.cts → store-D7YEMg2v.d.cts} +69 -3
- package/dist/{store-CiS_AGNH.d.ts → store-Ufc1Eoey.d.ts} +69 -3
- package/dist/{types-Cars4JZ1.d.ts → types-B-sJJ4GQ.d.ts} +1 -1
- package/dist/{types-DZPBXZOK.d.cts → types-CMQymcwk.d.cts} +11 -0
- package/dist/{types-Dzkr0Eqi.d.ts → types-CQ7xXJMP.d.ts} +11 -0
- package/dist/{types-CF7nDH3q.d.cts → types-CmUA9sal.d.cts} +1 -1
- package/dist/{where-BmtjfWuS.d.cts → where-5zf15aFZ.d.cts} +1 -1
- package/dist/{where-kk1Zz2En.d.ts → where-CtrLu1Zf.d.ts} +1 -1
- package/package.json +8 -8
- package/dist/chunk-3W6AIFT2.js.map +0 -1
- package/dist/chunk-4TJI44WP.cjs.map +0 -1
- package/dist/chunk-DN4RUDF3.cjs.map +0 -1
- package/dist/chunk-ENXJLDRK.js.map +0 -1
- package/dist/chunk-RF5EUQWS.js.map +0 -1
- package/dist/chunk-TVUARC7S.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I as IndexDeclaration, F as FulltextStrategy } from './types-
|
|
1
|
+
import { I as IndexDeclaration, F as FulltextStrategy } from './types-CQ7xXJMP.js';
|
|
2
2
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
3
|
-
import { S as SqliteTables } from './sqlite-
|
|
3
|
+
import { S as SqliteTables } from './sqlite-BxZUPbyD.js';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Table name configuration.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { I as IndexDeclaration, F as FulltextStrategy } from './types-
|
|
1
|
+
import { I as IndexDeclaration, F as FulltextStrategy } from './types-CMQymcwk.cjs';
|
|
2
2
|
import * as drizzle_orm_pg_core from 'drizzle-orm/pg-core';
|
|
3
|
-
import { S as SqliteTables } from './sqlite-
|
|
3
|
+
import { S as SqliteTables } from './sqlite-mvpXjEeB.cjs';
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Table name configuration.
|
package/dist/index.cjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkHTGDWIDE_cjs = require('./chunk-HTGDWIDE.cjs');
|
|
4
|
-
var
|
|
4
|
+
var chunkZGEMI7MJ_cjs = require('./chunk-ZGEMI7MJ.cjs');
|
|
5
5
|
var chunkWFUN6DCM_cjs = require('./chunk-WFUN6DCM.cjs');
|
|
6
6
|
var chunk4FJVSF3K_cjs = require('./chunk-4FJVSF3K.cjs');
|
|
7
7
|
var chunkPYJOBZR3_cjs = require('./chunk-PYJOBZR3.cjs');
|
|
8
|
-
var
|
|
8
|
+
var chunkLYRUNG6E_cjs = require('./chunk-LYRUNG6E.cjs');
|
|
9
9
|
var chunkIUIWCFG3_cjs = require('./chunk-IUIWCFG3.cjs');
|
|
10
10
|
var chunkPN37HVAV_cjs = require('./chunk-PN37HVAV.cjs');
|
|
11
11
|
var chunkCTHNVU6K_cjs = require('./chunk-CTHNVU6K.cjs');
|
|
@@ -28,7 +28,7 @@ function metaEdge(name, options = {}) {
|
|
|
28
28
|
description: options.description
|
|
29
29
|
};
|
|
30
30
|
return Object.freeze({
|
|
31
|
-
[
|
|
31
|
+
[chunkZGEMI7MJ_cjs.META_EDGE_BRAND]: true,
|
|
32
32
|
name,
|
|
33
33
|
properties
|
|
34
34
|
});
|
|
@@ -4298,7 +4298,7 @@ function planRemovals(graph, names) {
|
|
|
4298
4298
|
if (namesSet.size === 0) {
|
|
4299
4299
|
return { document, removedNodeKinds: [], removedEdgeKinds: [] };
|
|
4300
4300
|
}
|
|
4301
|
-
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } =
|
|
4301
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunkZGEMI7MJ_cjs.extensionKindNames(document);
|
|
4302
4302
|
const compileTimeNodeNames = new Set(
|
|
4303
4303
|
Object.keys(graph.nodes).filter((name) => !runtimeNodeNames.has(name))
|
|
4304
4304
|
);
|
|
@@ -4398,8 +4398,8 @@ function planRemovals(graph, names) {
|
|
|
4398
4398
|
function stripGraphExtension(graph) {
|
|
4399
4399
|
const document = graph.extension;
|
|
4400
4400
|
if (document === void 0) return graph;
|
|
4401
|
-
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } =
|
|
4402
|
-
const runtimeOntologyKeys =
|
|
4401
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunkZGEMI7MJ_cjs.extensionKindNames(document);
|
|
4402
|
+
const runtimeOntologyKeys = chunkZGEMI7MJ_cjs.buildGraphExtensionOntologyKeySet(document);
|
|
4403
4403
|
const compileNodes = {};
|
|
4404
4404
|
for (const [name, registration] of Object.entries(graph.nodes)) {
|
|
4405
4405
|
if (runtimeNodeNames.has(name)) continue;
|
|
@@ -4411,7 +4411,7 @@ function stripGraphExtension(graph) {
|
|
|
4411
4411
|
compileEdges[name] = registration;
|
|
4412
4412
|
}
|
|
4413
4413
|
const compileOntology = graph.ontology.filter(
|
|
4414
|
-
(relation) => !runtimeOntologyKeys.has(
|
|
4414
|
+
(relation) => !runtimeOntologyKeys.has(chunkZGEMI7MJ_cjs.compileTimeOntologyKey(relation))
|
|
4415
4415
|
);
|
|
4416
4416
|
const compileIndexes = (graph.indexes ?? []).filter(
|
|
4417
4417
|
(index) => index.origin !== "runtime"
|
|
@@ -4451,13 +4451,13 @@ function buildCompileTimeReferentIndex(graph, runtimeEdgeNames) {
|
|
|
4451
4451
|
append(endpoint.kind, referent);
|
|
4452
4452
|
}
|
|
4453
4453
|
}
|
|
4454
|
-
const runtimeOntologyKeys =
|
|
4454
|
+
const runtimeOntologyKeys = chunkZGEMI7MJ_cjs.buildGraphExtensionOntologyKeySet(
|
|
4455
4455
|
graph.extension
|
|
4456
4456
|
);
|
|
4457
4457
|
for (const relation of graph.ontology) {
|
|
4458
|
-
if (runtimeOntologyKeys.has(
|
|
4459
|
-
const fromName =
|
|
4460
|
-
const toName =
|
|
4458
|
+
if (runtimeOntologyKeys.has(chunkZGEMI7MJ_cjs.compileTimeOntologyKey(relation))) continue;
|
|
4459
|
+
const fromName = chunkZGEMI7MJ_cjs.getTypeName(relation.from);
|
|
4460
|
+
const toName = chunkZGEMI7MJ_cjs.getTypeName(relation.to);
|
|
4461
4461
|
const referent = {
|
|
4462
4462
|
type: "compile-time-ontology",
|
|
4463
4463
|
name: `${relation.metaEdge.name}(${fromName}, ${toName})`
|
|
@@ -9996,8 +9996,8 @@ function createQueryBuilder(graphId, registry, options) {
|
|
|
9996
9996
|
function buildKindRegistry(graph) {
|
|
9997
9997
|
const nodeTypes = extractNodeTypes(graph);
|
|
9998
9998
|
const edgeTypes = extractEdgeTypes(graph);
|
|
9999
|
-
const closures = graph.ontology.length > 0 ?
|
|
10000
|
-
return new
|
|
9999
|
+
const closures = graph.ontology.length > 0 ? chunkZGEMI7MJ_cjs.computeClosuresFromOntology(graph.ontology) : chunkZGEMI7MJ_cjs.createEmptyClosures();
|
|
10000
|
+
return new chunkZGEMI7MJ_cjs.KindRegistry(nodeTypes, edgeTypes, closures);
|
|
10001
10001
|
}
|
|
10002
10002
|
function extractNodeTypes(graph) {
|
|
10003
10003
|
const result = /* @__PURE__ */ new Map();
|
|
@@ -10992,7 +10992,7 @@ function createEdgeCollectionsProxy(graph, graphId, registry, backend, operation
|
|
|
10992
10992
|
// src/store/introspect.ts
|
|
10993
10993
|
function introspectSchema(graph, context) {
|
|
10994
10994
|
const extension = graph.extension;
|
|
10995
|
-
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } =
|
|
10995
|
+
const { nodes: runtimeNodeNames, edges: runtimeEdgeNames } = chunkZGEMI7MJ_cjs.extensionKindNames(extension);
|
|
10996
10996
|
const deprecated = graph.deprecatedKinds;
|
|
10997
10997
|
const kinds = [];
|
|
10998
10998
|
for (const [name, registration] of Object.entries(graph.nodes)) {
|
|
@@ -11003,7 +11003,7 @@ function introspectSchema(graph, context) {
|
|
|
11003
11003
|
description: reg.type.description,
|
|
11004
11004
|
annotations: reg.type.annotations,
|
|
11005
11005
|
deprecated: deprecated.has(name),
|
|
11006
|
-
properties:
|
|
11006
|
+
properties: chunkZGEMI7MJ_cjs.serializeSchemaProperties(reg.type.schema),
|
|
11007
11007
|
unique: (reg.unique ?? []).map((constraint) => ({
|
|
11008
11008
|
name: constraint.name,
|
|
11009
11009
|
fields: [...constraint.fields],
|
|
@@ -11024,17 +11024,17 @@ function introspectSchema(graph, context) {
|
|
|
11024
11024
|
to: reg.to.map((entry2) => entry2.kind),
|
|
11025
11025
|
cardinality: reg.cardinality ?? "many",
|
|
11026
11026
|
endpointExistence: reg.endpointExistence ?? "notDeleted",
|
|
11027
|
-
properties:
|
|
11027
|
+
properties: chunkZGEMI7MJ_cjs.serializeSchemaProperties(edgeType.schema),
|
|
11028
11028
|
annotations: edgeType.annotations,
|
|
11029
11029
|
deprecated: deprecated.has(name)
|
|
11030
11030
|
});
|
|
11031
11031
|
}
|
|
11032
|
-
const runtimeOntologyKeys =
|
|
11032
|
+
const runtimeOntologyKeys = chunkZGEMI7MJ_cjs.buildGraphExtensionOntologyKeySet(extension);
|
|
11033
11033
|
const ontology = graph.ontology.map((relation) => ({
|
|
11034
11034
|
metaEdge: relation.metaEdge.name,
|
|
11035
|
-
from:
|
|
11036
|
-
to:
|
|
11037
|
-
origin: runtimeOntologyKeys.has(
|
|
11035
|
+
from: chunkZGEMI7MJ_cjs.getTypeName(relation.from),
|
|
11036
|
+
to: chunkZGEMI7MJ_cjs.getTypeName(relation.to),
|
|
11037
|
+
origin: runtimeOntologyKeys.has(chunkZGEMI7MJ_cjs.compileTimeOntologyKey(relation)) ? "runtime" : "compile-time"
|
|
11038
11038
|
}));
|
|
11039
11039
|
return {
|
|
11040
11040
|
graphId: context.graphId,
|
|
@@ -11429,14 +11429,14 @@ async function reconcilePendingRemovals(context) {
|
|
|
11429
11429
|
const reconciliations = [];
|
|
11430
11430
|
const stopAtVersion = marker ?? 1;
|
|
11431
11431
|
let currentRow = activeRow;
|
|
11432
|
-
let currentSchema =
|
|
11432
|
+
let currentSchema = chunkZGEMI7MJ_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
11433
11433
|
while (currentRow.version > stopAtVersion) {
|
|
11434
11434
|
const priorRow = await backend.getSchemaVersion(
|
|
11435
11435
|
graphId,
|
|
11436
11436
|
currentRow.version - 1
|
|
11437
11437
|
);
|
|
11438
11438
|
if (priorRow === void 0) break;
|
|
11439
|
-
const priorSchema =
|
|
11439
|
+
const priorSchema = chunkZGEMI7MJ_cjs.parseSerializedSchema(priorRow.schema_doc);
|
|
11440
11440
|
for (const entity of ENTITY_KINDS) {
|
|
11441
11441
|
const priorEntries = priorSchema[entity === "node" ? "nodes" : "edges"];
|
|
11442
11442
|
const currentEntries = currentSchema[entity === "node" ? "nodes" : "edges"];
|
|
@@ -11952,7 +11952,7 @@ async function validateAndPrepareEdgeCreate(ctx, input, id, backend) {
|
|
|
11952
11952
|
nodeId: input.toId
|
|
11953
11953
|
});
|
|
11954
11954
|
}
|
|
11955
|
-
const validatedProps =
|
|
11955
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateEdgeProps(edgeKind.schema, input.props, {
|
|
11956
11956
|
kind,
|
|
11957
11957
|
operation: "create"
|
|
11958
11958
|
});
|
|
@@ -12102,7 +12102,7 @@ async function executeEdgeUpdate(ctx, input, backend) {
|
|
|
12102
12102
|
const edgeKind = registration.type;
|
|
12103
12103
|
const existingProps = JSON.parse(existing.props);
|
|
12104
12104
|
const mergedProps = { ...existingProps, ...input.props };
|
|
12105
|
-
const validatedProps =
|
|
12105
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateEdgeProps(edgeKind.schema, mergedProps, {
|
|
12106
12106
|
kind: existing.kind,
|
|
12107
12107
|
operation: "update",
|
|
12108
12108
|
id
|
|
@@ -12128,7 +12128,7 @@ async function executeEdgeUpsertUpdate(ctx, input, backend, options) {
|
|
|
12128
12128
|
const edgeKind = registration.type;
|
|
12129
12129
|
const existingProps = JSON.parse(existing.props);
|
|
12130
12130
|
const mergedProps = { ...existingProps, ...input.props };
|
|
12131
|
-
const validatedProps =
|
|
12131
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateEdgeProps(edgeKind.schema, mergedProps, {
|
|
12132
12132
|
kind: existing.kind,
|
|
12133
12133
|
operation: "update",
|
|
12134
12134
|
id
|
|
@@ -12285,7 +12285,7 @@ async function executeEdgeGetOrCreateByEndpoints(ctx, kind, fromKind, fromId, to
|
|
|
12285
12285
|
const matchOn = options?.matchOn ?? [];
|
|
12286
12286
|
const registration = getEdgeRegistration(ctx.graph, kind);
|
|
12287
12287
|
const edgeKind = registration.type;
|
|
12288
|
-
const validatedProps =
|
|
12288
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateEdgeProps(edgeKind.schema, props, {
|
|
12289
12289
|
kind,
|
|
12290
12290
|
operation: "create"
|
|
12291
12291
|
});
|
|
@@ -12367,7 +12367,7 @@ async function executeEdgeBulkGetOrCreateByEndpoints(ctx, kind, items, backend,
|
|
|
12367
12367
|
validateMatchOnFields(edgeKind.schema, matchOn, kind);
|
|
12368
12368
|
const validated = [];
|
|
12369
12369
|
for (const item of items) {
|
|
12370
|
-
const validatedProps =
|
|
12370
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateEdgeProps(edgeKind.schema, item.props, {
|
|
12371
12371
|
kind,
|
|
12372
12372
|
operation: "create"
|
|
12373
12373
|
});
|
|
@@ -13014,7 +13014,7 @@ async function validateAndPrepareNodeCreate(ctx, input, id, backend) {
|
|
|
13014
13014
|
const kind = input.kind;
|
|
13015
13015
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
13016
13016
|
const nodeKind = registration.type;
|
|
13017
|
-
const validatedProps =
|
|
13017
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateNodeProps(nodeKind.schema, input.props, {
|
|
13018
13018
|
kind,
|
|
13019
13019
|
operation: "create"
|
|
13020
13020
|
});
|
|
@@ -13088,7 +13088,7 @@ async function performNodeUpdate(ctx, input, backend, options) {
|
|
|
13088
13088
|
const existingProps = JSON.parse(existing.props);
|
|
13089
13089
|
const mergedProps = { ...existingProps, ...input.props };
|
|
13090
13090
|
const nodeKind = registration.type;
|
|
13091
|
-
const validatedProps =
|
|
13091
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateNodeProps(nodeKind.schema, mergedProps, {
|
|
13092
13092
|
kind,
|
|
13093
13093
|
operation: "update",
|
|
13094
13094
|
id
|
|
@@ -13361,7 +13361,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
13361
13361
|
const ifExists = options?.ifExists ?? "return";
|
|
13362
13362
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
13363
13363
|
const nodeKind = registration.type;
|
|
13364
|
-
const validatedProps =
|
|
13364
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
13365
13365
|
kind,
|
|
13366
13366
|
operation: "create"
|
|
13367
13367
|
});
|
|
@@ -13433,7 +13433,7 @@ async function executeNodeGetOrCreateByConstraint(ctx, kind, constraintName, pro
|
|
|
13433
13433
|
async function executeNodeFindByConstraint(ctx, kind, constraintName, props, backend) {
|
|
13434
13434
|
const registration = getNodeRegistration(ctx.graph, kind);
|
|
13435
13435
|
const nodeKind = registration.type;
|
|
13436
|
-
const validatedProps =
|
|
13436
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateNodeProps(nodeKind.schema, props, {
|
|
13437
13437
|
kind,
|
|
13438
13438
|
operation: "create"
|
|
13439
13439
|
});
|
|
@@ -13470,7 +13470,7 @@ async function executeNodeFindByConstraint(ctx, kind, constraintName, props, bac
|
|
|
13470
13470
|
function validateAndComputeKeys(nodeKind, kind, constraint, items) {
|
|
13471
13471
|
const validated = [];
|
|
13472
13472
|
for (const item of items) {
|
|
13473
|
-
const validatedProps =
|
|
13473
|
+
const validatedProps = chunkZGEMI7MJ_cjs.validateNodeProps(nodeKind.schema, item.props, {
|
|
13474
13474
|
kind,
|
|
13475
13475
|
operation: "create"
|
|
13476
13476
|
});
|
|
@@ -13764,7 +13764,7 @@ async function rebuildFulltextIndex(ctx, nodeKind, options) {
|
|
|
13764
13764
|
}
|
|
13765
13765
|
}
|
|
13766
13766
|
};
|
|
13767
|
-
await
|
|
13767
|
+
await chunkLYRUNG6E_cjs.runOptionallyInTransaction(backend, writePage);
|
|
13768
13768
|
processed += rows.length;
|
|
13769
13769
|
upserted += pageResult.toUpsert.length;
|
|
13770
13770
|
cleared += pageResult.toDelete.length;
|
|
@@ -13882,6 +13882,7 @@ async function executeVectorSearch(ctx, nodeKind, options) {
|
|
|
13882
13882
|
`vectorSearch.limit must be a positive integer, got: ${options.limit}`
|
|
13883
13883
|
);
|
|
13884
13884
|
}
|
|
13885
|
+
assertEfSearch(options.efSearch, "vectorSearch.efSearch");
|
|
13885
13886
|
const rows = await backend.vectorSearch({
|
|
13886
13887
|
graphId,
|
|
13887
13888
|
nodeKind,
|
|
@@ -13889,7 +13890,8 @@ async function executeVectorSearch(ctx, nodeKind, options) {
|
|
|
13889
13890
|
queryEmbedding: options.queryEmbedding,
|
|
13890
13891
|
metric: options.metric ?? "cosine",
|
|
13891
13892
|
limit: options.limit,
|
|
13892
|
-
...options.minScore === void 0 ? {} : { minScore: options.minScore }
|
|
13893
|
+
...options.minScore === void 0 ? {} : { minScore: options.minScore },
|
|
13894
|
+
...options.efSearch === void 0 ? {} : { efSearch: options.efSearch }
|
|
13893
13895
|
});
|
|
13894
13896
|
if (rows.length === 0) return [];
|
|
13895
13897
|
const ids = rows.map((row) => row.nodeId);
|
|
@@ -13926,6 +13928,7 @@ async function executeHybridSearch(ctx, nodeKind, options) {
|
|
|
13926
13928
|
if (options.fusion !== void 0) {
|
|
13927
13929
|
validateHybridFusionOptions(options.fusion);
|
|
13928
13930
|
}
|
|
13931
|
+
assertEfSearch(options.vector.efSearch, "hybridSearch.vector.efSearch");
|
|
13929
13932
|
validateFulltextCallOptions(backend, {
|
|
13930
13933
|
mode: options.fulltext.mode,
|
|
13931
13934
|
includeSnippets: options.fulltext.includeSnippets,
|
|
@@ -13944,7 +13947,8 @@ async function executeHybridSearch(ctx, nodeKind, options) {
|
|
|
13944
13947
|
queryEmbedding: options.vector.queryEmbedding,
|
|
13945
13948
|
metric: options.vector.metric ?? "cosine",
|
|
13946
13949
|
limit: vectorK,
|
|
13947
|
-
...options.vector.minScore === void 0 ? {} : { minScore: options.vector.minScore }
|
|
13950
|
+
...options.vector.minScore === void 0 ? {} : { minScore: options.vector.minScore },
|
|
13951
|
+
...options.vector.efSearch === void 0 ? {} : { efSearch: options.vector.efSearch }
|
|
13948
13952
|
});
|
|
13949
13953
|
const fulltextPromise = backend.fulltextSearch({
|
|
13950
13954
|
graphId,
|
|
@@ -14024,6 +14028,14 @@ async function executeHybridSearch(ctx, nodeKind, options) {
|
|
|
14024
14028
|
}
|
|
14025
14029
|
return hits;
|
|
14026
14030
|
}
|
|
14031
|
+
function assertEfSearch(efSearch, label) {
|
|
14032
|
+
if (efSearch === void 0) return;
|
|
14033
|
+
if (!Number.isInteger(efSearch) || efSearch <= 0) {
|
|
14034
|
+
throw new RangeError(
|
|
14035
|
+
`${label} must be a positive integer, got: ${efSearch}`
|
|
14036
|
+
);
|
|
14037
|
+
}
|
|
14038
|
+
}
|
|
14027
14039
|
function validateFulltextCallOptions(backend, options) {
|
|
14028
14040
|
const strategy = backend.fulltextStrategy;
|
|
14029
14041
|
const capabilities = backend.capabilities.fulltext;
|
|
@@ -14676,7 +14688,7 @@ var Store = class _Store {
|
|
|
14676
14688
|
* @returns A tuple with per-query typed results, preserving input order
|
|
14677
14689
|
*/
|
|
14678
14690
|
async batch(...queries) {
|
|
14679
|
-
return
|
|
14691
|
+
return chunkLYRUNG6E_cjs.runOptionallyInTransaction(this.#backend, async (target) => {
|
|
14680
14692
|
const results = [];
|
|
14681
14693
|
for (const query of queries) {
|
|
14682
14694
|
const result = await query.executeOn(target);
|
|
@@ -14982,7 +14994,7 @@ var Store = class _Store {
|
|
|
14982
14994
|
*/
|
|
14983
14995
|
async evolve(extension, options) {
|
|
14984
14996
|
const { activeRow, baseline } = await this.#loadCaughtUp("evolve");
|
|
14985
|
-
const merged =
|
|
14997
|
+
const merged = chunkZGEMI7MJ_cjs.mergeGraphExtension(baseline, extension);
|
|
14986
14998
|
if (merged === baseline) {
|
|
14987
14999
|
if (baseline === this.#graph) {
|
|
14988
15000
|
if (options?.ref !== void 0) options.ref.current = this;
|
|
@@ -15018,7 +15030,7 @@ var Store = class _Store {
|
|
|
15018
15030
|
);
|
|
15019
15031
|
if (error !== void 0) throw error;
|
|
15020
15032
|
}
|
|
15021
|
-
const committed = await
|
|
15033
|
+
const committed = await chunkZGEMI7MJ_cjs.commitNewSchemaVersion(
|
|
15022
15034
|
this.#backend,
|
|
15023
15035
|
merged,
|
|
15024
15036
|
activeRow.version
|
|
@@ -15170,9 +15182,9 @@ var Store = class _Store {
|
|
|
15170
15182
|
);
|
|
15171
15183
|
}
|
|
15172
15184
|
const compileTimeGraph = stripGraphExtension(this.#graph);
|
|
15173
|
-
const merged = plan.document === void 0 ? compileTimeGraph :
|
|
15174
|
-
const finalGraph =
|
|
15175
|
-
const committedRow = await
|
|
15185
|
+
const merged = plan.document === void 0 ? compileTimeGraph : chunkZGEMI7MJ_cjs.mergeGraphExtension(compileTimeGraph, plan.document);
|
|
15186
|
+
const finalGraph = chunkZGEMI7MJ_cjs.applyDeprecatedKinds(merged, baseline.deprecatedKinds);
|
|
15187
|
+
const committedRow = await chunkZGEMI7MJ_cjs.commitNewSchemaVersion(
|
|
15176
15188
|
this.#backend,
|
|
15177
15189
|
finalGraph,
|
|
15178
15190
|
activeRow.version
|
|
@@ -15255,8 +15267,8 @@ var Store = class _Store {
|
|
|
15255
15267
|
schemaMetadataFromRow(activeRow)
|
|
15256
15268
|
);
|
|
15257
15269
|
}
|
|
15258
|
-
const merged =
|
|
15259
|
-
const result = await
|
|
15270
|
+
const merged = chunkZGEMI7MJ_cjs.applyDeprecatedKinds(baseline, nextSet);
|
|
15271
|
+
const result = await chunkZGEMI7MJ_cjs.ensureSchema(this.#backend, merged, {
|
|
15260
15272
|
preloaded: { activeRow, storedSchema },
|
|
15261
15273
|
autoMigrate: true
|
|
15262
15274
|
});
|
|
@@ -15265,8 +15277,8 @@ var Store = class _Store {
|
|
|
15265
15277
|
}
|
|
15266
15278
|
#catchUpToStored(storedSchema) {
|
|
15267
15279
|
const compileTimeGraph = stripGraphExtension(this.#graph);
|
|
15268
|
-
const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph :
|
|
15269
|
-
return
|
|
15280
|
+
const withGraphExtension = storedSchema.extension === void 0 ? compileTimeGraph : chunkZGEMI7MJ_cjs.mergeGraphExtension(compileTimeGraph, storedSchema.extension);
|
|
15281
|
+
return chunkZGEMI7MJ_cjs.applyDeprecatedKinds(
|
|
15270
15282
|
withGraphExtension,
|
|
15271
15283
|
storedSchema.deprecatedKinds
|
|
15272
15284
|
);
|
|
@@ -15284,7 +15296,7 @@ var Store = class _Store {
|
|
|
15284
15296
|
* serializes the actual commit.
|
|
15285
15297
|
*/
|
|
15286
15298
|
async #loadCaughtUp(verb) {
|
|
15287
|
-
const activeRow = await
|
|
15299
|
+
const activeRow = await chunkZGEMI7MJ_cjs.loadActiveSchemaWithBootstrap(
|
|
15288
15300
|
this.#backend,
|
|
15289
15301
|
this.graphId
|
|
15290
15302
|
);
|
|
@@ -15295,7 +15307,7 @@ var Store = class _Store {
|
|
|
15295
15307
|
{ code }
|
|
15296
15308
|
);
|
|
15297
15309
|
}
|
|
15298
|
-
const storedSchema =
|
|
15310
|
+
const storedSchema = chunkZGEMI7MJ_cjs.parseSerializedSchema(activeRow.schema_doc);
|
|
15299
15311
|
const baseline = this.#catchUpToStored(storedSchema);
|
|
15300
15312
|
return { activeRow, storedSchema, baseline };
|
|
15301
15313
|
}
|
|
@@ -15461,17 +15473,24 @@ function schemaMetadataForResult(activeRow, result) {
|
|
|
15461
15473
|
}
|
|
15462
15474
|
return schemaMetadataFromRow(activeRow);
|
|
15463
15475
|
}
|
|
15476
|
+
async function materializeRuntimeContributions(backend, graphId) {
|
|
15477
|
+
if (backend.ensureRuntimeContributions) {
|
|
15478
|
+
await backend.ensureRuntimeContributions(graphId);
|
|
15479
|
+
return;
|
|
15480
|
+
}
|
|
15481
|
+
await backend.ensureFulltextTable?.(graphId);
|
|
15482
|
+
}
|
|
15464
15483
|
async function createStoreWithSchema(graph, backend, options) {
|
|
15465
15484
|
const {
|
|
15466
15485
|
graph: merged,
|
|
15467
15486
|
activeRow,
|
|
15468
15487
|
storedSchema
|
|
15469
|
-
} = await
|
|
15470
|
-
const result = await
|
|
15488
|
+
} = await chunkZGEMI7MJ_cjs.loadAndMergeGraphExtensionDocument(backend, graph);
|
|
15489
|
+
const result = await chunkZGEMI7MJ_cjs.ensureSchema(backend, merged, {
|
|
15471
15490
|
...options,
|
|
15472
15491
|
preloaded: { activeRow, storedSchema }
|
|
15473
15492
|
});
|
|
15474
|
-
await backend
|
|
15493
|
+
await materializeRuntimeContributions(backend, merged.id);
|
|
15475
15494
|
const store = new Store(
|
|
15476
15495
|
merged,
|
|
15477
15496
|
backend,
|
|
@@ -15480,70 +15499,84 @@ async function createStoreWithSchema(graph, backend, options) {
|
|
|
15480
15499
|
);
|
|
15481
15500
|
return [store, result];
|
|
15482
15501
|
}
|
|
15502
|
+
async function createVerifiedStore(graph, backend, options) {
|
|
15503
|
+
const {
|
|
15504
|
+
graph: merged,
|
|
15505
|
+
activeRow,
|
|
15506
|
+
result
|
|
15507
|
+
} = await chunkZGEMI7MJ_cjs.loadAndVerifyGraph(backend, graph);
|
|
15508
|
+
const store = new Store(
|
|
15509
|
+
merged,
|
|
15510
|
+
backend,
|
|
15511
|
+
options,
|
|
15512
|
+
schemaMetadataFromRow(activeRow)
|
|
15513
|
+
);
|
|
15514
|
+
return [store, result];
|
|
15515
|
+
}
|
|
15483
15516
|
|
|
15484
15517
|
Object.defineProperty(exports, "broader", {
|
|
15485
15518
|
enumerable: true,
|
|
15486
|
-
get: function () { return
|
|
15519
|
+
get: function () { return chunkZGEMI7MJ_cjs.broader; }
|
|
15487
15520
|
});
|
|
15488
15521
|
Object.defineProperty(exports, "core", {
|
|
15489
15522
|
enumerable: true,
|
|
15490
|
-
get: function () { return
|
|
15523
|
+
get: function () { return chunkZGEMI7MJ_cjs.core; }
|
|
15491
15524
|
});
|
|
15492
15525
|
Object.defineProperty(exports, "defineEdge", {
|
|
15493
15526
|
enumerable: true,
|
|
15494
|
-
get: function () { return
|
|
15527
|
+
get: function () { return chunkZGEMI7MJ_cjs.defineEdge; }
|
|
15495
15528
|
});
|
|
15496
15529
|
Object.defineProperty(exports, "defineNode", {
|
|
15497
15530
|
enumerable: true,
|
|
15498
|
-
get: function () { return
|
|
15531
|
+
get: function () { return chunkZGEMI7MJ_cjs.defineNode; }
|
|
15499
15532
|
});
|
|
15500
15533
|
Object.defineProperty(exports, "differentFrom", {
|
|
15501
15534
|
enumerable: true,
|
|
15502
|
-
get: function () { return
|
|
15535
|
+
get: function () { return chunkZGEMI7MJ_cjs.differentFrom; }
|
|
15503
15536
|
});
|
|
15504
15537
|
Object.defineProperty(exports, "disjointWith", {
|
|
15505
15538
|
enumerable: true,
|
|
15506
|
-
get: function () { return
|
|
15539
|
+
get: function () { return chunkZGEMI7MJ_cjs.disjointWith; }
|
|
15507
15540
|
});
|
|
15508
15541
|
Object.defineProperty(exports, "equivalentTo", {
|
|
15509
15542
|
enumerable: true,
|
|
15510
|
-
get: function () { return
|
|
15543
|
+
get: function () { return chunkZGEMI7MJ_cjs.equivalentTo; }
|
|
15511
15544
|
});
|
|
15512
15545
|
Object.defineProperty(exports, "hasPart", {
|
|
15513
15546
|
enumerable: true,
|
|
15514
|
-
get: function () { return
|
|
15547
|
+
get: function () { return chunkZGEMI7MJ_cjs.hasPart; }
|
|
15515
15548
|
});
|
|
15516
15549
|
Object.defineProperty(exports, "implies", {
|
|
15517
15550
|
enumerable: true,
|
|
15518
|
-
get: function () { return
|
|
15551
|
+
get: function () { return chunkZGEMI7MJ_cjs.implies; }
|
|
15519
15552
|
});
|
|
15520
15553
|
Object.defineProperty(exports, "inverseOf", {
|
|
15521
15554
|
enumerable: true,
|
|
15522
|
-
get: function () { return
|
|
15555
|
+
get: function () { return chunkZGEMI7MJ_cjs.inverseOf; }
|
|
15523
15556
|
});
|
|
15524
15557
|
Object.defineProperty(exports, "isMetaEdge", {
|
|
15525
15558
|
enumerable: true,
|
|
15526
|
-
get: function () { return
|
|
15559
|
+
get: function () { return chunkZGEMI7MJ_cjs.isMetaEdge; }
|
|
15527
15560
|
});
|
|
15528
15561
|
Object.defineProperty(exports, "narrower", {
|
|
15529
15562
|
enumerable: true,
|
|
15530
|
-
get: function () { return
|
|
15563
|
+
get: function () { return chunkZGEMI7MJ_cjs.narrower; }
|
|
15531
15564
|
});
|
|
15532
15565
|
Object.defineProperty(exports, "partOf", {
|
|
15533
15566
|
enumerable: true,
|
|
15534
|
-
get: function () { return
|
|
15567
|
+
get: function () { return chunkZGEMI7MJ_cjs.partOf; }
|
|
15535
15568
|
});
|
|
15536
15569
|
Object.defineProperty(exports, "relatedTo", {
|
|
15537
15570
|
enumerable: true,
|
|
15538
|
-
get: function () { return
|
|
15571
|
+
get: function () { return chunkZGEMI7MJ_cjs.relatedTo; }
|
|
15539
15572
|
});
|
|
15540
15573
|
Object.defineProperty(exports, "sameAs", {
|
|
15541
15574
|
enumerable: true,
|
|
15542
|
-
get: function () { return
|
|
15575
|
+
get: function () { return chunkZGEMI7MJ_cjs.sameAs; }
|
|
15543
15576
|
});
|
|
15544
15577
|
Object.defineProperty(exports, "subClassOf", {
|
|
15545
15578
|
enumerable: true,
|
|
15546
|
-
get: function () { return
|
|
15579
|
+
get: function () { return chunkZGEMI7MJ_cjs.subClassOf; }
|
|
15547
15580
|
});
|
|
15548
15581
|
Object.defineProperty(exports, "defineGraph", {
|
|
15549
15582
|
enumerable: true,
|
|
@@ -15834,6 +15867,7 @@ exports.createQueryBuilder = createQueryBuilder;
|
|
|
15834
15867
|
exports.createSqlSchema = createSqlSchema;
|
|
15835
15868
|
exports.createStore = createStore;
|
|
15836
15869
|
exports.createStoreWithSchema = createStoreWithSchema;
|
|
15870
|
+
exports.createVerifiedStore = createVerifiedStore;
|
|
15837
15871
|
exports.defineSubgraphProject = defineSubgraphProject;
|
|
15838
15872
|
exports.exists = exists;
|
|
15839
15873
|
exports.externalRef = externalRef;
|