@ultipa-graph/ultipa-driver 5.0.0-s5.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/.DS_Store +0 -0
- package/dist/connection/connection.final.d.ts +45 -0
- package/dist/connection/connection.final.js +600 -0
- package/dist/connection/connection.final.js.map +1 -0
- package/dist/connection/connection.pool.d.ts +26 -0
- package/dist/connection/connection.pool.js +121 -0
- package/dist/connection/connection.pool.js.map +1 -0
- package/dist/connection/extra/algos/algo.extra.d.ts +34 -0
- package/dist/connection/extra/algos/algo.extra.js +81 -0
- package/dist/connection/extra/algos/algo.extra.js.map +1 -0
- package/dist/connection/extra/algos/algo.utils.d.ts +3 -0
- package/dist/connection/extra/algos/algo.utils.js +71 -0
- package/dist/connection/extra/algos/algo.utils.js.map +1 -0
- package/dist/connection/extra/algos/community.d.ts +27 -0
- package/dist/connection/extra/algos/community.js +129 -0
- package/dist/connection/extra/algos/community.js.map +1 -0
- package/dist/connection/extra/algos/degrees.d.ts +10 -0
- package/dist/connection/extra/algos/degrees.js +43 -0
- package/dist/connection/extra/algos/degrees.js.map +1 -0
- package/dist/connection/extra/algos/embedding.d.ts +13 -0
- package/dist/connection/extra/algos/embedding.js +58 -0
- package/dist/connection/extra/algos/embedding.js.map +1 -0
- package/dist/connection/extra/algos/index.d.ts +5 -0
- package/dist/connection/extra/algos/index.js +14 -0
- package/dist/connection/extra/algos/index.js.map +1 -0
- package/dist/connection/extra/base.extra.d.ts +71 -0
- package/dist/connection/extra/base.extra.js +183 -0
- package/dist/connection/extra/base.extra.js.map +1 -0
- package/dist/connection/extra/connection.base.d.ts +82 -0
- package/dist/connection/extra/connection.base.js +623 -0
- package/dist/connection/extra/connection.base.js.map +1 -0
- package/dist/connection/extra/connection.d.ts +16 -0
- package/dist/connection/extra/connection.js +46 -0
- package/dist/connection/extra/connection.js.map +1 -0
- package/dist/connection/extra/graph.extra.d.ts +85 -0
- package/dist/connection/extra/graph.extra.js +241 -0
- package/dist/connection/extra/graph.extra.js.map +1 -0
- package/dist/connection/extra/index.extra.d.ts +70 -0
- package/dist/connection/extra/index.extra.js +201 -0
- package/dist/connection/extra/index.extra.js.map +1 -0
- package/dist/connection/extra/job.extra.d.ts +32 -0
- package/dist/connection/extra/job.extra.js +145 -0
- package/dist/connection/extra/job.extra.js.map +1 -0
- package/dist/connection/extra/meta.extra.d.ts +91 -0
- package/dist/connection/extra/meta.extra.js +441 -0
- package/dist/connection/extra/meta.extra.js.map +1 -0
- package/dist/connection/extra/property.extra.d.ts +81 -0
- package/dist/connection/extra/property.extra.js +268 -0
- package/dist/connection/extra/property.extra.js.map +1 -0
- package/dist/connection/extra/schema.extra.d.ts +50 -0
- package/dist/connection/extra/schema.extra.js +248 -0
- package/dist/connection/extra/schema.extra.js.map +1 -0
- package/dist/connection/extra/search.extra.d.ts +12 -0
- package/dist/connection/extra/search.extra.js +126 -0
- package/dist/connection/extra/search.extra.js.map +1 -0
- package/dist/connection/extra/task.extra.d.ts +24 -0
- package/dist/connection/extra/task.extra.js +126 -0
- package/dist/connection/extra/task.extra.js.map +1 -0
- package/dist/connection/extra/user.privilege.extra.d.ts +64 -0
- package/dist/connection/extra/user.privilege.extra.js +348 -0
- package/dist/connection/extra/user.privilege.extra.js.map +1 -0
- package/dist/connection/index.d.ts +4 -0
- package/dist/connection/index.js +10 -0
- package/dist/connection/index.js.map +1 -0
- package/dist/connection/network.manager.d.ts +27 -0
- package/dist/connection/network.manager.js +178 -0
- package/dist/connection/network.manager.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/printers/alias.d.ts +2 -0
- package/dist/printers/alias.js +15 -0
- package/dist/printers/alias.js.map +1 -0
- package/dist/printers/any.d.ts +2 -0
- package/dist/printers/any.js +40 -0
- package/dist/printers/any.js.map +1 -0
- package/dist/printers/array.aio.d.ts +44 -0
- package/dist/printers/array.aio.js +240 -0
- package/dist/printers/array.aio.js.map +1 -0
- package/dist/printers/common.d.ts +0 -0
- package/dist/printers/common.js +1 -0
- package/dist/printers/common.js.map +1 -0
- package/dist/printers/edge.d.ts +5 -0
- package/dist/printers/edge.js +49 -0
- package/dist/printers/edge.js.map +1 -0
- package/dist/printers/explain.plan.d.ts +2 -0
- package/dist/printers/explain.plan.js +24 -0
- package/dist/printers/explain.plan.js.map +1 -0
- package/dist/printers/graph.d.ts +2 -0
- package/dist/printers/graph.js +34 -0
- package/dist/printers/graph.js.map +1 -0
- package/dist/printers/index.d.ts +25 -0
- package/dist/printers/index.js +44 -0
- package/dist/printers/index.js.map +1 -0
- package/dist/printers/node.d.ts +5 -0
- package/dist/printers/node.js +49 -0
- package/dist/printers/node.js.map +1 -0
- package/dist/printers/path.d.ts +3 -0
- package/dist/printers/path.js +42 -0
- package/dist/printers/path.js.map +1 -0
- package/dist/printers/status.d.ts +3 -0
- package/dist/printers/status.js +45 -0
- package/dist/printers/status.js.map +1 -0
- package/dist/printers/table.d.ts +2 -0
- package/dist/printers/table.js +31 -0
- package/dist/printers/table.js.map +1 -0
- package/dist/proto/tmp.js +366 -0
- package/dist/proto/ultipa_grpc_pb.d.ts +257 -0
- package/dist/proto/ultipa_grpc_pb.js +366 -0
- package/dist/proto/ultipa_grpc_pb.js.map +1 -0
- package/dist/proto/ultipa_pb.d.ts +1 -0
- package/dist/proto/ultipa_pb.js +11002 -0
- package/dist/proto/ultipa_pb.js.map +1 -0
- package/dist/transaction/UltipaSession.d.ts +28 -0
- package/dist/transaction/UltipaSession.js +148 -0
- package/dist/transaction/UltipaSession.js.map +1 -0
- package/dist/transaction/UltipaTransaction.Recorder.d.ts +20 -0
- package/dist/transaction/UltipaTransaction.Recorder.js +23 -0
- package/dist/transaction/UltipaTransaction.Recorder.js.map +1 -0
- package/dist/transaction/UltipaTransaction.d.ts +35 -0
- package/dist/transaction/UltipaTransaction.js +203 -0
- package/dist/transaction/UltipaTransaction.js.map +1 -0
- package/dist/transaction/UltipaTransactionSession.d.ts +15 -0
- package/dist/transaction/UltipaTransactionSession.js +46 -0
- package/dist/transaction/UltipaTransactionSession.js.map +1 -0
- package/dist/transaction/operations/Transaction.Deletes.d.ts +4 -0
- package/dist/transaction/operations/Transaction.Deletes.js +52 -0
- package/dist/transaction/operations/Transaction.Deletes.js.map +1 -0
- package/dist/transaction/operations/Transaction.Inserts.d.ts +4 -0
- package/dist/transaction/operations/Transaction.Inserts.js +78 -0
- package/dist/transaction/operations/Transaction.Inserts.js.map +1 -0
- package/dist/transaction/operations/Transaction.Update.d.ts +4 -0
- package/dist/transaction/operations/Transaction.Update.js +43 -0
- package/dist/transaction/operations/Transaction.Update.js.map +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.js +13 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/types.algos.params.d.ts +545 -0
- package/dist/types/types.algos.params.js +16 -0
- package/dist/types/types.algos.params.js.map +1 -0
- package/dist/types/types.d.ts +496 -0
- package/dist/types/types.extra.d.ts +788 -0
- package/dist/types/types.extra.js +49 -0
- package/dist/types/types.extra.js.map +1 -0
- package/dist/types/types.js +706 -0
- package/dist/types/types.js.map +1 -0
- package/dist/types/util.d.ts +15 -0
- package/dist/types/util.js +163 -0
- package/dist/types/util.js.map +1 -0
- package/dist/utils/common.d.ts +3 -0
- package/dist/utils/common.js +31 -0
- package/dist/utils/common.js.map +1 -0
- package/dist/utils/config.d.ts +3 -0
- package/dist/utils/config.js +7 -0
- package/dist/utils/config.js.map +1 -0
- package/dist/utils/format.d.ts +49 -0
- package/dist/utils/format.js +990 -0
- package/dist/utils/format.js.map +1 -0
- package/dist/utils/index.d.ts +12 -0
- package/dist/utils/index.js +34 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/params.validate.d.ts +4 -0
- package/dist/utils/params.validate.js +14 -0
- package/dist/utils/params.validate.js.map +1 -0
- package/dist/utils/property.d.ts +15 -0
- package/dist/utils/property.js +117 -0
- package/dist/utils/property.js.map +1 -0
- package/dist/utils/raft.retry.d.ts +0 -0
- package/dist/utils/raft.retry.js +1 -0
- package/dist/utils/raft.retry.js.map +1 -0
- package/dist/utils/serialize/commont.d.ts +12 -0
- package/dist/utils/serialize/commont.js +46 -0
- package/dist/utils/serialize/commont.js.map +1 -0
- package/dist/utils/serialize/deserialize.d.ts +9 -0
- package/dist/utils/serialize/deserialize.js +164 -0
- package/dist/utils/serialize/deserialize.js.map +1 -0
- package/dist/utils/serialize/null.d.ts +24 -0
- package/dist/utils/serialize/null.js +133 -0
- package/dist/utils/serialize/null.js.map +1 -0
- package/dist/utils/serialize/serialize.d.ts +10 -0
- package/dist/utils/serialize/serialize.js +135 -0
- package/dist/utils/serialize/serialize.js.map +1 -0
- package/dist/utils/stream.helper.d.ts +9 -0
- package/dist/utils/stream.helper.js +97 -0
- package/dist/utils/stream.helper.js.map +1 -0
- package/dist/utils/time.record.d.ts +15 -0
- package/dist/utils/time.record.js +50 -0
- package/dist/utils/time.record.js.map +1 -0
- package/dist/utils/timezone.d.ts +7 -0
- package/dist/utils/timezone.js +21 -0
- package/dist/utils/timezone.js.map +1 -0
- package/dist/utils/ultipa.datetime.d.ts +8 -0
- package/dist/utils/ultipa.datetime.js +120 -0
- package/dist/utils/ultipa.datetime.js.map +1 -0
- package/dist/utils/uql-maker.d.ts +164 -0
- package/dist/utils/uql-maker.js +400 -0
- package/dist/utils/uql-maker.js.map +1 -0
- package/dist/utils/uql.parse.d.ts +27 -0
- package/dist/utils/uql.parse.js +206 -0
- package/dist/utils/uql.parse.js.map +1 -0
- package/package.json +62 -0
- package/readme.md +63 -0
|
@@ -0,0 +1,496 @@
|
|
|
1
|
+
import { ResponseType } from '.';
|
|
2
|
+
export declare namespace ULTIPA {
|
|
3
|
+
/**
|
|
4
|
+
* Raft集群的类型
|
|
5
|
+
*/
|
|
6
|
+
enum ClientType {
|
|
7
|
+
Default = 0,
|
|
8
|
+
Algo = 1,
|
|
9
|
+
Update = 2,
|
|
10
|
+
Leader = 3
|
|
11
|
+
}
|
|
12
|
+
interface TimeZone {
|
|
13
|
+
timeZone?: string;
|
|
14
|
+
timeZoneOffset?: number;
|
|
15
|
+
timestampToString?: boolean;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* 连接的配置
|
|
19
|
+
*/
|
|
20
|
+
class UltipaConfig {
|
|
21
|
+
useHost?: string;
|
|
22
|
+
graphSetName?: string;
|
|
23
|
+
clusterId?: string;
|
|
24
|
+
timeZone?: string;
|
|
25
|
+
timeZoneOffset?: number;
|
|
26
|
+
timestampToString?: boolean;
|
|
27
|
+
logUql?: boolean;
|
|
28
|
+
timeout?: number;
|
|
29
|
+
threadNum?: number;
|
|
30
|
+
responseWithRequestInfo?: boolean;
|
|
31
|
+
consistency?: boolean;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* 属性类型
|
|
35
|
+
*/
|
|
36
|
+
enum PropertyType {
|
|
37
|
+
PROPERTY_UNSET,
|
|
38
|
+
PROPERTY_INT32,
|
|
39
|
+
PROPERTY_STRING,
|
|
40
|
+
PROPERTY_FLOAT,
|
|
41
|
+
PROPERTY_DOUBLE,
|
|
42
|
+
PROPERTY_UINT32,
|
|
43
|
+
PROPERTY_INT64,
|
|
44
|
+
PROPERTY_UINT64,
|
|
45
|
+
PROPERTY_DATETIME,
|
|
46
|
+
PROPERTY_TIMESTAMP,
|
|
47
|
+
PROPERTY_TEXT,
|
|
48
|
+
PROPERTY_BLOB,
|
|
49
|
+
PROPERTY_POINT,
|
|
50
|
+
PROPERTY_DECIMAL,
|
|
51
|
+
PROPERTY_LIST,
|
|
52
|
+
PROPERTY_SET,
|
|
53
|
+
PROPERTY_MAP,
|
|
54
|
+
PROPERTY_NULL,
|
|
55
|
+
PROPERTY_BOOL,
|
|
56
|
+
unset,
|
|
57
|
+
int32,
|
|
58
|
+
string,
|
|
59
|
+
float,
|
|
60
|
+
double,
|
|
61
|
+
uint32,
|
|
62
|
+
int64,
|
|
63
|
+
uint64,
|
|
64
|
+
datetime,
|
|
65
|
+
timestamp,
|
|
66
|
+
text,
|
|
67
|
+
blob,
|
|
68
|
+
point,
|
|
69
|
+
decimal,
|
|
70
|
+
list,
|
|
71
|
+
set,
|
|
72
|
+
map,
|
|
73
|
+
null,
|
|
74
|
+
bool
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* 返回状态码
|
|
78
|
+
*/
|
|
79
|
+
enum Code {
|
|
80
|
+
SUCCESS,
|
|
81
|
+
FAILED,
|
|
82
|
+
PARAM_ERROR,
|
|
83
|
+
BASE_DB_ERROR,
|
|
84
|
+
ENGINE_ERROR,
|
|
85
|
+
SYSTEM_ERROR,
|
|
86
|
+
SYNTAX_ERROR,
|
|
87
|
+
PERMISSION_DENIED,
|
|
88
|
+
DUPLICATE_ID,
|
|
89
|
+
RAFT_REDIRECT,
|
|
90
|
+
RAFT_LEADER_NOT_YET_ELECTED,
|
|
91
|
+
RAFT_LOG_ERROR,
|
|
92
|
+
NOT_RAFT_MODE,
|
|
93
|
+
RAFT_NO_AVAILABLE_FOLLOWERS,
|
|
94
|
+
RAFT_NO_AVAILABLE_ALGO_SERVERS,
|
|
95
|
+
UNKNOWN_ERROR = 1000
|
|
96
|
+
}
|
|
97
|
+
enum ResultType {
|
|
98
|
+
RESULT_TYPE_UNSET,
|
|
99
|
+
RESULT_TYPE_PATH,
|
|
100
|
+
RESULT_TYPE_NODE,
|
|
101
|
+
RESULT_TYPE_EDGE,
|
|
102
|
+
RESULT_TYPE_ATTR,
|
|
103
|
+
RESULT_TYPE_TABLE
|
|
104
|
+
}
|
|
105
|
+
enum AuthenticateType {
|
|
106
|
+
PERMISSION_TYPE_UNSET,
|
|
107
|
+
PERMISSION_TYPE_UQL,
|
|
108
|
+
PERMISSION_TYPE_GQL,
|
|
109
|
+
PERMISSION_TYPE_INSERTNODES,
|
|
110
|
+
PERMISSION_TYPE_INSERTEDGES,
|
|
111
|
+
PERMISSION_TYPE_EXPORT,
|
|
112
|
+
PERMISSION_TYPE_DOWNLOADFILE,
|
|
113
|
+
PERMISSION_TYPE_INSTALLALGO,
|
|
114
|
+
PERMISSION_TYPE_UNINSTALLALGO,
|
|
115
|
+
PERMISSION_TYPE_ROLLBACKALGO
|
|
116
|
+
}
|
|
117
|
+
enum InsertType {
|
|
118
|
+
INSERT_TYPE_NORMAL,
|
|
119
|
+
INSERT_TYPE_OVERWRITE,
|
|
120
|
+
INSERT_TYPE_UPSERT
|
|
121
|
+
}
|
|
122
|
+
/** 语言类型 */
|
|
123
|
+
enum QueryType {
|
|
124
|
+
QL_UNSET = 0,
|
|
125
|
+
UQL = 1,
|
|
126
|
+
GQL = 2
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* 数据库类型
|
|
130
|
+
*/
|
|
131
|
+
enum DBType {
|
|
132
|
+
/**
|
|
133
|
+
* 点
|
|
134
|
+
*/
|
|
135
|
+
DBNODE,
|
|
136
|
+
/**
|
|
137
|
+
* 边
|
|
138
|
+
*/
|
|
139
|
+
DBEDGE
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* 算法任务的状态
|
|
143
|
+
*/
|
|
144
|
+
enum JOB_STATUS {
|
|
145
|
+
JOB_PENDING,
|
|
146
|
+
JOB_COMPUTING,
|
|
147
|
+
JOB_WRITING,
|
|
148
|
+
JOB_DONE,
|
|
149
|
+
JOB_FAILED,
|
|
150
|
+
JOB_STOPPED
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* 连接返回的统一状态
|
|
154
|
+
*/
|
|
155
|
+
type Status = {
|
|
156
|
+
code: number;
|
|
157
|
+
code_desc?: string;
|
|
158
|
+
message: string;
|
|
159
|
+
};
|
|
160
|
+
type ResultAlias = {
|
|
161
|
+
alias: string;
|
|
162
|
+
result_type: ResultType;
|
|
163
|
+
};
|
|
164
|
+
type ResultAliases = ResultAlias[];
|
|
165
|
+
interface Job {
|
|
166
|
+
id: string;
|
|
167
|
+
graph: string;
|
|
168
|
+
type: string;
|
|
169
|
+
uql?: string;
|
|
170
|
+
gql?: string;
|
|
171
|
+
status: string;
|
|
172
|
+
error: string;
|
|
173
|
+
result: string;
|
|
174
|
+
startTime: string;
|
|
175
|
+
endTime: string;
|
|
176
|
+
progress: string;
|
|
177
|
+
}
|
|
178
|
+
interface Process {
|
|
179
|
+
id: string;
|
|
180
|
+
uql: string;
|
|
181
|
+
gql: string;
|
|
182
|
+
duration: number;
|
|
183
|
+
status: string;
|
|
184
|
+
}
|
|
185
|
+
interface Projection {
|
|
186
|
+
project_name: string;
|
|
187
|
+
project_type: string;
|
|
188
|
+
filter_type: string;
|
|
189
|
+
is_default: string;
|
|
190
|
+
graph_name: string;
|
|
191
|
+
status: string;
|
|
192
|
+
stats: string;
|
|
193
|
+
hdc_server_name: string;
|
|
194
|
+
hdc_server_status: string;
|
|
195
|
+
config: string;
|
|
196
|
+
}
|
|
197
|
+
/**
|
|
198
|
+
* 点的结构
|
|
199
|
+
*/
|
|
200
|
+
class Node {
|
|
201
|
+
_id: string;
|
|
202
|
+
_uuid: string;
|
|
203
|
+
schema: string;
|
|
204
|
+
values: Map<string, any>;
|
|
205
|
+
getID(): string;
|
|
206
|
+
getUUID(): string;
|
|
207
|
+
getSchema(): string;
|
|
208
|
+
getValues(): Map<string, any>;
|
|
209
|
+
get(prop_name: string): any;
|
|
210
|
+
set(prop_name: string, value: any): void;
|
|
211
|
+
}
|
|
212
|
+
type NodeTable = Node[];
|
|
213
|
+
/**
|
|
214
|
+
* 一组点
|
|
215
|
+
*/
|
|
216
|
+
type NodeAlias = {
|
|
217
|
+
nodes: NodeTable;
|
|
218
|
+
alias: string;
|
|
219
|
+
};
|
|
220
|
+
/**
|
|
221
|
+
* 边的结构
|
|
222
|
+
*/
|
|
223
|
+
class Edge {
|
|
224
|
+
_uuid: string;
|
|
225
|
+
_from: string;
|
|
226
|
+
_to: string;
|
|
227
|
+
schema: string;
|
|
228
|
+
values: Map<string, any>;
|
|
229
|
+
getUUID(): string;
|
|
230
|
+
getSchema(): string;
|
|
231
|
+
getFrom(): string;
|
|
232
|
+
getTo(): string;
|
|
233
|
+
getValues(): Map<string, any>;
|
|
234
|
+
get(prop_name: string): any;
|
|
235
|
+
set(prop_name: string, value: any): void;
|
|
236
|
+
}
|
|
237
|
+
type EdgeTable = Edge[];
|
|
238
|
+
/**
|
|
239
|
+
* 一组边
|
|
240
|
+
*/
|
|
241
|
+
type EdgeAlias = {
|
|
242
|
+
edges: EdgeTable;
|
|
243
|
+
alias: string;
|
|
244
|
+
};
|
|
245
|
+
/**
|
|
246
|
+
* 路径的结构
|
|
247
|
+
*/
|
|
248
|
+
class Path {
|
|
249
|
+
nodeUUIDs: string[];
|
|
250
|
+
edgeUUIDs: string[];
|
|
251
|
+
getNodes(): string[];
|
|
252
|
+
getEdges(): string[];
|
|
253
|
+
}
|
|
254
|
+
type Paths = Path[];
|
|
255
|
+
class Graph {
|
|
256
|
+
paths?: Path[];
|
|
257
|
+
nodes: Map<string, Node>;
|
|
258
|
+
edges: Map<string, Edge>;
|
|
259
|
+
getPaths(): Path[];
|
|
260
|
+
getNodes(): Map<string, Node>;
|
|
261
|
+
getEdges(): Map<string, Edge>;
|
|
262
|
+
}
|
|
263
|
+
type PathAlias = {
|
|
264
|
+
alias: string;
|
|
265
|
+
paths: Paths;
|
|
266
|
+
};
|
|
267
|
+
type GraphAlias = {
|
|
268
|
+
alias: string;
|
|
269
|
+
graph: Graph;
|
|
270
|
+
};
|
|
271
|
+
type Header = {
|
|
272
|
+
name: string;
|
|
273
|
+
type: PropertyType;
|
|
274
|
+
subTypes: PropertyType[];
|
|
275
|
+
};
|
|
276
|
+
type GraphSet = {
|
|
277
|
+
id?: number | string;
|
|
278
|
+
name: string;
|
|
279
|
+
description?: string | "";
|
|
280
|
+
shards?: string[] | [];
|
|
281
|
+
partitionBy?: string | "";
|
|
282
|
+
/** */
|
|
283
|
+
status?: string;
|
|
284
|
+
totalNodes?: number;
|
|
285
|
+
totalEdges?: number;
|
|
286
|
+
};
|
|
287
|
+
type Schema = {
|
|
288
|
+
name: string;
|
|
289
|
+
description?: string;
|
|
290
|
+
dbType: DBType;
|
|
291
|
+
total?: number;
|
|
292
|
+
properties?: Property[];
|
|
293
|
+
};
|
|
294
|
+
type Property = {
|
|
295
|
+
name: string;
|
|
296
|
+
description?: string;
|
|
297
|
+
schema: string;
|
|
298
|
+
type: PropertyType;
|
|
299
|
+
subTypes?: PropertyType[];
|
|
300
|
+
};
|
|
301
|
+
type Replica = {
|
|
302
|
+
addr: string;
|
|
303
|
+
status: string;
|
|
304
|
+
streamAddr: string;
|
|
305
|
+
lastHearBeat: string;
|
|
306
|
+
};
|
|
307
|
+
type Statistics = {
|
|
308
|
+
totalCost: number;
|
|
309
|
+
engineCost: number;
|
|
310
|
+
nodeAffected?: number;
|
|
311
|
+
edgeAffected?: number;
|
|
312
|
+
};
|
|
313
|
+
class License {
|
|
314
|
+
LicenseINFO: any;
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* 表格的结构
|
|
318
|
+
*/
|
|
319
|
+
class Table {
|
|
320
|
+
name: string;
|
|
321
|
+
alias: string;
|
|
322
|
+
headers: string[];
|
|
323
|
+
rows: any[][];
|
|
324
|
+
toKV(): any[];
|
|
325
|
+
getHeaders(): string[];
|
|
326
|
+
getRows(): any[][];
|
|
327
|
+
}
|
|
328
|
+
type AttrAlias = {
|
|
329
|
+
values: any[];
|
|
330
|
+
type: ResultType;
|
|
331
|
+
type_desc: string;
|
|
332
|
+
alias: string;
|
|
333
|
+
};
|
|
334
|
+
type AttrNodesAlias = {
|
|
335
|
+
values: Node[][];
|
|
336
|
+
type: ResultType;
|
|
337
|
+
type_desc: string;
|
|
338
|
+
alias: string;
|
|
339
|
+
};
|
|
340
|
+
type AttrEdgesAlias = {
|
|
341
|
+
values: Edge[][];
|
|
342
|
+
type: ResultType;
|
|
343
|
+
type_desc: string;
|
|
344
|
+
alias: string;
|
|
345
|
+
};
|
|
346
|
+
type AttrPathsAlias = {
|
|
347
|
+
values: Path[][];
|
|
348
|
+
type: ResultType;
|
|
349
|
+
type_desc: string;
|
|
350
|
+
alias: string;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* 一组属性
|
|
354
|
+
*/
|
|
355
|
+
type AttrNewAlias = {
|
|
356
|
+
attr: Attr;
|
|
357
|
+
alias: string;
|
|
358
|
+
};
|
|
359
|
+
type Attr = {
|
|
360
|
+
type: PropertyType;
|
|
361
|
+
type_desc: string;
|
|
362
|
+
values: any[];
|
|
363
|
+
has_attr_data: boolean;
|
|
364
|
+
has_ultipa_data: boolean;
|
|
365
|
+
};
|
|
366
|
+
type AttrListData = {
|
|
367
|
+
type: ResultType;
|
|
368
|
+
type_desc: string;
|
|
369
|
+
nodes?: NodeTable;
|
|
370
|
+
edges?: EdgeTable;
|
|
371
|
+
paths?: Path[];
|
|
372
|
+
attrs?: Attr[];
|
|
373
|
+
};
|
|
374
|
+
type AttrMapData = {
|
|
375
|
+
key: Attr;
|
|
376
|
+
value: Attr;
|
|
377
|
+
};
|
|
378
|
+
type ListData = {
|
|
379
|
+
values: any[];
|
|
380
|
+
};
|
|
381
|
+
type SetData = ListData;
|
|
382
|
+
type MapValue = {
|
|
383
|
+
key: any;
|
|
384
|
+
value: any;
|
|
385
|
+
};
|
|
386
|
+
type MapData = {
|
|
387
|
+
values: MapData[];
|
|
388
|
+
};
|
|
389
|
+
type ExplainPlan = {
|
|
390
|
+
plan_nodes: PlanNode[];
|
|
391
|
+
};
|
|
392
|
+
type PlanNode = {
|
|
393
|
+
alias: string;
|
|
394
|
+
children_num: number;
|
|
395
|
+
children?: PlanNode[] | null;
|
|
396
|
+
query_text: string;
|
|
397
|
+
infos: string;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* uql统一返回结构体的data
|
|
401
|
+
*/
|
|
402
|
+
type QueryReplyBase = {
|
|
403
|
+
total_time_cost: number;
|
|
404
|
+
engine_time_cost: number;
|
|
405
|
+
results?: ResultAlias[];
|
|
406
|
+
paths?: PathAlias[];
|
|
407
|
+
nodes?: NodeAlias[];
|
|
408
|
+
edges?: EdgeAlias[];
|
|
409
|
+
graph?: GraphAlias[];
|
|
410
|
+
attrs?: AttrAlias[];
|
|
411
|
+
tables?: Table[];
|
|
412
|
+
statistics: Statistics;
|
|
413
|
+
explainPlans?: ExplainPlan;
|
|
414
|
+
explainPlansTreeTopNode?: PlanNode;
|
|
415
|
+
};
|
|
416
|
+
function getExplainPlansTreeTopNode(plans: ExplainPlan): PlanNode;
|
|
417
|
+
class QueryReply {
|
|
418
|
+
aliasMap: {
|
|
419
|
+
[x: string]: DataItem;
|
|
420
|
+
};
|
|
421
|
+
datas: DataItem[];
|
|
422
|
+
statistics: Statistics;
|
|
423
|
+
explainPlansTreeTopNode: PlanNode;
|
|
424
|
+
constructor(queryReplyBase: QueryReplyBase);
|
|
425
|
+
private defaultValueFromType;
|
|
426
|
+
___aliasMapFromDatas(): void;
|
|
427
|
+
isEmpty(): boolean;
|
|
428
|
+
singleDataNodes(): Node[];
|
|
429
|
+
singleDataEdges(): Edge[];
|
|
430
|
+
singleDataPaths(): any;
|
|
431
|
+
getTables(): Table[];
|
|
432
|
+
singleDataTables(): Table;
|
|
433
|
+
singleDataAttrs(): AttrAlias;
|
|
434
|
+
get(index: number): DataItem;
|
|
435
|
+
alias(alias: string): DataItem;
|
|
436
|
+
toJSON(): {
|
|
437
|
+
statistics: Statistics;
|
|
438
|
+
explainPlansTreeTopNode: PlanNode;
|
|
439
|
+
datas: DataItem[];
|
|
440
|
+
};
|
|
441
|
+
}
|
|
442
|
+
class DataItem {
|
|
443
|
+
data: any;
|
|
444
|
+
type: ResultType;
|
|
445
|
+
type_desc: string;
|
|
446
|
+
alias: string;
|
|
447
|
+
constructor(alias: string, data: any, type: ResultType);
|
|
448
|
+
private _asTypeError;
|
|
449
|
+
asEdges(): EdgeTable;
|
|
450
|
+
asPaths(): Paths;
|
|
451
|
+
asGraph(): Graph[];
|
|
452
|
+
asNodes(): NodeTable;
|
|
453
|
+
asTable(): Table;
|
|
454
|
+
asAttrs(): AttrAlias;
|
|
455
|
+
asNodeList(): AttrNodesAlias;
|
|
456
|
+
asEdgeList(): AttrEdgesAlias;
|
|
457
|
+
asPathList(): AttrPathsAlias;
|
|
458
|
+
asGraphs(): ResponseType.GraphSet[];
|
|
459
|
+
asProperties(): ResponseType.Property[];
|
|
460
|
+
asSchemas(): ResponseType.Schema[];
|
|
461
|
+
asAlgos(): ResponseType.Algo[];
|
|
462
|
+
asExtas(): ResponseType.Exta[];
|
|
463
|
+
asTasks(): ResponseType.Task[];
|
|
464
|
+
asAny(): any;
|
|
465
|
+
asTableWithT<T>(): T[];
|
|
466
|
+
toJSONString(): string;
|
|
467
|
+
}
|
|
468
|
+
/**
|
|
469
|
+
* 所有请求的统一返回结构体
|
|
470
|
+
*/
|
|
471
|
+
class Response<T> {
|
|
472
|
+
req?: any;
|
|
473
|
+
status: Status;
|
|
474
|
+
data?: T;
|
|
475
|
+
statistics?: Statistics;
|
|
476
|
+
explainPlans?: ExplainPlan;
|
|
477
|
+
}
|
|
478
|
+
/**
|
|
479
|
+
* uql请求的返回结构体
|
|
480
|
+
*/
|
|
481
|
+
class QueryResponse extends Response<ULTIPA.QueryReply> {
|
|
482
|
+
}
|
|
483
|
+
function NewQueryResponse(jsonObj: any): QueryResponse;
|
|
484
|
+
class QueryBaseResponse extends Response<ULTIPA.QueryReplyBase> {
|
|
485
|
+
}
|
|
486
|
+
function NewUQLBaseResponse(jsonObj: any): QueryBaseResponse;
|
|
487
|
+
function formatBaseResponse(base: QueryBaseResponse): any;
|
|
488
|
+
class UQLSingleResponse {
|
|
489
|
+
responseWithoutData: Response<null>;
|
|
490
|
+
QueryReply: QueryReply;
|
|
491
|
+
}
|
|
492
|
+
class TruncateType {
|
|
493
|
+
node: string;
|
|
494
|
+
edge: string;
|
|
495
|
+
}
|
|
496
|
+
}
|