@zilliz/milvus2-sdk-node 2.2.3 → 2.2.5

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 (93) hide show
  1. package/README.md +4 -21
  2. package/dist/milvus/BaseClient.d.ts +17 -0
  3. package/dist/milvus/BaseClient.js +58 -0
  4. package/dist/milvus/BaseClient.js.map +1 -0
  5. package/dist/milvus/Collection.d.ts +263 -171
  6. package/dist/milvus/Collection.js +328 -233
  7. package/dist/milvus/Collection.js.map +1 -1
  8. package/dist/milvus/Data.d.ts +142 -142
  9. package/dist/milvus/Data.js +211 -216
  10. package/dist/milvus/Data.js.map +1 -1
  11. package/dist/milvus/MilvusClient.d.ts +17 -0
  12. package/dist/milvus/MilvusClient.js +163 -0
  13. package/dist/milvus/MilvusClient.js.map +1 -0
  14. package/dist/milvus/MilvusIndex.d.ts +64 -60
  15. package/dist/milvus/MilvusIndex.js +74 -69
  16. package/dist/milvus/MilvusIndex.js.map +1 -1
  17. package/dist/milvus/Partition.d.ts +95 -88
  18. package/dist/milvus/Partition.js +108 -101
  19. package/dist/milvus/Partition.js.map +1 -1
  20. package/dist/milvus/Resource.d.ts +172 -0
  21. package/dist/milvus/Resource.js +356 -0
  22. package/dist/milvus/Resource.js.map +1 -0
  23. package/dist/milvus/User.d.ts +136 -110
  24. package/dist/milvus/User.js +171 -140
  25. package/dist/milvus/User.js.map +1 -1
  26. package/dist/milvus/Utils.d.ts +1 -1
  27. package/dist/milvus/Utils.js +1 -1
  28. package/dist/milvus/Utils.js.map +1 -1
  29. package/dist/milvus/const/Milvus.d.ts +270 -0
  30. package/dist/milvus/const/Milvus.js +370 -1
  31. package/dist/milvus/const/Milvus.js.map +1 -1
  32. package/dist/milvus/index.d.ts +11 -46
  33. package/dist/milvus/index.js +16 -186
  34. package/dist/milvus/index.js.map +1 -1
  35. package/dist/milvus/types/Collection.d.ts +88 -8
  36. package/dist/milvus/types/Collection.js +1 -9
  37. package/dist/milvus/types/Collection.js.map +1 -1
  38. package/dist/milvus/types/Common.d.ts +11 -267
  39. package/dist/milvus/types/Common.js +1 -369
  40. package/dist/milvus/types/Common.js.map +1 -1
  41. package/dist/milvus/types/Data.d.ts +154 -1
  42. package/dist/milvus/types/Index.d.ts +20 -1
  43. package/dist/milvus/types/Partition.d.ts +8 -1
  44. package/dist/milvus/types/Resource.d.ts +44 -0
  45. package/dist/milvus/types/{Search.js → Resource.js} +1 -1
  46. package/dist/milvus/types/Resource.js.map +1 -0
  47. package/dist/milvus/types/Response.d.ts +0 -246
  48. package/dist/milvus/types/Response.js.map +1 -1
  49. package/dist/milvus/types/User.d.ts +54 -2
  50. package/dist/milvus/types.d.ts +8 -7
  51. package/dist/milvus/types.js +2 -1
  52. package/dist/milvus/types.js.map +1 -1
  53. package/dist/proto/proto/common.proto +23 -2
  54. package/dist/proto/proto/feder.proto +40 -0
  55. package/dist/proto/proto/google/protobuf/descriptor.proto +31 -1
  56. package/dist/proto/proto/milvus.proto +101 -0
  57. package/dist/proto/proto/msg.proto +107 -0
  58. package/dist/proto/proto/schema.proto +18 -23
  59. package/dist/sdk.json +1 -1
  60. package/dist/utils/Blob.js.map +1 -0
  61. package/dist/{milvus/utils → utils}/Format.d.ts +12 -11
  62. package/dist/{milvus/utils → utils}/Format.js +18 -17
  63. package/dist/utils/Format.js.map +1 -0
  64. package/dist/utils/Function.d.ts +4 -0
  65. package/dist/utils/Function.js +33 -0
  66. package/dist/utils/Function.js.map +1 -0
  67. package/dist/utils/Grpc.d.ts +19 -0
  68. package/dist/utils/Grpc.js +64 -0
  69. package/dist/utils/Grpc.js.map +1 -0
  70. package/dist/utils/Validate.d.ts +21 -0
  71. package/dist/{milvus/utils → utils}/Validate.js +28 -6
  72. package/dist/utils/Validate.js.map +1 -0
  73. package/dist/utils/index.d.ts +5 -7
  74. package/dist/utils/index.js +17 -52
  75. package/dist/utils/index.js.map +1 -1
  76. package/dist/utils/test.d.ts +14 -0
  77. package/dist/utils/test.js +68 -0
  78. package/dist/utils/test.js.map +1 -0
  79. package/package.json +7 -12
  80. package/dist/milvus/Client.d.ts +0 -12
  81. package/dist/milvus/Client.js +0 -28
  82. package/dist/milvus/Client.js.map +0 -1
  83. package/dist/milvus/types/Search.d.ts +0 -81
  84. package/dist/milvus/types/Search.js.map +0 -1
  85. package/dist/milvus/utils/Blob.js.map +0 -1
  86. package/dist/milvus/utils/Format.js.map +0 -1
  87. package/dist/milvus/utils/Validate.d.ts +0 -9
  88. package/dist/milvus/utils/Validate.js.map +0 -1
  89. package/dist/milvus/utils/index.d.ts +0 -3
  90. package/dist/milvus/utils/index.js +0 -10
  91. package/dist/milvus/utils/index.js.map +0 -1
  92. /package/dist/{milvus/utils → utils}/Blob.d.ts +0 -0
  93. /package/dist/{milvus/utils → utils}/Blob.js +0 -0
