@wiscale/tauri-plugin-velesdb 1.5.1 → 1.7.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.d.mts CHANGED
@@ -508,5 +508,112 @@ declare function isEmpty(name: string): Promise<boolean>;
508
508
  * ```
509
509
  */
510
510
  declare function flush(name: string): Promise<void>;
511
+ /** Request to add an edge to a graph collection. */
512
+ interface AddEdgeRequest {
513
+ collection: string;
514
+ id: number;
515
+ source: number;
516
+ target: number;
517
+ label: string;
518
+ properties?: Record<string, unknown>;
519
+ }
520
+ /** Request to retrieve edges from a graph collection. */
521
+ interface GetEdgesRequest {
522
+ collection: string;
523
+ label?: string;
524
+ source?: number;
525
+ target?: number;
526
+ }
527
+ /** Request to traverse the knowledge graph. */
528
+ interface TraverseGraphRequest {
529
+ collection: string;
530
+ source: number;
531
+ maxDepth: number;
532
+ relTypes?: string[];
533
+ limit: number;
534
+ algorithm: 'bfs' | 'dfs';
535
+ }
536
+ /** Request to get the degree of a node. */
537
+ interface GetNodeDegreeRequest {
538
+ collection: string;
539
+ nodeId: number;
540
+ }
541
+ /** A single edge in the knowledge graph. */
542
+ interface EdgeOutput {
543
+ id: number;
544
+ source: number;
545
+ target: number;
546
+ label: string;
547
+ properties: Record<string, unknown>;
548
+ }
549
+ /** A single traversal result node. */
550
+ interface TraversalOutput {
551
+ targetId: number;
552
+ depth: number;
553
+ path: number[];
554
+ }
555
+ /** In/out degree of a graph node. */
556
+ interface NodeDegreeOutput {
557
+ nodeId: number;
558
+ inDegree: number;
559
+ outDegree: number;
560
+ }
561
+ /**
562
+ * Adds an edge to a knowledge graph collection.
563
+ *
564
+ * @param request - Edge to add (collection, id, source, target, label, optional properties)
565
+ * @throws {CommandError} If the collection doesn't exist
566
+ *
567
+ * @example
568
+ * ```typescript
569
+ * await addEdge({
570
+ * collection: 'social', id: 1, source: 100, target: 200,
571
+ * label: 'FOLLOWS', properties: { since: '2024-01-01' }
572
+ * });
573
+ * ```
574
+ */
575
+ declare function addEdge(request: AddEdgeRequest): Promise<void>;
576
+ /**
577
+ * Retrieves edges from a knowledge graph collection.
578
+ *
579
+ * @param request - Filter (by label, source, or target node)
580
+ * @returns Array of matching edges
581
+ * @throws {CommandError} If the collection doesn't exist
582
+ *
583
+ * @example
584
+ * ```typescript
585
+ * const edges = await getEdges({ collection: 'social', label: 'FOLLOWS' });
586
+ * ```
587
+ */
588
+ declare function getEdges(request: GetEdgesRequest): Promise<EdgeOutput[]>;
589
+ /**
590
+ * Traverses the knowledge graph from a source node.
591
+ *
592
+ * @param request - Traversal parameters (source, maxDepth, algorithm, optional relTypes filter)
593
+ * @returns Array of reachable nodes with their depth and path
594
+ * @throws {CommandError} If the collection doesn't exist
595
+ *
596
+ * @example
597
+ * ```typescript
598
+ * const result = await traverseGraph({
599
+ * collection: 'social', source: 100, algorithm: 'bfs', maxDepth: 3, limit: 50
600
+ * });
601
+ * ```
602
+ */
603
+ declare function traverseGraph(request: TraverseGraphRequest): Promise<TraversalOutput[]>;
604
+ /**
605
+ * Gets the in-degree and out-degree of a graph node.
606
+ *
607
+ * @param request - Collection name and node ID
608
+ * @returns Node degree information (inDegree, outDegree)
609
+ * @throws {CommandError} If the collection doesn't exist
610
+ *
611
+ * @example
612
+ * ```typescript
613
+ * const degree = await getNodeDegree({ collection: 'social', nodeId: 100 });
614
+ * console.log(`In: ${degree.inDegree}, Out: ${degree.outDegree}`);
615
+ * ```
616
+ */
617
+ declare function getNodeDegree(request: GetNodeDegreeRequest): Promise<NodeDegreeOutput>;
511
618
 
512
- export { type BatchSearchRequest, type CollectionInfo, type CommandError, type CreateCollectionRequest, type CreateMetadataCollectionRequest, type DeletePointsRequest, type DistanceMetric, type FusionParams, type FusionStrategy, type GetPointsRequest, type HybridSearchRequest, type IndividualSearchRequest, type MetadataPointInput, type MultiQuerySearchRequest, type PointInput, type PointOutput, type QueryRequest, type SearchRequest, type SearchResponse, type SearchResult, type TextSearchRequest, type UpsertMetadataRequest, type UpsertRequest, batchSearch, createCollection, createMetadataCollection, deleteCollection, deletePoints, flush, getCollection, getPoints, hybridSearch, isEmpty, listCollections, multiQuerySearch, query, search, textSearch, upsert, upsertMetadata };
619
+ export { type AddEdgeRequest, type BatchSearchRequest, type CollectionInfo, type CommandError, type CreateCollectionRequest, type CreateMetadataCollectionRequest, type DeletePointsRequest, type DistanceMetric, type EdgeOutput, type FusionParams, type FusionStrategy, type GetEdgesRequest, type GetNodeDegreeRequest, type GetPointsRequest, type HybridSearchRequest, type IndividualSearchRequest, type MetadataPointInput, type MultiQuerySearchRequest, type NodeDegreeOutput, type PointInput, type PointOutput, type QueryRequest, type SearchRequest, type SearchResponse, type SearchResult, type TextSearchRequest, type TraversalOutput, type TraverseGraphRequest, type UpsertMetadataRequest, type UpsertRequest, addEdge, batchSearch, createCollection, createMetadataCollection, deleteCollection, deletePoints, flush, getCollection, getEdges, getNodeDegree, getPoints, hybridSearch, isEmpty, listCollections, multiQuerySearch, query, search, textSearch, traverseGraph, upsert, upsertMetadata };
package/dist/index.d.ts CHANGED
@@ -508,5 +508,112 @@ declare function isEmpty(name: string): Promise<boolean>;
508
508
  * ```
