@nicia-ai/typegraph 0.16.1 → 0.17.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 +28 -28
- package/dist/backend/postgres/index.js +3 -3
- package/dist/backend/sqlite/index.cjs +13 -13
- package/dist/backend/sqlite/index.js +3 -3
- package/dist/backend/sqlite/local.cjs +10 -10
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.js +6 -6
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/{chunk-CRMN2NOM.cjs → chunk-2UTJRP4F.cjs} +14 -14
- package/dist/{chunk-CRMN2NOM.cjs.map → chunk-2UTJRP4F.cjs.map} +1 -1
- package/dist/{chunk-NI2GV74U.cjs → chunk-5GZMPJOP.cjs} +6 -6
- package/dist/{chunk-NI2GV74U.cjs.map → chunk-5GZMPJOP.cjs.map} +1 -1
- package/dist/{chunk-56RQFK7U.cjs → chunk-5H74QKKF.cjs} +50 -26
- package/dist/chunk-5H74QKKF.cjs.map +1 -0
- package/dist/{chunk-HWWF3FOP.js → chunk-7ZVPFJLQ.js} +3 -3
- package/dist/{chunk-HWWF3FOP.js.map → chunk-7ZVPFJLQ.js.map} +1 -1
- package/dist/{chunk-IRFD3MEU.js → chunk-G5CYWKRF.js} +3 -3
- package/dist/{chunk-IRFD3MEU.js.map → chunk-G5CYWKRF.js.map} +1 -1
- package/dist/{chunk-XZBAGJJH.js → chunk-IRS2C6GN.js} +36 -12
- package/dist/chunk-IRS2C6GN.js.map +1 -0
- package/dist/{chunk-44SXEVF4.cjs → chunk-O5PST6TB.cjs} +17 -2
- package/dist/chunk-O5PST6TB.cjs.map +1 -0
- package/dist/{chunk-L4ON6RJF.js → chunk-W6M7XWKX.js} +4 -4
- package/dist/{chunk-L4ON6RJF.js.map → chunk-W6M7XWKX.js.map} +1 -1
- package/dist/{chunk-SJ2QMDXY.js → chunk-WFMTAEEN.js} +17 -3
- package/dist/chunk-WFMTAEEN.js.map +1 -0
- package/dist/{chunk-3HQLOKS5.cjs → chunk-X33WV2UF.cjs} +14 -14
- package/dist/{chunk-3HQLOKS5.cjs.map → chunk-X33WV2UF.cjs.map} +1 -1
- package/dist/{index-QTnQwakS.d.cts → index-DXkEXpNz.d.cts} +13 -1
- package/dist/{index-QTnQwakS.d.ts → index-DXkEXpNz.d.ts} +13 -1
- package/dist/index.cjs +283 -240
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +69 -30
- package/dist/index.js.map +1 -1
- package/dist/interchange/index.cjs +7 -7
- package/dist/interchange/index.d.cts +1 -1
- package/dist/interchange/index.d.ts +1 -1
- package/dist/interchange/index.js +2 -2
- package/dist/profiler/index.d.cts +1 -1
- package/dist/profiler/index.d.ts +1 -1
- package/dist/schema/index.cjs +22 -22
- package/dist/schema/index.d.cts +1 -1
- package/dist/schema/index.d.ts +1 -1
- package/dist/schema/index.js +4 -4
- package/dist/{store-BZ7BexR1.d.cts → store-B_JzzHwb.d.cts} +2 -2
- package/dist/{store--7Nft1Ii.d.ts → store-DkY1pDfu.d.ts} +2 -2
- package/package.json +1 -1
- package/dist/chunk-44SXEVF4.cjs.map +0 -1
- package/dist/chunk-56RQFK7U.cjs.map +0 -1
- package/dist/chunk-SJ2QMDXY.js.map +0 -1
- package/dist/chunk-XZBAGJJH.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -3,11 +3,11 @@ 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-B3mmOMJV.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-B3mmOMJV.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, D as DynamicEdgeCollection, h as DynamicNodeCollection, i as Edge, j as EdgeAccessor, k as EdgeCollection, l as EdgeFindByEndpointsOptions, m as EdgeGetOrCreateByEndpointsOptions, n as EdgeGetOrCreateByEndpointsResult, o as EmbeddingSchema, p as EmbeddingValue, q as ExecutableAggregateQuery, r as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, s as GraphEdgeCollections, t as GraphNodeCollections, H as HookContext, I as IfExistsMode, N as Node, u as NodeAccessor, v as NodeAlias, w as NodeCollection, x as NodeGetOrCreateByConstraintOptions, y as NodeGetOrCreateByConstraintResult, z as NodeRef, O as OperationHookContext, P as PaginateOptions, J as PaginatedResult, K as Predicate, L as PreparedQuery, M as PropsAccessor, R as QueryHookContext, S as QueryOptions, U as RecursiveTraversalOptions, V as SelectContext, W as SelectableEdge, X as SelectableNode, Y as Store, Z as StoreHooks, _ as StoreOptions, $ as StoreProjection, a0 as StreamOptions, a1 as SubgraphOptions, a2 as SubgraphResult, a3 as SubsetEdge, a4 as SubsetNode, a5 as TransactionContext, a6 as TypedEdgeCollection, a7 as UnionableQuery, a8 as UpdateEdgeInput, a9 as UpdateNodeInput, aa as createStore, ab as createStoreWithSchema, ac as defineSubgraphProject, ad as embedding, ae as exists, af as fieldRef, ag as getEmbeddingDimensions, ah as inSubquery, ai as isEmbeddingSchema, aj as isParameterRef, ak as notExists, al as notInSubquery, am as param } from './store-
|
|
6
|
+
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-B_JzzHwb.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, D as DynamicEdgeCollection, h as DynamicNodeCollection, i as Edge, j as EdgeAccessor, k as EdgeCollection, l as EdgeFindByEndpointsOptions, m as EdgeGetOrCreateByEndpointsOptions, n as EdgeGetOrCreateByEndpointsResult, o as EmbeddingSchema, p as EmbeddingValue, q as ExecutableAggregateQuery, r as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, s as GraphEdgeCollections, t as GraphNodeCollections, H as HookContext, I as IfExistsMode, N as Node, u as NodeAccessor, v as NodeAlias, w as NodeCollection, x as NodeGetOrCreateByConstraintOptions, y as NodeGetOrCreateByConstraintResult, z as NodeRef, O as OperationHookContext, P as PaginateOptions, J as PaginatedResult, K as Predicate, L as PreparedQuery, M as PropsAccessor, R as QueryHookContext, S as QueryOptions, U as RecursiveTraversalOptions, V as SelectContext, W as SelectableEdge, X as SelectableNode, Y as Store, Z as StoreHooks, _ as StoreOptions, $ as StoreProjection, a0 as StreamOptions, a1 as SubgraphOptions, a2 as SubgraphResult, a3 as SubsetEdge, a4 as SubsetNode, a5 as TransactionContext, a6 as TypedEdgeCollection, a7 as UnionableQuery, a8 as UpdateEdgeInput, a9 as UpdateNodeInput, aa as createStore, ab as createStoreWithSchema, ac as defineSubgraphProject, ad as embedding, ae as exists, af as fieldRef, ag as getEmbeddingDimensions, ah as inSubquery, ai as isEmbeddingSchema, aj as isParameterRef, ak as notExists, al as notInSubquery, am as param } from './store-B_JzzHwb.cjs';
|
|
8
8
|
import { G as GraphDef, K as KindRegistry } from './manager-Bj1UEnhE.cjs';
|
|
9
9
|
export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, N as NodeKinds, S as SchemaManagerOptions, d as SchemaValidationResult, e as defineGraph, g as getEdgeKinds, f as getNodeKinds, i as isGraphDef } from './manager-Bj1UEnhE.cjs';
|
|
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-
|
|
10
|
+
export { B as BackendDisposedError, 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-DXkEXpNz.cjs';
|
|
11
11
|
import { A as AggregateExpr, F as FieldRef, C as ComparisonOp, a as AggregateComparisonPredicate } from './ast-Bh2NDeaK.cjs';
|
|
12
12
|
export { J as JsonPointer, b as JsonPointerFor, c as JsonPointerInput, d as JsonPointerSegment, e as JsonPointerSegments, f as JsonPointerSegmentsFor, M as MAX_JSON_POINTER_DEPTH, O as OrderSpec, P as ParameterRef, R as ResolveJsonPointer, g as ResolveJsonPointerSegments, S as SortDirection, T as TraversalExpansion, j as joinJsonPointers, h as jsonPointer, n as normalizeJsonPointer, p as parseJsonPointer } from './ast-Bh2NDeaK.cjs';
|
|
13
13
|
import 'drizzle-orm';
|
package/dist/index.d.ts
CHANGED
|
@@ -3,11 +3,11 @@ 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-ThB4cFLp.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-ThB4cFLp.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, D as DynamicEdgeCollection, h as DynamicNodeCollection, i as Edge, j as EdgeAccessor, k as EdgeCollection, l as EdgeFindByEndpointsOptions, m as EdgeGetOrCreateByEndpointsOptions, n as EdgeGetOrCreateByEndpointsResult, o as EmbeddingSchema, p as EmbeddingValue, q as ExecutableAggregateQuery, r as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, s as GraphEdgeCollections, t as GraphNodeCollections, H as HookContext, I as IfExistsMode, N as Node, u as NodeAccessor, v as NodeAlias, w as NodeCollection, x as NodeGetOrCreateByConstraintOptions, y as NodeGetOrCreateByConstraintResult, z as NodeRef, O as OperationHookContext, P as PaginateOptions, J as PaginatedResult, K as Predicate, L as PreparedQuery, M as PropsAccessor, R as QueryHookContext, S as QueryOptions, U as RecursiveTraversalOptions, V as SelectContext, W as SelectableEdge, X as SelectableNode, Y as Store, Z as StoreHooks, _ as StoreOptions, $ as StoreProjection, a0 as StreamOptions, a1 as SubgraphOptions, a2 as SubgraphResult, a3 as SubsetEdge, a4 as SubsetNode, a5 as TransactionContext, a6 as TypedEdgeCollection, a7 as UnionableQuery, a8 as UpdateEdgeInput, a9 as UpdateNodeInput, aa as createStore, ab as createStoreWithSchema, ac as defineSubgraphProject, ad as embedding, ae as exists, af as fieldRef, ag as getEmbeddingDimensions, ah as inSubquery, ai as isEmbeddingSchema, aj as isParameterRef, ak as notExists, al as notInSubquery, am as param } from './store
|
|
6
|
+
import { A as AliasMap, E as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-DkY1pDfu.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, D as DynamicEdgeCollection, h as DynamicNodeCollection, i as Edge, j as EdgeAccessor, k as EdgeCollection, l as EdgeFindByEndpointsOptions, m as EdgeGetOrCreateByEndpointsOptions, n as EdgeGetOrCreateByEndpointsResult, o as EmbeddingSchema, p as EmbeddingValue, q as ExecutableAggregateQuery, r as ExecutableQuery, F as FieldAccessor, G as GetOrCreateAction, s as GraphEdgeCollections, t as GraphNodeCollections, H as HookContext, I as IfExistsMode, N as Node, u as NodeAccessor, v as NodeAlias, w as NodeCollection, x as NodeGetOrCreateByConstraintOptions, y as NodeGetOrCreateByConstraintResult, z as NodeRef, O as OperationHookContext, P as PaginateOptions, J as PaginatedResult, K as Predicate, L as PreparedQuery, M as PropsAccessor, R as QueryHookContext, S as QueryOptions, U as RecursiveTraversalOptions, V as SelectContext, W as SelectableEdge, X as SelectableNode, Y as Store, Z as StoreHooks, _ as StoreOptions, $ as StoreProjection, a0 as StreamOptions, a1 as SubgraphOptions, a2 as SubgraphResult, a3 as SubsetEdge, a4 as SubsetNode, a5 as TransactionContext, a6 as TypedEdgeCollection, a7 as UnionableQuery, a8 as UpdateEdgeInput, a9 as UpdateNodeInput, aa as createStore, ab as createStoreWithSchema, ac as defineSubgraphProject, ad as embedding, ae as exists, af as fieldRef, ag as getEmbeddingDimensions, ah as inSubquery, ai as isEmbeddingSchema, aj as isParameterRef, ak as notExists, al as notInSubquery, am as param } from './store-DkY1pDfu.js';
|
|
8
8
|
import { G as GraphDef, K as KindRegistry } from './manager-Chhrq1vl.js';
|
|
9
9
|
export { A as AllEdgeTypes, a as AllNodeTypes, E as EdgeKinds, b as GetEdgeType, c as GetNodeType, N as NodeKinds, S as SchemaManagerOptions, d as SchemaValidationResult, e as defineGraph, g as getEdgeKinds, f as getNodeKinds, i as isGraphDef } from './manager-Chhrq1vl.js';
|
|
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-
|
|
10
|
+
export { B as BackendDisposedError, 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-DXkEXpNz.js';
|
|
11
11
|
import { A as AggregateExpr, F as FieldRef, C as ComparisonOp, a as AggregateComparisonPredicate } from './ast-COMyNeMn.js';
|
|
12
12
|
export { J as JsonPointer, b as JsonPointerFor, c as JsonPointerInput, d as JsonPointerSegment, e as JsonPointerSegments, f as JsonPointerSegmentsFor, M as MAX_JSON_POINTER_DEPTH, O as OrderSpec, P as ParameterRef, R as ResolveJsonPointer, g as ResolveJsonPointerSegments, S as SortDirection, T as TraversalExpansion, j as joinJsonPointers, h as jsonPointer, n as normalizeJsonPointer, p as parseJsonPointer } from './ast-COMyNeMn.js';
|
|
13
13
|
import 'drizzle-orm';
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { META_EDGE_BRAND, META_EDGE_SUB_CLASS_OF, META_EDGE_NARROWER, META_EDGE_BROADER, META_EDGE_RELATED_TO, META_EDGE_EQUIVALENT_TO, META_EDGE_SAME_AS, META_EDGE_DIFFERENT_FROM, META_EDGE_DISJOINT_WITH, META_EDGE_HAS_PART, META_EDGE_PART_OF, META_EDGE_INVERSE_OF, META_EDGE_IMPLIES, ensureSchema, computeClosuresFromOntology, createEmptyClosures, KindRegistry, validateNodeProps, validateEdgeProps } from './chunk-
|
|
2
|
-
export { isMetaEdge } from './chunk-
|
|
3
|
-
import { NODE_TYPE_BRAND, EDGE_TYPE_BRAND, nowIso, validateOptionalIsoDate, getNodeKinds, getEdgeKinds } from './chunk-
|
|
4
|
-
export { defineGraph, getEdgeKinds, getNodeKinds, isEdgeType, isEdgeTypeWithEndpoints, isGraphDef, isNodeType } from './chunk-
|
|
5
|
-
import { ConfigurationError, UnsupportedPredicateError, ValidationError, CompilerInvariantError, KindNotFoundError, DatabaseOperationError, EdgeNotFoundError, NodeConstraintNotFoundError, RestrictedDeleteError, NodeNotFoundError, EndpointNotFoundError, UniquenessError, CardinalityError, EndpointError, DisjointError } from './chunk-
|
|
6
|
-
export { CardinalityError, CompilerInvariantError, ConfigurationError, DatabaseOperationError, DisjointError, EdgeNotFoundError, EndpointError, EndpointNotFoundError, KindNotFoundError, MigrationError, NodeConstraintNotFoundError, NodeNotFoundError, RestrictedDeleteError, SchemaMismatchError, TypeGraphError, UniquenessError, UnsupportedPredicateError, ValidationError, VersionConflictError, getErrorSuggestion, isConstraintError, isSystemError, isTypeGraphError, isUserRecoverable } from './chunk-
|
|
1
|
+
import { META_EDGE_BRAND, META_EDGE_SUB_CLASS_OF, META_EDGE_NARROWER, META_EDGE_BROADER, META_EDGE_RELATED_TO, META_EDGE_EQUIVALENT_TO, META_EDGE_SAME_AS, META_EDGE_DIFFERENT_FROM, META_EDGE_DISJOINT_WITH, META_EDGE_HAS_PART, META_EDGE_PART_OF, META_EDGE_INVERSE_OF, META_EDGE_IMPLIES, ensureSchema, computeClosuresFromOntology, createEmptyClosures, KindRegistry, validateNodeProps, validateEdgeProps } from './chunk-W6M7XWKX.js';
|
|
2
|
+
export { isMetaEdge } from './chunk-W6M7XWKX.js';
|
|
3
|
+
import { NODE_TYPE_BRAND, EDGE_TYPE_BRAND, nowIso, validateOptionalIsoDate, getNodeKinds, getEdgeKinds } from './chunk-G5CYWKRF.js';
|
|
4
|
+
export { defineGraph, getEdgeKinds, getNodeKinds, isEdgeType, isEdgeTypeWithEndpoints, isGraphDef, isNodeType } from './chunk-G5CYWKRF.js';
|
|
5
|
+
import { ConfigurationError, UnsupportedPredicateError, ValidationError, CompilerInvariantError, KindNotFoundError, DatabaseOperationError, EdgeNotFoundError, NodeConstraintNotFoundError, RestrictedDeleteError, NodeNotFoundError, EndpointNotFoundError, UniquenessError, CardinalityError, EndpointError, DisjointError } from './chunk-WFMTAEEN.js';
|
|
6
|
+
export { BackendDisposedError, CardinalityError, CompilerInvariantError, ConfigurationError, DatabaseOperationError, DisjointError, EdgeNotFoundError, EndpointError, EndpointNotFoundError, KindNotFoundError, MigrationError, NodeConstraintNotFoundError, NodeNotFoundError, RestrictedDeleteError, SchemaMismatchError, TypeGraphError, UniquenessError, UnsupportedPredicateError, ValidationError, VersionConflictError, getErrorSuggestion, isConstraintError, isSystemError, isTypeGraphError, isUserRecoverable } from './chunk-WFMTAEEN.js';
|
|
7
7
|
import { MAX_PG_IDENTIFIER_LENGTH, DEFAULT_PAGINATION_LIMIT, getDialect, DEFAULT_STREAM_BATCH_SIZE, NODE_META_KEYS, EDGE_META_KEYS, SQLITE_PATH_DELIMITER, PG_ARRAY_START, PG_ARRAY_END, PG_PATH_ELEMENT_SEPARATOR, fnv1aBase36 } from './chunk-GNIYZKBI.js';
|
|
8
8
|
import { jsonPointer, parseJsonPointer, createSchemaIntrospector, normalizeJsonPointer, joinJsonPointers, resolveFieldTypeInfoAtJsonPointer, getEmbeddingDimensions, isEmbeddingSchema } from './chunk-K7SQ3SWP.js';
|
|
9
9
|
export { MAX_JSON_POINTER_DEPTH, embedding, getEmbeddingDimensions, isEmbeddingSchema, joinJsonPointers, jsonPointer, normalizeJsonPointer, parseJsonPointer } from './chunk-K7SQ3SWP.js';
|
|
@@ -2187,14 +2187,18 @@ function buildStandardProjection(input) {
|
|
|
2187
2187
|
});
|
|
2188
2188
|
return sql.join(projectedFields, sql`, `);
|
|
2189
2189
|
}
|
|
2190
|
-
function
|
|
2191
|
-
const
|
|
2190
|
+
function buildAliasToCteMap(ast) {
|
|
2191
|
+
const map = /* @__PURE__ */ new Map([
|
|
2192
2192
|
[ast.start.alias, `cte_${ast.start.alias}`]
|
|
2193
2193
|
]);
|
|
2194
2194
|
for (const traversal of ast.traversals) {
|
|
2195
|
-
|
|
2196
|
-
|
|
2195
|
+
map.set(traversal.nodeAlias, `cte_${traversal.nodeAlias}`);
|
|
2196
|
+
map.set(traversal.edgeAlias, `cte_${traversal.nodeAlias}`);
|
|
2197
2197
|
}
|
|
2198
|
+
return map;
|
|
2199
|
+
}
|
|
2200
|
+
function compileSelectiveProjection(fields, dialect, ast, collapsedTraversalCteAlias) {
|
|
2201
|
+
const aliasToCte = buildAliasToCteMap(ast);
|
|
2198
2202
|
const columns = fields.map((field2) => {
|
|
2199
2203
|
const cteAlias = collapsedTraversalCteAlias ?? aliasToCte.get(field2.alias) ?? `cte_${field2.alias}`;
|
|
2200
2204
|
if (field2.isSystemField) {
|
|
@@ -2243,6 +2247,7 @@ function buildStandardOrderBy(input) {
|
|
|
2243
2247
|
if (!ast.orderBy || ast.orderBy.length === 0) {
|
|
2244
2248
|
return void 0;
|
|
2245
2249
|
}
|
|
2250
|
+
const aliasToCte = buildAliasToCteMap(ast);
|
|
2246
2251
|
const parts = [];
|
|
2247
2252
|
for (const orderSpec of ast.orderBy) {
|
|
2248
2253
|
const valueType = orderSpec.field.valueType;
|
|
@@ -2251,7 +2256,7 @@ function buildStandardOrderBy(input) {
|
|
|
2251
2256
|
"Ordering by JSON arrays or objects is not supported"
|
|
2252
2257
|
);
|
|
2253
2258
|
}
|
|
2254
|
-
const cteAlias = collapsedTraversalCteAlias ?? `cte_${orderSpec.field.alias}`;
|
|
2259
|
+
const cteAlias = collapsedTraversalCteAlias ?? aliasToCte.get(orderSpec.field.alias) ?? `cte_${orderSpec.field.alias}`;
|
|
2255
2260
|
const field2 = compileFieldValue(
|
|
2256
2261
|
orderSpec.field,
|
|
2257
2262
|
dialect,
|
|
@@ -2298,8 +2303,14 @@ function buildStandardGroupBy(input) {
|
|
|
2298
2303
|
if (allFields.length === 0) {
|
|
2299
2304
|
return void 0;
|
|
2300
2305
|
}
|
|
2306
|
+
const aliasToCte = buildAliasToCteMap(ast);
|
|
2301
2307
|
const parts = allFields.map(
|
|
2302
|
-
(field2) => compileFieldValue(
|
|
2308
|
+
(field2) => compileFieldValue(
|
|
2309
|
+
field2,
|
|
2310
|
+
dialect,
|
|
2311
|
+
field2.valueType,
|
|
2312
|
+
aliasToCte.get(field2.alias) ?? `cte_${field2.alias}`
|
|
2313
|
+
)
|
|
2303
2314
|
);
|
|
2304
2315
|
return sql`GROUP BY ${sql.join(parts, sql`, `)}`;
|
|
2305
2316
|
}
|
|
@@ -2374,6 +2385,7 @@ function buildStandardVectorOrderBy(input) {
|
|
|
2374
2385
|
const distanceOrder = sql`cte_embeddings.distance ASC`;
|
|
2375
2386
|
const additionalOrders = [];
|
|
2376
2387
|
if (ast.orderBy && ast.orderBy.length > 0) {
|
|
2388
|
+
const aliasToCte = buildAliasToCteMap(ast);
|
|
2377
2389
|
for (const orderSpec of ast.orderBy) {
|
|
2378
2390
|
const valueType = orderSpec.field.valueType;
|
|
2379
2391
|
if (valueType === "array" || valueType === "object") {
|
|
@@ -2381,7 +2393,7 @@ function buildStandardVectorOrderBy(input) {
|
|
|
2381
2393
|
"Ordering by JSON arrays or objects is not supported"
|
|
2382
2394
|
);
|
|
2383
2395
|
}
|
|
2384
|
-
const cteAlias = `cte_${orderSpec.field.alias}`;
|
|
2396
|
+
const cteAlias = aliasToCte.get(orderSpec.field.alias) ?? `cte_${orderSpec.field.alias}`;
|
|
2385
2397
|
const field2 = compileFieldValue(
|
|
2386
2398
|
orderSpec.field,
|
|
2387
2399
|
dialect,
|
|
@@ -3851,6 +3863,16 @@ function mapSubgraphEdgeRow(row, projectionPlan) {
|
|
|
3851
3863
|
applyProjectedFields(projectedEdge, row, kindPlan);
|
|
3852
3864
|
return projectedEdge;
|
|
3853
3865
|
}
|
|
3866
|
+
|
|
3867
|
+
// src/query/ast.ts
|
|
3868
|
+
function mergeEdgeKinds(traversal) {
|
|
3869
|
+
const inverse = traversal.inverseEdgeKinds;
|
|
3870
|
+
if (inverse === void 0 || inverse.length === 0) return traversal.edgeKinds;
|
|
3871
|
+
return [
|
|
3872
|
+
...traversal.edgeKinds,
|
|
3873
|
+
...inverse.filter((kind) => !traversal.edgeKinds.includes(kind))
|
|
3874
|
+
];
|
|
3875
|
+
}
|
|
3854
3876
|
var OPERATOR_MAP = {
|
|
3855
3877
|
union: "UNION",
|
|
3856
3878
|
unionAll: "UNION ALL",
|
|
@@ -5433,16 +5455,6 @@ function getStreamBatchSize(options) {
|
|
|
5433
5455
|
return options?.batchSize ?? DEFAULT_STREAM_BATCH_SIZE;
|
|
5434
5456
|
}
|
|
5435
5457
|
|
|
5436
|
-
// src/query/ast.ts
|
|
5437
|
-
function mergeEdgeKinds(traversal) {
|
|
5438
|
-
const inverse = traversal.inverseEdgeKinds;
|
|
5439
|
-
if (inverse === void 0 || inverse.length === 0) return traversal.edgeKinds;
|
|
5440
|
-
return [
|
|
5441
|
-
...traversal.edgeKinds,
|
|
5442
|
-
...inverse.filter((kind) => !traversal.edgeKinds.includes(kind))
|
|
5443
|
-
];
|
|
5444
|
-
}
|
|
5445
|
-
|
|
5446
5458
|
// src/query/execution/field-tracker.ts
|
|
5447
5459
|
var OBJECT_PROTOTYPE_PROPERTIES = /* @__PURE__ */ new Set([
|
|
5448
5460
|
"__proto__",
|
|
@@ -6562,11 +6574,33 @@ var ExecutableQuery = class _ExecutableQuery {
|
|
|
6562
6574
|
* Orders results.
|
|
6563
6575
|
*/
|
|
6564
6576
|
orderBy(alias, field2, direction = "asc") {
|
|
6565
|
-
const
|
|
6566
|
-
(traversal) => traversal.
|
|
6567
|
-
)
|
|
6568
|
-
const
|
|
6569
|
-
const
|
|
6577
|
+
const edgeTraversal = this.#state.traversals.find(
|
|
6578
|
+
(traversal) => traversal.edgeAlias === alias
|
|
6579
|
+
);
|
|
6580
|
+
const isEdge = edgeTraversal !== void 0;
|
|
6581
|
+
const isSystem = field2 === "id" || field2 === "kind" || isEdge && (field2 === "from_id" || field2 === "to_id");
|
|
6582
|
+
let typeInfo;
|
|
6583
|
+
if (!isSystem) {
|
|
6584
|
+
if (isEdge) {
|
|
6585
|
+
const edgeKindNames = mergeEdgeKinds(edgeTraversal);
|
|
6586
|
+
typeInfo = this.#config.schemaIntrospector.getSharedEdgeFieldTypeInfo(
|
|
6587
|
+
edgeKindNames,
|
|
6588
|
+
field2
|
|
6589
|
+
);
|
|
6590
|
+
} else {
|
|
6591
|
+
const kindNames = alias === this.#state.startAlias ? this.#state.startKinds : this.#state.traversals.find(
|
|
6592
|
+
(traversal) => traversal.nodeAlias === alias
|
|
6593
|
+
)?.nodeKinds;
|
|
6594
|
+
typeInfo = kindNames ? this.#config.schemaIntrospector.getSharedFieldTypeInfo(
|
|
6595
|
+
kindNames,
|
|
6596
|
+
field2
|
|
6597
|
+
) : void 0;
|
|
6598
|
+
}
|
|
6599
|
+
}
|
|
6600
|
+
const orderSpec = isSystem ? {
|
|
6601
|
+
field: fieldRef(alias, [field2], { valueType: "string" }),
|
|
6602
|
+
direction
|
|
6603
|
+
} : {
|
|
6570
6604
|
field: fieldRef(alias, ["props"], {
|
|
6571
6605
|
jsonPointer: jsonPointer([field2]),
|
|
6572
6606
|
valueType: typeInfo?.valueType,
|
|
@@ -8110,8 +8144,13 @@ var QueryBuilder = class _QueryBuilder {
|
|
|
8110
8144
|
* Orders results.
|
|
8111
8145
|
*/
|
|
8112
8146
|
orderBy(alias, field2, direction = "asc") {
|
|
8113
|
-
const
|
|
8114
|
-
const
|
|
8147
|
+
const edgeKindNames = this.#getEdgeKindNamesForAlias(alias);
|
|
8148
|
+
const isEdge = edgeKindNames !== void 0;
|
|
8149
|
+
const isSystem = field2 === "id" || field2 === "kind" || isEdge && (field2 === "from_id" || field2 === "to_id");
|
|
8150
|
+
const typeInfo = isSystem ? void 0 : isEdge ? this.#config.schemaIntrospector.getSharedEdgeFieldTypeInfo(
|
|
8151
|
+
edgeKindNames,
|
|
8152
|
+
field2
|
|
8153
|
+
) : this.#getOrderByTypeInfo(alias, field2);
|
|
8115
8154
|
const orderSpec = isSystem ? {
|
|
8116
8155
|
field: fieldRef(alias, [field2], { valueType: "string" }),
|
|
8117
8156
|
direction
|