@zilliz/milvus2-sdk-node 2.0.3 → 2.1.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.
@@ -10,6 +10,7 @@ option java_generate_equals_and_hash = true;
10
10
 
11
11
  import "common.proto";
12
12
  import "schema.proto";
13
+ import "google/protobuf/descriptor.proto";
13
14
 
14
15
  service MilvusService {
15
16
  rpc CreateCollection(CreateCollectionRequest) returns (common.Status) {}
@@ -73,6 +74,16 @@ service MilvusService {
73
74
  rpc UpdateCredential(UpdateCredentialRequest) returns (common.Status) {}
74
75
  rpc DeleteCredential(DeleteCredentialRequest) returns (common.Status) {}
75
76
  rpc ListCredUsers(ListCredUsersRequest) returns (ListCredUsersResponse) {}
77
+
78
+ // https://wiki.lfaidata.foundation/display/MIL/MEP+29+--+Support+Role-Based+Access+Control
79
+ rpc CreateRole(CreateRoleRequest) returns (common.Status) {}
80
+ rpc DropRole(DropRoleRequest) returns (common.Status) {}
81
+ rpc OperateUserRole(OperateUserRoleRequest) returns (common.Status) {}
82
+ rpc SelectRole(SelectRoleRequest) returns (SelectRoleResponse) {}
83
+ rpc SelectUser(SelectUserRequest) returns (SelectUserResponse) {}
84
+ rpc SelectResource(SelectResourceRequest) returns (SelectResourceResponse) {}
85
+ rpc OperatePrivilege(OperatePrivilegeRequest) returns (common.Status) {}
86
+ rpc SelectGrant(SelectGrantRequest) returns (SelectGrantResponse) {}
76
87
  }
77
88
 
78
89
  message CreateAliasRequest {
@@ -99,14 +110,19 @@ message AlterAliasRequest{
99
110
  * Create collection in milvus
100
111
  */
101
112
  message CreateCollectionRequest {
113
+ option (common.privilege_ext_obj) = {
114
+ resource_type: Collection
115
+ resource_privilege: PrivilegeCreate
116
+ resource_name_index: 3
117
+ };
102
118
  // Not useful for now
103
119
  common.MsgBase base = 1;
104
120
  // Not useful for now
105
121
  string db_name = 2;
106
122
  // The unique collection name in milvus.(Required)
107
- string collection_name = 3;
123
+ string collection_name = 3;
108
124
  // The serialized `schema.CollectionSchema`(Required)
109
- bytes schema = 4;
125
+ bytes schema = 4;
110
126
  // Once set, no modification is allowed (Optional)
111
127
  // https://github.com/milvus-io/milvus/issues/6690
112
128
  int32 shards_num = 5;
@@ -115,11 +131,16 @@ message CreateCollectionRequest {
115
131
  }
116
132
 
117
133
  /**
118
- * Drop collection in milvus, also will drop data in collection.
134
+ * Drop collection in milvus, also will drop data in collection.
119
135
  */
120
136
  message DropCollectionRequest {
137
+ option (common.privilege_ext_obj) = {
138
+ resource_type: Collection
139
+ resource_privilege: PrivilegeDrop
140
+ resource_name_index: 3
141
+ };
121
142
  // Not useful for now
122
- common.MsgBase base = 1;
143
+ common.MsgBase base = 1;
123
144
  // Not useful for now
124
145
  string db_name = 2;
125
146
  // The unique collection name in milvus.(Required)
@@ -130,12 +151,17 @@ message DropCollectionRequest {
130
151
  * Check collection exist in milvus or not.
131
152
  */
132
153
  message HasCollectionRequest {
154
+ option (common.privilege_ext_obj) = {
155
+ resource_type: Collection
156
+ resource_privilege: PrivilegeRead
157
+ resource_name_index: 3
158
+ };
133
159
  // Not useful for now
134
160
  common.MsgBase base = 1;
135
161
  // Not useful for now
136
162
  string db_name = 2;
137
163
  // The collection name you want to check.
138
- string collection_name = 3;
164
+ string collection_name = 3;
139
165
  // If time_stamp is not zero, will return true when time_stamp >= created collection timestamp, otherwise will return false.
140
166
  uint64 time_stamp = 4;
141
167
  }
@@ -155,6 +181,11 @@ message StringResponse {
155
181
  * Get collection meta datas like: schema, collectionID, shards number ...
156
182
  */
157
183
  message DescribeCollectionRequest {
184
+ option (common.privilege_ext_obj) = {
185
+ resource_type: Collection
186
+ resource_privilege: PrivilegeRead
187
+ resource_name_index: 3
188
+ };
158
189
  // Not useful for now
159
190
  common.MsgBase base = 1;
160
191
  // Not useful for now
@@ -201,6 +232,11 @@ message DescribeCollectionResponse {
201
232
  * Load collection data into query nodes, then you can do vector search on this collection.
202
233
  */
203
234
  message LoadCollectionRequest {
235
+ option (common.privilege_ext_obj) = {
236
+ resource_type: Collection
237
+ resource_privilege: PrivilegeLoad
238
+ resource_name_index: 3
239
+ };
204
240
  // Not useful for now
205
241
  common.MsgBase base = 1;
206
242
  // Not useful for now
@@ -215,6 +251,11 @@ message LoadCollectionRequest {
215
251
  * Release collection data from query nodes, then you can't do vector search on this collection.
216
252
  */
217
253
  message ReleaseCollectionRequest {
254
+ option (common.privilege_ext_obj) = {
255
+ resource_type: Collection
256
+ resource_privilege: PrivilegeRelease
257
+ resource_name_index: 3
258
+ };
218
259
  // Not useful for now
219
260
  common.MsgBase base = 1;
220
261
  // Not useful for now
@@ -227,6 +268,11 @@ message ReleaseCollectionRequest {
227
268
  * Get collection statistics like row_count.
228
269
  */
229
270
  message GetCollectionStatisticsRequest {
271
+ option (common.privilege_ext_obj) = {
272
+ resource_type: Collection
273
+ resource_privilege: PrivilegeRead
274
+ resource_name_index: 3
275
+ };
230
276
  // Not useful for now
231
277
  common.MsgBase base = 1;
232
278
  // Not useful for now
@@ -249,16 +295,20 @@ message GetCollectionStatisticsResponse {
249
295
  * This is for ShowCollectionsRequest type field.
250
296
  */
251
297
  enum ShowType {
252
- // Will return all colloections
298
+ // Will return all colloections
253
299
  All = 0;
254
300
  // Will return loaded collections with their inMemory_percentages
255
301
  InMemory = 1;
256
302
  }
257
303
 
258
304
  /*
259
- * List collections
305
+ * List collections
260
306
  */
261
307
  message ShowCollectionsRequest {
308
+ option (common.privilege_ext_obj) = {
309
+ resource_type: Collection
310
+ resource_privilege: PrivilegeRead
311
+ };
262
312
  // Not useful for now
263
313
  common.MsgBase base = 1;
264
314
  // Not useful for now
@@ -268,7 +318,7 @@ message ShowCollectionsRequest {
268
318
  // Decide return Loaded collections or All collections(Optional)
269
319
  ShowType type = 4;
270
320
  // When type is InMemory, will return these collection's inMemory_percentages.(Optional)
271
- repeated string collection_names = 5;
321
+ repeated string collection_names = 5;
272
322
  }
273
323
 
274
324
  /*
@@ -286,7 +336,9 @@ message ShowCollectionsResponse {
286
336
  // The utc timestamp calculated by created_timestamp
287
337
  repeated uint64 created_utc_timestamps = 5;
288
338
  // Load percentage on querynode when type is InMemory
289
- repeated int64 inMemory_percentages = 6;
339
+ repeated int64 inMemory_percentages = 6;
340
+ // Indicate whether query service is available
341
+ repeated bool query_service_available = 7;
290
342
  }
291
343
 
292
344
  /*
@@ -314,7 +366,7 @@ message DropPartitionRequest {
314
366
  // The collection name in milvus
315
367
  string collection_name = 3;
316
368
  // The partition name you want to drop
317
- string partition_name = 4;
369
+ string partition_name = 4;
318
370
  }
319
371
 
320
372
  /*
@@ -374,7 +426,7 @@ message GetPartitionStatisticsRequest {
374
426
  // The collection name in milvus
375
427
  string collection_name = 3;
376
428
  // The partition name you want to collect statistics
377
- string partition_name = 4;
429
+ string partition_name = 4;
378
430
  }
379
431
 
380
432
  message GetPartitionStatisticsResponse {
@@ -449,7 +501,7 @@ message ShowSegmentsResponse {
449
501
  */
450
502
  message CreateIndexRequest {
451
503
  // Not useful for now
452
- common.MsgBase base = 1;
504
+ common.MsgBase base = 1;
453
505
  // Not useful for now
454
506
  string db_name = 2;
455
507
  // The particular collection name you want to create index.
@@ -463,7 +515,7 @@ message CreateIndexRequest {
463
515
  }
464
516
 
465
517
  /*
466
- * Get created index information.
518
+ * Get created index information.
467
519
  * Current release of Milvus only supports showing latest built index.
468
520
  */
469
521
  message DescribeIndexRequest {
@@ -476,7 +528,7 @@ message DescribeIndexRequest {
476
528
  // The vector field name in this particular collection
477
529
  string field_name = 4;
478
530
  // No need to set up for now @2021.06.30
479
- string index_name = 5;
531
+ string index_name = 5;
480
532
  }
481
533
 
482
534
  /*
@@ -504,7 +556,7 @@ message DescribeIndexResponse {
504
556
  }
505
557
 
506
558
  /*
507
- * Get index building progress
559
+ * Get index building progress
508
560
  */
509
561
  message GetIndexBuildProgressRequest {
510
562
  // Not useful for now
@@ -578,22 +630,6 @@ message DeleteRequest {
578
630
  repeated uint32 hash_keys = 6;
579
631
  }
580
632
 
581
- enum PlaceholderType {
582
- None = 0;
583
- BinaryVector = 100;
584
- FloatVector = 101;
585
- }
586
-
587
- message PlaceholderValue {
588
- string tag = 1;
589
- PlaceholderType type = 2;
590
- // values is a 2d-array, every array contains a vector
591
- repeated bytes values = 3;
592
- }
593
-
594
- message PlaceholderGroup {
595
- repeated PlaceholderValue placeholders = 1;
596
- }
597
633
 
598
634
  message SearchRequest {
599
635
  common.MsgBase base = 1; // must
@@ -608,6 +644,7 @@ message SearchRequest {
608
644
  repeated common.KeyValuePair search_params = 9; // must
609
645
  uint64 travel_timestamp = 10;
610
646
  uint64 guarantee_timestamp = 11; // guarantee_timestamp
647
+ int64 nq = 12;
611
648
  }
612
649
 
613
650
  message Hits {
@@ -662,7 +699,7 @@ message VectorsArray {
662
699
  oneof array {
663
700
  VectorIDs id_array = 1; // vector ids
664
701
  schema.VectorField data_array = 2; // vectors data
665
- }
702
+ }
666
703
  }
667
704
 
668
705
  message CalcDistanceRequest {
@@ -708,8 +745,10 @@ message QuerySegmentInfo {
708
745
  int64 num_rows = 5;
709
746
  string index_name = 6;
710
747
  int64 indexID = 7;
748
+ // deprecated, check node_ids(NodeIds) field
711
749
  int64 nodeID = 8;
712
750
  common.SegmentState state = 9;
751
+ repeated int64 nodeIds = 10;
713
752
  }
714
753
 
715
754
  message GetQuerySegmentInfoRequest {
@@ -815,23 +854,25 @@ message ImportRequest {
815
854
  repeated string files = 5; // file paths to be imported
816
855
  repeated common.KeyValuePair options = 6; // import options, bucket, etc.
817
856
  }
818
-
857
+
819
858
  message ImportResponse {
820
859
  common.Status status = 1;
821
860
  repeated int64 tasks = 2; // id array of import tasks
822
861
  }
823
-
862
+
824
863
  message GetImportStateRequest {
825
864
  int64 task = 1; // id of an import task
826
865
  }
827
-
866
+
828
867
  message GetImportStateResponse {
829
868
  common.Status status = 1;
830
- common.ImportState state = 2; // is this import task finished or not
831
- int64 row_count = 3; // if the task is finished, this value is how many rows are imported. if the task is not finished, this value is how many rows are parsed. return 0 if failed.
832
- repeated int64 id_list = 4; // auto generated ids if the primary key is autoid
833
- repeated common.KeyValuePair infos = 5; // more informations about the task, progress percent, file path, failed reason, etc.
834
- int64 id = 6; // id of an import task
869
+ common.ImportState state = 2; // is this import task finished or not
870
+ int64 row_count = 3; // if the task is finished, this value is how many rows are imported. if the task is not finished, this value is how many rows are parsed. return 0 if failed.
871
+ repeated int64 id_list = 4; // auto generated ids if the primary key is autoid
872
+ repeated common.KeyValuePair infos = 5; // more information about the task, progress percent, file path, failed reason, etc.
873
+ int64 id = 6; // id of an import task
874
+ bool data_queryable = 7; // A flag indicating whether import data are queryable (i.e. loaded in query nodes)
875
+ bool data_indexed = 8; // A flag indicating whether import data are indexed.
835
876
  }
836
877
 
837
878
  message ListImportTasksRequest {
@@ -923,3 +964,178 @@ message ListCredUsersRequest {
923
964
  common.MsgBase base = 1;
924
965
  }
925
966
 
967
+ // https://wiki.lfaidata.foundation/display/MIL/MEP+29+--+Support+Role-Based+Access+Control
968
+ message RoleEntity {
969
+ string name = 1;
970
+ }
971
+
972
+ message UserEntity {
973
+ string name = 1;
974
+ }
975
+
976
+ message CreateRoleRequest {
977
+ // Not useful for now
978
+ common.MsgBase base = 1;
979
+ // role
980
+ RoleEntity entity = 2;
981
+ }
982
+
983
+ message DropRoleRequest {
984
+ // Not useful for now
985
+ common.MsgBase base = 1;
986
+ // role name
987
+ string role_name = 2;
988
+ }
989
+
990
+ enum OperateUserRoleType {
991
+ AddUserToRole = 0;
992
+ RemoveUserFromRole = 1;
993
+ }
994
+
995
+ message OperateUserRoleRequest {
996
+ // Not useful for now
997
+ common.MsgBase base = 1;
998
+ // username
999
+ string username = 2;
1000
+ // role name
1001
+ string role_name = 3;
1002
+ // operation type
1003
+ OperateUserRoleType type = 4;
1004
+ }
1005
+
1006
+ message SelectRoleRequest {
1007
+ // Not useful for now
1008
+ common.MsgBase base = 1;
1009
+ // role
1010
+ RoleEntity role = 2;
1011
+ // include user info
1012
+ bool include_user_info = 3;
1013
+ }
1014
+
1015
+ message RoleResult {
1016
+ RoleEntity role = 1;
1017
+ repeated UserEntity users = 2;
1018
+ }
1019
+
1020
+ message SelectRoleResponse {
1021
+ // Not useful for now
1022
+ common.Status status = 1;
1023
+ // role result array
1024
+ repeated RoleResult results = 2;
1025
+ }
1026
+
1027
+ message SelectUserRequest {
1028
+ // Not useful for now
1029
+ common.MsgBase base = 1;
1030
+ // user
1031
+ UserEntity user = 2;
1032
+ // include user info
1033
+ bool include_role_info = 3;
1034
+ }
1035
+
1036
+ message UserResult {
1037
+ UserEntity user = 1;
1038
+ repeated RoleEntity roles = 2;
1039
+ }
1040
+
1041
+ message SelectUserResponse {
1042
+ // Not useful for now
1043
+ common.Status status = 1;
1044
+ // user result array
1045
+ repeated UserResult result = 2;
1046
+ }
1047
+
1048
+ message ResourceEntity {
1049
+ string type = 1;
1050
+ }
1051
+
1052
+ message PrivilegeEntity {
1053
+ string name = 1;
1054
+ }
1055
+
1056
+ message SelectResourceRequest {
1057
+ // Not useful for now
1058
+ common.MsgBase base = 1;
1059
+ // resource
1060
+ ResourceEntity entity = 2;
1061
+ // include privilege info
1062
+ bool include_privilege_info = 3;
1063
+ }
1064
+
1065
+ message ResourceResult {
1066
+ ResourceEntity resource = 1;
1067
+ repeated PrivilegeEntity privileges = 2;
1068
+ }
1069
+
1070
+ message SelectResourceResponse {
1071
+ // Not useful for now
1072
+ common.Status status = 1;
1073
+ // resource result array
1074
+ repeated ResourceResult results = 2;
1075
+ }
1076
+
1077
+ message PrincipalEntity {
1078
+ // principal type, including user, role
1079
+ string principal_type = 1;
1080
+ // principal, including user entity or role entity
1081
+ oneof principal {
1082
+ UserEntity user = 2;
1083
+ RoleEntity role = 3;
1084
+ }
1085
+ }
1086
+
1087
+ message GrantorEntity {
1088
+ UserEntity user = 1;
1089
+ PrivilegeEntity privilege = 2;
1090
+ }
1091
+
1092
+ message GrantEntity {
1093
+ // principal
1094
+ PrincipalEntity principal = 1;
1095
+ // resource
1096
+ ResourceEntity resource = 2;
1097
+ // resource name
1098
+ string resource_name = 3;
1099
+ // privilege
1100
+ GrantorEntity grantor = 4;
1101
+ }
1102
+
1103
+ message SelectGrantRequest {
1104
+ // Not useful for now
1105
+ common.MsgBase base = 1;
1106
+ // grant
1107
+ GrantEntity entity = 2;
1108
+ }
1109
+
1110
+ message SelectGrantResponse {
1111
+ // Not useful for now
1112
+ common.Status status = 1;
1113
+ // grant info array
1114
+ repeated GrantEntity entities = 2;
1115
+ }
1116
+
1117
+ enum OperatePrivilegeType {
1118
+ Grant = 0;
1119
+ Revoke = 1;
1120
+ }
1121
+
1122
+ message OperatePrivilegeRequest {
1123
+ // Not useful for now
1124
+ common.MsgBase base = 1;
1125
+ // grant
1126
+ GrantEntity entity = 2;
1127
+ // operation type
1128
+ OperatePrivilegeType type = 3;
1129
+ }
1130
+
1131
+ message MilvusExt {
1132
+ string version = 1;
1133
+ }
1134
+
1135
+ extend google.protobuf.FileOptions {
1136
+ MilvusExt milvus_ext_obj = 1001;
1137
+ }
1138
+
1139
+ option (milvus_ext_obj) = {
1140
+ version: "2.1.0"
1141
+ };
package/dist/sdk.json CHANGED
@@ -1 +1 @@
1
- {"version":"2.0.3","milvusVersion":"v2.0.2"}
1
+ {"version":"2.1.0","milvusVersion":"v2.1.0"}
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@zilliz/milvus2-sdk-node",
3
3
  "author": "ued@zilliz.com",
4
- "version": "2.0.3",
5
- "milvusVersion": "v2.0.2",
4
+ "version": "2.1.0",
5
+ "milvusVersion": "v2.1.0",
6
6
  "main": "dist/milvus",
7
7
  "files": [
8
8
  "dist"
9
9
  ],
10
10
  "scripts": {
11
+ "pre": "git submodule update --remote && rm -rf proto/proto/google && mkdir -p proto/proto/google/protobuf && wget https://raw.githubusercontent.com/protocolbuffers/protobuf/main/src/google/protobuf/descriptor.proto -O proto/proto/google/protobuf/descriptor.proto",
11
12
  "build": "tsc --declaration && node build.js",
12
13
  "testAll": "jest --testPathIgnorePatterns=/test/build/",
13
14
  "test": "jest",
@@ -24,7 +25,7 @@
24
25
  "@microsoft/api-extractor": "^7.18.5",
25
26
  "json-schema": "^0.4.0",
26
27
  "node-forge": "^1.0.0",
27
- "protobufjs": "^6.11.2"
28
+ "protobufjs": "^6.11.3"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@babel/plugin-transform-modules-commonjs": "^7.13.8",