509
509
  */
510
510
  declare function flush(name: string): Promise<void>;
511
+ /** Request to add an edge to a graph collection. */
512
+ interface AddEdgeRequest {
513
+ collection: string;
514
+ id: number;
515
+ source: number;
516
+ target: number;
517
+ label: string;
518
+ properties?: Record<string, unknown>;
519
+ }
520
+ /** Request to retrieve edges from a graph collection. */
521
+ interface GetEdgesRequest {
522
+ collection: string;
523
+ label?: string;
524
+ source?: number;
525
+ target?: number;
526
+ }
527
+ /** Request to traverse the knowledge graph. */
528
+ interface TraverseGraphRequest {
529
+ collection: string;
530
+ source: number;
531
+ maxDepth: number;
532
+ relTypes?: string[];
533
+ limit: number;
534
+ algorithm: 'bfs' | 'dfs';
535
+ }
536
+ /** Request to get the degree of a node. */
537
+ interface GetNodeDegreeRequest {
538
+ collection: string;
539
+ nodeId: number;
540
+ }
541
+ /** A single edge in the knowledge graph. */
542
+ interface EdgeOutput {
543
+ id: number;
544
+ source: number;
545
+ target: number;
546
+ label: string;
547
+ properties: Record<string, unknown>;
548
+ }
549
+ /** A single traversal result node. */
550
+ interface TraversalOutput {
551
+ targetId: number;
552
+ depth: number;
553
+ path: number[];
554
+ }
555
+ /** In/out degree of a graph node. */
556
+ interface NodeDegreeOutput {
557
+ nodeId: number;
558
+ inDegree: number;
559
+ outDegree: number;
560
+ }
561
+ /**
562
+ * Adds an edge to a knowledge graph collection.
563
+ *
564
+ * @param request - Edge to add (collection, id, source, target, label, optional properties)
565
+ * @throws {CommandError} If the collection doesn't exist
566
+ *
567
+ * @example
568
+ * ```typescript
569
+ * await addEdge({
570
+ * collection: 'social', id: 1, source: 100, target: 200,
571
+ * label: 'FOLLOWS', properties: { since: '2024-01-01' }
572
+ * });
573
+ * ```
574
+ */
575
+ declare function addEdge(request: AddEdgeRequest): Promise<void>;
576
+ /**
577
+ * Retrieves edges from a knowledge graph collection.
578
+ *
579
+ * @param request - Filter (by label, source, or target node)
580
+ * @returns Array of matching edges
581
+ * @throws {CommandError} If the collection doesn't exist
582
+ *
583
+ * @example
584
+ * ```typescript
585
+ * const edges = await getEdges({ collection: 'social', label: 'FOLLOWS' });
586
+ * ```
587
+ */
588
+ declare function getEdges(request: GetEdgesRequest): Promise<EdgeOutput[]>;
589
+ /**
590
+ * Traverses the knowledge graph from a source node.
591
+ *
592
+ * @param request - Traversal parameters (source, maxDepth, algorithm, optional relTypes filter)
593
+ * @returns Array of reachable nodes with their depth and path
594
+ * @throws {CommandError} If the collection doesn't exist
595
+ *
596
+ * @example
597
+ * ```typescript
598
+ * const result = await traverseGraph({
599
+ * collection: 'social', source: 100, algorithm: 'bfs', maxDepth: 3, limit: 50
600
+ * });
601
+ * ```
602
+ */
603
+ declare function traverseGraph(request: TraverseGraphRequest): Promise<TraversalOutput[]>;
604
+ /**
605
+ * Gets the in-degree and out-degree of a graph node.
606
+ *
607
+ * @param request - Collection name and node ID
608
+ * @returns Node degree information (inDegree, outDegree)
609
+ * @throws {CommandError} If the collection doesn't exist
610
+ *
611
+ * @example
612
+ * ```typescript
613
+ * const degree = await getNodeDegree({ collection: 'social', nodeId: 100 });
614
+ * console.log(`In: ${degree.inDegree}, Out: ${degree.outDegree}`);
615
+ * ```
616
+ */
617
+ declare function getNodeDegree(request: GetNodeDegreeRequest): Promise<NodeDegreeOutput>;
511
618
 
