@nicia-ai/typegraph 0.12.0 → 0.13.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/index.cjs +55 -23
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +55 -23
- package/dist/index.js.map +1 -1
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/{store-BcnA11lH.d.ts → store-6-vH0ZIj.d.ts} +19 -0
- package/dist/{store-NEa4EFFD.d.cts → store-Bmdt_dS6.d.cts} +19 -0
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,8 +3,8 @@ import { N as NodeType, E as EdgeType } from './types-DMzKq0d5.cjs';
|
|
|
3
3
|
export { A as AnyEdgeType, C as Cardinality, a as Collation, D as DeleteBehavior, b as EdgeId, c as EdgeProps, d as EdgeRegistration, e as EdgeTypeWithEndpoints, f as EndpointExistence, G as GraphDefaults, g as NodeId, h as NodeProps, i as NodeRegistration, S as SqlDialect, T as TemporalMode, U as UniqueConstraint, j as UniquenessScope, k as isEdgeType, l as isEdgeTypeWithEndpoints, m as isNodeType } from './types-DMzKq0d5.cjs';
|
|
4
4
|
import { I as InferenceType, M as MetaEdge, O as OntologyRelation } from './types-GLkwvQvS.cjs';
|
|
5
5
|
export { D as DEFAULT_SQL_SCHEMA, G as GraphBackend, a as MetaEdgeProperties, S as SqlSchema, b as SqlTableNames, T as TransactionBackend, c as createSqlSchema, i as isMetaEdge } from './types-GLkwvQvS.cjs';
|
|
6
|
-
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-
|
|
7
|
-
export { a as AggregateResult, b as AnyEdge, c as AnyNode, B as BatchResults, d as BatchableQuery, e as ConstraintNames, f as CreateEdgeInput, g as CreateNodeInput, h as Edge, i as EdgeAccessor, j as EdgeCollection, k as EdgeFindByEndpointsOptions, l as EdgeGetOrCreateByEndpointsOptions, m as EdgeGetOrCreateByEndpointsResult, n as EmbeddingSchema, o as EmbeddingValue, p as ExecutableAggregateQuery, q as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, H as HookContext, I as IfExistsMode, N as Node, r as NodeAccessor, s as NodeAlias, t as NodeCollection, u as NodeGetOrCreateByConstraintOptions, v as NodeGetOrCreateByConstraintResult, w as NodeRef, O as OperationHookContext, P as PaginateOptions, x as PaginatedResult, y as Predicate, z as PreparedQuery, D as PropsAccessor, J as QueryHookContext, K as QueryOptions, R as RecursiveTraversalOptions, S as SelectContext, L as SelectableEdge, M as SelectableNode, U as Store, V as StoreHooks, W as StoreOptions, X as StreamOptions, Y as SubgraphOptions, Z as SubgraphResult, _ as SubsetEdge, $ as SubsetNode, a0 as TransactionContext, a1 as TypedEdgeCollection, a2 as UnionableQuery, a3 as UpdateEdgeInput, a4 as UpdateNodeInput, a5 as createStore, a6 as createStoreWithSchema, a7 as defineSubgraphProject, a8 as embedding, a9 as exists, aa as fieldRef, ab as getEmbeddingDimensions, ac as inSubquery, ad as isEmbeddingSchema, ae as isParameterRef, af as notExists, ag as notInSubquery, ah as param } from './store-
|
|
6
|
+
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-Bmdt_dS6.cjs';
|
|
7
|
+
export { a as AggregateResult, b as AnyEdge, c as AnyNode, B as BatchResults, d as BatchableQuery, e as ConstraintNames, f as CreateEdgeInput, g as CreateNodeInput, h as Edge, i as EdgeAccessor, j as EdgeCollection, k as EdgeFindByEndpointsOptions, l as EdgeGetOrCreateByEndpointsOptions, m as EdgeGetOrCreateByEndpointsResult, n as EmbeddingSchema, o as EmbeddingValue, p as ExecutableAggregateQuery, q as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, H as HookContext, I as IfExistsMode, N as Node, r as NodeAccessor, s as NodeAlias, t as NodeCollection, u as NodeGetOrCreateByConstraintOptions, v as NodeGetOrCreateByConstraintResult, w as NodeRef, O as OperationHookContext, P as PaginateOptions, x as PaginatedResult, y as Predicate, z as PreparedQuery, D as PropsAccessor, J as QueryHookContext, K as QueryOptions, R as RecursiveTraversalOptions, S as SelectContext, L as SelectableEdge, M as SelectableNode, U as Store, V as StoreHooks, W as StoreOptions, X as StreamOptions, Y as SubgraphOptions, Z as SubgraphResult, _ as SubsetEdge, $ as SubsetNode, a0 as TransactionContext, a1 as TypedEdgeCollection, a2 as UnionableQuery, a3 as UpdateEdgeInput, a4 as UpdateNodeInput, a5 as createStore, a6 as createStoreWithSchema, a7 as defineSubgraphProject, a8 as embedding, a9 as exists, aa as fieldRef, ab as getEmbeddingDimensions, ac as inSubquery, ad as isEmbeddingSchema, ae as isParameterRef, af as notExists, ag as notInSubquery, ah as param } from './store-Bmdt_dS6.cjs';
|
|
8
8
|
import { G as GraphDef, K as KindRegistry } from './manager-DGSnJa1v.cjs';
|
|
9
9
|
export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, N as NodeKinds, d as defineGraph, g as getEdgeKinds, e as getNodeKinds, i as isGraphDef } from './manager-DGSnJa1v.cjs';
|
|
10
10
|
export { C as CardinalityError, a as CompilerInvariantError, b as ConfigurationError, D as DatabaseOperationError, c as DisjointError, E as EdgeNotFoundError, d as EndpointError, e as EndpointNotFoundError, f as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, g as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaMismatchError, T as TypeGraphError, h as TypeGraphErrorOptions, U as UniquenessError, i as UnsupportedPredicateError, V as ValidationError, j as ValidationErrorDetails, k as ValidationIssue, l as VersionConflictError, m as getErrorSuggestion, n as isConstraintError, o as isSystemError, p as isTypeGraphError, q as isUserRecoverable } from './index-QTnQwakS.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,8 +3,8 @@ import { N as NodeType, E as EdgeType } from './types-DMzKq0d5.js';
|
|
|
3
3
|
export { A as AnyEdgeType, C as Cardinality, a as Collation, D as DeleteBehavior, b as EdgeId, c as EdgeProps, d as EdgeRegistration, e as EdgeTypeWithEndpoints, f as EndpointExistence, G as GraphDefaults, g as NodeId, h as NodeProps, i as NodeRegistration, S as SqlDialect, T as TemporalMode, U as UniqueConstraint, j as UniquenessScope, k as isEdgeType, l as isEdgeTypeWithEndpoints, m as isNodeType } from './types-DMzKq0d5.js';
|
|
4
4
|
import { I as InferenceType, M as MetaEdge, O as OntologyRelation } from './types-1YJKodRv.js';
|
|
5
5
|
export { D as DEFAULT_SQL_SCHEMA, G as GraphBackend, a as MetaEdgeProperties, S as SqlSchema, b as SqlTableNames, T as TransactionBackend, c as createSqlSchema, i as isMetaEdge } from './types-1YJKodRv.js';
|
|
6
|
-
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-
|
|
7
|
-
export { a as AggregateResult, b as AnyEdge, c as AnyNode, B as BatchResults, d as BatchableQuery, e as ConstraintNames, f as CreateEdgeInput, g as CreateNodeInput, h as Edge, i as EdgeAccessor, j as EdgeCollection, k as EdgeFindByEndpointsOptions, l as EdgeGetOrCreateByEndpointsOptions, m as EdgeGetOrCreateByEndpointsResult, n as EmbeddingSchema, o as EmbeddingValue, p as ExecutableAggregateQuery, q as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, H as HookContext, I as IfExistsMode, N as Node, r as NodeAccessor, s as NodeAlias, t as NodeCollection, u as NodeGetOrCreateByConstraintOptions, v as NodeGetOrCreateByConstraintResult, w as NodeRef, O as OperationHookContext, P as PaginateOptions, x as PaginatedResult, y as Predicate, z as PreparedQuery, D as PropsAccessor, J as QueryHookContext, K as QueryOptions, R as RecursiveTraversalOptions, S as SelectContext, L as SelectableEdge, M as SelectableNode, U as Store, V as StoreHooks, W as StoreOptions, X as StreamOptions, Y as SubgraphOptions, Z as SubgraphResult, _ as SubsetEdge, $ as SubsetNode, a0 as TransactionContext, a1 as TypedEdgeCollection, a2 as UnionableQuery, a3 as UpdateEdgeInput, a4 as UpdateNodeInput, a5 as createStore, a6 as createStoreWithSchema, a7 as defineSubgraphProject, a8 as embedding, a9 as exists, aa as fieldRef, ab as getEmbeddingDimensions, ac as inSubquery, ad as isEmbeddingSchema, ae as isParameterRef, af as notExists, ag as notInSubquery, ah as param } from './store-
|
|
6
|
+
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-6-vH0ZIj.js';
|
|
7
|
+
export { a as AggregateResult, b as AnyEdge, c as AnyNode, B as BatchResults, d as BatchableQuery, e as ConstraintNames, f as CreateEdgeInput, g as CreateNodeInput, h as Edge, i as EdgeAccessor, j as EdgeCollection, k as EdgeFindByEndpointsOptions, l as EdgeGetOrCreateByEndpointsOptions, m as EdgeGetOrCreateByEndpointsResult, n as EmbeddingSchema, o as EmbeddingValue, p as ExecutableAggregateQuery, q as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, H as HookContext, I as IfExistsMode, N as Node, r as NodeAccessor, s as NodeAlias, t as NodeCollection, u as NodeGetOrCreateByConstraintOptions, v as NodeGetOrCreateByConstraintResult, w as NodeRef, O as OperationHookContext, P as PaginateOptions, x as PaginatedResult, y as Predicate, z as PreparedQuery, D as PropsAccessor, J as QueryHookContext, K as QueryOptions, R as RecursiveTraversalOptions, S as SelectContext, L as SelectableEdge, M as SelectableNode, U as Store, V as StoreHooks, W as StoreOptions, X as StreamOptions, Y as SubgraphOptions, Z as SubgraphResult, _ as SubsetEdge, $ as SubsetNode, a0 as TransactionContext, a1 as TypedEdgeCollection, a2 as UnionableQuery, a3 as UpdateEdgeInput, a4 as UpdateNodeInput, a5 as createStore, a6 as createStoreWithSchema, a7 as defineSubgraphProject, a8 as embedding, a9 as exists, aa as fieldRef, ab as getEmbeddingDimensions, ac as inSubquery, ad as isEmbeddingSchema, ae as isParameterRef, af as notExists, ag as notInSubquery, ah as param } from './store-6-vH0ZIj.js';
|
|
8
8
|
import { G as GraphDef, K as KindRegistry } from './manager-BCLhWysp.js';
|
|
9
9
|
export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, N as NodeKinds, d as defineGraph, g as getEdgeKinds, e as getNodeKinds, i as isGraphDef } from './manager-BCLhWysp.js';
|
|
10
10
|
export { C as CardinalityError, a as CompilerInvariantError, b as ConfigurationError, D as DatabaseOperationError, c as DisjointError, E as EdgeNotFoundError, d as EndpointError, e as EndpointNotFoundError, f as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, g as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaMismatchError, T as TypeGraphError, h as TypeGraphErrorOptions, U as UniquenessError, i as UnsupportedPredicateError, V as ValidationError, j as ValidationErrorDetails, k as ValidationIssue, l as VersionConflictError, m as getErrorSuggestion, n as isConstraintError, o as isSystemError, p as isTypeGraphError, q as isUserRecoverable } from './index-QTnQwakS.js';
|
package/dist/index.js
CHANGED
|
@@ -8919,6 +8919,35 @@ function createEdgeCollection(config) {
|
|
|
8919
8919
|
executeHardDelete: executeEdgeHardDelete2,
|
|
8920
8920
|
matchesTemporalMode
|
|
8921
8921
|
} = config;
|
|
8922
|
+
const mapRows = (rows) => rows.map((row) => narrowEdge(rowToEdge2(row)));
|
|
8923
|
+
async function findEdgesFrom(from, target) {
|
|
8924
|
+
const rows = await target.findEdgesByKind({
|
|
8925
|
+
graphId,
|
|
8926
|
+
kind,
|
|
8927
|
+
fromKind: from.kind,
|
|
8928
|
+
fromId: from.id,
|
|
8929
|
+
excludeDeleted: true
|
|
8930
|
+
});
|
|
8931
|
+
return mapRows(rows);
|
|
8932
|
+
}
|
|
8933
|
+
async function findEdgesTo(to, target) {
|
|
8934
|
+
const rows = await target.findEdgesByKind({
|
|
8935
|
+
graphId,
|
|
8936
|
+
kind,
|
|
8937
|
+
toKind: to.kind,
|
|
8938
|
+
toId: to.id,
|
|
8939
|
+
excludeDeleted: true
|
|
8940
|
+
});
|
|
8941
|
+
return mapRows(rows);
|
|
8942
|
+
}
|
|
8943
|
+
function buildFindByEndpointsOptions(options) {
|
|
8944
|
+
const result = {};
|
|
8945
|
+
if (options?.matchOn !== void 0)
|
|
8946
|
+
result.matchOn = options.matchOn;
|
|
8947
|
+
if (options?.props !== void 0)
|
|
8948
|
+
result.props = options.props;
|
|
8949
|
+
return result;
|
|
8950
|
+
}
|
|
8922
8951
|
return {
|
|
8923
8952
|
async create(from, to, props, options) {
|
|
8924
8953
|
const result = await executeEdgeCreate2(
|
|
@@ -8974,24 +9003,32 @@ function createEdgeCollection(config) {
|
|
|
8974
9003
|
return narrowEdge(result);
|
|
8975
9004
|
},
|
|
8976
9005
|
async findFrom(from) {
|
|
8977
|
-
|
|
8978
|
-
graphId,
|
|
8979
|
-
kind,
|
|
8980
|
-
fromKind: from.kind,
|
|
8981
|
-
fromId: from.id,
|
|
8982
|
-
excludeDeleted: true
|
|
8983
|
-
});
|
|
8984
|
-
return rows.map((row) => narrowEdge(rowToEdge2(row)));
|
|
9006
|
+
return findEdgesFrom(from, backend);
|
|
8985
9007
|
},
|
|
8986
9008
|
async findTo(to) {
|
|
8987
|
-
|
|
8988
|
-
|
|
8989
|
-
|
|
8990
|
-
|
|
8991
|
-
|
|
8992
|
-
|
|
8993
|
-
}
|
|
8994
|
-
|
|
9009
|
+
return findEdgesTo(to, backend);
|
|
9010
|
+
},
|
|
9011
|
+
batchFindFrom(from) {
|
|
9012
|
+
return { executeOn: (target) => findEdgesFrom(from, target) };
|
|
9013
|
+
},
|
|
9014
|
+
batchFindTo(to) {
|
|
9015
|
+
return { executeOn: (target) => findEdgesTo(to, target) };
|
|
9016
|
+
},
|
|
9017
|
+
batchFindByEndpoints(from, to, options) {
|
|
9018
|
+
return {
|
|
9019
|
+
executeOn: async (target) => {
|
|
9020
|
+
const result = await config.executeFindByEndpoints(
|
|
9021
|
+
kind,
|
|
9022
|
+
from.kind,
|
|
9023
|
+
from.id,
|
|
9024
|
+
to.kind,
|
|
9025
|
+
to.id,
|
|
9026
|
+
target,
|
|
9027
|
+
buildFindByEndpointsOptions(options)
|
|
9028
|
+
);
|
|
9029
|
+
return result === void 0 ? [] : [narrowEdge(result)];
|
|
9030
|
+
}
|
|
9031
|
+
};
|
|
8995
9032
|
},
|
|
8996
9033
|
async delete(id) {
|
|
8997
9034
|
await executeEdgeDelete2(id, backend);
|
|
@@ -9025,7 +9062,7 @@ function createEdgeCollection(config) {
|
|
|
9025
9062
|
if (options?.limit !== void 0) params.limit = options.limit;
|
|
9026
9063
|
if (options?.offset !== void 0) params.offset = options.offset;
|
|
9027
9064
|
const rows = await backend.findEdgesByKind(params);
|
|
9028
|
-
return rows
|
|
9065
|
+
return mapRows(rows);
|
|
9029
9066
|
},
|
|
9030
9067
|
async count(options) {
|
|
9031
9068
|
const mode = options?.temporalMode ?? defaultTemporalMode;
|
|
@@ -9154,11 +9191,6 @@ function createEdgeCollection(config) {
|
|
|
9154
9191
|
await deleteAll(backend);
|
|
9155
9192
|
},
|
|
9156
9193
|
async findByEndpoints(from, to, options) {
|
|
9157
|
-
const findOptions = {};
|
|
9158
|
-
if (options?.matchOn !== void 0)
|
|
9159
|
-
findOptions.matchOn = options.matchOn;
|
|
9160
|
-
if (options?.props !== void 0)
|
|
9161
|
-
findOptions.props = options.props;
|
|
9162
9194
|
const result = await config.executeFindByEndpoints(
|
|
9163
9195
|
kind,
|
|
9164
9196
|
from.kind,
|
|
@@ -9166,7 +9198,7 @@ function createEdgeCollection(config) {
|
|
|
9166
9198
|
to.kind,
|
|
9167
9199
|
to.id,
|
|
9168
9200
|
backend,
|
|
9169
|
-
|
|
9201
|
+
buildFindByEndpointsOptions(options)
|
|
9170
9202
|
);
|
|
9171
9203
|
return result === void 0 ? void 0 : narrowEdge(result);
|
|
9172
9204
|
},
|