@ultipa-graph/ultipa-driver 5.1.4-s5.1 → 6.0.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.
Files changed (215) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +65 -0
  3. package/dist/client.d.ts +194 -0
  4. package/dist/client.js +390 -0
  5. package/dist/config.d.ts +65 -0
  6. package/dist/config.js +135 -0
  7. package/dist/connection.d.ts +30 -0
  8. package/dist/connection.js +190 -0
  9. package/dist/errors.d.ts +99 -0
  10. package/dist/errors.js +237 -0
  11. package/dist/index.d.ts +14 -5
  12. package/dist/index.js +88 -39
  13. package/dist/printers.d.ts +33 -0
  14. package/dist/printers.js +312 -0
  15. package/dist/proto/gqldb.proto +632 -0
  16. package/dist/response.d.ts +256 -0
  17. package/dist/response.js +723 -0
  18. package/dist/services/admin-service.d.ts +40 -0
  19. package/dist/services/admin-service.js +115 -0
  20. package/dist/services/bulk-import-service.d.ts +35 -0
  21. package/dist/services/bulk-import-service.js +108 -0
  22. package/dist/services/converters.d.ts +57 -0
  23. package/dist/services/converters.js +254 -0
  24. package/dist/services/data-service.d.ts +44 -0
  25. package/dist/services/data-service.js +206 -0
  26. package/dist/services/graph-service.d.ts +32 -0
  27. package/dist/services/graph-service.js +127 -0
  28. package/dist/services/health-service.d.ts +50 -0
  29. package/dist/services/health-service.js +78 -0
  30. package/dist/services/index.d.ts +13 -0
  31. package/dist/services/index.js +30 -0
  32. package/dist/services/query-service.d.ts +39 -0
  33. package/dist/services/query-service.js +112 -0
  34. package/dist/services/service-context.d.ts +39 -0
  35. package/dist/services/service-context.js +73 -0
  36. package/dist/services/session-service.d.ts +24 -0
  37. package/dist/services/session-service.js +66 -0
  38. package/dist/services/transaction-service.d.ts +33 -0
  39. package/dist/services/transaction-service.js +100 -0
  40. package/dist/services.d.ts +28 -0
  41. package/dist/services.js +122 -0
  42. package/dist/session.d.ts +45 -0
  43. package/dist/session.js +75 -0
  44. package/dist/transaction.d.ts +42 -0
  45. package/dist/transaction.js +89 -0
  46. package/dist/types/bulk_import.d.ts +53 -0
  47. package/dist/types/bulk_import.js +6 -0
  48. package/dist/types/data_types.d.ts +116 -0
  49. package/dist/types/data_types.js +122 -0
  50. package/dist/types/enums.d.ts +59 -0
  51. package/dist/types/enums.js +67 -0
  52. package/dist/types/graph_models.d.ts +54 -0
  53. package/dist/types/graph_models.js +6 -0
  54. package/dist/types/index.d.ts +11 -5
  55. package/dist/types/index.js +36 -37
  56. package/dist/types/metadata.d.ts +60 -0
  57. package/dist/types/metadata.js +6 -0
  58. package/dist/types/schema.d.ts +31 -0
  59. package/dist/types/schema.js +6 -0
  60. package/dist/types/typed_value.d.ts +25 -0
  61. package/dist/types/typed_value.js +1176 -0
  62. package/dist/types/wrappers.d.ts +23 -0
  63. package/dist/types/wrappers.js +39 -0
  64. package/dist/types.d.ts +7 -0
  65. package/dist/types.js +24 -0
  66. package/package.json +40 -53
  67. package/dist/connection/connection.final.d.ts +0 -14
  68. package/dist/connection/connection.final.js +0 -96
  69. package/dist/connection/connection.final.js.map +0 -1
  70. package/dist/connection/connection.pool.d.ts +0 -21
  71. package/dist/connection/connection.pool.js +0 -103
  72. package/dist/connection/connection.pool.js.map +0 -1
  73. package/dist/connection/extra/base.extra.d.ts +0 -18
  74. package/dist/connection/extra/base.extra.js +0 -111
  75. package/dist/connection/extra/base.extra.js.map +0 -1
  76. package/dist/connection/extra/batch.insert.extra.d.ts +0 -58
  77. package/dist/connection/extra/batch.insert.extra.js +0 -353
  78. package/dist/connection/extra/batch.insert.extra.js.map +0 -1
  79. package/dist/connection/extra/connection.base.d.ts +0 -112
  80. package/dist/connection/extra/connection.base.js +0 -528
  81. package/dist/connection/extra/connection.base.js.map +0 -1
  82. package/dist/connection/extra/connection.d.ts +0 -17
  83. package/dist/connection/extra/connection.js +0 -44
  84. package/dist/connection/extra/connection.js.map +0 -1
  85. package/dist/connection/extra/graph.extra.d.ts +0 -54
  86. package/dist/connection/extra/graph.extra.js +0 -151
  87. package/dist/connection/extra/graph.extra.js.map +0 -1
  88. package/dist/connection/extra/hdc.extra.d.ts +0 -89
  89. package/dist/connection/extra/hdc.extra.js +0 -322
  90. package/dist/connection/extra/hdc.extra.js.map +0 -1
  91. package/dist/connection/extra/index.extra.d.ts +0 -102
  92. package/dist/connection/extra/index.extra.js +0 -210
  93. package/dist/connection/extra/index.extra.js.map +0 -1
  94. package/dist/connection/extra/job.extra.d.ts +0 -32
  95. package/dist/connection/extra/job.extra.js +0 -122
  96. package/dist/connection/extra/job.extra.js.map +0 -1
  97. package/dist/connection/extra/policy.extra.d.ts +0 -32
  98. package/dist/connection/extra/policy.extra.js +0 -114
  99. package/dist/connection/extra/policy.extra.js.map +0 -1
  100. package/dist/connection/extra/privilege.extra.d.ts +0 -8
  101. package/dist/connection/extra/privilege.extra.js +0 -20
  102. package/dist/connection/extra/privilege.extra.js.map +0 -1
  103. package/dist/connection/extra/property.extra.d.ts +0 -66
  104. package/dist/connection/extra/property.extra.js +0 -190
  105. package/dist/connection/extra/property.extra.js.map +0 -1
  106. package/dist/connection/extra/schema.extra.d.ts +0 -108
  107. package/dist/connection/extra/schema.extra.js +0 -253
  108. package/dist/connection/extra/schema.extra.js.map +0 -1
  109. package/dist/connection/extra/user.extra.d.ts +0 -28
  110. package/dist/connection/extra/user.extra.js +0 -91
  111. package/dist/connection/extra/user.extra.js.map +0 -1
  112. package/dist/connection/index.d.ts +0 -5
  113. package/dist/connection/index.js +0 -13
  114. package/dist/connection/index.js.map +0 -1
  115. package/dist/connection/network.manager.d.ts +0 -28
  116. package/dist/connection/network.manager.js +0 -179
  117. package/dist/connection/network.manager.js.map +0 -1
  118. package/dist/index.js.map +0 -1
  119. package/dist/printers/alias.d.ts +0 -2
  120. package/dist/printers/alias.js +0 -39
  121. package/dist/printers/alias.js.map +0 -1
  122. package/dist/printers/any.d.ts +0 -2
  123. package/dist/printers/any.js +0 -63
  124. package/dist/printers/any.js.map +0 -1
  125. package/dist/printers/array.aio.d.ts +0 -3
  126. package/dist/printers/array.aio.js +0 -259
  127. package/dist/printers/array.aio.js.map +0 -1
  128. package/dist/printers/edge.d.ts +0 -5
  129. package/dist/printers/edge.js +0 -78
  130. package/dist/printers/edge.js.map +0 -1
  131. package/dist/printers/explain.plan.d.ts +0 -2
  132. package/dist/printers/explain.plan.js +0 -46
  133. package/dist/printers/explain.plan.js.map +0 -1
  134. package/dist/printers/index.d.ts +0 -24
  135. package/dist/printers/index.js +0 -43
  136. package/dist/printers/index.js.map +0 -1
  137. package/dist/printers/node.d.ts +0 -5
  138. package/dist/printers/node.js +0 -77
  139. package/dist/printers/node.js.map +0 -1
  140. package/dist/printers/path.d.ts +0 -3
  141. package/dist/printers/path.js +0 -62
  142. package/dist/printers/path.js.map +0 -1
  143. package/dist/printers/status.d.ts +0 -3
  144. package/dist/printers/status.js +0 -68
  145. package/dist/printers/status.js.map +0 -1
  146. package/dist/printers/table.d.ts +0 -2
  147. package/dist/printers/table.js +0 -56
  148. package/dist/printers/table.js.map +0 -1
  149. package/dist/proto/tmp.js +0 -366
  150. package/dist/proto/ultipa_grpc_pb.d.ts +0 -258
  151. package/dist/proto/ultipa_grpc_pb.js +0 -366
  152. package/dist/proto/ultipa_grpc_pb.js.map +0 -1
  153. package/dist/proto/ultipa_pb.d.ts +0 -1
  154. package/dist/proto/ultipa_pb.js +0 -11002
  155. package/dist/proto/ultipa_pb.js.map +0 -1
  156. package/dist/types/index.js.map +0 -1
  157. package/dist/types/types.algos.params.d.ts +0 -545
  158. package/dist/types/types.algos.params.js +0 -16
  159. package/dist/types/types.algos.params.js.map +0 -1
  160. package/dist/types/types.d.ts +0 -1204
  161. package/dist/types/types.extra.d.ts +0 -146
  162. package/dist/types/types.extra.js +0 -27
  163. package/dist/types/types.extra.js.map +0 -1
  164. package/dist/types/types.js +0 -1596
  165. package/dist/types/types.js.map +0 -1
  166. package/dist/types/util.d.ts +0 -15
  167. package/dist/types/util.js +0 -136
  168. package/dist/types/util.js.map +0 -1
  169. package/dist/utils/common.d.ts +0 -3
  170. package/dist/utils/common.js +0 -22
  171. package/dist/utils/common.js.map +0 -1
  172. package/dist/utils/format.d.ts +0 -45
  173. package/dist/utils/format.js +0 -877
  174. package/dist/utils/format.js.map +0 -1
  175. package/dist/utils/index.d.ts +0 -10
  176. package/dist/utils/index.js +0 -30
  177. package/dist/utils/index.js.map +0 -1
  178. package/dist/utils/property.d.ts +0 -18
  179. package/dist/utils/property.js +0 -153
  180. package/dist/utils/property.js.map +0 -1
  181. package/dist/utils/serialize/commont.d.ts +0 -12
  182. package/dist/utils/serialize/commont.js +0 -46
  183. package/dist/utils/serialize/commont.js.map +0 -1
  184. package/dist/utils/serialize/deserialize.d.ts +0 -9
  185. package/dist/utils/serialize/deserialize.js +0 -166
  186. package/dist/utils/serialize/deserialize.js.map +0 -1
  187. package/dist/utils/serialize/null.d.ts +0 -25
  188. package/dist/utils/serialize/null.js +0 -136
  189. package/dist/utils/serialize/null.js.map +0 -1
  190. package/dist/utils/serialize/serialize.d.ts +0 -10
  191. package/dist/utils/serialize/serialize.js +0 -144
  192. package/dist/utils/serialize/serialize.js.map +0 -1
  193. package/dist/utils/stream.helper.d.ts +0 -10
  194. package/dist/utils/stream.helper.js +0 -71
  195. package/dist/utils/stream.helper.js.map +0 -1
  196. package/dist/utils/time.record.d.ts +0 -15
  197. package/dist/utils/time.record.js +0 -52
  198. package/dist/utils/time.record.js.map +0 -1
  199. package/dist/utils/ultipa.datetime.d.ts +0 -14
  200. package/dist/utils/ultipa.datetime.js +0 -160
  201. package/dist/utils/ultipa.datetime.js.map +0 -1
  202. package/dist/utils/uql-maker.d.ts +0 -165
  203. package/dist/utils/uql-maker.js +0 -402
  204. package/dist/utils/uql-maker.js.map +0 -1
  205. package/dist/utils/uql.parse.d.ts +0 -27
  206. package/dist/utils/uql.parse.js +0 -205
  207. package/dist/utils/uql.parse.js.map +0 -1
  208. package/readme.md +0 -65
  209. package/src/proto/build.sh +0 -41
  210. package/src/proto/build_windows.sh +0 -40
  211. package/src/proto/ultipa.proto +0 -492
  212. package/src/proto/ultipa_grpc_pb.d.ts +0 -92
  213. package/src/proto/ultipa_grpc_pb.js +0 -414
  214. package/src/proto/ultipa_pb.d.ts +0 -1806
  215. package/src/proto/ultipa_pb.js +0 -13499
