@nicia-ai/typegraph 0.28.1 → 0.30.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 +24 -762
- package/dist/backend/postgres/index.cjs.map +1 -1
- package/dist/backend/postgres/index.d.cts +24 -5
- package/dist/backend/postgres/index.d.ts +24 -5
- package/dist/backend/postgres/index.js +11 -753
- package/dist/backend/postgres/index.js.map +1 -1
- package/dist/backend/postgres/pglite.cjs +52 -0
- package/dist/backend/postgres/pglite.cjs.map +1 -0
- package/dist/backend/postgres/pglite.d.cts +116 -0
- package/dist/backend/postgres/pglite.d.ts +116 -0
- package/dist/backend/postgres/pglite.js +50 -0
- package/dist/backend/postgres/pglite.js.map +1 -0
- package/dist/backend/sqlite/index.cjs +23 -27
- package/dist/backend/sqlite/index.d.cts +22 -15
- package/dist/backend/sqlite/index.d.ts +22 -15
- package/dist/backend/sqlite/index.js +10 -10
- package/dist/backend/sqlite/libsql.cjs +18 -14
- package/dist/backend/sqlite/libsql.cjs.map +1 -1
- package/dist/backend/sqlite/libsql.d.cts +3 -3
- package/dist/backend/sqlite/libsql.d.ts +3 -3
- package/dist/backend/sqlite/libsql.js +17 -13
- package/dist/backend/sqlite/libsql.js.map +1 -1
- package/dist/backend/sqlite/local.cjs +19 -17
- package/dist/backend/sqlite/local.cjs.map +1 -1
- package/dist/backend/sqlite/local.d.cts +9 -3
- package/dist/backend/sqlite/local.d.ts +9 -3
- package/dist/backend/sqlite/local.js +17 -15
- package/dist/backend/sqlite/local.js.map +1 -1
- package/dist/chunk-26HWIIVS.cjs +740 -0
- package/dist/chunk-26HWIIVS.cjs.map +1 -0
- package/dist/chunk-2QA5EHEN.js +181 -0
- package/dist/chunk-2QA5EHEN.js.map +1 -0
- package/dist/chunk-3IRMLJEK.js +206 -0
- package/dist/chunk-3IRMLJEK.js.map +1 -0
- package/dist/{chunk-5MTOKWDA.js → chunk-3JLRHQ67.js} +9 -9
- package/dist/{chunk-5MTOKWDA.js.map → chunk-3JLRHQ67.js.map} +1 -1
- package/dist/{chunk-WVQXAFP3.js → chunk-454I6GDF.js} +46 -5
- package/dist/chunk-454I6GDF.js.map +1 -0
- package/dist/{chunk-CTHNVU6K.cjs → chunk-4BXHVEFB.cjs} +16 -16
- package/dist/{chunk-CTHNVU6K.cjs.map → chunk-4BXHVEFB.cjs.map} +1 -1
- package/dist/{chunk-NMOE2ZEU.cjs → chunk-4LBO6KIF.cjs} +139 -128
- package/dist/chunk-4LBO6KIF.cjs.map +1 -0
- package/dist/chunk-633N7DSE.js +258 -0
- package/dist/chunk-633N7DSE.js.map +1 -0
- package/dist/{chunk-WFUN6DCM.cjs → chunk-7JGLPAFV.cjs} +11 -11
- package/dist/chunk-7JGLPAFV.cjs.map +1 -0
- package/dist/{chunk-ZTREJOGB.js → chunk-AI3RNREM.js} +140 -69
- package/dist/chunk-AI3RNREM.js.map +1 -0
- package/dist/{chunk-TSGBRPNE.js → chunk-ENDUY2CD.js} +46 -46
- package/dist/chunk-ENDUY2CD.js.map +1 -0
- package/dist/{chunk-7V335GHG.cjs → chunk-FLRCVI2G.cjs} +12 -2
- package/dist/chunk-FLRCVI2G.cjs.map +1 -0
- package/dist/chunk-FVIGJTS7.js +305 -0
- package/dist/chunk-FVIGJTS7.js.map +1 -0
- package/dist/chunk-FWBVPATK.cjs +208 -0
- package/dist/chunk-FWBVPATK.cjs.map +1 -0
- package/dist/chunk-IE6GN7L3.cjs +319 -0
- package/dist/chunk-IE6GN7L3.cjs.map +1 -0
- package/dist/{chunk-PGU2XKMA.js → chunk-IUIJJYPI.js} +117 -106
- package/dist/chunk-IUIJJYPI.js.map +1 -0
- package/dist/{chunk-E5ROA3MN.js → chunk-IX7RE7CG.js} +3 -3
- package/dist/{chunk-E5ROA3MN.js.map → chunk-IX7RE7CG.js.map} +1 -1
- package/dist/{chunk-YEDQLNVE.cjs → chunk-JIEJCTDS.cjs} +30 -2
- package/dist/chunk-JIEJCTDS.cjs.map +1 -0
- package/dist/{chunk-WZH2MKHW.cjs → chunk-K4N35E7B.cjs} +101 -101
- package/dist/{chunk-WZH2MKHW.cjs.map → chunk-K4N35E7B.cjs.map} +1 -1
- package/dist/{chunk-NZ5PMBTG.js → chunk-K5P5OZXS.js} +12 -3
- package/dist/chunk-K5P5OZXS.js.map +1 -0
- package/dist/chunk-K5VREXMZ.js +738 -0
- package/dist/chunk-K5VREXMZ.js.map +1 -0
- package/dist/chunk-LUHU4T2F.cjs +12 -0
- package/dist/{chunk-4FJVSF3K.cjs.map → chunk-LUHU4T2F.cjs.map} +1 -1
- package/dist/{chunk-O57GYGYK.js → chunk-M6OC455F.js} +32 -18
- package/dist/chunk-M6OC455F.js.map +1 -0
- package/dist/{chunk-OYLF3IC7.js → chunk-MAQJYNJR.js} +4 -4
- package/dist/chunk-MAQJYNJR.js.map +1 -0
- package/dist/{chunk-OOS2RKRH.js → chunk-MXE2U3EX.js} +4 -4
- package/dist/{chunk-OOS2RKRH.js.map → chunk-MXE2U3EX.js.map} +1 -1
- package/dist/{chunk-TKM2WDT4.js → chunk-N2OEOGBB.js} +386 -1093
- package/dist/chunk-N2OEOGBB.js.map +1 -0
- package/dist/{chunk-EJCDOA37.js → chunk-R4JOBEJU.js} +5 -5
- package/dist/{chunk-EJCDOA37.js.map → chunk-R4JOBEJU.js.map} +1 -1
- package/dist/{chunk-FFHW2JEK.cjs → chunk-RP7YITHX.cjs} +32 -17
- package/dist/chunk-RP7YITHX.cjs.map +1 -0
- package/dist/{chunk-PYJOBZR3.cjs → chunk-SGPXKJ4A.cjs} +60 -60
- package/dist/chunk-SGPXKJ4A.cjs.map +1 -0
- package/dist/{chunk-U5ROKVRF.js → chunk-TQOYM4LN.js} +29 -3
- package/dist/chunk-TQOYM4LN.js.map +1 -0
- package/dist/{chunk-PN37HVAV.cjs → chunk-UESTHN47.cjs} +153 -71
- package/dist/chunk-UESTHN47.cjs.map +1 -0
- package/dist/chunk-VFX3LC76.cjs +183 -0
- package/dist/chunk-VFX3LC76.cjs.map +1 -0
- package/dist/chunk-WEMZM7J7.cjs +270 -0
- package/dist/chunk-WEMZM7J7.cjs.map +1 -0
- package/dist/{chunk-NYQFPGYP.cjs → chunk-WFCECD6Q.cjs} +423 -1139
- package/dist/chunk-WFCECD6Q.cjs.map +1 -0
- package/dist/{chunk-EK6RJ373.cjs → chunk-YQGLVWB2.cjs} +7 -7
- package/dist/{chunk-EK6RJ373.cjs.map → chunk-YQGLVWB2.cjs.map} +1 -1
- package/dist/{chunk-X3244EKP.cjs → chunk-ZFWNO3GE.cjs} +48 -4
- package/dist/chunk-ZFWNO3GE.cjs.map +1 -0
- package/dist/ddl-BSFlbGQF.d.cts +38 -0
- package/dist/ddl-EdkIiFVU.d.ts +38 -0
- package/dist/{extension-types-B78CZfA5.d.cts → extension-types-CwHV-Uk4.d.cts} +4 -4
- package/dist/{extension-types-B78CZfA5.d.ts → extension-types-CwHV-Uk4.d.ts} +4 -4
- package/dist/graph-extension/index.cjs +19 -19
- package/dist/graph-extension/index.d.cts +4 -4
- package/dist/graph-extension/index.d.ts +4 -4
- package/dist/graph-extension/index.js +4 -4
- package/dist/{index-CWdBFWbI.d.ts → index-DzeIiMO3.d.ts} +30 -3
- package/dist/{index-Bilw0pYm.d.cts → index-Ln_KHTGA.d.cts} +30 -3
- package/dist/index.cjs +1542 -1011
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +142 -12
- package/dist/index.d.ts +142 -12
- package/dist/index.js +1138 -643
- package/dist/index.js.map +1 -1
- package/dist/indexes/index.cjs +19 -19
- package/dist/indexes/index.d.cts +9 -9
- package/dist/indexes/index.d.ts +9 -9
- package/dist/indexes/index.js +5 -5
- package/dist/interchange/index.cjs +8 -14
- package/dist/interchange/index.cjs.map +1 -1
- package/dist/interchange/index.d.cts +5 -16
- package/dist/interchange/index.d.ts +5 -16
- package/dist/interchange/index.js +3 -9
- package/dist/interchange/index.js.map +1 -1
- package/dist/{manager-ehLTTNq0.d.ts → manager-BbdyNhkv.d.ts} +2 -2
- package/dist/{manager-c1MGaVVR.d.cts → manager-wTDgjoXG.d.cts} +2 -2
- package/dist/{materialize-indexes-DFavFQah.d.ts → materialize-indexes-lkawaDor.d.ts} +1 -1
- package/dist/{materialize-indexes-BQfaAZKA.d.cts → materialize-indexes-oanE3RU0.d.cts} +1 -1
- package/dist/{ddl-0Ooc2dpL.d.ts → postgres-CK2ByP1q.d.cts} +2 -471
- package/dist/{ddl-Dza3kDrI.d.cts → postgres-ymXYC6Rr.d.ts} +2 -471
- package/dist/profiler/index.cjs +10 -10
- package/dist/profiler/index.d.cts +7 -7
- package/dist/profiler/index.d.ts +7 -7
- package/dist/profiler/index.js +3 -3
- package/dist/schema/index.cjs +33 -33
- package/dist/schema/index.d.cts +7 -7
- package/dist/schema/index.d.ts +7 -7
- package/dist/schema/index.js +10 -10
- package/dist/{sqlite-BxZUPbyD.d.ts → sqlite-DxH1lrwD.d.cts} +2 -468
- package/dist/{sqlite-mvpXjEeB.d.cts → sqlite-R8YGOqVQ.d.ts} +2 -468
- package/dist/{store-Ufc1Eoey.d.ts → store--z1Tmk7U.d.cts} +124 -5
- package/dist/{store-D7YEMg2v.d.cts → store-CNKM334w.d.ts} +124 -5
- package/dist/{types-CMQymcwk.d.cts → types-BBiDqJCU.d.ts} +252 -46
- package/dist/{types-B-sJJ4GQ.d.ts → types-CMvxx2kd.d.ts} +2 -2
- package/dist/{types-CmUA9sal.d.cts → types-D5B6Be5c.d.cts} +2 -2
- package/dist/{types-CQ7xXJMP.d.ts → types-dL-clxO3.d.cts} +252 -46
- package/dist/{where-CtrLu1Zf.d.ts → where-CAo6wsBZ.d.ts} +2 -2
- package/dist/{where-5zf15aFZ.d.cts → where-bJjuOCeV.d.cts} +2 -2
- package/package.json +20 -5
- package/dist/chunk-3EUKJEQ3.js +0 -77
- package/dist/chunk-3EUKJEQ3.js.map +0 -1
- package/dist/chunk-4FJVSF3K.cjs +0 -12
- package/dist/chunk-7V335GHG.cjs.map +0 -1
- package/dist/chunk-FFHW2JEK.cjs.map +0 -1
- package/dist/chunk-HTGDWIDE.cjs +0 -89
- package/dist/chunk-HTGDWIDE.cjs.map +0 -1
- package/dist/chunk-LYRUNG6E.cjs +0 -52
- package/dist/chunk-LYRUNG6E.cjs.map +0 -1
- package/dist/chunk-NMOE2ZEU.cjs.map +0 -1
- package/dist/chunk-NYQFPGYP.cjs.map +0 -1
- package/dist/chunk-NZ5PMBTG.js.map +0 -1
- package/dist/chunk-O57GYGYK.js.map +0 -1
- package/dist/chunk-OYLF3IC7.js.map +0 -1
- package/dist/chunk-PCHTTG42.js +0 -47
- package/dist/chunk-PCHTTG42.js.map +0 -1
- package/dist/chunk-PGU2XKMA.js.map +0 -1
- package/dist/chunk-PN37HVAV.cjs.map +0 -1
- package/dist/chunk-PYJOBZR3.cjs.map +0 -1
- package/dist/chunk-TKM2WDT4.js.map +0 -1
- package/dist/chunk-TSGBRPNE.js.map +0 -1
- package/dist/chunk-U5ROKVRF.js.map +0 -1
- package/dist/chunk-WFUN6DCM.cjs.map +0 -1
- package/dist/chunk-WVQXAFP3.js.map +0 -1
- package/dist/chunk-X3244EKP.cjs.map +0 -1
- package/dist/chunk-YEDQLNVE.cjs.map +0 -1
- package/dist/chunk-ZTREJOGB.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export { A as AnyEdgeType,
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
6
|
-
import { A as AliasMap,
|
|
7
|
-
export {
|
|
8
|
-
import { G as GraphDef, K as KindRegistry } from './manager-
|
|
9
|
-
export { A as AllEdgeTypes, t as AllNodeTypes, u as EdgeKinds, v as GetEdgeType, w as GetNodeType, x as NodeKinds, c as SchemaManagerOptions, d as SchemaValidationResult, y as defineGraph, z as getEdgeKinds, B as getNodeKinds, F as isGraphDef } from './manager-
|
|
10
|
-
export { B as BackendDisposedError, C as CardinalityError, b as CompilerInvariantError, c as ConfigurationError, D as DatabaseOperationError, d as DisjointError, E as EagerMaterializationError, e as EdgeNotFoundError, f as
|
|
11
|
-
export { a as MaterializeIndexesEntry, b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-
|
|
12
|
-
export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from './where-
|
|
2
|
+
import { e as KindAnnotations, N as NodeType, d as EdgeType } from './extension-types-CwHV-Uk4.cjs';
|
|
3
|
+
export { A as AnyEdgeType, h as CURRENT_GRAPH_EXTENSION_VERSION, f as Cardinality, C as Collation, D as DeleteBehavior, i as EdgeId, j as EdgeProps, E as EdgeRegistration, k as EdgeTypeWithEndpoints, g as EndpointExistence, c as GraphDefaults, G as GraphExtension, l as GraphExtensionVersion, J as JsonValue, L as LEGACY_GRAPH_EXTENSION_VERSION, m as NodeId, n as NodeProps, b as NodeRegistration, T as TemporalMode, o as UniqueConstraint, U as UniquenessScope, p as isEdgeType, q as isEdgeTypeWithEndpoints, r as isNodeType } from './extension-types-CwHV-Uk4.cjs';
|
|
4
|
+
import { K as InferenceType, M as MetaEdge, V as VectorStrategy, G as GraphBackend, O as OntologyRelation, L as AggregateExpr, P as FieldRef, T as ComparisonOp, U as AggregateComparisonPredicate } from './types-dL-clxO3.cjs';
|
|
5
|
+
export { W as AdoptedTransaction, B as BackendCapabilities, X as CommitSchemaVersionExpected, Y as CommitSchemaVersionParams, Z as DEFAULT_SQL_SCHEMA, _ as DeleteFulltextBatchParams, E as EdgeIndexConfig, c as EdgeIndexDeclaration, q as EdgeIndexDirection, r as EdgeIndexWhereBuilder, $ as FulltextBatchRow, a0 as FulltextCapabilities, a1 as FulltextQueryMode, a2 as FulltextSearchParams, a3 as FulltextSearchResult, F as FulltextStrategy, a4 as HybridFusionOptions, I as IndexDeclaration, s as IndexOrigin, t as IndexScope, e as IndexWhereExpression, u as IndexWhereFieldBuilder, v as IndexWhereInput, J as JsonPointer, a5 as JsonPointerFor, a6 as JsonPointerInput, a7 as JsonPointerSegment, a8 as JsonPointerSegments, a9 as JsonPointerSegmentsFor, aa as MAX_JSON_POINTER_DEPTH, ab as MetaEdgeProperties, N as NodeIndexConfig, d as NodeIndexDeclaration, w as NodeIndexWhereBuilder, ac as OrderSpec, ad as ParameterRef, ae as ResolveJsonPointer, af as ResolveJsonPointerSegments, H as SchemaVersionRow, ag as SetActiveVersionParams, ah as SortDirection, p as SqlDialect, ai as SqlSchema, aj as SqlTableNames, ak as StrategyTableContribution, al as TableContribution, am as TransactionBackend, an as TraversalExpansion, ao as UpsertFulltextBatchParams, ap as VectorCapabilities, aq as VectorSlot, ar as buildVectorCapabilities, as as createSqlSchema, at as fts5Strategy, au as isMetaEdge, av as joinJsonPointers, aw as jsonPointer, ax as normalizeJsonPointer, ay as parseJsonPointer, az as tsvectorStrategy } from './types-dL-clxO3.cjs';
|
|
6
|
+
import { E as EmbeddingMetric, a as EmbeddingIndexType, A as AliasMap, b as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store--z1Tmk7U.cjs';
|
|
7
|
+
export { c as AggregateResult, d as AlgorithmCyclePolicy, e as AnyEdge, f as AnyNode, B as BaseTraversalOptions, g as BatchResults, h as BatchableQuery, i as ConstraintNames, j as CreateEdgeInput, k as CreateNodeInput, D as DEFAULT_SEARCHABLE_LANGUAGE, l as DegreeOptions, m as DynamicEdgeAccessor, n as DynamicEdgeCollection, o as DynamicEdgeType, p as DynamicFieldBuilder, q as DynamicNodeAccessor, r as DynamicNodeCollection, s as DynamicNodeType, t as DynamicSelectableEdge, u as DynamicSelectableNode, v as Edge, w as EdgeAccessor, x as EdgeCollection, y as EdgeFindByEndpointsOptions, z as EdgeGetOrCreateByEndpointsOptions, F as EdgeGetOrCreateByEndpointsResult, G as EdgeIntrospection, H as EmbeddingSchema, I as EmbeddingValue, J as ExecutableAggregateQuery, K as ExecutableQuery, L as FieldAccessor, M as FulltextSearchHit, N as FulltextSearchOptions, O as GetOrCreateAction, P as GraphAlgorithms, R as GraphEdgeCollections, U as GraphNodeCollections, V as HookContext, W as HybridFulltextOptions, X as HybridSearchHit, Y as HybridSearchOptions, Z as HybridVectorOptions, _ as IfExistsMode, $ as KindIntrospection, a0 as MaterializeRemovalsEntry, a1 as MaterializeRemovalsOptions, a2 as MaterializeRemovalsResult, a3 as NeighborsOptions, a4 as Node, a5 as NodeAccessor, a6 as NodeAlias, a7 as NodeBulkFindByIndexOptions, a8 as NodeCollection, a9 as NodeGetOrCreateByConstraintOptions, aa as NodeGetOrCreateByConstraintResult, ab as NodeIdentifier, ac as NodeRef, ad as OntologyIntrospection, ae as OperationHookContext, af as PaginateOptions, ag as PaginatedResult, ah as PathNode, ai as Predicate, aj as PreparedQuery, ak as PropsAccessor, al as QueryHookContext, am as QueryOptions, an as ReachableNode, ao as ReachableOptions, ap as RebuildFulltextOptions, aq as RebuildFulltextResult, ar as ReclaimedVectorFieldEntry, as as RecursiveTraversalOptions, at as ReembedFunction, au as ReembedVectorFieldOptions, av as ReembedVectorFieldResult, aw as SchemaIntrospection, ax as SearchableMetadata, ay as SearchableOptions, az as SearchableSchema, aA as SelectContext, aB as SelectableEdge, aC as SelectableNode, aD as ShortestPathOptions, aE as ShortestPathResult, S as Store, aF as StoreHooks, aG as StoreOptions, aH as StoreProjection, aI as StoreRef, aJ as StoreSearch, aK as StreamOptions, aL as SubgraphEdgeResult, aM as SubgraphNodeResult, aN as SubgraphOptions, aO as SubgraphResult, aP as SubsetEdge, aQ as SubsetNode, aR as TemporalAlgorithmOptions, aS as TransactionContext, aT as TraversalDirection, aU as TypedEdgeCollection, aV as UnionableQuery, aW as UniqueIntrospection, aX as UpdateEdgeInput, aY as UpdateNodeInput, aZ as VectorSearchHit, a_ as VectorSearchOptions, a$ as createStore, b0 as createStoreWithSchema, b1 as createVerifiedStore, b2 as defineSubgraphProject, b3 as embedding, b4 as exists, b5 as fieldRef, b6 as getEmbeddingDimensions, b7 as getSearchableMetadata, b8 as inSubquery, b9 as isEmbeddingSchema, ba as isParameterRef, bb as isSearchableSchema, bc as notExists, bd as notInSubquery, be as param, bf as searchable } from './store--z1Tmk7U.cjs';
|
|
8
|
+
import { G as GraphDef, K as KindRegistry } from './manager-wTDgjoXG.cjs';
|
|
9
|
+
export { A as AllEdgeTypes, t as AllNodeTypes, u as EdgeKinds, v as GetEdgeType, w as GetNodeType, x as NodeKinds, c as SchemaManagerOptions, d as SchemaValidationResult, y as defineGraph, z as getEdgeKinds, B as getNodeKinds, F as isGraphDef } from './manager-wTDgjoXG.cjs';
|
|
10
|
+
export { B as BackendDisposedError, C as CardinalityError, b as CompilerInvariantError, c as ConfigurationError, D as DatabaseOperationError, d as DisjointError, E as EagerMaterializationError, e as EdgeNotFoundError, f as EmbeddingDimensionChangedError, g as EndpointError, h as EndpointNotFoundError, i as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, j as NodeIndexNotFoundError, k as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaContentConflictError, l as SchemaMismatchError, m as StaleVersionError, n as StoreNotInitializedError, o as StoreNotInitializedReason, T as TypeGraphError, p as TypeGraphErrorOptions, U as UniquenessError, q as UnsupportedPredicateError, a as ValidationError, r as ValidationErrorDetails, V as ValidationIssue, s as VersionConflictError, t as getErrorSuggestion, u as isConstraintError, v as isSystemError, w as isTypeGraphError, x as isUserRecoverable } from './index-Ln_KHTGA.cjs';
|
|
11
|
+
export { a as MaterializeIndexesEntry, b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-oanE3RU0.cjs';
|
|
12
|
+
export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from './where-bJjuOCeV.cjs';
|
|
13
13
|
export { GraphExtensionError, GraphExtensionIssue, GraphExtensionIssueCode, GraphExtensionUnresolvedEndpointError, GraphExtensionValidationError, GraphExtensionVersionUnsupportedError, IncompatibleChange, IncompatibleChangeError, KindCollisionError, KindHasReferentsError, KindReferent, RemoveCompileTimeKindError, defineGraphExtension, validateGraphExtension } from './graph-extension/index.cjs';
|
|
14
14
|
import 'drizzle-orm';
|
|
15
15
|
import 'drizzle-orm/pg-core';
|
|
@@ -232,6 +232,111 @@ declare function getExternalRefTable(schema: z.ZodType): string | undefined;
|
|
|
232
232
|
*/
|
|
233
233
|
declare function createExternalRef<T extends string>(table: T): (id: string) => ExternalRefValue<T>;
|
|
234
234
|
|
|
235
|
+
declare const libsqlVectorStrategy: VectorStrategy;
|
|
236
|
+
|
|
237
|
+
declare const pgvectorStrategy: VectorStrategy;
|
|
238
|
+
|
|
239
|
+
declare const sqliteVecStrategy: VectorStrategy;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* The resolved storage config for one `(nodeKind, fieldPath)` slot that the
|
|
243
|
+
* legacy table did not record. The legacy shared table stored only the
|
|
244
|
+
* vector and its dimension count — not the metric or index type — so a
|
|
245
|
+
* caller that wants migrated fields to match a specific graph's `embedding()`
|
|
246
|
+
* declarations supplies this resolver.
|
|
247
|
+
*/
|
|
248
|
+
type LegacyEmbeddingSlotConfig = Readonly<{
|
|
249
|
+
metric: EmbeddingMetric;
|
|
250
|
+
indexType: EmbeddingIndexType;
|
|
251
|
+
}>;
|
|
252
|
+
/**
|
|
253
|
+
* Options for {@link migrateLegacyEmbeddings}.
|
|
254
|
+
*/
|
|
255
|
+
type MigrateLegacyEmbeddingsOptions = Readonly<{
|
|
256
|
+
/**
|
|
257
|
+
* The backend to migrate, wired with the destination `VectorStrategy`
|
|
258
|
+
* (i.e. the post-cutover backend). Its `vectorStrategy` owns the per-field
|
|
259
|
+
* storage rows are written into and its `upsertEmbedding` performs the
|
|
260
|
+
* writes.
|
|
261
|
+
*/
|
|
262
|
+
backend: GraphBackend;
|
|
263
|
+
/**
|
|
264
|
+
* Restrict the migration to a single graph. When omitted, every graph's
|
|
265
|
+
* rows in the legacy table are migrated (the table is graph-scoped by its
|
|
266
|
+
* `graph_id` column).
|
|
267
|
+
*/
|
|
268
|
+
graphId?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Resolves the metric / index type for a `(nodeKind, fieldPath)` slot the
|
|
271
|
+
* legacy table didn't persist. Return `undefined` to fall back to the
|
|
272
|
+
* cosine / hnsw defaults. Supply this (typically reading the graph's
|
|
273
|
+
* `embedding()` declarations) when migrated fields must match a specific
|
|
274
|
+
* metric — e.g. an `l2` field, which scores incorrectly under the cosine
|
|
275
|
+
* default.
|
|
276
|
+
*/
|
|
277
|
+
resolveSlotConfig?: (nodeKind: string, fieldPath: string) => LegacyEmbeddingSlotConfig | undefined;
|
|
278
|
+
/** Rows read per round-trip. Defaults to {@link DEFAULT_BATCH_SIZE}. */
|
|
279
|
+
batchSize?: number;
|
|
280
|
+
/**
|
|
281
|
+
* Physical name of the legacy table to drain. Defaults to
|
|
282
|
+
* {@link LEGACY_EMBEDDINGS_TABLE_NAME}. Override only for a non-default
|
|
283
|
+
* deployment that renamed the embeddings table.
|
|
284
|
+
*/
|
|
285
|
+
legacyTableName?: string;
|
|
286
|
+
}>;
|
|
287
|
+
/**
|
|
288
|
+
* Summary of a {@link migrateLegacyEmbeddings} run.
|
|
289
|
+
*/
|
|
290
|
+
type MigrateLegacyEmbeddingsResult = Readonly<{
|
|
291
|
+
/** Total embedding rows re-inserted into per-field storage. */
|
|
292
|
+
migrated: number;
|
|
293
|
+
/**
|
|
294
|
+
* Per-`(nodeKind, fieldPath)` counts, keyed `"<nodeKind>.<fieldPath>"`
|
|
295
|
+
* (the strategy's logical-slot key form). Empty when the legacy table was
|
|
296
|
+
* absent or held no rows for the requested scope.
|
|
297
|
+
*/
|
|
298
|
+
perField: Readonly<Record<string, number>>;
|
|
299
|
+
/**
|
|
300
|
+
* Rows skipped because their vector length didn't match the per-field
|
|
301
|
+
* table's fixed dimension. The legacy shared column allowed mixed
|
|
302
|
+
* dimensions for one `(nodeKind, fieldPath)` (e.g. an unmigrated model
|
|
303
|
+
* change); the first migrated row fixes the typed table's dimension and
|
|
304
|
+
* any differently-sized rows for that slot are skipped rather than aborting
|
|
305
|
+
* the whole migration. Keyed `"<nodeKind>.<fieldPath>"`. Non-empty here
|
|
306
|
+
* means those fields need a deliberate re-embed at a single dimension.
|
|
307
|
+
*/
|
|
308
|
+
skippedDimensionMismatch: Readonly<Record<string, number>>;
|
|
309
|
+
/**
|
|
310
|
+
* Rows skipped because their legacy embedding could not be decoded into a
|
|
311
|
+
* finite-number array — a corrupt value (e.g. a pgvector `vector` column
|
|
312
|
+
* permits `NaN`/`Infinity`, which is not valid JSON). Keyed
|
|
313
|
+
* `"<nodeKind>.<fieldPath>"`. Skipping + reporting keeps one bad row from
|
|
314
|
+
* aborting the whole migration; non-empty here means those rows need manual
|
|
315
|
+
* repair.
|
|
316
|
+
*/
|
|
317
|
+
skippedDecodeError: Readonly<Record<string, number>>;
|
|
318
|
+
/**
|
|
319
|
+
* Whether the legacy table existed. `false` means the run was a clean
|
|
320
|
+
* no-op (fresh install, or already-dropped table on a re-run).
|
|
321
|
+
*/
|
|
322
|
+
legacyTablePresent: boolean;
|
|
323
|
+
}>;
|
|
324
|
+
/**
|
|
325
|
+
* Re-inserts every embedding from the legacy shared
|
|
326
|
+
* `typegraph_node_embeddings` table into the active
|
|
327
|
+
* `backend.vectorStrategy`'s per-`(nodeKind, fieldPath)` storage.
|
|
328
|
+
*
|
|
329
|
+
* One-time, explicitly-run upgrade step for the shared-table → per-field
|
|
330
|
+
* cutover (#157). Idempotent, batched, and a clean no-op when the legacy
|
|
331
|
+
* table is absent. See the module doc comment for the full contract.
|
|
332
|
+
*
|
|
333
|
+
* @throws Error when the backend exposes no `vectorStrategy` /
|
|
334
|
+
* `upsertEmbedding` (nothing to migrate *into*) — a configuration
|
|
335
|
+
* error the caller must fix by wiring the destination strategy
|
|
336
|
+
* before migrating.
|
|
337
|
+
*/
|
|
338
|
+
declare function migrateLegacyEmbeddings(options: MigrateLegacyEmbeddingsOptions): Promise<MigrateLegacyEmbeddingsResult>;
|
|
339
|
+
|
|
235
340
|
/**
|
|
236
341
|
* Creates a subClassOf ontology relation.
|
|
237
342
|
*/
|
|
@@ -446,6 +551,31 @@ declare const core: {
|
|
|
446
551
|
readonly implies: typeof implies;
|
|
447
552
|
};
|
|
448
553
|
|
|
554
|
+
/**
|
|
555
|
+
* Transitive closure computation for ontology relationships.
|
|
556
|
+
*
|
|
557
|
+
* Uses Warshall's algorithm for efficient closure computation.
|
|
558
|
+
*/
|
|
559
|
+
/**
|
|
560
|
+
* Computes the transitive closure of a set of directed relations.
|
|
561
|
+
*
|
|
562
|
+
* Given relations like [A→B, B→C], computes all transitive paths [A→B, A→C, B→C].
|
|
563
|
+
*
|
|
564
|
+
* @param relations - Array of [from, to] pairs representing direct relationships
|
|
565
|
+
* @returns Map from each 'from' to the set of all reachable 'to' values
|
|
566
|
+
*/
|
|
567
|
+
declare function computeTransitiveClosure(relations: readonly (readonly [string, string])[]): ReadonlyMap<string, ReadonlySet<string>>;
|
|
568
|
+
/**
|
|
569
|
+
* Computes the inverse of a transitive closure map.
|
|
570
|
+
*
|
|
571
|
+
* Given A→{B, C}, returns B→{A}, C→{A}.
|
|
572
|
+
*/
|
|
573
|
+
declare function invertClosure(closure: ReadonlyMap<string, ReadonlySet<string>>): ReadonlyMap<string, ReadonlySet<string>>;
|
|
574
|
+
/**
|
|
575
|
+
* Checks if there's a path from source to target in the closure.
|
|
576
|
+
*/
|
|
577
|
+
declare function isReachable(closure: ReadonlyMap<string, ReadonlySet<string>>, source: string, target: string): boolean;
|
|
578
|
+
|
|
449
579
|
/**
|
|
450
580
|
* Recursive CTE Compilation
|
|
451
581
|
*
|
|
@@ -787,4 +917,4 @@ type IdConfig = Readonly<{
|
|
|
787
917
|
edgeIdGenerator: IdGenerator;
|
|
788
918
|
}>;
|
|
789
919
|
|
|
790
|
-
export { AliasMap, type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, FieldRef, type FlexibleQueryFragment, GraphDef, type IdConfig, type IdGenerator, InferenceType, KindAnnotations, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, MetaEdge, type MetaEdgeOptions, NodeType, OntologyRelation, QueryBuilder, type QueryFragment, type TraversalFragment, avg, broader, composeFragments, core, count, countDistinct, countDistinctEdges, countEdges, createExternalRef, createFragment, createQueryBuilder, defineEdge, defineNode, differentFrom, disjointWith, equivalentTo, externalRef, field, generateId, getExternalRefTable, hasPart, having, havingEq, havingGt, havingGte, havingLt, havingLte, implies, inverseOf, isExternalRefSchema, limitFragment, max, metaEdge, min, narrower, offsetFragment, orderByFragment, partOf, relatedTo, sameAs, subClassOf, sum };
|
|
920
|
+
export { AliasMap, type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, FieldRef, type FlexibleQueryFragment, GraphBackend, GraphDef, type IdConfig, type IdGenerator, InferenceType, KindAnnotations, type LegacyEmbeddingSlotConfig, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, MetaEdge, type MetaEdgeOptions, type MigrateLegacyEmbeddingsOptions, type MigrateLegacyEmbeddingsResult, NodeType, OntologyRelation, QueryBuilder, type QueryFragment, type TraversalFragment, VectorStrategy, avg, broader, composeFragments, computeTransitiveClosure, core, count, countDistinct, countDistinctEdges, countEdges, createExternalRef, createFragment, createQueryBuilder, defineEdge, defineNode, differentFrom, disjointWith, equivalentTo, externalRef, field, generateId, getExternalRefTable, hasPart, having, havingEq, havingGt, havingGte, havingLt, havingLte, implies, inverseOf, invertClosure, isExternalRefSchema, isReachable, libsqlVectorStrategy, limitFragment, max, metaEdge, migrateLegacyEmbeddings, min, narrower, offsetFragment, orderByFragment, partOf, pgvectorStrategy, relatedTo, sameAs, sqliteVecStrategy, subClassOf, sum };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
import {
|
|
3
|
-
export { A as AnyEdgeType,
|
|
4
|
-
import {
|
|
5
|
-
export {
|
|
6
|
-
import { A as AliasMap,
|
|
7
|
-
export {
|
|
8
|
-
import { G as GraphDef, K as KindRegistry } from './manager-
|
|
9
|
-
export { A as AllEdgeTypes, t as AllNodeTypes, u as EdgeKinds, v as GetEdgeType, w as GetNodeType, x as NodeKinds, c as SchemaManagerOptions, d as SchemaValidationResult, y as defineGraph, z as getEdgeKinds, B as getNodeKinds, F as isGraphDef } from './manager-
|
|
10
|
-
export { B as BackendDisposedError, C as CardinalityError, b as CompilerInvariantError, c as ConfigurationError, D as DatabaseOperationError, d as DisjointError, E as EagerMaterializationError, e as EdgeNotFoundError, f as
|
|
11
|
-
export { a as MaterializeIndexesEntry, b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-
|
|
12
|
-
export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from './where-
|
|
2
|
+
import { e as KindAnnotations, N as NodeType, d as EdgeType } from './extension-types-CwHV-Uk4.js';
|
|
3
|
+
export { A as AnyEdgeType, h as CURRENT_GRAPH_EXTENSION_VERSION, f as Cardinality, C as Collation, D as DeleteBehavior, i as EdgeId, j as EdgeProps, E as EdgeRegistration, k as EdgeTypeWithEndpoints, g as EndpointExistence, c as GraphDefaults, G as GraphExtension, l as GraphExtensionVersion, J as JsonValue, L as LEGACY_GRAPH_EXTENSION_VERSION, m as NodeId, n as NodeProps, b as NodeRegistration, T as TemporalMode, o as UniqueConstraint, U as UniquenessScope, p as isEdgeType, q as isEdgeTypeWithEndpoints, r as isNodeType } from './extension-types-CwHV-Uk4.js';
|
|
4
|
+
import { K as InferenceType, M as MetaEdge, V as VectorStrategy, G as GraphBackend, O as OntologyRelation, L as AggregateExpr, P as FieldRef, T as ComparisonOp, U as AggregateComparisonPredicate } from './types-BBiDqJCU.js';
|
|
5
|
+
export { W as AdoptedTransaction, B as BackendCapabilities, X as CommitSchemaVersionExpected, Y as CommitSchemaVersionParams, Z as DEFAULT_SQL_SCHEMA, _ as DeleteFulltextBatchParams, E as EdgeIndexConfig, c as EdgeIndexDeclaration, q as EdgeIndexDirection, r as EdgeIndexWhereBuilder, $ as FulltextBatchRow, a0 as FulltextCapabilities, a1 as FulltextQueryMode, a2 as FulltextSearchParams, a3 as FulltextSearchResult, F as FulltextStrategy, a4 as HybridFusionOptions, I as IndexDeclaration, s as IndexOrigin, t as IndexScope, e as IndexWhereExpression, u as IndexWhereFieldBuilder, v as IndexWhereInput, J as JsonPointer, a5 as JsonPointerFor, a6 as JsonPointerInput, a7 as JsonPointerSegment, a8 as JsonPointerSegments, a9 as JsonPointerSegmentsFor, aa as MAX_JSON_POINTER_DEPTH, ab as MetaEdgeProperties, N as NodeIndexConfig, d as NodeIndexDeclaration, w as NodeIndexWhereBuilder, ac as OrderSpec, ad as ParameterRef, ae as ResolveJsonPointer, af as ResolveJsonPointerSegments, H as SchemaVersionRow, ag as SetActiveVersionParams, ah as SortDirection, p as SqlDialect, ai as SqlSchema, aj as SqlTableNames, ak as StrategyTableContribution, al as TableContribution, am as TransactionBackend, an as TraversalExpansion, ao as UpsertFulltextBatchParams, ap as VectorCapabilities, aq as VectorSlot, ar as buildVectorCapabilities, as as createSqlSchema, at as fts5Strategy, au as isMetaEdge, av as joinJsonPointers, aw as jsonPointer, ax as normalizeJsonPointer, ay as parseJsonPointer, az as tsvectorStrategy } from './types-BBiDqJCU.js';
|
|
6
|
+
import { E as EmbeddingMetric, a as EmbeddingIndexType, A as AliasMap, b as EdgeAliasMap, Q as QueryBuilder, T as TraversalBuilder, C as CreateQueryBuilderOptions } from './store-CNKM334w.js';
|
|
7
|
+
export { c as AggregateResult, d as AlgorithmCyclePolicy, e as AnyEdge, f as AnyNode, B as BaseTraversalOptions, g as BatchResults, h as BatchableQuery, i as ConstraintNames, j as CreateEdgeInput, k as CreateNodeInput, D as DEFAULT_SEARCHABLE_LANGUAGE, l as DegreeOptions, m as DynamicEdgeAccessor, n as DynamicEdgeCollection, o as DynamicEdgeType, p as DynamicFieldBuilder, q as DynamicNodeAccessor, r as DynamicNodeCollection, s as DynamicNodeType, t as DynamicSelectableEdge, u as DynamicSelectableNode, v as Edge, w as EdgeAccessor, x as EdgeCollection, y as EdgeFindByEndpointsOptions, z as EdgeGetOrCreateByEndpointsOptions, F as EdgeGetOrCreateByEndpointsResult, G as EdgeIntrospection, H as EmbeddingSchema, I as EmbeddingValue, J as ExecutableAggregateQuery, K as ExecutableQuery, L as FieldAccessor, M as FulltextSearchHit, N as FulltextSearchOptions, O as GetOrCreateAction, P as GraphAlgorithms, R as GraphEdgeCollections, U as GraphNodeCollections, V as HookContext, W as HybridFulltextOptions, X as HybridSearchHit, Y as HybridSearchOptions, Z as HybridVectorOptions, _ as IfExistsMode, $ as KindIntrospection, a0 as MaterializeRemovalsEntry, a1 as MaterializeRemovalsOptions, a2 as MaterializeRemovalsResult, a3 as NeighborsOptions, a4 as Node, a5 as NodeAccessor, a6 as NodeAlias, a7 as NodeBulkFindByIndexOptions, a8 as NodeCollection, a9 as NodeGetOrCreateByConstraintOptions, aa as NodeGetOrCreateByConstraintResult, ab as NodeIdentifier, ac as NodeRef, ad as OntologyIntrospection, ae as OperationHookContext, af as PaginateOptions, ag as PaginatedResult, ah as PathNode, ai as Predicate, aj as PreparedQuery, ak as PropsAccessor, al as QueryHookContext, am as QueryOptions, an as ReachableNode, ao as ReachableOptions, ap as RebuildFulltextOptions, aq as RebuildFulltextResult, ar as ReclaimedVectorFieldEntry, as as RecursiveTraversalOptions, at as ReembedFunction, au as ReembedVectorFieldOptions, av as ReembedVectorFieldResult, aw as SchemaIntrospection, ax as SearchableMetadata, ay as SearchableOptions, az as SearchableSchema, aA as SelectContext, aB as SelectableEdge, aC as SelectableNode, aD as ShortestPathOptions, aE as ShortestPathResult, S as Store, aF as StoreHooks, aG as StoreOptions, aH as StoreProjection, aI as StoreRef, aJ as StoreSearch, aK as StreamOptions, aL as SubgraphEdgeResult, aM as SubgraphNodeResult, aN as SubgraphOptions, aO as SubgraphResult, aP as SubsetEdge, aQ as SubsetNode, aR as TemporalAlgorithmOptions, aS as TransactionContext, aT as TraversalDirection, aU as TypedEdgeCollection, aV as UnionableQuery, aW as UniqueIntrospection, aX as UpdateEdgeInput, aY as UpdateNodeInput, aZ as VectorSearchHit, a_ as VectorSearchOptions, a$ as createStore, b0 as createStoreWithSchema, b1 as createVerifiedStore, b2 as defineSubgraphProject, b3 as embedding, b4 as exists, b5 as fieldRef, b6 as getEmbeddingDimensions, b7 as getSearchableMetadata, b8 as inSubquery, b9 as isEmbeddingSchema, ba as isParameterRef, bb as isSearchableSchema, bc as notExists, bd as notInSubquery, be as param, bf as searchable } from './store-CNKM334w.js';
|
|
8
|
+
import { G as GraphDef, K as KindRegistry } from './manager-BbdyNhkv.js';
|
|
9
|
+
export { A as AllEdgeTypes, t as AllNodeTypes, u as EdgeKinds, v as GetEdgeType, w as GetNodeType, x as NodeKinds, c as SchemaManagerOptions, d as SchemaValidationResult, y as defineGraph, z as getEdgeKinds, B as getNodeKinds, F as isGraphDef } from './manager-BbdyNhkv.js';
|
|
10
|
+
export { B as BackendDisposedError, C as CardinalityError, b as CompilerInvariantError, c as ConfigurationError, D as DatabaseOperationError, d as DisjointError, E as EagerMaterializationError, e as EdgeNotFoundError, f as EmbeddingDimensionChangedError, g as EndpointError, h as EndpointNotFoundError, i as ErrorCategory, K as KindNotFoundError, M as MigrationError, N as NodeConstraintNotFoundError, j as NodeIndexNotFoundError, k as NodeNotFoundError, R as RestrictedDeleteError, S as SchemaContentConflictError, l as SchemaMismatchError, m as StaleVersionError, n as StoreNotInitializedError, o as StoreNotInitializedReason, T as TypeGraphError, p as TypeGraphErrorOptions, U as UniquenessError, q as UnsupportedPredicateError, a as ValidationError, r as ValidationErrorDetails, V as ValidationIssue, s as VersionConflictError, t as getErrorSuggestion, u as isConstraintError, v as isSystemError, w as isTypeGraphError, x as isUserRecoverable } from './index-DzeIiMO3.js';
|
|
11
|
+
export { a as MaterializeIndexesEntry, b as MaterializeIndexesOptions, M as MaterializeIndexesResult } from './materialize-indexes-lkawaDor.js';
|
|
12
|
+
export { a as andWhere, d as defineEdgeIndex, b as defineNodeIndex, n as notWhere, o as orWhere } from './where-CAo6wsBZ.js';
|
|
13
13
|
export { GraphExtensionError, GraphExtensionIssue, GraphExtensionIssueCode, GraphExtensionUnresolvedEndpointError, GraphExtensionValidationError, GraphExtensionVersionUnsupportedError, IncompatibleChange, IncompatibleChangeError, KindCollisionError, KindHasReferentsError, KindReferent, RemoveCompileTimeKindError, defineGraphExtension, validateGraphExtension } from './graph-extension/index.js';
|
|
14
14
|
import 'drizzle-orm';
|
|
15
15
|
import 'drizzle-orm/pg-core';
|
|
@@ -232,6 +232,111 @@ declare function getExternalRefTable(schema: z.ZodType): string | undefined;
|
|
|
232
232
|
*/
|
|
233
233
|
declare function createExternalRef<T extends string>(table: T): (id: string) => ExternalRefValue<T>;
|
|
234
234
|
|
|
235
|
+
declare const libsqlVectorStrategy: VectorStrategy;
|
|
236
|
+
|
|
237
|
+
declare const pgvectorStrategy: VectorStrategy;
|
|
238
|
+
|
|
239
|
+
declare const sqliteVecStrategy: VectorStrategy;
|
|
240
|
+
|
|
241
|
+
/**
|
|
242
|
+
* The resolved storage config for one `(nodeKind, fieldPath)` slot that the
|
|
243
|
+
* legacy table did not record. The legacy shared table stored only the
|
|
244
|
+
* vector and its dimension count — not the metric or index type — so a
|
|
245
|
+
* caller that wants migrated fields to match a specific graph's `embedding()`
|
|
246
|
+
* declarations supplies this resolver.
|
|
247
|
+
*/
|
|
248
|
+
type LegacyEmbeddingSlotConfig = Readonly<{
|
|
249
|
+
metric: EmbeddingMetric;
|
|
250
|
+
indexType: EmbeddingIndexType;
|
|
251
|
+
}>;
|
|
252
|
+
/**
|
|
253
|
+
* Options for {@link migrateLegacyEmbeddings}.
|
|
254
|
+
*/
|
|
255
|
+
type MigrateLegacyEmbeddingsOptions = Readonly<{
|
|
256
|
+
/**
|
|
257
|
+
* The backend to migrate, wired with the destination `VectorStrategy`
|
|
258
|
+
* (i.e. the post-cutover backend). Its `vectorStrategy` owns the per-field
|
|
259
|
+
* storage rows are written into and its `upsertEmbedding` performs the
|
|
260
|
+
* writes.
|
|
261
|
+
*/
|
|
262
|
+
backend: GraphBackend;
|
|
263
|
+
/**
|
|
264
|
+
* Restrict the migration to a single graph. When omitted, every graph's
|
|
265
|
+
* rows in the legacy table are migrated (the table is graph-scoped by its
|
|
266
|
+
* `graph_id` column).
|
|
267
|
+
*/
|
|
268
|
+
graphId?: string;
|
|
269
|
+
/**
|
|
270
|
+
* Resolves the metric / index type for a `(nodeKind, fieldPath)` slot the
|
|
271
|
+
* legacy table didn't persist. Return `undefined` to fall back to the
|
|
272
|
+
* cosine / hnsw defaults. Supply this (typically reading the graph's
|
|
273
|
+
* `embedding()` declarations) when migrated fields must match a specific
|
|
274
|
+
* metric — e.g. an `l2` field, which scores incorrectly under the cosine
|
|
275
|
+
* default.
|
|
276
|
+
*/
|
|
277
|
+
resolveSlotConfig?: (nodeKind: string, fieldPath: string) => LegacyEmbeddingSlotConfig | undefined;
|
|
278
|
+
/** Rows read per round-trip. Defaults to {@link DEFAULT_BATCH_SIZE}. */
|
|
279
|
+
batchSize?: number;
|
|
280
|
+
/**
|
|
281
|
+
* Physical name of the legacy table to drain. Defaults to
|
|
282
|
+
* {@link LEGACY_EMBEDDINGS_TABLE_NAME}. Override only for a non-default
|
|
283
|
+
* deployment that renamed the embeddings table.
|
|
284
|
+
*/
|
|
285
|
+
legacyTableName?: string;
|
|
286
|
+
}>;
|
|
287
|
+
/**
|
|
288
|
+
* Summary of a {@link migrateLegacyEmbeddings} run.
|
|
289
|
+
*/
|
|
290
|
+
type MigrateLegacyEmbeddingsResult = Readonly<{
|
|
291
|
+
/** Total embedding rows re-inserted into per-field storage. */
|
|
292
|
+
migrated: number;
|
|
293
|
+
/**
|
|
294
|
+
* Per-`(nodeKind, fieldPath)` counts, keyed `"<nodeKind>.<fieldPath>"`
|
|
295
|
+
* (the strategy's logical-slot key form). Empty when the legacy table was
|
|
296
|
+
* absent or held no rows for the requested scope.
|
|
297
|
+
*/
|
|
298
|
+
perField: Readonly<Record<string, number>>;
|
|
299
|
+
/**
|
|
300
|
+
* Rows skipped because their vector length didn't match the per-field
|
|
301
|
+
* table's fixed dimension. The legacy shared column allowed mixed
|
|
302
|
+
* dimensions for one `(nodeKind, fieldPath)` (e.g. an unmigrated model
|
|
303
|
+
* change); the first migrated row fixes the typed table's dimension and
|
|
304
|
+
* any differently-sized rows for that slot are skipped rather than aborting
|
|
305
|
+
* the whole migration. Keyed `"<nodeKind>.<fieldPath>"`. Non-empty here
|
|
306
|
+
* means those fields need a deliberate re-embed at a single dimension.
|
|
307
|
+
*/
|
|
308
|
+
skippedDimensionMismatch: Readonly<Record<string, number>>;
|
|
309
|
+
/**
|
|
310
|
+
* Rows skipped because their legacy embedding could not be decoded into a
|
|
311
|
+
* finite-number array — a corrupt value (e.g. a pgvector `vector` column
|
|
312
|
+
* permits `NaN`/`Infinity`, which is not valid JSON). Keyed
|
|
313
|
+
* `"<nodeKind>.<fieldPath>"`. Skipping + reporting keeps one bad row from
|
|
314
|
+
* aborting the whole migration; non-empty here means those rows need manual
|
|
315
|
+
* repair.
|
|
316
|
+
*/
|
|
317
|
+
skippedDecodeError: Readonly<Record<string, number>>;
|
|
318
|
+
/**
|
|
319
|
+
* Whether the legacy table existed. `false` means the run was a clean
|
|
320
|
+
* no-op (fresh install, or already-dropped table on a re-run).
|
|
321
|
+
*/
|
|
322
|
+
legacyTablePresent: boolean;
|
|
323
|
+
}>;
|
|
324
|
+
/**
|
|
325
|
+
* Re-inserts every embedding from the legacy shared
|
|
326
|
+
* `typegraph_node_embeddings` table into the active
|
|
327
|
+
* `backend.vectorStrategy`'s per-`(nodeKind, fieldPath)` storage.
|
|
328
|
+
*
|
|
329
|
+
* One-time, explicitly-run upgrade step for the shared-table → per-field
|
|
330
|
+
* cutover (#157). Idempotent, batched, and a clean no-op when the legacy
|
|
331
|
+
* table is absent. See the module doc comment for the full contract.
|
|
332
|
+
*
|
|
333
|
+
* @throws Error when the backend exposes no `vectorStrategy` /
|
|
334
|
+
* `upsertEmbedding` (nothing to migrate *into*) — a configuration
|
|
335
|
+
* error the caller must fix by wiring the destination strategy
|
|
336
|
+
* before migrating.
|
|
337
|
+
*/
|
|
338
|
+
declare function migrateLegacyEmbeddings(options: MigrateLegacyEmbeddingsOptions): Promise<MigrateLegacyEmbeddingsResult>;
|
|
339
|
+
|
|
235
340
|
/**
|
|
236
341
|
* Creates a subClassOf ontology relation.
|
|
237
342
|
*/
|
|
@@ -446,6 +551,31 @@ declare const core: {
|
|
|
446
551
|
readonly implies: typeof implies;
|
|
447
552
|
};
|
|
448
553
|
|
|
554
|
+
/**
|
|
555
|
+
* Transitive closure computation for ontology relationships.
|
|
556
|
+
*
|
|
557
|
+
* Uses Warshall's algorithm for efficient closure computation.
|
|
558
|
+
*/
|
|
559
|
+
/**
|
|
560
|
+
* Computes the transitive closure of a set of directed relations.
|
|
561
|
+
*
|
|
562
|
+
* Given relations like [A→B, B→C], computes all transitive paths [A→B, A→C, B→C].
|
|
563
|
+
*
|
|
564
|
+
* @param relations - Array of [from, to] pairs representing direct relationships
|
|
565
|
+
* @returns Map from each 'from' to the set of all reachable 'to' values
|
|
566
|
+
*/
|
|
567
|
+
declare function computeTransitiveClosure(relations: readonly (readonly [string, string])[]): ReadonlyMap<string, ReadonlySet<string>>;
|
|
568
|
+
/**
|
|
569
|
+
* Computes the inverse of a transitive closure map.
|
|
570
|
+
*
|
|
571
|
+
* Given A→{B, C}, returns B→{A}, C→{A}.
|
|
572
|
+
*/
|
|
573
|
+
declare function invertClosure(closure: ReadonlyMap<string, ReadonlySet<string>>): ReadonlyMap<string, ReadonlySet<string>>;
|
|
574
|
+
/**
|
|
575
|
+
* Checks if there's a path from source to target in the closure.
|
|
576
|
+
*/
|
|
577
|
+
declare function isReachable(closure: ReadonlyMap<string, ReadonlySet<string>>, source: string, target: string): boolean;
|
|
578
|
+
|
|
449
579
|
/**
|
|
450
580
|
* Recursive CTE Compilation
|
|
451
581
|
*
|
|
@@ -787,4 +917,4 @@ type IdConfig = Readonly<{
|
|
|
787
917
|
edgeIdGenerator: IdGenerator;
|
|
788
918
|
}>;
|
|
789
919
|
|
|
790
|
-
export { AliasMap, type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, FieldRef, type FlexibleQueryFragment, GraphDef, type IdConfig, type IdGenerator, InferenceType, KindAnnotations, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, MetaEdge, type MetaEdgeOptions, NodeType, OntologyRelation, QueryBuilder, type QueryFragment, type TraversalFragment, avg, broader, composeFragments, core, count, countDistinct, countDistinctEdges, countEdges, createExternalRef, createFragment, createQueryBuilder, defineEdge, defineNode, differentFrom, disjointWith, equivalentTo, externalRef, field, generateId, getExternalRefTable, hasPart, having, havingEq, havingGt, havingGte, havingLt, havingLte, implies, inverseOf, isExternalRefSchema, limitFragment, max, metaEdge, min, narrower, offsetFragment, orderByFragment, partOf, relatedTo, sameAs, subClassOf, sum };
|
|
920
|
+
export { AliasMap, type DefineEdgeOptions, type DefineNodeOptions, EdgeType, type ExternalRefSchema, type ExternalRefValue, FieldRef, type FlexibleQueryFragment, GraphBackend, GraphDef, type IdConfig, type IdGenerator, InferenceType, KindAnnotations, type LegacyEmbeddingSlotConfig, MAX_EXPLICIT_RECURSIVE_DEPTH, MAX_RECURSIVE_DEPTH, MetaEdge, type MetaEdgeOptions, type MigrateLegacyEmbeddingsOptions, type MigrateLegacyEmbeddingsResult, NodeType, OntologyRelation, QueryBuilder, type QueryFragment, type TraversalFragment, VectorStrategy, avg, broader, composeFragments, computeTransitiveClosure, core, count, countDistinct, countDistinctEdges, countEdges, createExternalRef, createFragment, createQueryBuilder, defineEdge, defineNode, differentFrom, disjointWith, equivalentTo, externalRef, field, generateId, getExternalRefTable, hasPart, having, havingEq, havingGt, havingGte, havingLt, havingLte, implies, inverseOf, invertClosure, isExternalRefSchema, isReachable, libsqlVectorStrategy, limitFragment, max, metaEdge, migrateLegacyEmbeddings, min, narrower, offsetFragment, orderByFragment, partOf, pgvectorStrategy, relatedTo, sameAs, sqliteVecStrategy, subClassOf, sum };
|