@zilliz/milvus2-sdk-node 2.0.3 → 2.1.2

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.
@@ -5,27 +5,19 @@ var ErrorReason_1 = require("../const/ErrorReason");
5
5
  var Common_1 = require("../types/Common");
6
6
  /**
7
7
  * when create collection, field must contain 2 Fields.
8
- * Type is int64 and primary_key = true
8
+ * Type is int64 or varchar and primary_key = true
9
9
  * Type is one of float_vector and binary_vector
10
10
  * Will check fields
11
11
  * @param fields
12
12
  */
13
13
  var checkCollectionFields = function (fields) {
14
14
  var vectorTypes = [Common_1.DataType.BinaryVector, Common_1.DataType.FloatVector];
15
- var primaryTypes = [
16
- Common_1.DataType.Int16,
17
- Common_1.DataType.Int32,
18
- Common_1.DataType.Int8,
19
- Common_1.DataType.Int64,
20
- ];
21
- if (!fields.find(function (v) {
22
- return v.data_type && primaryTypes.includes(v.data_type) && v.is_primary_key;
23
- })) {
15
+ // primary key only support DataType.Int64 and varchar
16
+ var primaryTypes = [Common_1.DataType.Int64, Common_1.DataType.VarChar];
17
+ if (!fields.find(function (v) { return v.data_type && primaryTypes.includes(v.data_type) && v.is_primary_key; })) {
24
18
  throw new Error(ErrorReason_1.ERROR_REASONS.CREATE_COLLECTION_CHECK_PRIMARY_KEY);
25
19
  }
26
- if (!fields.find(function (v) {
27
- return v.data_type ? vectorTypes.includes(v.data_type) : false;
28
- })) {
20
+ if (!fields.find(function (v) { return (v.data_type ? vectorTypes.includes(v.data_type) : false); })) {
29
21
  throw new Error(ErrorReason_1.ERROR_REASONS.CREATE_COLLECTION_CHECK_VECTOR_FIELD_EXIST);
30
22
  }
31
23
  fields.forEach(function (v) {
@@ -1 +1 @@
1
- {"version":3,"file":"Validate.js","sourceRoot":"","sources":["../../../milvus/utils/Validate.ts"],"names":[],"mappings":";;;AAAA,oDAAqD;AAErD,0CAA2C;AAE3C;;;;;;GAMG;AACI,IAAM,qBAAqB,GAAG,UAAC,MAAmB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CAAC,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,SAAS,CAAC;YAC1D,IAAI,CAAC,GAAG,EAAE;gBACR,MAAM,IAAI,KAAK,CAAC,2BAAa,CAAC,gCAAgC,CAAC,CAAC;aACjE;YACD,IAAI,CAAC,CAAC,SAAS,KAAK,iBAAQ,CAAC,YAAY,IAAI,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;gBAChE,MAAM,IAAI,KAAK,CAAC,2BAAa,CAAC,kCAAkC,CAAC,CAAC;aACnE;SACF;IACH,CAAC,CAAC,CAAC;IAEH,OAAO,IAAI,CAAC;AACd,CAAC,CAAC;AA9BW,QAAA,qBAAqB,yBA8BhC"}
@@ -8,6 +8,8 @@ option java_package = "io.milvus.grpc";
8
8
  option java_outer_classname = "CommonProto";
9
9
  option java_generate_equals_and_hash = true;
10
10
 
11
+ import "google/protobuf/descriptor.proto";
12
+
11
13
  enum ErrorCode {
12
14
  Success = 0;
13
15
  UnexpectedError = 1;
@@ -42,6 +44,19 @@ enum ErrorCode {
42
44
  DeleteCredentialFailure = 31;
43
45
  GetCredentialFailure = 32;
44
46
  ListCredUsersFailure = 33;
47
+ GetUserFailure = 34;
48
+ CreateRoleFailure = 35;
49
+ DropRoleFailure = 36;
50
+ OperateUserRoleFailure = 37;
51
+ SelectRoleFailure = 38;
52
+ SelectUserFailure = 39;
53
+ SelectResourceFailure = 40;
54
+ OperatePrivilegeFailure = 41;
55
+ SelectGrantFailure = 42;
56
+ RefreshPolicyInfoCacheFailure = 43;
57
+ ListPolicyFailure = 44;
58
+ NotShardLeader = 45;
59
+ NoReplicaAvailable = 46;
45
60
 
46
61
  // internal error code.
47
62
  DDRequestRace = 1000;
@@ -85,6 +100,24 @@ message Blob {
85
100
  bytes value = 1;
86
101
  }
87
102
 
103
+ enum PlaceholderType {
104
+ None = 0;
105
+ BinaryVector = 100;
106
+ FloatVector = 101;
107
+ }
108
+
109
+ message PlaceholderValue {
110
+ string tag = 1;
111
+ PlaceholderType type = 2;
112
+ // values is a 2d-array, every array contains a vector
113
+ repeated bytes values = 3;
114
+ }
115
+
116
+ message PlaceholderGroup {
117
+ repeated PlaceholderValue placeholders = 1;
118
+ }
119
+
120
+
88
121
  message Address {
89
122
  string ip = 1;
90
123
  int64 port = 2;
@@ -133,6 +166,7 @@ enum MsgType {
133
166
  Insert = 400;
134
167
  Delete = 401;
135
168
  Flush = 402;
169
+ ResendSegmentStats = 403;
136
170
 
137
171
  /* QUERY */
138
172
  Search = 500;
@@ -176,6 +210,18 @@ enum MsgType {
176
210
  DeleteCredential = 1502;
177
211
  UpdateCredential = 1503;
178
212
  ListCredUsernames = 1504;
213
+
214
+ /* RBAC */
215
+ CreateRole = 1600;
216
+ DropRole = 1601;
217
+ OperateUserRole = 1602;
218
+ SelectRole = 1603;
219
+ SelectUser = 1604;
220
+ SelectResource = 1605;
221
+ OperatePrivilege = 1606;
222
+ SelectGrant = 1607;
223
+ RefreshPolicyInfoCache = 1608;
224
+ ListPolicy = 1609;
179
225
  }
180
226
 
181
227
  message MsgBase {
@@ -223,4 +269,32 @@ enum ImportState {
223
269
  ImportParsed = 4;
224
270
  ImportPersisted = 5;
225
271
  ImportCompleted = 6;
272
+ ImportAllocSegment = 10;
273
+ }
274
+
275
+ enum ResourceType {
276
+ Collection = 0;
277
+ }
278
+
279
+ enum ResourcePrivilege {
280
+ PrivilegeAll = 0;
281
+ PrivilegeCreate = 1;
282
+ PrivilegeDrop = 2;
283
+ PrivilegeAlter = 3;
284
+ PrivilegeRead = 4;
285
+ PrivilegeLoad = 5;
286
+ PrivilegeRelease = 6;
287
+ PrivilegeCompact = 7;
288
+ PrivilegeInsert = 8;
289
+ PrivilegeDelete = 9;
290
+ }
291
+
292
+ message PrivilegeExt {
293
+ ResourceType resource_type = 1;
294
+ ResourcePrivilege resource_privilege = 2;
295
+ int32 resource_name_index = 3;
226
296
  }
297
+
298
+ extend google.protobuf.MessageOptions {
299
+ PrivilegeExt privilege_ext_obj = 1001;
300
+ }