512
- export { type BatchSearchRequest, type CollectionInfo, type CommandError, type CreateCollectionRequest, type CreateMetadataCollectionRequest, type DeletePointsRequest, type DistanceMetric, type FusionParams, type FusionStrategy, type GetPointsRequest, type HybridSearchRequest, type IndividualSearchRequest, type MetadataPointInput, type MultiQuerySearchRequest, type PointInput, type PointOutput, type QueryRequest, type SearchRequest, type SearchResponse, type SearchResult, type TextSearchRequest, type UpsertMetadataRequest, type UpsertRequest, batchSearch, createCollection, createMetadataCollection, deleteCollection, deletePoints, flush, getCollection, getPoints, hybridSearch, isEmpty, listCollections, multiQuerySearch, query, search, textSearch, upsert, upsertMetadata };
619
+ export { type AddEdgeRequest, type BatchSearchRequest, type CollectionInfo, type CommandError, type CreateCollectionRequest, type CreateMetadataCollectionRequest, type DeletePointsRequest, type DistanceMetric, type EdgeOutput, type FusionParams, type FusionStrategy, type GetEdgesRequest, type GetNodeDegreeRequest, type GetPointsRequest, type HybridSearchRequest, type IndividualSearchRequest, type MetadataPointInput, type MultiQuerySearchRequest, type NodeDegreeOutput, type PointInput, type PointOutput, type QueryRequest, type SearchRequest, type SearchResponse, type SearchResult, type TextSearchRequest, type TraversalOutput, type TraverseGraphRequest, type UpsertMetadataRequest, type UpsertRequest, addEdge, batchSearch, createCollection, createMetadataCollection, deleteCollection, deletePoints, flush, getCollection, getEdges, getNodeDegree, getPoints, hybridSearch, isEmpty, listCollections, multiQuerySearch, query, search, textSearch, traverseGraph, upsert, upsertMetadata };
package/dist/index.js CHANGED
@@ -20,6 +20,7 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
20
20
  // index.ts
21
21
  var index_exports = {};
