@ductape/sdk 0.0.4-v46 → 0.0.4-v49
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/README.md +1 -1
- package/dist/api/services/appApi.service.js +1 -1
- package/dist/api/services/appApi.service.js.map +1 -1
- package/dist/api/services/productsApi.service.d.ts +1 -0
- package/dist/api/services/productsApi.service.js +30 -2
- package/dist/api/services/productsApi.service.js.map +1 -1
- package/dist/api/services/workspaceSecretsApi.service.d.ts +75 -0
- package/dist/api/services/workspaceSecretsApi.service.js +62 -0
- package/dist/api/services/workspaceSecretsApi.service.js.map +1 -0
- package/dist/api/utils/cache.utils.js +10 -4
- package/dist/api/utils/cache.utils.js.map +1 -1
- package/dist/apps/services/app.service.js +5 -1
- package/dist/apps/services/app.service.js.map +1 -1
- package/dist/database/adapters/base.adapter.d.ts +8 -8
- package/dist/database/adapters/base.adapter.js.map +1 -1
- package/dist/database/adapters/dynamodb.adapter.d.ts +7 -7
- package/dist/database/adapters/dynamodb.adapter.js +174 -35
- package/dist/database/adapters/dynamodb.adapter.js.map +1 -1
- package/dist/database/adapters/mongodb.adapter.d.ts +7 -7
- package/dist/database/adapters/mongodb.adapter.js +263 -73
- package/dist/database/adapters/mongodb.adapter.js.map +1 -1
- package/dist/database/adapters/mysql.adapter.d.ts +7 -7
- package/dist/database/adapters/mysql.adapter.js +117 -42
- package/dist/database/adapters/mysql.adapter.js.map +1 -1
- package/dist/database/adapters/postgresql.adapter.d.ts +7 -7
- package/dist/database/adapters/postgresql.adapter.js +194 -63
- package/dist/database/adapters/postgresql.adapter.js.map +1 -1
- package/dist/database/database.service.d.ts +38 -1
- package/dist/database/database.service.js +307 -7
- package/dist/database/database.service.js.map +1 -1
- package/dist/database/types/aggregation.types.d.ts +73 -14
- package/dist/database/types/database.types.d.ts +2 -1
- package/dist/database/types/database.types.js +2 -1
- package/dist/database/types/database.types.js.map +1 -1
- package/dist/database/types/result.types.d.ts +2 -0
- package/dist/database/utils/transaction.js +2 -2
- package/dist/database/utils/transaction.js.map +1 -1
- package/dist/graph/adapters/arangodb.adapter.d.ts +80 -0
- package/dist/graph/adapters/arangodb.adapter.js +1393 -0
- package/dist/graph/adapters/arangodb.adapter.js.map +1 -0
- package/dist/graph/adapters/base.adapter.d.ts +228 -0
- package/dist/graph/adapters/base.adapter.js +38 -0
- package/dist/graph/adapters/base.adapter.js.map +1 -0
- package/dist/graph/adapters/index.d.ts +10 -0
- package/dist/graph/adapters/index.js +23 -0
- package/dist/graph/adapters/index.js.map +1 -0
- package/dist/graph/adapters/memgraph.adapter.d.ts +85 -0
- package/dist/graph/adapters/memgraph.adapter.js +1491 -0
- package/dist/graph/adapters/memgraph.adapter.js.map +1 -0
- package/dist/graph/adapters/neo4j.adapter.d.ts +88 -0
- package/dist/graph/adapters/neo4j.adapter.js +1861 -0
- package/dist/graph/adapters/neo4j.adapter.js.map +1 -0
- package/dist/graph/adapters/neptune.adapter.d.ts +87 -0
- package/dist/graph/adapters/neptune.adapter.js +1430 -0
- package/dist/graph/adapters/neptune.adapter.js.map +1 -0
- package/dist/graph/graph.service.d.ts +278 -0
- package/dist/graph/graph.service.js +687 -0
- package/dist/graph/graph.service.js.map +1 -0
- package/dist/graph/index.d.ts +11 -0
- package/dist/graph/index.js +42 -0
- package/dist/graph/index.js.map +1 -0
- package/dist/graph/types/connection.types.d.ts +158 -0
- package/dist/graph/types/connection.types.js +43 -0
- package/dist/graph/types/connection.types.js.map +1 -0
- package/dist/graph/types/graph.types.d.ts +144 -0
- package/dist/graph/types/graph.types.js +84 -0
- package/dist/graph/types/graph.types.js.map +1 -0
- package/dist/graph/types/index.d.ts +11 -0
- package/dist/graph/types/index.js +35 -0
- package/dist/graph/types/index.js.map +1 -0
- package/dist/graph/types/node.types.d.ts +193 -0
- package/dist/graph/types/node.types.js +49 -0
- package/dist/graph/types/node.types.js.map +1 -0
- package/dist/graph/types/path.types.d.ts +224 -0
- package/dist/graph/types/path.types.js +38 -0
- package/dist/graph/types/path.types.js.map +1 -0
- package/dist/graph/types/query.types.d.ts +247 -0
- package/dist/graph/types/query.types.js +23 -0
- package/dist/graph/types/query.types.js.map +1 -0
- package/dist/graph/types/relationship.types.d.ts +224 -0
- package/dist/graph/types/relationship.types.js +35 -0
- package/dist/graph/types/relationship.types.js.map +1 -0
- package/dist/graph/types/result.types.d.ts +237 -0
- package/dist/graph/types/result.types.js +7 -0
- package/dist/graph/types/result.types.js.map +1 -0
- package/dist/graph/validators/index.d.ts +81 -0
- package/dist/graph/validators/index.js +243 -0
- package/dist/graph/validators/index.js.map +1 -0
- package/dist/index.d.ts +132 -1
- package/dist/index.js +207 -0
- package/dist/index.js.map +1 -1
- package/dist/logs/logs.types.d.ts +1 -0
- package/dist/logs/logs.types.js +1 -0
- package/dist/logs/logs.types.js.map +1 -1
- package/dist/processor/services/processor.service.js.map +1 -1
- package/dist/products/services/products.service.d.ts +17 -1
- package/dist/products/services/products.service.js +240 -41
- package/dist/products/services/products.service.js.map +1 -1
- package/dist/products/validators/index.d.ts +3 -1
- package/dist/products/validators/index.js +5 -1
- package/dist/products/validators/index.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.d.ts +15 -4
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js +501 -109
- package/dist/products/validators/joi-validators/create.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/create.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js +82 -0
- package/dist/products/validators/joi-validators/create.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.d.ts +14 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js +696 -0
- package/dist/products/validators/joi-validators/create.productGraphAction.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.d.ts +6 -0
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js +28 -26
- package/dist/products/validators/joi-validators/update.productDatabaseAction.validator.js.map +1 -1
- package/dist/products/validators/joi-validators/update.productGraph.validator.d.ts +3 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js +87 -0
- package/dist/products/validators/joi-validators/update.productGraph.validator.js.map +1 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.d.ts +7 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js +72 -0
- package/dist/products/validators/joi-validators/update.productGraphAction.validator.js.map +1 -0
- package/dist/types/enums.d.ts +2 -1
- package/dist/types/enums.js +1 -0
- package/dist/types/enums.js.map +1 -1
- package/dist/types/productsBuilder.types.d.ts +80 -6
- package/dist/types/productsBuilder.types.js +61 -4
- package/dist/types/productsBuilder.types.js.map +1 -1
- package/package.json +5 -1
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Node Types
|
|
3
|
+
* Defines interfaces for graph nodes (vertices)
|
|
4
|
+
*/
|
|
5
|
+
/**
|
|
6
|
+
* Property value types supported in graph nodes
|
|
7
|
+
*/
|
|
8
|
+
export type NodePropertyValue = string | number | boolean | Date | string[] | number[] | boolean[] | null | Record<string, any>;
|
|
9
|
+
/**
|
|
10
|
+
* Node properties type
|
|
11
|
+
*/
|
|
12
|
+
export type NodeProperties = Record<string, NodePropertyValue>;
|
|
13
|
+
/**
|
|
14
|
+
* Represents a node (vertex) in the graph
|
|
15
|
+
*/
|
|
16
|
+
export interface INode<T extends NodeProperties = NodeProperties> {
|
|
17
|
+
id: string | number;
|
|
18
|
+
labels: string[];
|
|
19
|
+
properties: T;
|
|
20
|
+
elementId?: string;
|
|
21
|
+
metadata?: INodeMetadata;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Node metadata
|
|
25
|
+
*/
|
|
26
|
+
export interface INodeMetadata {
|
|
27
|
+
createdAt?: Date;
|
|
28
|
+
updatedAt?: Date;
|
|
29
|
+
version?: number;
|
|
30
|
+
source?: string;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Options for creating a node
|
|
34
|
+
*/
|
|
35
|
+
export interface ICreateNodeOptions<T extends NodeProperties = NodeProperties> {
|
|
36
|
+
labels: string | string[];
|
|
37
|
+
properties: T;
|
|
38
|
+
returnNode?: boolean;
|
|
39
|
+
onConflict?: 'error' | 'ignore' | 'merge';
|
|
40
|
+
uniqueConstraint?: {
|
|
41
|
+
property: string;
|
|
42
|
+
value: NodePropertyValue;
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Options for finding nodes
|
|
47
|
+
*/
|
|
48
|
+
export interface IFindNodesOptions {
|
|
49
|
+
labels?: string | string[];
|
|
50
|
+
where?: INodeWhereClause;
|
|
51
|
+
properties?: Partial<NodeProperties>;
|
|
52
|
+
orderBy?: INodeOrderBy[];
|
|
53
|
+
skip?: number;
|
|
54
|
+
limit?: number;
|
|
55
|
+
returnProperties?: string[];
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Node where clause for filtering
|
|
59
|
+
*/
|
|
60
|
+
export interface INodeWhereClause {
|
|
61
|
+
property: string;
|
|
62
|
+
operator: NodeComparisonOperator;
|
|
63
|
+
value: NodePropertyValue;
|
|
64
|
+
and?: INodeWhereClause[];
|
|
65
|
+
or?: INodeWhereClause[];
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Comparison operators for node queries
|
|
69
|
+
*/
|
|
70
|
+
export declare enum NodeComparisonOperator {
|
|
71
|
+
EQUALS = "=",
|
|
72
|
+
NOT_EQUALS = "<>",
|
|
73
|
+
GREATER_THAN = ">",
|
|
74
|
+
GREATER_THAN_OR_EQUAL = ">=",
|
|
75
|
+
LESS_THAN = "<",
|
|
76
|
+
LESS_THAN_OR_EQUAL = "<=",
|
|
77
|
+
IN = "IN",
|
|
78
|
+
NOT_IN = "NOT IN",
|
|
79
|
+
CONTAINS = "CONTAINS",
|
|
80
|
+
STARTS_WITH = "STARTS WITH",
|
|
81
|
+
ENDS_WITH = "ENDS WITH",
|
|
82
|
+
IS_NULL = "IS NULL",
|
|
83
|
+
IS_NOT_NULL = "IS NOT NULL",
|
|
84
|
+
REGEX = "=~"
|
|
85
|
+
}
|
|
86
|
+
/**
|
|
87
|
+
* Order by clause for node queries
|
|
88
|
+
*/
|
|
89
|
+
export interface INodeOrderBy {
|
|
90
|
+
property: string;
|
|
91
|
+
direction: 'ASC' | 'DESC';
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Options for updating a node
|
|
95
|
+
*/
|
|
96
|
+
export interface IUpdateNodeOptions {
|
|
97
|
+
id?: string | number;
|
|
98
|
+
labels?: string | string[];
|
|
99
|
+
where?: INodeWhereClause;
|
|
100
|
+
set?: Partial<NodeProperties>;
|
|
101
|
+
remove?: string[];
|
|
102
|
+
addLabels?: string[];
|
|
103
|
+
removeLabels?: string[];
|
|
104
|
+
returnNode?: boolean;
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Options for deleting nodes
|
|
108
|
+
*/
|
|
109
|
+
export interface IDeleteNodeOptions {
|
|
110
|
+
id?: string | number;
|
|
111
|
+
labels?: string | string[];
|
|
112
|
+
where?: INodeWhereClause;
|
|
113
|
+
detach?: boolean;
|
|
114
|
+
returnCount?: boolean;
|
|
115
|
+
}
|
|
116
|
+
/**
|
|
117
|
+
* Options for merging nodes (MERGE in Cypher)
|
|
118
|
+
*/
|
|
119
|
+
export interface IMergeNodeOptions<T extends NodeProperties = NodeProperties> {
|
|
120
|
+
labels: string | string[];
|
|
121
|
+
matchProperties: Partial<T>;
|
|
122
|
+
onCreate?: Partial<T>;
|
|
123
|
+
onMatch?: Partial<T>;
|
|
124
|
+
returnNode?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* Node label definition for schema
|
|
128
|
+
*/
|
|
129
|
+
export interface INodeLabelDefinition {
|
|
130
|
+
name: string;
|
|
131
|
+
properties?: INodePropertyDefinition[];
|
|
132
|
+
constraints?: INodeConstraint[];
|
|
133
|
+
indexes?: INodeIndex[];
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Node property definition for schema
|
|
137
|
+
*/
|
|
138
|
+
export interface INodePropertyDefinition {
|
|
139
|
+
name: string;
|
|
140
|
+
type: 'string' | 'integer' | 'float' | 'boolean' | 'date' | 'datetime' | 'point' | 'list' | 'map';
|
|
141
|
+
required?: boolean;
|
|
142
|
+
unique?: boolean;
|
|
143
|
+
indexed?: boolean;
|
|
144
|
+
defaultValue?: NodePropertyValue;
|
|
145
|
+
}
|
|
146
|
+
/**
|
|
147
|
+
* Node constraint types
|
|
148
|
+
*/
|
|
149
|
+
export declare enum NodeConstraintType {
|
|
150
|
+
UNIQUE = "UNIQUE",
|
|
151
|
+
EXISTS = "EXISTS",// Property must exist
|
|
152
|
+
NODE_KEY = "NODE_KEY"
|
|
153
|
+
}
|
|
154
|
+
/**
|
|
155
|
+
* Node constraint definition
|
|
156
|
+
*/
|
|
157
|
+
export interface INodeConstraint {
|
|
158
|
+
name: string;
|
|
159
|
+
type: NodeConstraintType;
|
|
160
|
+
properties: string[];
|
|
161
|
+
label: string;
|
|
162
|
+
}
|
|
163
|
+
/**
|
|
164
|
+
* Node index types
|
|
165
|
+
*/
|
|
166
|
+
export declare enum NodeIndexType {
|
|
167
|
+
BTREE = "BTREE",
|
|
168
|
+
FULLTEXT = "FULLTEXT",
|
|
169
|
+
POINT = "POINT",// Spatial index
|
|
170
|
+
RANGE = "RANGE",
|
|
171
|
+
TEXT = "TEXT",
|
|
172
|
+
VECTOR = "VECTOR"
|
|
173
|
+
}
|
|
174
|
+
/**
|
|
175
|
+
* Node index definition
|
|
176
|
+
*/
|
|
177
|
+
export interface INodeIndex {
|
|
178
|
+
name: string;
|
|
179
|
+
type: NodeIndexType;
|
|
180
|
+
properties: string[];
|
|
181
|
+
label: string;
|
|
182
|
+
options?: Record<string, any>;
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Batch node operation
|
|
186
|
+
*/
|
|
187
|
+
export interface IBatchNodeOperation<T extends NodeProperties = NodeProperties> {
|
|
188
|
+
operation: 'create' | 'update' | 'delete' | 'merge';
|
|
189
|
+
labels?: string | string[];
|
|
190
|
+
properties?: T;
|
|
191
|
+
where?: INodeWhereClause;
|
|
192
|
+
id?: string | number;
|
|
193
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Node Types
|
|
4
|
+
* Defines interfaces for graph nodes (vertices)
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.NodeIndexType = exports.NodeConstraintType = exports.NodeComparisonOperator = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Comparison operators for node queries
|
|
10
|
+
*/
|
|
11
|
+
var NodeComparisonOperator;
|
|
12
|
+
(function (NodeComparisonOperator) {
|
|
13
|
+
NodeComparisonOperator["EQUALS"] = "=";
|
|
14
|
+
NodeComparisonOperator["NOT_EQUALS"] = "<>";
|
|
15
|
+
NodeComparisonOperator["GREATER_THAN"] = ">";
|
|
16
|
+
NodeComparisonOperator["GREATER_THAN_OR_EQUAL"] = ">=";
|
|
17
|
+
NodeComparisonOperator["LESS_THAN"] = "<";
|
|
18
|
+
NodeComparisonOperator["LESS_THAN_OR_EQUAL"] = "<=";
|
|
19
|
+
NodeComparisonOperator["IN"] = "IN";
|
|
20
|
+
NodeComparisonOperator["NOT_IN"] = "NOT IN";
|
|
21
|
+
NodeComparisonOperator["CONTAINS"] = "CONTAINS";
|
|
22
|
+
NodeComparisonOperator["STARTS_WITH"] = "STARTS WITH";
|
|
23
|
+
NodeComparisonOperator["ENDS_WITH"] = "ENDS WITH";
|
|
24
|
+
NodeComparisonOperator["IS_NULL"] = "IS NULL";
|
|
25
|
+
NodeComparisonOperator["IS_NOT_NULL"] = "IS NOT NULL";
|
|
26
|
+
NodeComparisonOperator["REGEX"] = "=~";
|
|
27
|
+
})(NodeComparisonOperator || (exports.NodeComparisonOperator = NodeComparisonOperator = {}));
|
|
28
|
+
/**
|
|
29
|
+
* Node constraint types
|
|
30
|
+
*/
|
|
31
|
+
var NodeConstraintType;
|
|
32
|
+
(function (NodeConstraintType) {
|
|
33
|
+
NodeConstraintType["UNIQUE"] = "UNIQUE";
|
|
34
|
+
NodeConstraintType["EXISTS"] = "EXISTS";
|
|
35
|
+
NodeConstraintType["NODE_KEY"] = "NODE_KEY";
|
|
36
|
+
})(NodeConstraintType || (exports.NodeConstraintType = NodeConstraintType = {}));
|
|
37
|
+
/**
|
|
38
|
+
* Node index types
|
|
39
|
+
*/
|
|
40
|
+
var NodeIndexType;
|
|
41
|
+
(function (NodeIndexType) {
|
|
42
|
+
NodeIndexType["BTREE"] = "BTREE";
|
|
43
|
+
NodeIndexType["FULLTEXT"] = "FULLTEXT";
|
|
44
|
+
NodeIndexType["POINT"] = "POINT";
|
|
45
|
+
NodeIndexType["RANGE"] = "RANGE";
|
|
46
|
+
NodeIndexType["TEXT"] = "TEXT";
|
|
47
|
+
NodeIndexType["VECTOR"] = "VECTOR";
|
|
48
|
+
})(NodeIndexType || (exports.NodeIndexType = NodeIndexType = {}));
|
|
49
|
+
//# sourceMappingURL=node.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.types.js","sourceRoot":"","sources":["../../../src/graph/types/node.types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAgFH;;GAEG;AACH,IAAY,sBAeX;AAfD,WAAY,sBAAsB;IAChC,sCAAY,CAAA;IACZ,2CAAiB,CAAA;IACjB,4CAAkB,CAAA;IAClB,sDAA4B,CAAA;IAC5B,yCAAe,CAAA;IACf,mDAAyB,CAAA;IACzB,mCAAS,CAAA;IACT,2CAAiB,CAAA;IACjB,+CAAqB,CAAA;IACrB,qDAA2B,CAAA;IAC3B,iDAAuB,CAAA;IACvB,6CAAmB,CAAA;IACnB,qDAA2B,CAAA;IAC3B,sCAAY,CAAA;AACd,CAAC,EAfW,sBAAsB,sCAAtB,sBAAsB,QAejC;AAoED;;GAEG;AACH,IAAY,kBAIX;AAJD,WAAY,kBAAkB;IAC5B,uCAAiB,CAAA;IACjB,uCAAiB,CAAA;IACjB,2CAAqB,CAAA;AACvB,CAAC,EAJW,kBAAkB,kCAAlB,kBAAkB,QAI7B;AAYD;;GAEG;AACH,IAAY,aAOX;AAPD,WAAY,aAAa;IACvB,gCAAe,CAAA;IACf,sCAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,8BAAa,CAAA;IACb,kCAAiB,CAAA;AACnB,CAAC,EAPW,aAAa,6BAAb,aAAa,QAOxB"}
|
|
@@ -0,0 +1,224 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Path and Traversal Types
|
|
3
|
+
* Defines interfaces for graph paths, traversals, and pattern matching
|
|
4
|
+
*/
|
|
5
|
+
import { INode, NodeProperties, INodeWhereClause } from './node.types';
|
|
6
|
+
import { IRelationship, RelationshipProperties, RelationshipDirection, IRelationshipPattern, IRelationshipWhereClause } from './relationship.types';
|
|
7
|
+
/**
|
|
8
|
+
* Represents a path in the graph
|
|
9
|
+
*/
|
|
10
|
+
export interface IPath<N extends NodeProperties = NodeProperties, R extends RelationshipProperties = RelationshipProperties> {
|
|
11
|
+
nodes: INode<N>[];
|
|
12
|
+
relationships: IRelationship<R>[];
|
|
13
|
+
length: number;
|
|
14
|
+
start: INode<N>;
|
|
15
|
+
end: INode<N>;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* Weighted path with cost information
|
|
19
|
+
*/
|
|
20
|
+
export interface IWeightedPath<N extends NodeProperties = NodeProperties, R extends RelationshipProperties = RelationshipProperties> extends IPath<N, R> {
|
|
21
|
+
totalWeight: number;
|
|
22
|
+
weights: number[];
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Options for traversing the graph
|
|
26
|
+
*/
|
|
27
|
+
export interface ITraverseOptions {
|
|
28
|
+
startNode: INodeSelector;
|
|
29
|
+
relationships?: IRelationshipPattern | IRelationshipPattern[];
|
|
30
|
+
direction?: RelationshipDirection;
|
|
31
|
+
minDepth?: number;
|
|
32
|
+
maxDepth?: number;
|
|
33
|
+
uniqueness?: TraversalUniqueness;
|
|
34
|
+
orderBy?: TraversalOrder;
|
|
35
|
+
limit?: number;
|
|
36
|
+
filters?: ITraversalFilter;
|
|
37
|
+
returnPaths?: boolean;
|
|
38
|
+
returnNodes?: boolean;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Node selector for traversal start point
|
|
42
|
+
*/
|
|
43
|
+
export interface INodeSelector {
|
|
44
|
+
id?: string | number;
|
|
45
|
+
labels?: string | string[];
|
|
46
|
+
properties?: Partial<NodeProperties>;
|
|
47
|
+
where?: INodeWhereClause;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Traversal uniqueness constraints
|
|
51
|
+
*/
|
|
52
|
+
export declare enum TraversalUniqueness {
|
|
53
|
+
NONE = "NONE",// No restrictions
|
|
54
|
+
NODE_GLOBAL = "NODE_GLOBAL",// Each node visited once globally
|
|
55
|
+
NODE_PATH = "NODE_PATH",// Each node visited once per path
|
|
56
|
+
RELATIONSHIP_GLOBAL = "RELATIONSHIP_GLOBAL",// Each relationship traversed once globally
|
|
57
|
+
RELATIONSHIP_PATH = "RELATIONSHIP_PATH",// Each relationship traversed once per path
|
|
58
|
+
NODE_RECENT = "NODE_RECENT"
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Traversal ordering
|
|
62
|
+
*/
|
|
63
|
+
export declare enum TraversalOrder {
|
|
64
|
+
BREADTH_FIRST = "BREADTH_FIRST",
|
|
65
|
+
DEPTH_FIRST = "DEPTH_FIRST"
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Traversal filter options
|
|
69
|
+
*/
|
|
70
|
+
export interface ITraversalFilter {
|
|
71
|
+
nodeLabels?: string[];
|
|
72
|
+
nodeWhere?: INodeWhereClause;
|
|
73
|
+
relationshipTypes?: string[];
|
|
74
|
+
relationshipWhere?: IRelationshipWhereClause;
|
|
75
|
+
stopAtLabels?: string[];
|
|
76
|
+
stopAtDepth?: number;
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* Options for finding shortest path
|
|
80
|
+
*/
|
|
81
|
+
export interface IShortestPathOptions {
|
|
82
|
+
startNode: INodeSelector;
|
|
83
|
+
endNode: INodeSelector;
|
|
84
|
+
relationships?: IRelationshipPattern | IRelationshipPattern[];
|
|
85
|
+
direction?: RelationshipDirection;
|
|
86
|
+
maxDepth?: number;
|
|
87
|
+
weightProperty?: string;
|
|
88
|
+
defaultWeight?: number;
|
|
89
|
+
algorithm?: PathAlgorithm;
|
|
90
|
+
returnAllShortest?: boolean;
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* Supported pathfinding algorithms
|
|
94
|
+
*/
|
|
95
|
+
export declare enum PathAlgorithm {
|
|
96
|
+
DIJKSTRA = "DIJKSTRA",
|
|
97
|
+
ASTAR = "ASTAR",
|
|
98
|
+
BFS = "BFS",
|
|
99
|
+
ALHOP = "ALHOP"
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Options for finding all paths
|
|
103
|
+
*/
|
|
104
|
+
export interface IAllPathsOptions {
|
|
105
|
+
startNode: INodeSelector;
|
|
106
|
+
endNode: INodeSelector;
|
|
107
|
+
relationships?: IRelationshipPattern | IRelationshipPattern[];
|
|
108
|
+
direction?: RelationshipDirection;
|
|
109
|
+
minDepth?: number;
|
|
110
|
+
maxDepth?: number;
|
|
111
|
+
limit?: number;
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Graph pattern for pattern matching
|
|
115
|
+
*/
|
|
116
|
+
export interface IGraphPattern {
|
|
117
|
+
nodes: INodePattern[];
|
|
118
|
+
relationships: IRelationshipPatternDef[];
|
|
119
|
+
where?: IPatternWhereClause;
|
|
120
|
+
optional?: boolean;
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Node pattern in graph pattern matching
|
|
124
|
+
*/
|
|
125
|
+
export interface INodePattern {
|
|
126
|
+
variable: string;
|
|
127
|
+
labels?: string | string[];
|
|
128
|
+
properties?: Partial<NodeProperties>;
|
|
129
|
+
where?: INodeWhereClause;
|
|
130
|
+
}
|
|
131
|
+
/**
|
|
132
|
+
* Relationship pattern in graph pattern matching
|
|
133
|
+
*/
|
|
134
|
+
export interface IRelationshipPatternDef {
|
|
135
|
+
variable?: string;
|
|
136
|
+
type?: string | string[];
|
|
137
|
+
startNode: string;
|
|
138
|
+
endNode: string;
|
|
139
|
+
direction?: RelationshipDirection;
|
|
140
|
+
properties?: Partial<RelationshipProperties>;
|
|
141
|
+
where?: IRelationshipWhereClause;
|
|
142
|
+
minHops?: number;
|
|
143
|
+
maxHops?: number;
|
|
144
|
+
}
|
|
145
|
+
/**
|
|
146
|
+
* Where clause for pattern matching
|
|
147
|
+
*/
|
|
148
|
+
export interface IPatternWhereClause {
|
|
149
|
+
conditions: IPatternCondition[];
|
|
150
|
+
operator?: 'AND' | 'OR';
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Individual pattern condition
|
|
154
|
+
*/
|
|
155
|
+
export interface IPatternCondition {
|
|
156
|
+
expression: string;
|
|
157
|
+
params?: Record<string, any>;
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Options for pattern matching
|
|
161
|
+
*/
|
|
162
|
+
export interface IMatchPatternOptions {
|
|
163
|
+
pattern: IGraphPattern;
|
|
164
|
+
return?: string[];
|
|
165
|
+
orderBy?: IPatternOrderBy[];
|
|
166
|
+
skip?: number;
|
|
167
|
+
limit?: number;
|
|
168
|
+
optional?: boolean;
|
|
169
|
+
}
|
|
170
|
+
/**
|
|
171
|
+
* Order by for pattern results
|
|
172
|
+
*/
|
|
173
|
+
export interface IPatternOrderBy {
|
|
174
|
+
expression: string;
|
|
175
|
+
direction: 'ASC' | 'DESC';
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Subgraph extraction options
|
|
179
|
+
*/
|
|
180
|
+
export interface ISubgraphOptions {
|
|
181
|
+
startNodes: INodeSelector | INodeSelector[];
|
|
182
|
+
maxDepth?: number;
|
|
183
|
+
relationships?: IRelationshipPattern | IRelationshipPattern[];
|
|
184
|
+
direction?: RelationshipDirection;
|
|
185
|
+
includeStartNodes?: boolean;
|
|
186
|
+
nodeFilter?: INodeWhereClause;
|
|
187
|
+
relationshipFilter?: IRelationshipWhereClause;
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Represents an extracted subgraph
|
|
191
|
+
*/
|
|
192
|
+
export interface ISubgraph<N extends NodeProperties = NodeProperties, R extends RelationshipProperties = RelationshipProperties> {
|
|
193
|
+
nodes: INode<N>[];
|
|
194
|
+
relationships: IRelationship<R>[];
|
|
195
|
+
nodeCount: number;
|
|
196
|
+
relationshipCount: number;
|
|
197
|
+
}
|
|
198
|
+
/**
|
|
199
|
+
* Neighborhood options
|
|
200
|
+
*/
|
|
201
|
+
export interface INeighborhoodOptions {
|
|
202
|
+
node: INodeSelector;
|
|
203
|
+
depth?: number;
|
|
204
|
+
direction?: RelationshipDirection;
|
|
205
|
+
relationshipTypes?: string[];
|
|
206
|
+
includeCenter?: boolean;
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Connected components options
|
|
210
|
+
*/
|
|
211
|
+
export interface IConnectedComponentsOptions {
|
|
212
|
+
labels?: string[];
|
|
213
|
+
relationshipTypes?: string[];
|
|
214
|
+
direction?: RelationshipDirection;
|
|
215
|
+
minSize?: number;
|
|
216
|
+
}
|
|
217
|
+
/**
|
|
218
|
+
* Represents a connected component
|
|
219
|
+
*/
|
|
220
|
+
export interface IConnectedComponent<N extends NodeProperties = NodeProperties> {
|
|
221
|
+
id: number;
|
|
222
|
+
nodes: INode<N>[];
|
|
223
|
+
size: number;
|
|
224
|
+
}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Path and Traversal Types
|
|
4
|
+
* Defines interfaces for graph paths, traversals, and pattern matching
|
|
5
|
+
*/
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.PathAlgorithm = exports.TraversalOrder = exports.TraversalUniqueness = void 0;
|
|
8
|
+
/**
|
|
9
|
+
* Traversal uniqueness constraints
|
|
10
|
+
*/
|
|
11
|
+
var TraversalUniqueness;
|
|
12
|
+
(function (TraversalUniqueness) {
|
|
13
|
+
TraversalUniqueness["NONE"] = "NONE";
|
|
14
|
+
TraversalUniqueness["NODE_GLOBAL"] = "NODE_GLOBAL";
|
|
15
|
+
TraversalUniqueness["NODE_PATH"] = "NODE_PATH";
|
|
16
|
+
TraversalUniqueness["RELATIONSHIP_GLOBAL"] = "RELATIONSHIP_GLOBAL";
|
|
17
|
+
TraversalUniqueness["RELATIONSHIP_PATH"] = "RELATIONSHIP_PATH";
|
|
18
|
+
TraversalUniqueness["NODE_RECENT"] = "NODE_RECENT";
|
|
19
|
+
})(TraversalUniqueness || (exports.TraversalUniqueness = TraversalUniqueness = {}));
|
|
20
|
+
/**
|
|
21
|
+
* Traversal ordering
|
|
22
|
+
*/
|
|
23
|
+
var TraversalOrder;
|
|
24
|
+
(function (TraversalOrder) {
|
|
25
|
+
TraversalOrder["BREADTH_FIRST"] = "BREADTH_FIRST";
|
|
26
|
+
TraversalOrder["DEPTH_FIRST"] = "DEPTH_FIRST";
|
|
27
|
+
})(TraversalOrder || (exports.TraversalOrder = TraversalOrder = {}));
|
|
28
|
+
/**
|
|
29
|
+
* Supported pathfinding algorithms
|
|
30
|
+
*/
|
|
31
|
+
var PathAlgorithm;
|
|
32
|
+
(function (PathAlgorithm) {
|
|
33
|
+
PathAlgorithm["DIJKSTRA"] = "DIJKSTRA";
|
|
34
|
+
PathAlgorithm["ASTAR"] = "ASTAR";
|
|
35
|
+
PathAlgorithm["BFS"] = "BFS";
|
|
36
|
+
PathAlgorithm["ALHOP"] = "ALHOP";
|
|
37
|
+
})(PathAlgorithm || (exports.PathAlgorithm = PathAlgorithm = {}));
|
|
38
|
+
//# sourceMappingURL=path.types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"path.types.js","sourceRoot":"","sources":["../../../src/graph/types/path.types.ts"],"names":[],"mappings":";AAAA;;;GAGG;;;AAyDH;;GAEG;AACH,IAAY,mBAOX;AAPD,WAAY,mBAAmB;IAC7B,oCAAa,CAAA;IACb,kDAA2B,CAAA;IAC3B,8CAAuB,CAAA;IACvB,kEAA2C,CAAA;IAC3C,8DAAuC,CAAA;IACvC,kDAA2B,CAAA;AAC7B,CAAC,EAPW,mBAAmB,mCAAnB,mBAAmB,QAO9B;AAED;;GAEG;AACH,IAAY,cAGX;AAHD,WAAY,cAAc;IACxB,iDAA+B,CAAA;IAC/B,6CAA2B,CAAA;AAC7B,CAAC,EAHW,cAAc,8BAAd,cAAc,QAGzB;AA6BD;;GAEG;AACH,IAAY,aAKX;AALD,WAAY,aAAa;IACvB,sCAAqB,CAAA;IACrB,gCAAe,CAAA;IACf,4BAAW,CAAA;IACX,gCAAe,CAAA;AACjB,CAAC,EALW,aAAa,6BAAb,aAAa,QAKxB"}
|