@@ -0,0 +1,256 @@
1
+ /**
2
+ * Response handling for GQLDB Node.js driver.
3
+ */
4
+ import { PropertyType, Schema, Table, Attr } from './types';
5
+ /** Represents a single row in the query result */
6
+ export declare class Row {
7
+ readonly values: any[];
8
+ readonly types: PropertyType[];
9
+ constructor(values: any[], types?: PropertyType[]);
10
+ /** Get the value at the given column index */
11
+ get(index: number): any;
12
+ /** Get the PropertyType at the given column index */
13
+ getType(index: number): PropertyType;
14
+ /** Get the value at the given column index as a string */
15
+ getString(index: number): string;
16
+ /** Get the value at the given column index as a number */
17
+ getNumber(index: number): number;
18
+ /** Get the value at the given column index as a boolean */
19
+ getBoolean(index: number): boolean;
20
+ }
21
+ /**
22
+ * Represents a single column's data from the response.
23
+ * Allows chaining operations like resp.alias("n").asNodes() or resp.get(0).asNodes().
24
+ */
25
+ export declare class AliasResult {
26
+ private readonly aliasName;
27
+ private readonly columnIdx;
28
+ private readonly response;
29
+ constructor(aliasName: string, columnIdx: number, response: Response);
30
+ /** Get the alias name */
31
+ get alias(): string;
32
+ /** Get the column index */
33
+ get columnIndex(): number;
34
+ /**
35
+ * Extract nodes from the aliased column with schema info.
36
+ * Throws TypeError if the column contains non-NODE types.
37
+ */
38
+ private collectNode;
39
+ private collectEdge;
40
+ /**
41
+ * Extract nodes from the aliased column with schema info.
42
+ * Supports both direct NODE columns and LIST of NODE columns
43
+ * (e.g., group variables from quantified patterns).
44
+ */
45
+ asNodes(): NodeResult;
46
+ /**
47
+ * Extract edges from the aliased column with schema info.
48
+ * Supports both direct EDGE columns and LIST of EDGE columns
49
+ * (e.g., group variables from quantified patterns).
50
+ */
51
+ asEdges(): EdgeResult;
52
+ /**
53
+ * Extract paths from the aliased column.
54
+ * Throws TypeError if the column contains non-PATH types.
55
+ */
56
+ asPaths(): Path[];
57
+ /** Convert the aliased column to a single-column table */
58
+ asTable(): Table;
59
+ private unwrapGqldbTable;
60
+ /** Extract scalar or list attribute values from the aliased column */
61
+ asAttr(): Attr;
62
+ /** Extract raw JavaScript values from the aliased column */
63
+ asValues(): any[];
64
+ private buildSchemaFromNode;
65
+ private buildSchemaFromEdge;
66
+ private inferPropertyType;
67
+ }
68
+ /** Represents the result of a GQL query */
69
+ export declare class Response {
70
+ readonly columns: string[];
71
+ readonly rows: Row[];
72
+ readonly rowCount: number;
73
+ readonly hasMore: boolean;
74
+ readonly warnings: string[];
75
+ readonly rowsAffected: number;
76
+ constructor(columns: string[], rows: Row[], rowCount: number, hasMore: boolean, warnings: string[], rowsAffected?: number);
77
+ /** Check if the response has no rows */
78
+ isEmpty(): boolean;
79
+ /** Get the first row */
80
+ first(): Row | undefined;
81
+ /** Get the last row */
82
+ last(): Row | undefined;
83
+ /** Get the value for a column by name */
84
+ getByName(row: Row, columnName: string): any;
85
+ /** Iterate over all rows with a callback */
86
+ forEach(fn: (row: Row, index: number) => void): void;
87
+ /** Transform each row using a callback */
88
+ map<T>(fn: (row: Row) => T): T[];
89
+ /** Convert the response to an array of objects */
90
+ toObjects(): Record<string, any>[];
91
+ /** Convert the response to JSON */
92
+ toJSON(): string;
93
+ /** Get the single value from a single-row, single-column response */
94
+ singleValue(): any;
95
+ /** Get the single number value */
96
+ singleNumber(): number;
97
+ /** Get the single string value */
98
+ singleString(): string;
99
+ /** Iterator support */
100
+ [Symbol.iterator](): Iterator<Row>;
101
+ /** Get the number of rows */
102
+ get length(): number;
103
+ /**
104
+ * Get an AliasResult for the specified column name.
105
+ * Use this to extract data from a specific column by name.
106
+ * Example: resp.alias("n").asNodes()
107
+ */
108
+ alias(columnName: string): AliasResult;
109
+ /**
110
+ * Get an AliasResult for the column at the specified index.
111
+ * Use this to extract data from a specific column by index.
112
+ * Example: resp.get(0).asNodes()
113
+ */
114
+ get(index: number): AliasResult;
115
+ /**
116
+ * @deprecated Use alias() or get() instead. This method will be removed in a future version.
117
+ * Extract nodes from response with schema info.
118
+ * Supports both NODE and LIST of NODE columns.
119
+ */
120
+ asNodes(): NodeResult;
121
+ /**
122
+ * @deprecated Use alias() or get() instead. This method will be removed in a future version.
123
+ * Extract edges from response with schema info.
124
+ * Supports both EDGE and LIST of EDGE columns.
125
+ */
126
+ asEdges(): EdgeResult;
127
+ /**
128
+ * @deprecated Use alias() or get() instead. This method will be removed in a future version.
129
+ * Extract paths from response.
130
+ * Paths are identified by PropertyType.PATH type in the TypedValue.
131
+ */
132
+ asPaths(): Path[];
133
+ /**
134
+ * @deprecated Use alias() or get() instead. This method will be removed in a future version.
135
+ * Return response as generic table.
136
+ * If response is a single TABLE column, unwraps the GqldbTable into proper headers/rows.
137
+ */
138
+ asTable(): Table;
139
+ /**
140
+ * @deprecated Use alias() or get() instead. This method will be removed in a future version.
141
+ * Extract scalar or list attribute values
142
+ */
143
+ asAttr(columnName: string): Attr;
144
+ private buildSchemaFromNode;
145
+ private buildSchemaFromEdge;
146
+ private inferPropertyType;
147
+ }
148
+ /** Result of an insert nodes operation */
149
+ export interface InsertNodesResult {
150
+ success: boolean;
151
+ nodeIds: string[];
152
+ nodeCount: number;
153
+ message: string;
154
+ }
155
+ /** Result of an insert edges operation */
156
+ export interface InsertEdgesResult {
157
+ success: boolean;
158
+ edgeIds: string[];
159
+ edgeCount: number;
160
+ message: string;
161
+ skippedCount: number;
162
+ }
163
+ /** Result of a delete operation */
164
+ export interface DeleteResult {
165
+ success: boolean;
166
+ deletedCount: number;
167
+ message: string;
168
+ }
169
+ /** Configuration for the unified Export operation */
170
+ export interface ExportConfig {
171
+ graphName: string;
172
+ batchSize?: number;
173
+ exportNodes?: boolean;
174
+ exportEdges?: boolean;
175
+ nodeLabels?: string[];
176
+ edgeLabels?: string[];
177
+ includeMetadata?: boolean;
178
+ }
179
+ /** Statistics for an export operation */
180
+ export interface ExportStats {
181
+ nodesExported: number;
182
+ edgesExported: number;
183
+ bytesWritten: number;
184
+ durationMs: number;
185
+ }
186
+ /** A chunk of exported data in JSON Lines format */
187
+ export interface ExportChunk {
188
+ data: Buffer;
189
+ isFinal: boolean;
190
+ stats?: ExportStats;
191
+ }
192
+ /**
193
+ * A batch of exported nodes
194
+ * @deprecated Use export() with ExportConfig instead
195
+ */
196
+ export interface ExportNodesResult {
197
+ nodes: ExportedNode[];
198
+ hasMore: boolean;
199
+ }
200
+ /**
201
+ * A batch of exported edges
202
+ * @deprecated Use export() with ExportConfig instead
203
+ */
204
+ export interface ExportEdgesResult {
205
+ edges: ExportedEdge[];
206
+ hasMore: boolean;
207
+ }
208
+ /**
209
+ * A node exported from the database
210
+ * @deprecated Use export() with ExportConfig instead
211
+ */
212
+ export interface ExportedNode {
213
+ id: string;
214
+ labels: string[];
215
+ properties: Record<string, any>;
216
+ }
217
+ /**
218
+ * An edge exported from the database
219
+ * @deprecated Use export() with ExportConfig instead
220
+ */
221
+ export interface ExportedEdge {
222
+ id: string;
223
+ label: string;
224
+ fromNodeId: string;
225
+ toNodeId: string;
226
+ properties: Record<string, any>;
227
+ }
228
+ /** Represents a node in the graph database */
229
+ export interface Node {
230
+ id: string;
231
+ labels: string[];
232
+ properties: Record<string, any>;
233
+ }
234
+ /** Represents an edge in the graph database */
235
+ export interface Edge {
236
+ id: string;
237
+ label: string;
238
+ fromNodeId: string;
239
+ toNodeId: string;
240
+ properties: Record<string, any>;
241
+ }
242
+ /** Represents a path in the graph database */
243
+ export interface Path {
244
+ nodes: Node[];
245
+ edges: Edge[];
246
+ }
247
+ /** Result wrapper for nodes with schema information */
248
+ export interface NodeResult {
249
+ nodes: Node[];
250
+ schemas: Map<string, Schema>;
251
+ }
252
+ /** Result wrapper for edges with schema information */
253
+ export interface EdgeResult {
254
+ edges: Edge[];
255
+ schemas: Map<string, Schema>;
256
+ }