22
22
  __export(index_exports, {
23
+ addEdge: () => addEdge,
23
24
  batchSearch: () => batchSearch,
24
25
  createCollection: () => createCollection,
25
26
  createMetadataCollection: () => createMetadataCollection,
@@ -27,6 +28,8 @@ __export(index_exports, {
27
28
  deletePoints: () => deletePoints,
28
29
  flush: () => flush,
29
30
  getCollection: () => getCollection,
31
+ getEdges: () => getEdges,
32
+ getNodeDegree: () => getNodeDegree,
30
33
  getPoints: () => getPoints,
31
34
  hybridSearch: () => hybridSearch,
32
35
  isEmpty: () => isEmpty,
@@ -35,6 +38,7 @@ __export(index_exports, {
35
38
  query: () => query,
36
39
  search: () => search,
37
40
  textSearch: () => textSearch,
41
+ traverseGraph: () => traverseGraph,
38
42
  upsert: () => upsert,
39
43
  upsertMetadata: () => upsertMetadata
40
44
  });
@@ -91,8 +95,21 @@ async function isEmpty(name) {
91
95
  async function flush(name) {
92
96
  return (0, import_core.invoke)("plugin:velesdb|flush", { name });
93
97
  }
98
+ async function addEdge(request) {
99
+ return (0, import_core.invoke)("plugin:velesdb|add_edge", { request });
100
+ }
101
+ async function getEdges(request) {
102
+ return (0, import_core.invoke)("plugin:velesdb|get_edges", { request });
103
+ }
104
+ async function traverseGraph(request) {
105
+ return (0, import_core.invoke)("plugin:velesdb|traverse_graph", { request });
106
+ }
107
+ async function getNodeDegree(request) {
108
+ return (0, import_core.invoke)("plugin:velesdb|get_node_degree", { request });
109
+ }
94
110
  // Annotate the CommonJS export names for ESM import in node:
95
111
  0 && (module.exports = {
112
+ addEdge,
96
113
  batchSearch,
97
114
  createCollection,
98
115
  createMetadataCollection,
@@ -100,6 +117,8 @@ async function flush(name) {
100
117
  deletePoints,
101
118
  flush,
102
119
  getCollection,
120
+ getEdges,
121
+ getNodeDegree,
103
122
  getPoints,
104
123
  hybridSearch,
105
124
  isEmpty,
@@ -108,6 +127,7 @@ async function flush(name) {
108
127
  query,
109
128
  search,
110
129
  textSearch,
130
+ traverseGraph,
111
131
  upsert,
112
132
  upsertMetadata
113
133
  });
package/dist/index.mjs CHANGED
@@ -51,7 +51,20 @@ async function isEmpty(name) {
51
51
  async function flush(name) {
52
52
  return invoke("plugin:velesdb|flush", { name });
53
53
  }
54
+ async function addEdge(request) {
55
+ return invoke("plugin:velesdb|add_edge", { request });
56
+ }
57
+ async function getEdges(request) {
58
+ return invoke("plugin:velesdb|get_edges", { request });
59
+ }
60
+ async function traverseGraph(request) {
61
+ return invoke("plugin:velesdb|traverse_graph", { request });
62
+ }
63
+ async function getNodeDegree(request) {
64
+ return invoke("plugin:velesdb|get_node_degree", { request });
65
+ }
54
66
  export {
67
+ addEdge,
55
68
  batchSearch,
56
69
  createCollection,
57
70
  createMetadataCollection,
@@ -59,6 +72,8 @@ export {
59
72
  deletePoints,
60
73
  flush,
61
74
  getCollection,
75
+ getEdges,
76
+ getNodeDegree,
62
77
  getPoints,
63
78
  hybridSearch,
64
79
  isEmpty,
@@ -67,6 +82,7 @@ export {
67
82
  query,
68
83
  search,
69
84
  textSearch,
85
+ traverseGraph,
70
86
  upsert,
71
87
  upsertMetadata
72
88
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@wiscale/tauri-plugin-velesdb",
3
- "version": "1.5.1",
3
+ "version": "1.7.0",
4
4
  "description": "TypeScript bindings for the VelesDB Tauri plugin - Vector search in desktop apps",
5
5
  "main": "dist/index.js",
6
6
  "module": "dist/index.mjs",
@@ -33,7 +33,7 @@
33
33
  "desktop"
34
34
  ],
35
35
  "author": "Cyberlife Coder",
36
- "license": "Elastic-2.0",
36
+ "license": "MIT",
37
37
  "repository": {
38
38
  "type": "git",
39
39
  "url": "https://github.com/cyberlife-coder/VelesDB.git",