@@ -40,7 +40,7 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
40
40
  function verb(n) { return function (v) { return step([n, v]); }; }
41
41
  function step(op) {
42
42
  if (f) throw new TypeError("Generator is already executing.");
43
- while (_) try {
43
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
44
44
  if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
45
45
  if (y = 0, t) op = [op[0] & 2, t.value];
46
46
  switch (op[0]) {
@@ -70,56 +70,44 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
70
70
  }
71
71
  return to.concat(ar || Array.prototype.slice.call(from));
72
72
  };
73
- var __importDefault = (this && this.__importDefault) || function (mod) {
74
- return (mod && mod.__esModule) ? mod : { "default": mod };
75
- };
76
73
  Object.defineProperty(exports, "__esModule", { value: true });
77
74
  exports.Data = void 0;
78
- var protobufjs_1 = __importDefault(require("protobufjs"));
79
75
  var utils_1 = require("../utils");
80
- var Client_1 = require("./Client");
81
- var ErrorReason_1 = require("./const/ErrorReason");
82
- var Common_1 = require("./types/Common");
83
- var Response_1 = require("./types/Response");
84
- var index_1 = require("./utils/index");
85
- var Blob_1 = require("./utils/Blob");
86
- var path_1 = __importDefault(require("path"));
87
- var Format_1 = require("./utils/Format");
88
- var protoPath = path_1.default.resolve(__dirname, '../proto/proto/milvus.proto');
76
+ var _1 = require(".");
77
+ var Collection_1 = require("./Collection");
89
78
  var Data = /** @class */ (function (_super) {
90
79
  __extends(Data, _super);
91
- function Data(client, collectionManager) {
92
- var _this = _super.call(this, client) || this;
93
- _this.vectorTypes = [Common_1.DataType.BinaryVector, Common_1.DataType.FloatVector];
94
- _this.collectionManager = collectionManager;
95
- _this._protoRoot = protobufjs_1.default.loadSync(protoPath);
80
+ function Data() {
81
+ var _this = _super !== null && _super.apply(this, arguments) || this;
82
+ _this.vectorTypes = [_1.DataType.BinaryVector, _1.DataType.FloatVector];
96
83
  return _this;
97
84
  }
98
85
  /**
99
86
  * Insert data into Milvus.
100
87
  *
101
88
  * @param data
102
- * | Property | Type | Description |
103
- * | :---------------------- | :-------------------- | :------------------------------- |
104
- * | collection_name | String | Collection name |
105
- * | partition_name(optional)| String | Partition name |
106
- * | fields_data | { [x: string]: any }[] | If the field type is binary, the vector data length needs to be dimension / 8 |
107
- * | hash_keys(optional) | Number[] | The hash value depends on the primarykey value |
108
- * | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
109
- *
110
- * @return
111
- * | Property | Description |
112
- * | :-------------| :------------------------------- |
113
- * | status | { error_code: number, reason: string }|
114
- * | succ_index | Index array of the successfully inserted data |
115
- * | err_index | Index array of the unsuccessfully inserted data |
116
- * | IDs | ID array of the successfully inserted data |
89
+ * | Property | Type | Description |
90
+ * | :--- | :-- | :-- |
91
+ * | collection_name | String | Collection name |
92
+ * | partition_name(optional)| String | Partition name |
93
+ * | fields_data | { [x: string]: any }[] | If the field type is binary, the vector data length needs to be dimension / 8 |
94
+ * | hash_keys(optional) | Number[] | The hash value depends on the primarykey value |
95
+ * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
96
+
97
+ *
98
+ * @returns
99
+ * | Property | Description |
100
+ * | :-- | :-- |
101
+ * | status | { error_code: number, reason: string } |
102
+ * | succ_index | Index array of the successfully inserted data |
103
+ * | err_index | Index array of the unsuccessfully inserted data |
104
+ * | IDs | ID array of the successfully inserted data |
117
105
  *
118
106
  *
119
107
  * #### Example
120
108
  *
121
109
  * ```
122
- * new milvusClient(MILUVS_ADDRESS).dataManager.insert({
110
+ * new milvusClient(MILUVS_ADDRESS).insert({
123
111
  * collection_name: COLLECTION_NAME,
124
112
  * fields_data: [{
125
113
  * vector_field: [1,2,2,4],
@@ -135,19 +123,19 @@ var Data = /** @class */ (function (_super) {
135
123
  return __generator(this, function (_a) {
136
124
  switch (_a.label) {
137
125
  case 0:
138
- this.checkCollectionName(data);
126
+ (0, utils_1.checkCollectionName)(data);
139
127
  if (!data.fields_data ||
140
128
  !Array.isArray(data.fields_data) ||
141
129
  !data.fields_data.length) {
142
- throw new Error(ErrorReason_1.ERROR_REASONS.INSERT_CHECK_FILEDS_DATA_IS_REQUIRED);
130
+ throw new Error(_1.ERROR_REASONS.INSERT_CHECK_FILEDS_DATA_IS_REQUIRED);
143
131
  }
144
132
  collection_name = data.collection_name;
145
- return [4 /*yield*/, this.collectionManager.describeCollection({
133
+ return [4 /*yield*/, this.describeCollection({
146
134
  collection_name: collection_name,
147
135
  })];
148
136
  case 1:
149
137
  collectionInfo = _a.sent();
150
- if (collectionInfo.status.error_code !== Response_1.ErrorCode.SUCCESS) {
138
+ if (collectionInfo.status.error_code !== _1.ErrorCode.SUCCESS) {
151
139
  throw new Error(collectionInfo.status.reason);
152
140
  }
153
141
  fieldsData = collectionInfo.schema.fields
@@ -155,7 +143,7 @@ var Data = /** @class */ (function (_super) {
155
143
  .map(function (v) { return ({
156
144
  name: v.name,
157
145
  type: v.data_type,
158
- dim: Number((0, index_1.findKeyValue)(v.type_params, 'dim')),
146
+ dim: Number((0, utils_1.findKeyValue)(v.type_params, 'dim')),
159
147
  value: [],
160
148
  }); });
161
149
  params = __assign(__assign({}, data), { num_rows: data.fields_data.length });
@@ -166,13 +154,13 @@ var Data = /** @class */ (function (_super) {
166
154
  fieldNames.forEach(function (name) {
167
155
  var target = fieldsData.find(function (item) { return item.name === name; });
168
156
  if (!target) {
169
- throw new Error("".concat(ErrorReason_1.ERROR_REASONS.INSERT_CHECK_WRONG_FIELD, " ").concat(i));
157
+ throw new Error("".concat(_1.ERROR_REASONS.INSERT_CHECK_WRONG_FIELD, " ").concat(i));
170
158
  }
171
- var isVector = _this.vectorTypes.includes(Common_1.DataTypeMap[target.type.toLowerCase()]);
159
+ var isVector = _this.vectorTypes.includes(_1.DataTypeMap[target.type.toLowerCase()]);
172
160
  // Check if the dimension is matched when the data type is BinaryVector.
173
- if (Common_1.DataTypeMap[target.type.toLowerCase()] === Common_1.DataType.BinaryVector &&
161
+ if (_1.DataTypeMap[target.type.toLowerCase()] === _1.DataType.BinaryVector &&
174
162
  v[name].length !== target.dim / 8) {
175
- throw new Error(ErrorReason_1.ERROR_REASONS.INSERT_CHECK_WRONG_DIM);
163
+ throw new Error(_1.ERROR_REASONS.INSERT_CHECK_WRONG_DIM);
176
164
  }
177
165
  // Value in vector field should be array. Therefore you need concat it.
178
166
  // but array.concat is slow, we need for loop to push the value one by one
@@ -191,55 +179,55 @@ var Data = /** @class */ (function (_super) {
191
179
  var _a, _b, _c, _d;
192
180
  // milvus return string for field type, so we define the DataTypeMap to the value we need.
193
181
  // but if milvus change the string, may casue we cant find value.
194
- var type = Common_1.DataTypeMap[v.type.toLowerCase()];
182
+ var type = _1.DataTypeMap[v.type.toLowerCase()];
195
183
  var key = _this.vectorTypes.includes(type) ? 'vectors' : 'scalars';
196
184
  var dataKey = 'float_vector';
197
185
  switch (type) {
198
- case Common_1.DataType.FloatVector:
186
+ case _1.DataType.FloatVector:
199
187
  dataKey = 'float_vector';
200
188
  break;
201
- case Common_1.DataType.BinaryVector:
189
+ case _1.DataType.BinaryVector:
202
190
  dataKey = 'binary_vector';
203
191
  break;
204
- case Common_1.DataType.Double:
192
+ case _1.DataType.Double:
205
193
  dataKey = 'double_data';
206
194
  break;
207
- case Common_1.DataType.Float:
195
+ case _1.DataType.Float:
208
196
  dataKey = 'float_data';
209
197
  break;
210
- case Common_1.DataType.Int64:
198
+ case _1.DataType.Int64:
211
199
  dataKey = 'long_data';
212
200
  break;
213
- case Common_1.DataType.Int32:
214
- case Common_1.DataType.Int16:
215
- case Common_1.DataType.Int8:
201
+ case _1.DataType.Int32:
202
+ case _1.DataType.Int16:
203
+ case _1.DataType.Int8:
216
204
  dataKey = 'int_data';
217
205
  break;
218
- case Common_1.DataType.Bool:
206
+ case _1.DataType.Bool:
219
207
  dataKey = 'bool_data';
220
208
  break;
221
- case Common_1.DataType.VarChar:
209
+ case _1.DataType.VarChar:
222
210
  dataKey = 'string_data';
223
211
  break;
224
212
  default:
225
- throw new Error(ErrorReason_1.ERROR_REASONS.INSERT_CHECK_WRONG_DATA_TYPE);
213
+ throw new Error(_1.ERROR_REASONS.INSERT_CHECK_WRONG_DATA_TYPE);
226
214
  }
227
215
  return _a = {
228
216
  type: type,
229
217
  field_name: v.name
230
218
  },
231
- _a[key] = type === Common_1.DataType.FloatVector
219
+ _a[key] = type === _1.DataType.FloatVector
232
220
  ? (_b = {
233
221
  dim: v.dim
234
222
  },
235
223
  _b[dataKey] = {
236
224
  data: v.value,
237
225
  },
238
- _b) : type === Common_1.DataType.BinaryVector
226
+ _b) : type === _1.DataType.BinaryVector
239
227
  ? (_c = {
240
228
  dim: v.dim
241
229
  },
242
- _c[dataKey] = (0, Blob_1.parseBinaryVectorToBytes)(v.value),
230
+ _c[dataKey] = (0, utils_1.parseBinaryVectorToBytes)(v.value),
243
231
  _c) : (_d = {},
244
232
  _d[dataKey] = {
245
233
  data: v.value,
@@ -247,7 +235,7 @@ var Data = /** @class */ (function (_super) {
247
235
  _d),
248
236
  _a;
249
237
  });
250
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Insert', params, data.timeout)];
238
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'Insert', params, data.timeout)];
251
239
  case 2:
252
240
  promise = _a.sent();
253
241
  return [2 /*return*/, promise];
@@ -259,24 +247,25 @@ var Data = /** @class */ (function (_super) {
259
247
  * Delete entities in Milvus
260
248
  *
261
249
  * @param data
262
- * | Property | Type | Description |
263
- * | :---------------------- | :-------------------- | :------------------------------- |
264
- * | collection_name | String | Collection name |
265
- * | partition_name(optional)| String | Partition name |
266
- * | expr | String | Boolean expression used to filter attribute. |
267
- * | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
250
+ * | Property | Type | Description |
251
+ * | :--- | :-- | :-- |
252
+ * | collection_name | String | Collection name |
253
+ * | partition_name(optional)| String | Partition name |
254
+ * | expr | String | Boolean expression used to filter attribute. |
255
+ * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
256
+
268
257
  *
269
- * @return
270
- * | Property | Description |
271
- * | :-------------| :------------------------------- |
272
- * | status | { error_code: number, reason: string }|
273
- * | IDs | ID array of the successfully deleted data |
258
+ * @returns
259
+ * | Property | Description |
260
+ * | :-- | :-- |
261
+ * | status | { error_code: number, reason: string } |
262
+ * | IDs | ID array of the successfully deleted data |
274
263
  *
275
264
  *
276
265
  * #### Example
277
266
  *
278
267
  * ```
279
- * new milvusClient(MILUVS_ADDRESS).dataManager.deleteEntities({
268
+ * new milvusClient(MILUVS_ADDRESS).deleteEntities({
280
269
  * collection_name: COLLECTION_NAME,
281
270
  * expr: 'id in [1,2,3,4]'
282
271
  * });
@@ -289,9 +278,9 @@ var Data = /** @class */ (function (_super) {
289
278
  switch (_a.label) {
290
279
  case 0:
291
280
  if (!data || !data.collection_name || !data.expr) {
292
- throw new Error(ErrorReason_1.ERROR_REASONS.DELETE_PARAMS_CHECK);
281
+ throw new Error(_1.ERROR_REASONS.DELETE_PARAMS_CHECK);
293
282
  }
294
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Delete', data, data.timeout)];
283
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'Delete', data, data.timeout)];
295
284
  case 1:
296
285
  promise = _a.sent();
297
286
  return [2 /*return*/, promise];
@@ -303,30 +292,31 @@ var Data = /** @class */ (function (_super) {
303
292
  * Perform vector similarity search.
304
293
  *
305
294
  * @param data
306
- * | Property | Type | Description |
307
- * | :---------------------- | :-------------------- | :------------------------------- |
308
- * | collection_name | String | Collection name |
309
- * | partition_names(optional)| String[] | Array of partition names |
310
- * | expr(optional) | String | Scalar field filter expression |
311
- * | search_params | Object | anns_field: vector field name <br/> topk: search result counts <br/> [metric_type](https://milvus.io/docs/v2.0.0/metric.md#floating#Similarity-Metrics) <br/>params: search params |
312
- * | vectors | Number[][] | Original vector to search with |
313
- * | output_fields(optional) | String[] | Support scalar field |
314
- * | vector_type | enum | Binary field -> 100, Float field -> 101 |
315
- * | travel_timestamp | number | We can get timestamp after insert success. Use this timestamp we can time travel in vector search.|
316
- * | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
317
- *
318
- * @return
319
- * | Property | Description |
320
- * | :-------------| :------------------------------- |
321
- * | status | { error_code: number, reason: string }|
322
- * | results | {score:number,id:string}[]; |
295
+ * | Property | Type | Description |
296
+ * | :--- | :-- | :-- |
297
+ * | collection_name | String | Collection name |
298
+ * | partition_names(optional)| String[] | Array of partition names |
299
+ * | expr(optional) | String | Scalar field filter expression |
300
+ * | search_params | Object | anns_field: vector field name <br/> topk: search result counts <br/> [metric_type](https://milvus.io/docs/v2.0.0/metric.md#floating#Similarity-Metrics) <br/>params: search params |
301
+ * | vectors | Number[][] | Original vector to search with |
302
+ * | output_fields(optional) | String[] | Support scalar field |
303
+ * | vector_type | enum | Binary field -> 100, Float field -> 101 |
304
+ * | travel_timestamp | number | We can get timestamp after insert success. Use this timestamp we can time travel in vector search.|
305
+ * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
306
+
307
+ *
308
+ * @returns
309
+ * | Property | Description |
310
+ * | :-- | :-- |
311
+ * | status | { error_code: number, reason: string } |
312
+ * | results | {score:number,id:string}[]; |
323
313
  *
324
314
  *
325
315
  *
326
316
  * #### Example
327
317
  *
328
318
  * ```
329
- * new milvusClient(MILUVS_ADDRESS).dataManager.search({
319
+ * new milvusClient(MILUVS_ADDRESS).search({
330
320
  * collection_name: COLLECTION_NAME,
331
321
  * expr: "",
332
322
  * vectors: [[1, 2, 3, 4]],
@@ -348,54 +338,54 @@ var Data = /** @class */ (function (_super) {
348
338
  return __generator(this, function (_c) {
349
339
  switch (_c.label) {
350
340
  case 0:
351
- this.checkCollectionName(data);
341
+ (0, utils_1.checkCollectionName)(data);
352
342
  if (!data.search_params ||
353
343
  !data.search_params.anns_field ||
354
344
  !data.search_params.metric_type ||
355
345
  !data.search_params.topk ||
356
346
  !data.search_params.params) {
357
- throw new Error(ErrorReason_1.ERROR_REASONS.SEARCH_PARAMS_IS_REQUIRED);
347
+ throw new Error(_1.ERROR_REASONS.SEARCH_PARAMS_IS_REQUIRED);
358
348
  }
359
349
  if (!this.vectorTypes.includes(data.vector_type))
360
- throw new Error(ErrorReason_1.ERROR_REASONS.SEARCH_MISS_VECTOR_TYPE);
361
- return [4 /*yield*/, this.collectionManager.describeCollection({
350
+ throw new Error(_1.ERROR_REASONS.SEARCH_MISS_VECTOR_TYPE);
351
+ return [4 /*yield*/, this.describeCollection({
362
352
  collection_name: data.collection_name,
363
353
  })];
364
354
  case 1:
365
355
  collectionInfo = _c.sent();
366
356
  targetField = collectionInfo.schema.fields.find(function (v) { return v.name === data.search_params.anns_field; });
367
357
  if (!targetField) {
368
- throw new Error(ErrorReason_1.ERROR_REASONS.SEARCH_NOT_FIND_VECTOR_FIELD);
358
+ throw new Error(_1.ERROR_REASONS.SEARCH_NOT_FIND_VECTOR_FIELD);
369
359
  }
370
- dim = (0, index_1.findKeyValue)(targetField.type_params, 'dim');
371
- vectorType = Common_1.DataTypeMap[targetField.data_type.toLowerCase()];
372
- dimension = vectorType === Common_1.DataType.BinaryVector ? Number(dim) / 8 : Number(dim);
360
+ dim = (0, utils_1.findKeyValue)(targetField.type_params, 'dim');
361
+ vectorType = _1.DataTypeMap[targetField.data_type.toLowerCase()];
362
+ dimension = vectorType === _1.DataType.BinaryVector ? Number(dim) / 8 : Number(dim);
373
363
  if (!data.vectors[0] || data.vectors[0].length !== dimension) {
374
- throw new Error(ErrorReason_1.ERROR_REASONS.SEARCH_DIM_NOT_MATCH);
364
+ throw new Error(_1.ERROR_REASONS.SEARCH_DIM_NOT_MATCH);
375
365
  }
376
366
  round_decimal = data.search_params.round_decimal;
377
367
  if (round_decimal !== undefined &&
378
368
  (!Number.isInteger(round_decimal) ||
379
369
  round_decimal < -1 ||
380
370
  round_decimal > 6)) {
381
- throw new Error(ErrorReason_1.ERROR_REASONS.SEARCH_ROUND_DECIMAL_NOT_VALID);
371
+ throw new Error(_1.ERROR_REASONS.SEARCH_ROUND_DECIMAL_NOT_VALID);
382
372
  }
383
- PlaceholderGroup = this._protoRoot.lookupType('milvus.proto.common.PlaceholderGroup');
373
+ PlaceholderGroup = this.milvusProto.lookupType('milvus.proto.common.PlaceholderGroup');
384
374
  placeholderGroupParams = PlaceholderGroup.create({
385
375
  placeholders: [
386
376
  {
387
377
  tag: '$0',
388
378
  type: data.vector_type,
389
379
  values: data.vectors.map(function (v) {
390
- return data.vector_type === Common_1.DataType.BinaryVector
391
- ? (0, Blob_1.parseBinaryVectorToBytes)(v)
392
- : (0, Blob_1.parseFloatVectorToBytes)(v);
380
+ return data.vector_type === _1.DataType.BinaryVector
381
+ ? (0, utils_1.parseBinaryVectorToBytes)(v)
382
+ : (0, utils_1.parseFloatVectorToBytes)(v);
393
383
  }),
394
384
  },
395
385
  ],
396
386
  });
397
387
  placeholderGroupBytes = PlaceholderGroup.encode(placeholderGroupParams).finish();
398
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Search', __assign(__assign({}, data), { nq: data.nq || data.vectors.length, dsl: data.expr || '', dsl_type: Common_1.DslType.BoolExprV1, placeholder_group: placeholderGroupBytes, search_params: (0, Format_1.parseToKeyValue)(data.search_params) }), data.timeout)];
388
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'Search', __assign(__assign({}, data), { nq: data.nq || data.vectors.length, dsl: data.expr || '', dsl_type: _1.DslType.BoolExprV1, placeholder_group: placeholderGroupBytes, search_params: (0, utils_1.parseToKeyValue)(data.search_params) }), data.timeout)];
399
389
  case 2:
400
390
  promise = _c.sent();
401
391
  results = [];
@@ -429,7 +419,7 @@ var Data = /** @class */ (function (_super) {
429
419
  var i = index === 0 ? scoreIndex : scoreIndex + topk;
430
420
  var fixedScore = typeof round_decimal === 'undefined' || round_decimal === -1
431
421
  ? score
432
- : (0, Format_1.formatNumberPrecision)(score, round_decimal);
422
+ : (0, utils_1.formatNumberPrecision)(score, round_decimal);
433
423
  var result = {
434
424
  score: fixedScore,
435
425
  id: idData_1 ? idData_1[i] : '',
@@ -453,20 +443,21 @@ var Data = /** @class */ (function (_super) {
453
443
  * Milvus temporarily buffers the newly inserted vectors in the cache. Call `flush()` to persist them to the object storage.
454
444
  * It's async function, so it's will take some times to excute.
455
445
  * @param data
456
- * | Property | Type | Description |
457
- * | :---------------------- | :---- | :------------------------------- |
458
- * | collection_names | String[] | Array of collection names |
459
- * | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
446
+ * | Property | Type | Description |
447
+ * | :--- | :-- | :-- |
448
+ * | collection_names | String[] | Array of collection names |
449
+ * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
450
+
460
451
  *
461
- * @return
462
- * | Property | Description |
463
- * | :-------------| :------------------------------- |
464
- * | status | { error_code: number, reason: string }|
452
+ * @returns
453
+ * | Property | Description |
454
+ * | :-- | :-- |
455
+ * | status | { error_code: number, reason: string } |
465
456
  *
466
457
  * #### Example
467
458
  *
468
459
  * ```
469
- * new milvusClient(MILUVS_ADDRESS).dataManager.flush({
460
+ * new milvusClient(MILUVS_ADDRESS).flush({
470
461
  * collection_names: ['my_collection'],
471
462
  * });
472
463
  * ```
@@ -480,9 +471,9 @@ var Data = /** @class */ (function (_super) {
480
471
  if (!data ||
481
472
  !Array.isArray(data.collection_names) ||
482
473
  !data.collection_names.length) {
483
- throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
474
+ throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
484
475
  }
485
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Flush', data, data.timeout)];
476
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'Flush', data, data.timeout)];
486
477
  case 1:
487
478
  res = _a.sent();
488
479
  return [2 /*return*/, res];
@@ -495,20 +486,21 @@ var Data = /** @class */ (function (_super) {
495
486
  * So you can ensure it's flushed after function return the result.
496
487
  *
497
488
  * @param data
498
- * | Property | Type | Description |
499
- * | :---------------------- | :---- | :------------------------------- |
500
- * | collection_names | String[] | Array of collection names |
501
- * | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
489
+ * | Property | Type | Description |
490
+ * | :--- | :-- | :-- |
491
+ * | collection_names | String[] | Array of collection names |
492
+ * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
493
+
502
494
  *
503
- * @return
504
- * | Property | Description |
505
- * | :-------------| :------------------------------- |
506
- * | status | { error_code: number, reason: string }|
495
+ * @returns
496
+ * | Property | Description |
497
+ * | :-- | :-- |
498
+ * | status | { error_code: number, reason: string } |
507
499
  *
508
500
  * #### Example
509
501
  *
510
502
  * ```
511
- * new milvusClient(MILUVS_ADDRESS).dataManager.flushSync({
503
+ * new milvusClient(MILUVS_ADDRESS).flushSync({
512
504
  * collection_names: ['my_collection'],
513
505
  * });
514
506
  * ```
@@ -522,9 +514,9 @@ var Data = /** @class */ (function (_super) {
522
514
  if (!data ||
523
515
  !Array.isArray(data.collection_names) ||
524
516
  !data.collection_names.length) {
525
- throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
517
+ throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
526
518
  }
527
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Flush', data, data.timeout)];
519
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'Flush', data, data.timeout)];
528
520
  case 1:
529
521
  res = _a.sent();
530
522
  segIDs = Object.keys(res.coll_segIDs)
@@ -538,7 +530,7 @@ var Data = /** @class */ (function (_super) {
538
530
  return [4 /*yield*/, this.getFlushState({ segmentIDs: segIDs })];
539
531
  case 3:
540
532
  flushRes = _a.sent();
541
- return [4 /*yield*/, (0, index_1.sleep)(100)];
533
+ return [4 /*yield*/, (0, utils_1.sleep)(100)];
542
534
  case 4:
543
535
  _a.sent();
544
536
  isFlushed = flushRes.flushed;
@@ -554,26 +546,27 @@ var Data = /** @class */ (function (_super) {
554
546
  * Query vector data in Milvus. Current release of Milvus only supports expression as fieldname in [id1,id2,id3]
555
547
  *
556
548
  * @param data
557
- * | Property | Type | Description |
558
- * | :--------------------------- | :---- | :------------------------------- |
559
- * | collection_name | String | Collection name |
560
- * | expr | String | Scalar field filter expression |
561
- * | partitions_names(optional) | String[] | Array of partition names |
562
- * | output_fields | String[] | Vector or scalar field to be returned |
563
- * | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
549
+ * | Property | Type | Description |
550
+ * | :--- | :-- | :-- |
551
+ * | collection_name | String | Collection name |
552
+ * | expr | String | Scalar field filter expression |
553
+ * | partitions_names(optional) | String[] | Array of partition names |
554
+ * | output_fields | String[] | Vector or scalar field to be returned |
555
+ * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
556
+
564
557
  * | params | {key: value}[] | An optional key pair json array
565
558
  *
566
- * @return
567
- * | Property | Description |
568
- * | :-------------| :------------------------------- |
569
- * | status | { error_code: number,reason:string } |
570
- * | data | Data of all fields that you defined in `output_fields`, {field_name: value}[] |
559
+ * @returns
560
+ * | Property | Description |
561
+ * | :-- | :-- |
562
+ * | status | { error_code: number,reason:string } |
563
+ * | data | Data of all fields that you defined in `output_fields`, {field_name: value}[] |
571
564
  *
572
565
  *
573
566
  * #### Example
574
567
  *
575
568
  * ```
576
- * new milvusClient(MILUVS_ADDRESS).dataManager.query({
569
+ * new milvusClient(MILUVS_ADDRESS).query({
577
570
  * collection_name: 'my_collection',
578
571
  * expr: "age in [1,2,3,4,5,6,7,8]",
579
572
  * output_fields: ["age"],
@@ -586,14 +579,14 @@ var Data = /** @class */ (function (_super) {
586
579
  return __generator(this, function (_a) {
587
580
  switch (_a.label) {
588
581
  case 0:
589
- this.checkCollectionName(data);
582
+ (0, utils_1.checkCollectionName)(data);
590
583
  if (typeof data.limit === 'number') {
591
584
  limits = { limit: data.limit };
592
585
  }
593
586
  if (typeof data.offset === 'number') {
594
587
  offset = { offset: data.offset };
595
588
  }
596
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Query', __assign(__assign({}, data), { query_params: (0, Format_1.parseToKeyValue)(__assign(__assign({}, limits), offset)) }), data.timeout)];
589
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'Query', __assign(__assign({}, data), { query_params: (0, utils_1.parseToKeyValue)(__assign(__assign({}, limits), offset)) }), data.timeout)];
597
590
  case 1:
598
591
  promise = _a.sent();
599
592
  results = [];
@@ -654,9 +647,9 @@ var Data = /** @class */ (function (_super) {
654
647
  /**
655
648
  * @ignore
656
649
  * @param data
657
- * | Property | Type | Description |
658
- * | :------------------- | :---- | :---------------------------------------- |
659
- * | request | object | Only allow "system_info" for now |
650
+ * | Property | Type | Description |
651
+ * | :--- | :-- | :-- |
652
+ * | request | object | Only allow "system_info" for now |
660
653
  */
661
654
  Data.prototype.getMetric = function (data) {
662
655
  return __awaiter(this, void 0, void 0, function () {
@@ -665,9 +658,9 @@ var Data = /** @class */ (function (_super) {
665
658
  switch (_a.label) {
666
659
  case 0:
667
660
  if (!data || !data.request || !data.request.metric_type) {
668
- throw new Error(ErrorReason_1.ERROR_REASONS.GET_METRIC_CHECK_PARAMS);
661
+ throw new Error(_1.ERROR_REASONS.GET_METRIC_CHECK_PARAMS);
669
662
  }
670
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetMetrics', {
663
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetMetrics', {
671
664
  request: JSON.stringify(data.request),
672
665
  }, data.timeout)];
673
666
  case 1:
@@ -681,23 +674,24 @@ var Data = /** @class */ (function (_super) {
681
674
  * Get flush state by segment ids
682
675
  *
683
676
  * @param data
684
- * | Property | Type | Description |
685
- * | :---------------------- | :---- | :------------------------------- |
686
- * | segmentIDs | Array | The segment ids |
687
- * | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
677
+ * | Property | Type | Description |
678
+ * | :--- | :-- | :-- |
679
+ * | segmentIDs | Array | The segment ids |
680
+ * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
681
+
688
682
  *
689
683
  *
690
- * @return
691
- * | Property | Description |
692
- * | :-----------| :------------------------------- |
693
- * | status | { error_code: number,reason:string } |
694
- * | flushed | segments flushed or not |
684
+ * @returns
685
+ * | Property | Description |
686
+ * | :--- | :-- |
687
+ * | status | { error_code: number,reason:string } |
688
+ * | flushed | segments flushed or not |
695
689
  *
696
690
  *
697
691
  * #### Example
698
692
  *
699
693
  * ```
700
- * const res = await milvusClient.dataManager.getFlushState({
694
+ * const res = await milvusClient.getFlushState({
701
695
  * segmentIDs: segIds,
702
696
  * });
703
697
  * ```
@@ -709,9 +703,9 @@ var Data = /** @class */ (function (_super) {
709
703
  switch (_a.label) {
710
704
  case 0:
711
705
  if (!data || !data.segmentIDs) {
712
- throw new Error(ErrorReason_1.ERROR_REASONS.GET_FLUSH_STATE_CHECK_PARAMS);
706
+ throw new Error(_1.ERROR_REASONS.GET_FLUSH_STATE_CHECK_PARAMS);
713
707
  }
714
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetFlushState', data, data.timeout)];
708
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetFlushState', data, data.timeout)];
715
709
  case 1:
716
710
  res = _a.sent();
717
711
  return [2 /*return*/, res];
@@ -724,24 +718,24 @@ var Data = /** @class */ (function (_super) {
724
718
  * Only work in cluster milvus.
725
719
  *
726
720
  * @param data
727
- * | Property | Type | Description |
728
- * | :-------------------| :---- | :------------------------------- |
729
- * | src_nodeID | number | The source query node id to balance. |
730
- * | dst_nodeIDs | number[] | The destination query node ids to balance.(optional) |
731
- * | sealed_segmentIDs | number[] | Sealed segment ids to balance.(optional) |
732
- * | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
721
+ * | Property | Type | Description |
722
+ * | :--- | :-- | :-- |
723
+ * | src_nodeID | number | The source query node id to balance. |
724
+ * | dst_nodeIDs | number[] | The destination query node ids to balance.(optional) |
725
+ * | sealed_segmentIDs | number[] | Sealed segment ids to balance.(optional) |
726
+ * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
733
727
  *
734
- * @return
735
- * | Property | Description |
736
- * | :-----------| :------------------------------- |
737
- * | status | { error_code: number,reason:string } |
738
- * | infos | segments infomations |
728
+ * @returns
729
+ * | Property | Description |
730
+ * | :--- | :-- |
731
+ * | status | { error_code: number,reason:string } |
732
+ * | infos | segments infomations |
739
733
  *
740
734
  *
741
735
  * #### Example
742
736
  *
743
737
  * ```
744
- * const res = await dataManager.loadBalance({
738
+ * const res = await loadBalance({
745
739
  * src_nodeID: 31,
746
740
  * });
747
741
  * ```
@@ -753,9 +747,9 @@ var Data = /** @class */ (function (_super) {
753
747
  switch (_a.label) {
754
748
  case 0:
755
749
  if (!data || !data.src_nodeID) {
756
- throw new Error(ErrorReason_1.ERROR_REASONS.LOAD_BALANCE_CHECK_PARAMS);
750
+ throw new Error(_1.ERROR_REASONS.LOAD_BALANCE_CHECK_PARAMS);
757
751
  }
758
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'LoadBalance', data, data.timeout)];
752
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'LoadBalance', data, data.timeout)];
759
753
  case 1:
760
754
  res = _a.sent();
761
755
  return [2 /*return*/, res];
@@ -767,23 +761,23 @@ var Data = /** @class */ (function (_super) {
767
761
  * Notifies Proxy to return segments information from query nodes.
768
762
  *
769
763
  * @param data
770
- * | Property | Type | Description |
771
- * | :---------------------- | :---- | :------------------------------- |
772
- * | collectionName | String | The name of the collection to get segments info. |
773
- * | timeout | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
764
+ * | Property | Type | Description |
765
+ * | :--- | :-- | :-- |
766
+ * | collectionName | String | The name of the collection to get segments info. |
767
+ * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
774
768
  *
775
769
  *
776
- * @return
777
- * | Property | Description |
778
- * | :-----------| :------------------------------- |
779
- * | status | { error_code: number,reason:string } |
780
- * | infos | QuerySegmentInfo is the growing segments's information in query cluster. |
770
+ * @returns
771
+ * | Property | Description |
772
+ * | :--- | :-- |
773
+ * | status | { error_code: number,reason:string } |
774
+ * | infos | QuerySegmentInfo is the growing segments's information in query cluster. |
781
775
  *
782
776
  *
783
777
  * #### Example
784
778
  *
785
779
  * ```
786
- * const res = await dataManager.getQuerySegmentInfo({
780
+ * const res = await getQuerySegmentInfo({
787
781
  * collectionName: COLLECTION,
788
782
  * });
789
783
  * ```
@@ -795,9 +789,9 @@ var Data = /** @class */ (function (_super) {
795
789
  switch (_a.label) {
796
790
  case 0:
797
791
  if (!data || !data.collectionName) {
798
- throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
792
+ throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
799
793
  }
800
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetQuerySegmentInfo', data, data.timeout)];
794
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetQuerySegmentInfo', data, data.timeout)];
801
795
  case 1:
802
796
  res = _a.sent();
803
797
  return [2 /*return*/, res];
@@ -809,28 +803,29 @@ var Data = /** @class */ (function (_super) {
809
803
  * Import data from files
810
804
  *
811
805
  * @param data
812
- * | Property | Type | Description |
813
- * | :---------------------- | :---- | :------------------------------- |
814
- * | collection_name | String | The name of the collection |
815
- * | files | string[] | File path array |
806
+ * | Property | Type | Description |
807
+ * | :--- | :-- | :-- |
808
+ * | collection_name | String | The name of the collection |
809
+ * | files | string[] | File path array |
816
810
  *
817
811
  *
818
- * @return
819
- * | Property | Description |
820
- * | :-----------| :------------------------------- |
821
- * | status | { error_code: number,reason:string } |
822
- * | tasks | taskId array |
812
+ * @returns
813
+ * | Property | Description |
814
+ * | :--- | :-- |
815
+ * | status | { error_code: number,reason:string } |
816
+ * | tasks | taskId array |
823
817
  *
824
818
  *
825
819
  * #### Example
826
820
  *
827
821
  * ```
828
- * const res = await dataManager.bulkInsert({
822
+ * const res = await bulkInsert({
829
823
  * collection_name: COLLECTION,
830
824
  * files: [`path-to-data-file.json`]
831
825
  * });
832
826
  * ```
833
827
  */
828
+ /* istanbul ignore next */
834
829
  Data.prototype.bulkInsert = function (data) {
835
830
  return __awaiter(this, void 0, void 0, function () {
836
831
  var res;
@@ -838,12 +833,12 @@ var Data = /** @class */ (function (_super) {
838
833
  switch (_a.label) {
839
834
  case 0:
840
835
  if (!data || !data.collection_name) {
841
- throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
836
+ throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
842
837
  }
843
838
  if (!data || !data.files) {
844
- throw new Error(ErrorReason_1.ERROR_REASONS.IMPORT_FILE_CHECK);
839
+ throw new Error(_1.ERROR_REASONS.IMPORT_FILE_CHECK);
845
840
  }
846
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'Import', __assign(__assign({}, data), { options: data.options || [] }), data.timeout)];
841
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'Import', __assign(__assign({}, data), { options: data.options || [] }), data.timeout)];
847
842
  case 1:
848
843
  res = _a.sent();
849
844
  return [2 /*return*/, res];
@@ -855,32 +850,32 @@ var Data = /** @class */ (function (_super) {
855
850
  * List import tasks
856
851
  *
857
852
  * @param data
858
- * | Property | Type | Description |
859
- * | :---------------------- | :---- | :------------------------------- |
860
- * | collection_name | String | The name of the collection |
861
- * | limit | number | optional, maximum number of tasks returned, list all tasks if the value is 0 |
853
+ * | Property | Type | Description |
854
+ * | :--- | :-- | :-- |
855
+ * | collection_name | String | The name of the collection |
856
+ * | limit | number | optional, maximum number of tasks returned, list all tasks if the value is 0 |
862
857
  *
863
858
  *
864
- * @return
865
- * | Property | Description |
866
- * | :-----------| :------------------------------- |
867
- * | status | { error_code: number,reason:string } |
859
+ * @returns
860
+ * | Property | Description |
861
+ * | :--- | :-- |
862
+ * | status | { error_code: number,reason:string } |
868
863
  * | state | import state |
869
864
  * | row_count | how many rows to import|
870
865
  * | id_list| id lists |
871
866
  * | collection_id | collection to be imported to |
872
- * |
873
- * | tasks | taskId array |
867
+ * | tasks | taskId array |
874
868
  *
875
869
  *
876
870
  * #### Example
877
871
  *
878
872
  * ```
879
- * const res = await dataManager.listImportTasks({
873
+ * const res = await listImportTasks({
880
874
  * collection_name: COLLECTION
881
875
  * });
882
876
  * ```
883
877
  */
878
+ /* istanbul ignore next */
884
879
  Data.prototype.listImportTasks = function (data) {
885
880
  return __awaiter(this, void 0, void 0, function () {
886
881
  var res;
@@ -888,9 +883,9 @@ var Data = /** @class */ (function (_super) {
888
883
  switch (_a.label) {
889
884
  case 0:
890
885
  if (!data || !data.collection_name) {
891
- throw new Error(ErrorReason_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
886
+ throw new Error(_1.ERROR_REASONS.COLLECTION_NAME_IS_REQUIRED);
892
887
  }
893
- return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ListImportTasks', __assign(__assign({}, data), { limit: data.limit || 0 }), data.timeout)];
888
+ return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'ListImportTasks', __assign(__assign({}, data), { limit: data.limit || 0 }), data.timeout)];
894
889
  case 1:
895
890
  res = _a.sent();
896
891
  return [2 /*return*/, res];
@@ -899,6 +894,6 @@ var Data = /** @class */ (function (_super) {
899
894
  });
900
895
  };
901
896
  return Data;
902
- }(Client_1.Client));
897
+ }(Collection_1.Collection));
903
898
  exports.Data = Data;
904
899
  //# sourceMappingURL=Data.js.map