@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.
- package/README.md +4 -21
- package/dist/milvus/BaseClient.d.ts +17 -0
- package/dist/milvus/BaseClient.js +58 -0
- package/dist/milvus/BaseClient.js.map +1 -0
- package/dist/milvus/Collection.d.ts +263 -171
- package/dist/milvus/Collection.js +328 -233
- package/dist/milvus/Collection.js.map +1 -1
- package/dist/milvus/Data.d.ts +142 -142
- package/dist/milvus/Data.js +211 -216
- package/dist/milvus/Data.js.map +1 -1
- package/dist/milvus/MilvusClient.d.ts +17 -0
- package/dist/milvus/MilvusClient.js +163 -0
- package/dist/milvus/MilvusClient.js.map +1 -0
- package/dist/milvus/MilvusIndex.d.ts +64 -60
- package/dist/milvus/MilvusIndex.js +74 -69
- package/dist/milvus/MilvusIndex.js.map +1 -1
- package/dist/milvus/Partition.d.ts +95 -88
- package/dist/milvus/Partition.js +108 -101
- package/dist/milvus/Partition.js.map +1 -1
- package/dist/milvus/Resource.d.ts +172 -0
- package/dist/milvus/Resource.js +356 -0
- package/dist/milvus/Resource.js.map +1 -0
- package/dist/milvus/User.d.ts +136 -110
- package/dist/milvus/User.js +171 -140
- package/dist/milvus/User.js.map +1 -1
- package/dist/milvus/Utils.d.ts +1 -1
- package/dist/milvus/Utils.js +1 -1
- package/dist/milvus/Utils.js.map +1 -1
- package/dist/milvus/const/Milvus.d.ts +270 -0
- package/dist/milvus/const/Milvus.js +370 -1
- package/dist/milvus/const/Milvus.js.map +1 -1
- package/dist/milvus/index.d.ts +11 -46
- package/dist/milvus/index.js +16 -186
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Collection.d.ts +88 -8
- package/dist/milvus/types/Collection.js +1 -9
- package/dist/milvus/types/Collection.js.map +1 -1
- package/dist/milvus/types/Common.d.ts +11 -267
- package/dist/milvus/types/Common.js +1 -369
- package/dist/milvus/types/Common.js.map +1 -1
- package/dist/milvus/types/Data.d.ts +154 -1
- package/dist/milvus/types/Index.d.ts +20 -1
- package/dist/milvus/types/Partition.d.ts +8 -1
- package/dist/milvus/types/Resource.d.ts +44 -0
- package/dist/milvus/types/{Search.js → Resource.js} +1 -1
- package/dist/milvus/types/Resource.js.map +1 -0
- package/dist/milvus/types/Response.d.ts +0 -246
- package/dist/milvus/types/Response.js.map +1 -1
- package/dist/milvus/types/User.d.ts +54 -2
- package/dist/milvus/types.d.ts +8 -7
- package/dist/milvus/types.js +2 -1
- package/dist/milvus/types.js.map +1 -1
- package/dist/proto/proto/common.proto +23 -2
- package/dist/proto/proto/feder.proto +40 -0
- package/dist/proto/proto/google/protobuf/descriptor.proto +31 -1
- package/dist/proto/proto/milvus.proto +101 -0
- package/dist/proto/proto/msg.proto +107 -0
- package/dist/proto/proto/schema.proto +18 -23
- package/dist/sdk.json +1 -1
- package/dist/utils/Blob.js.map +1 -0
- package/dist/{milvus/utils → utils}/Format.d.ts +12 -11
- package/dist/{milvus/utils → utils}/Format.js +18 -17
- package/dist/utils/Format.js.map +1 -0
- package/dist/utils/Function.d.ts +4 -0
- package/dist/utils/Function.js +33 -0
- package/dist/utils/Function.js.map +1 -0
- package/dist/utils/Grpc.d.ts +19 -0
- package/dist/utils/Grpc.js +64 -0
- package/dist/utils/Grpc.js.map +1 -0
- package/dist/utils/Validate.d.ts +21 -0
- package/dist/{milvus/utils → utils}/Validate.js +28 -6
- package/dist/utils/Validate.js.map +1 -0
- package/dist/utils/index.d.ts +5 -7
- package/dist/utils/index.js +17 -52
- package/dist/utils/index.js.map +1 -1
- package/dist/utils/test.d.ts +14 -0
- package/dist/utils/test.js +68 -0
- package/dist/utils/test.js.map +1 -0
- package/package.json +7 -12
- package/dist/milvus/Client.d.ts +0 -12
- package/dist/milvus/Client.js +0 -28
- package/dist/milvus/Client.js.map +0 -1
- package/dist/milvus/types/Search.d.ts +0 -81
- package/dist/milvus/types/Search.js.map +0 -1
- package/dist/milvus/utils/Blob.js.map +0 -1
- package/dist/milvus/utils/Format.js.map +0 -1
- package/dist/milvus/utils/Validate.d.ts +0 -9
- package/dist/milvus/utils/Validate.js.map +0 -1
- package/dist/milvus/utils/index.d.ts +0 -3
- package/dist/milvus/utils/index.js +0 -10
- package/dist/milvus/utils/index.js.map +0 -1
- /package/dist/{milvus/utils → utils}/Blob.d.ts +0 -0
- /package/dist/{milvus/utils → utils}/Blob.js +0 -0
|
@@ -12,6 +12,7 @@ option csharp_namespace = "IO.Milvus.Grpc";
|
|
|
12
12
|
|
|
13
13
|
import "common.proto";
|
|
14
14
|
import "schema.proto";
|
|
15
|
+
import "feder.proto";
|
|
15
16
|
import "google/protobuf/descriptor.proto";
|
|
16
17
|
|
|
17
18
|
service MilvusService {
|
|
@@ -39,6 +40,8 @@ service MilvusService {
|
|
|
39
40
|
rpc CreateAlias(CreateAliasRequest) returns (common.Status) {}
|
|
40
41
|
rpc DropAlias(DropAliasRequest) returns (common.Status) {}
|
|
41
42
|
rpc AlterAlias(AlterAliasRequest) returns (common.Status) {}
|
|
43
|
+
rpc DescribeAlias(DescribeAliasRequest) returns (DescribeAliasResponse) {}
|
|
44
|
+
rpc ListAliases(ListAliasesRequest) returns (ListAliasesResponse) {}
|
|
42
45
|
|
|
43
46
|
rpc CreateIndex(CreateIndexRequest) returns (common.Status) {}
|
|
44
47
|
rpc DescribeIndex(DescribeIndexRequest) returns (DescribeIndexResponse) {}
|
|
@@ -55,8 +58,10 @@ service MilvusService {
|
|
|
55
58
|
rpc Flush(FlushRequest) returns (FlushResponse) {}
|
|
56
59
|
rpc Query(QueryRequest) returns (QueryResults) {}
|
|
57
60
|
rpc CalcDistance(CalcDistanceRequest) returns (CalcDistanceResults) {}
|
|
61
|
+
rpc FlushAll(FlushAllRequest) returns (FlushAllResponse) {}
|
|
58
62
|
|
|
59
63
|
rpc GetFlushState(GetFlushStateRequest) returns (GetFlushStateResponse) {}
|
|
64
|
+
rpc GetFlushAllState(GetFlushAllStateRequest) returns (GetFlushAllStateResponse) {}
|
|
60
65
|
rpc GetPersistentSegmentInfo(GetPersistentSegmentInfoRequest) returns (GetPersistentSegmentInfoResponse) {}
|
|
61
66
|
rpc GetQuerySegmentInfo(GetQuerySegmentInfoRequest) returns (GetQuerySegmentInfoResponse) {}
|
|
62
67
|
rpc GetReplicas(GetReplicasRequest) returns (GetReplicasResponse) {}
|
|
@@ -106,6 +111,9 @@ service MilvusService {
|
|
|
106
111
|
rpc DescribeResourceGroup(DescribeResourceGroupRequest) returns (DescribeResourceGroupResponse) {}
|
|
107
112
|
|
|
108
113
|
rpc RenameCollection(RenameCollectionRequest) returns (common.Status) {}
|
|
114
|
+
|
|
115
|
+
rpc ListIndexedSegment(feder.ListIndexedSegmentRequest) returns(feder.ListIndexedSegmentResponse) {}
|
|
116
|
+
rpc DescribeSegmentIndexData(feder.DescribeSegmentIndexDataRequest) returns(feder.DescribeSegmentIndexDataResponse) {}
|
|
109
117
|
}
|
|
110
118
|
|
|
111
119
|
message CreateAliasRequest {
|
|
@@ -128,6 +136,40 @@ message AlterAliasRequest{
|
|
|
128
136
|
string alias = 4;
|
|
129
137
|
}
|
|
130
138
|
|
|
139
|
+
message DescribeAliasRequest{
|
|
140
|
+
common.MsgBase base = 1;
|
|
141
|
+
string db_name = 2;
|
|
142
|
+
string alias = 3;
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/*
|
|
146
|
+
* Describe alias response
|
|
147
|
+
*/
|
|
148
|
+
message DescribeAliasResponse {
|
|
149
|
+
// Response status
|
|
150
|
+
common.Status status = 1;
|
|
151
|
+
string db_name = 2;
|
|
152
|
+
string alias = 3;
|
|
153
|
+
string collection = 4;
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
message ListAliasesRequest{
|
|
157
|
+
common.MsgBase base = 1;
|
|
158
|
+
string db_name = 2;
|
|
159
|
+
string collection_name = 3;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/*
|
|
163
|
+
* List aliases response
|
|
164
|
+
*/
|
|
165
|
+
message ListAliasesResponse {
|
|
166
|
+
// Response status
|
|
167
|
+
common.Status status = 1;
|
|
168
|
+
string db_name = 2;
|
|
169
|
+
string collection_name = 3;
|
|
170
|
+
repeated string aliases = 4;
|
|
171
|
+
}
|
|
172
|
+
|
|
131
173
|
/**
|
|
132
174
|
* Create collection in milvus
|
|
133
175
|
*/
|
|
@@ -877,6 +919,14 @@ message CalcDistanceResults {
|
|
|
877
919
|
}
|
|
878
920
|
}
|
|
879
921
|
|
|
922
|
+
message FlushAllRequest {
|
|
923
|
+
}
|
|
924
|
+
|
|
925
|
+
message FlushAllResponse {
|
|
926
|
+
common.Status status = 1;
|
|
927
|
+
uint64 flush_all_ts = 2;
|
|
928
|
+
}
|
|
929
|
+
|
|
880
930
|
message PersistentSegmentInfo {
|
|
881
931
|
int64 segmentID = 1;
|
|
882
932
|
int64 collectionID = 2;
|
|
@@ -1033,6 +1083,16 @@ message GetFlushStateResponse {
|
|
|
1033
1083
|
bool flushed = 2;
|
|
1034
1084
|
}
|
|
1035
1085
|
|
|
1086
|
+
message GetFlushAllStateRequest {
|
|
1087
|
+
common.MsgBase base = 1;
|
|
1088
|
+
uint64 flush_all_ts = 2;
|
|
1089
|
+
}
|
|
1090
|
+
|
|
1091
|
+
message GetFlushAllStateResponse {
|
|
1092
|
+
common.Status status = 1;
|
|
1093
|
+
bool flushed = 2;
|
|
1094
|
+
}
|
|
1095
|
+
|
|
1036
1096
|
message ImportRequest {
|
|
1037
1097
|
option (common.privilege_ext_obj) = {
|
|
1038
1098
|
object_type: Collection
|
|
@@ -1356,6 +1416,11 @@ message OperatePrivilegeRequest {
|
|
|
1356
1416
|
}
|
|
1357
1417
|
|
|
1358
1418
|
message GetLoadingProgressRequest {
|
|
1419
|
+
option (common.privilege_ext_obj) = {
|
|
1420
|
+
object_type: Collection
|
|
1421
|
+
object_privilege: PrivilegeGetLoadingProgress
|
|
1422
|
+
object_name_index: 2
|
|
1423
|
+
};
|
|
1359
1424
|
// Not useful for now
|
|
1360
1425
|
common.MsgBase base = 1;
|
|
1361
1426
|
string collection_name = 2;
|
|
@@ -1365,9 +1430,15 @@ message GetLoadingProgressRequest {
|
|
|
1365
1430
|
message GetLoadingProgressResponse {
|
|
1366
1431
|
common.Status status = 1;
|
|
1367
1432
|
int64 progress = 2;
|
|
1433
|
+
int64 refresh_progress = 3;
|
|
1368
1434
|
}
|
|
1369
1435
|
|
|
1370
1436
|
message GetLoadStateRequest {
|
|
1437
|
+
option (common.privilege_ext_obj) = {
|
|
1438
|
+
object_type: Collection
|
|
1439
|
+
object_privilege: PrivilegeGetLoadState
|
|
1440
|
+
object_name_index: 2
|
|
1441
|
+
};
|
|
1371
1442
|
// Not useful for now
|
|
1372
1443
|
common.MsgBase base = 1;
|
|
1373
1444
|
string collection_name = 2;
|
|
@@ -1414,17 +1485,32 @@ message CheckHealthResponse {
|
|
|
1414
1485
|
}
|
|
1415
1486
|
|
|
1416
1487
|
message CreateResourceGroupRequest {
|
|
1488
|
+
option (common.privilege_ext_obj) = {
|
|
1489
|
+
object_type: Global
|
|
1490
|
+
object_privilege: PrivilegeCreateResourceGroup
|
|
1491
|
+
object_name_index: -1
|
|
1492
|
+
};
|
|
1417
1493
|
common.MsgBase base = 1;
|
|
1418
1494
|
string resource_group = 2;
|
|
1419
1495
|
}
|
|
1420
1496
|
|
|
1421
1497
|
message DropResourceGroupRequest {
|
|
1498
|
+
option (common.privilege_ext_obj) = {
|
|
1499
|
+
object_type: Global
|
|
1500
|
+
object_privilege: PrivilegeDropResourceGroup
|
|
1501
|
+
object_name_index: -1
|
|
1502
|
+
};
|
|
1422
1503
|
common.MsgBase base = 1;
|
|
1423
1504
|
string resource_group = 2;
|
|
1424
1505
|
}
|
|
1425
1506
|
|
|
1426
1507
|
// transfer `nodeNum` nodes from `source_resource_group` to `target_resource_group`
|
|
1427
1508
|
message TransferNodeRequest {
|
|
1509
|
+
option (common.privilege_ext_obj) = {
|
|
1510
|
+
object_type: Global
|
|
1511
|
+
object_privilege: PrivilegeTransferNode
|
|
1512
|
+
object_name_index: -1
|
|
1513
|
+
};
|
|
1428
1514
|
common.MsgBase base = 1;
|
|
1429
1515
|
string source_resource_group = 2;
|
|
1430
1516
|
string target_resource_group = 3;
|
|
@@ -1433,6 +1519,11 @@ message TransferNodeRequest {
|
|
|
1433
1519
|
|
|
1434
1520
|
// transfer `replicaNum` replicas in `collectionID` from `source_resource_group` to `target_resource_group`
|
|
1435
1521
|
message TransferReplicaRequest {
|
|
1522
|
+
option (common.privilege_ext_obj) = {
|
|
1523
|
+
object_type: Global
|
|
1524
|
+
object_privilege: PrivilegeTransferReplica
|
|
1525
|
+
object_name_index: -1
|
|
1526
|
+
};
|
|
1436
1527
|
common.MsgBase base = 1;
|
|
1437
1528
|
string source_resource_group = 2;
|
|
1438
1529
|
string target_resource_group = 3;
|
|
@@ -1441,6 +1532,11 @@ message TransferReplicaRequest {
|
|
|
1441
1532
|
}
|
|
1442
1533
|
|
|
1443
1534
|
message ListResourceGroupsRequest {
|
|
1535
|
+
option (common.privilege_ext_obj) = {
|
|
1536
|
+
object_type: Global
|
|
1537
|
+
object_privilege: PrivilegeListResourceGroups
|
|
1538
|
+
object_name_index: -1
|
|
1539
|
+
};
|
|
1444
1540
|
common.MsgBase base = 1;
|
|
1445
1541
|
}
|
|
1446
1542
|
|
|
@@ -1450,6 +1546,11 @@ message ListResourceGroupsResponse {
|
|
|
1450
1546
|
}
|
|
1451
1547
|
|
|
1452
1548
|
message DescribeResourceGroupRequest {
|
|
1549
|
+
option (common.privilege_ext_obj) = {
|
|
1550
|
+
object_type: Global
|
|
1551
|
+
object_privilege: PrivilegeDescribeResourceGroup
|
|
1552
|
+
object_name_index: -1
|
|
1553
|
+
};
|
|
1453
1554
|
common.MsgBase base = 1;
|
|
1454
1555
|
string resource_group = 2;
|
|
1455
1556
|
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
syntax = "proto3";
|
|
2
|
+
package milvus.proto.msg;
|
|
3
|
+
option go_package = "github.com/milvus-io/milvus-proto/go-api/msgpb";
|
|
4
|
+
|
|
5
|
+
import "common.proto";
|
|
6
|
+
import "schema.proto";
|
|
7
|
+
|
|
8
|
+
enum InsertDataVersion {
|
|
9
|
+
// 0 must refer to row-based format, since it's the first version in Milvus.
|
|
10
|
+
RowBased = 0;
|
|
11
|
+
ColumnBased = 1;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
message InsertRequest {
|
|
15
|
+
common.MsgBase base = 1;
|
|
16
|
+
string shardName = 2;
|
|
17
|
+
string db_name = 3;
|
|
18
|
+
string collection_name = 4;
|
|
19
|
+
string partition_name = 5;
|
|
20
|
+
int64 dbID = 6;
|
|
21
|
+
int64 collectionID = 7;
|
|
22
|
+
int64 partitionID = 8;
|
|
23
|
+
int64 segmentID = 9;
|
|
24
|
+
repeated uint64 timestamps = 10;
|
|
25
|
+
repeated int64 rowIDs = 11;
|
|
26
|
+
// row_data was reserved for compatibility
|
|
27
|
+
repeated common.Blob row_data = 12;
|
|
28
|
+
repeated schema.FieldData fields_data = 13;
|
|
29
|
+
uint64 num_rows = 14;
|
|
30
|
+
InsertDataVersion version = 15;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
message DeleteRequest {
|
|
34
|
+
common.MsgBase base = 1;
|
|
35
|
+
string shardName = 2;
|
|
36
|
+
string db_name = 3;
|
|
37
|
+
string collection_name = 4;
|
|
38
|
+
string partition_name = 5;
|
|
39
|
+
int64 dbID = 6;
|
|
40
|
+
int64 collectionID = 7;
|
|
41
|
+
int64 partitionID = 8;
|
|
42
|
+
repeated int64 int64_primary_keys = 9; // deprecated
|
|
43
|
+
repeated uint64 timestamps = 10;
|
|
44
|
+
int64 num_rows = 11;
|
|
45
|
+
schema.IDs primary_keys = 12;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
message MsgPosition {
|
|
49
|
+
string channel_name = 1;
|
|
50
|
+
bytes msgID = 2;
|
|
51
|
+
string msgGroup = 3;
|
|
52
|
+
uint64 timestamp = 4;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
message CreateCollectionRequest {
|
|
56
|
+
common.MsgBase base = 1;
|
|
57
|
+
string db_name = 2;
|
|
58
|
+
string collectionName = 3;
|
|
59
|
+
string partitionName = 4;
|
|
60
|
+
// `schema` is the serialized `schema.CollectionSchema`
|
|
61
|
+
int64 dbID = 5;
|
|
62
|
+
int64 collectionID = 6;
|
|
63
|
+
int64 partitionID = 7;
|
|
64
|
+
bytes schema = 8;
|
|
65
|
+
repeated string virtualChannelNames = 9;
|
|
66
|
+
repeated string physicalChannelNames = 10;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
message DropCollectionRequest {
|
|
70
|
+
common.MsgBase base = 1;
|
|
71
|
+
string db_name = 2;
|
|
72
|
+
string collectionName = 3;
|
|
73
|
+
int64 dbID = 4;
|
|
74
|
+
int64 collectionID = 5;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
message CreatePartitionRequest {
|
|
78
|
+
common.MsgBase base = 1;
|
|
79
|
+
string db_name = 2;
|
|
80
|
+
string collection_name = 3;
|
|
81
|
+
string partition_name = 4;
|
|
82
|
+
int64 dbID = 5;
|
|
83
|
+
int64 collectionID = 6;
|
|
84
|
+
int64 partitionID = 7;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
message DropPartitionRequest {
|
|
88
|
+
common.MsgBase base = 1;
|
|
89
|
+
string db_name = 2;
|
|
90
|
+
string collection_name = 3;
|
|
91
|
+
string partition_name = 4;
|
|
92
|
+
int64 dbID = 5;
|
|
93
|
+
int64 collectionID = 6;
|
|
94
|
+
int64 partitionID = 7;
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
message TimeTickMsg {
|
|
98
|
+
common.MsgBase base = 1;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
message DataNodeTtMsg {
|
|
102
|
+
common.MsgBase base =1;
|
|
103
|
+
string channel_name = 2;
|
|
104
|
+
uint64 timestamp = 3;
|
|
105
|
+
repeated common.SegmentStats segments_stats = 4;
|
|
106
|
+
}
|
|
107
|
+
|
|
@@ -28,6 +28,8 @@ enum DataType {
|
|
|
28
28
|
|
|
29
29
|
String = 20;
|
|
30
30
|
VarChar = 21; // variable-length strings with a specified maximum length
|
|
31
|
+
Array = 22;
|
|
32
|
+
JSON = 23;
|
|
31
33
|
|
|
32
34
|
BinaryVector = 100;
|
|
33
35
|
FloatVector = 101;
|
|
@@ -52,7 +54,9 @@ message FieldSchema {
|
|
|
52
54
|
repeated common.KeyValuePair type_params = 6;
|
|
53
55
|
repeated common.KeyValuePair index_params = 7;
|
|
54
56
|
bool autoID = 8;
|
|
55
|
-
FieldState state = 9; // To keep compatible with older version, the default
|
|
57
|
+
FieldState state = 9; // To keep compatible with older version, the default
|
|
58
|
+
// state is `Created`.
|
|
59
|
+
DataType element_type = 10; // For array type, the element type is stored here
|
|
56
60
|
}
|
|
57
61
|
|
|
58
62
|
/**
|
|
@@ -65,34 +69,24 @@ message CollectionSchema {
|
|
|
65
69
|
repeated FieldSchema fields = 4;
|
|
66
70
|
}
|
|
67
71
|
|
|
68
|
-
message BoolArray {
|
|
69
|
-
repeated bool data = 1;
|
|
70
|
-
}
|
|
72
|
+
message BoolArray { repeated bool data = 1; }
|
|
71
73
|
|
|
72
|
-
message IntArray {
|
|
73
|
-
repeated int32 data = 1;
|
|
74
|
-
}
|
|
74
|
+
message IntArray { repeated int32 data = 1; }
|
|
75
75
|
|
|
76
|
-
message LongArray {
|
|
77
|
-
repeated int64 data = 1;
|
|
78
|
-
}
|
|
76
|
+
message LongArray { repeated int64 data = 1; }
|
|
79
77
|
|
|
80
|
-
message FloatArray {
|
|
81
|
-
repeated float data = 1;
|
|
82
|
-
}
|
|
78
|
+
message FloatArray { repeated float data = 1; }
|
|
83
79
|
|
|
84
|
-
message DoubleArray {
|
|
85
|
-
repeated double data = 1;
|
|
86
|
-
}
|
|
80
|
+
message DoubleArray { repeated double data = 1; }
|
|
87
81
|
|
|
88
82
|
// For special fields such as bigdecimal, array...
|
|
89
|
-
message BytesArray {
|
|
90
|
-
repeated bytes data = 1;
|
|
91
|
-
}
|
|
83
|
+
message BytesArray { repeated bytes data = 1; }
|
|
92
84
|
|
|
93
|
-
message StringArray {
|
|
94
|
-
|
|
95
|
-
}
|
|
85
|
+
message StringArray { repeated string data = 1; }
|
|
86
|
+
|
|
87
|
+
message ArrayArray { repeated ScalarField data = 1; }
|
|
88
|
+
|
|
89
|
+
message JSONArray { repeated bytes data = 1; }
|
|
96
90
|
|
|
97
91
|
message ScalarField {
|
|
98
92
|
oneof data {
|
|
@@ -103,6 +97,8 @@ message ScalarField {
|
|
|
103
97
|
DoubleArray double_data = 5;
|
|
104
98
|
StringArray string_data = 6;
|
|
105
99
|
BytesArray bytes_data = 7;
|
|
100
|
+
ArrayArray array_data = 8;
|
|
101
|
+
JSONArray json_data = 9;
|
|
106
102
|
}
|
|
107
103
|
}
|
|
108
104
|
|
|
@@ -139,4 +135,3 @@ message SearchResultData {
|
|
|
139
135
|
IDs ids = 5;
|
|
140
136
|
repeated int64 topks = 6;
|
|
141
137
|
}
|
|
142
|
-
|
package/dist/sdk.json
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":"2.2.
|
|
1
|
+
{"version":"2.2.5","milvusVersion":"v2.2.5"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Blob.js","sourceRoot":"","sources":["../../utils/Blob.ts"],"names":[],"mappings":";;;AAAO,IAAM,uBAAuB,GAAG,UAAC,KAAe;IACrD,sBAAsB;IACtB,IAAM,CAAC,GAAG,IAAI,YAAY,CAAC,KAAK,CAAC,CAAC;IAClC,oCAAoC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AALW,QAAA,uBAAuB,2BAKlC;AAEK,IAAM,wBAAwB,GAAG,UAAC,KAAe;IACtD,sBAAsB;IACtB,IAAM,CAAC,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAChC,oCAAoC;IACpC,OAAO,MAAM,CAAC,IAAI,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC;AAC/B,CAAC,CAAC;AALW,QAAA,wBAAwB,4BAKnC"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KeyValuePair } from '../types/Common';
|
|
1
|
+
import { KeyValuePair } from '../milvus/types/Common';
|
|
2
2
|
/**
|
|
3
3
|
* parse [{key:"row_count",value:4}] to {row_count:4}
|
|
4
4
|
* @param data key value pair array
|
|
@@ -11,7 +11,7 @@ export declare const formatKeyValueData: (data: KeyValuePair[], keys: string[])
|
|
|
11
11
|
/**
|
|
12
12
|
* parse {row_count:4} to [{key:"row_count",value:"4"}]
|
|
13
13
|
* @param data Object
|
|
14
|
-
* @
|
|
14
|
+
* @returns {KeyValuePair[]}
|
|
15
15
|
*/
|
|
16
16
|
export declare const parseToKeyValue: (data?: {
|
|
17
17
|
[x: string]: any;
|
|
@@ -23,18 +23,19 @@ export declare const parseToKeyValue: (data?: {
|
|
|
23
23
|
* @returns
|
|
24
24
|
*/
|
|
25
25
|
export declare const formatNumberPrecision: (number: number, precision: number) => number;
|
|
26
|
+
export declare const checkTimeParam: (ts: any) => boolean;
|
|
26
27
|
/**
|
|
27
28
|
* Convert a hybrid timestamp to UNIX Epoch time ignoring the logic part.
|
|
28
29
|
*
|
|
29
30
|
* @param data
|
|
30
|
-
* | Property | Type
|
|
31
|
+
* | Property | Type | Description |
|
|
31
32
|
* | :---------------- | :---- | :------------------------------- |
|
|
32
33
|
* | hybridts | String or BigInt | The known hybrid timestamp to convert to UNIX Epoch time. Non-negative interger range from 0 to 18446744073709551615. |
|
|
33
34
|
*
|
|
34
35
|
*
|
|
35
36
|
*
|
|
36
|
-
* @
|
|
37
|
-
*
|
|
37
|
+
* @returns
|
|
38
|
+
* | Property | Description |
|
|
38
39
|
* | :-----------| :------------------------------- |
|
|
39
40
|
* | unixtime as string | The Unix Epoch time is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT). |
|
|
40
41
|
*
|
|
@@ -50,14 +51,14 @@ export declare const hybridtsToUnixtime: (hybridts: bigint | string) => string;
|
|
|
50
51
|
* Generate a hybrid timestamp based on Unix Epoch time, timedelta and incremental time internval.
|
|
51
52
|
*
|
|
52
53
|
* @param data
|
|
53
|
-
* | Property | Type
|
|
54
|
+
* | Property | Type | Description |
|
|
54
55
|
* | :---------------- | :---- | :------------------------------- |
|
|
55
56
|
* | unixtime | string or bigint | The known Unix Epoch time used to generate a hybrid timestamp. The Unix Epoch time is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT). |
|
|
56
57
|
*
|
|
57
58
|
*
|
|
58
59
|
*
|
|
59
|
-
* @
|
|
60
|
-
* | Property | Type
|
|
60
|
+
* @returns
|
|
61
|
+
* | Property | Type | Description |
|
|
61
62
|
* | :-----------| :--- | :------------------------------- |
|
|
62
63
|
* | Hybrid timetamp | String | Hybrid timetamp is a non-negative interger range from 0 to 18446744073709551615. |
|
|
63
64
|
*
|
|
@@ -73,14 +74,14 @@ export declare const unixtimeToHybridts: (unixtime: bigint | string) => string;
|
|
|
73
74
|
* Generate a hybrid timestamp based on datetime。
|
|
74
75
|
*
|
|
75
76
|
* @param data
|
|
76
|
-
* | Property | Type
|
|
77
|
+
* | Property | Type | Description |
|
|
77
78
|
* | :---------------- | :---- | :------------------------------- |
|
|
78
79
|
* | datetime | Date | The known datetime used to generate a hybrid timestamp. |
|
|
79
80
|
*
|
|
80
81
|
*
|
|
81
82
|
*
|
|
82
|
-
* @
|
|
83
|
-
* | Property | Type
|
|
83
|
+
* @returns
|
|
84
|
+
* | Property | Type | Description |
|
|
84
85
|
* | :-----------| :--- | :------------------------------- |
|
|
85
86
|
* | Hybrid timetamp | String | Hybrid timetamp is a non-negative interger range from 0 to 18446744073709551615. |
|
|
86
87
|
*
|
|
@@ -9,10 +9,10 @@ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
|
|
|
9
9
|
return to.concat(ar || Array.prototype.slice.call(from));
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
-
exports.formatAddress = exports.stringToBase64 = exports.datetimeToHybrids = exports.unixtimeToHybridts = exports.hybridtsToUnixtime = exports.formatNumberPrecision = exports.parseToKeyValue = exports.formatKeyValueData = void 0;
|
|
13
|
-
var
|
|
14
|
-
var Milvus_1 = require("../const/Milvus");
|
|
15
|
-
var ErrorReason_1 = require("../const/ErrorReason");
|
|
12
|
+
exports.formatAddress = exports.stringToBase64 = exports.datetimeToHybrids = exports.unixtimeToHybridts = exports.hybridtsToUnixtime = exports.checkTimeParam = exports.formatNumberPrecision = exports.parseToKeyValue = exports.formatKeyValueData = void 0;
|
|
13
|
+
var _1 = require("./");
|
|
14
|
+
var Milvus_1 = require("../milvus/const/Milvus");
|
|
15
|
+
var ErrorReason_1 = require("../milvus/const/ErrorReason");
|
|
16
16
|
/**
|
|
17
17
|
* parse [{key:"row_count",value:4}] to {row_count:4}
|
|
18
18
|
* @param data key value pair array
|
|
@@ -22,7 +22,7 @@ var ErrorReason_1 = require("../const/ErrorReason");
|
|
|
22
22
|
var formatKeyValueData = function (data, keys) {
|
|
23
23
|
var result = {};
|
|
24
24
|
keys.forEach(function (k) {
|
|
25
|
-
var value = (0,
|
|
25
|
+
var value = (0, _1.findKeyValue)(data, k);
|
|
26
26
|
result[k] = value;
|
|
27
27
|
});
|
|
28
28
|
return result;
|
|
@@ -31,7 +31,7 @@ exports.formatKeyValueData = formatKeyValueData;
|
|
|
31
31
|
/**
|
|
32
32
|
* parse {row_count:4} to [{key:"row_count",value:"4"}]
|
|
33
33
|
* @param data Object
|
|
34
|
-
* @
|
|
34
|
+
* @returns {KeyValuePair[]}
|
|
35
35
|
*/
|
|
36
36
|
var parseToKeyValue = function (data) {
|
|
37
37
|
return data
|
|
@@ -70,18 +70,19 @@ var checkTimeParam = function (ts) {
|
|
|
70
70
|
return false;
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
|
+
exports.checkTimeParam = checkTimeParam;
|
|
73
74
|
/**
|
|
74
75
|
* Convert a hybrid timestamp to UNIX Epoch time ignoring the logic part.
|
|
75
76
|
*
|
|
76
77
|
* @param data
|
|
77
|
-
* | Property | Type
|
|
78
|
+
* | Property | Type | Description |
|
|
78
79
|
* | :---------------- | :---- | :------------------------------- |
|
|
79
80
|
* | hybridts | String or BigInt | The known hybrid timestamp to convert to UNIX Epoch time. Non-negative interger range from 0 to 18446744073709551615. |
|
|
80
81
|
*
|
|
81
82
|
*
|
|
82
83
|
*
|
|
83
|
-
* @
|
|
84
|
-
*
|
|
84
|
+
* @returns
|
|
85
|
+
* | Property | Description |
|
|
85
86
|
* | :-----------| :------------------------------- |
|
|
86
87
|
* | unixtime as string | The Unix Epoch time is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT). |
|
|
87
88
|
*
|
|
@@ -93,7 +94,7 @@ var checkTimeParam = function (ts) {
|
|
|
93
94
|
* ```
|
|
94
95
|
*/
|
|
95
96
|
var hybridtsToUnixtime = function (hybridts) {
|
|
96
|
-
if (!checkTimeParam(hybridts)) {
|
|
97
|
+
if (!(0, exports.checkTimeParam)(hybridts)) {
|
|
97
98
|
throw new Error("hybridts ".concat(ErrorReason_1.ERROR_REASONS.TIMESTAMP_PARAM_CHECK));
|
|
98
99
|
}
|
|
99
100
|
var timestamp = typeof hybridts === 'bigint' ? hybridts : BigInt(hybridts);
|
|
@@ -105,14 +106,14 @@ exports.hybridtsToUnixtime = hybridtsToUnixtime;
|
|
|
105
106
|
* Generate a hybrid timestamp based on Unix Epoch time, timedelta and incremental time internval.
|
|
106
107
|
*
|
|
107
108
|
* @param data
|
|
108
|
-
* | Property | Type
|
|
109
|
+
* | Property | Type | Description |
|
|
109
110
|
* | :---------------- | :---- | :------------------------------- |
|
|
110
111
|
* | unixtime | string or bigint | The known Unix Epoch time used to generate a hybrid timestamp. The Unix Epoch time is the number of seconds that have elapsed since January 1, 1970 (midnight UTC/GMT). |
|
|
111
112
|
*
|
|
112
113
|
*
|
|
113
114
|
*
|
|
114
|
-
* @
|
|
115
|
-
* | Property | Type
|
|
115
|
+
* @returns
|
|
116
|
+
* | Property | Type | Description |
|
|
116
117
|
* | :-----------| :--- | :------------------------------- |
|
|
117
118
|
* | Hybrid timetamp | String | Hybrid timetamp is a non-negative interger range from 0 to 18446744073709551615. |
|
|
118
119
|
*
|
|
@@ -124,7 +125,7 @@ exports.hybridtsToUnixtime = hybridtsToUnixtime;
|
|
|
124
125
|
* ```
|
|
125
126
|
*/
|
|
126
127
|
var unixtimeToHybridts = function (unixtime) {
|
|
127
|
-
if (!checkTimeParam(unixtime)) {
|
|
128
|
+
if (!(0, exports.checkTimeParam)(unixtime)) {
|
|
128
129
|
throw new Error("hybridts ".concat(ErrorReason_1.ERROR_REASONS.TIMESTAMP_PARAM_CHECK));
|
|
129
130
|
}
|
|
130
131
|
var timestamp = typeof unixtime === 'bigint' ? unixtime : BigInt(unixtime);
|
|
@@ -136,14 +137,14 @@ exports.unixtimeToHybridts = unixtimeToHybridts;
|
|
|
136
137
|
* Generate a hybrid timestamp based on datetime。
|
|
137
138
|
*
|
|
138
139
|
* @param data
|
|
139
|
-
* | Property | Type
|
|
140
|
+
* | Property | Type | Description |
|
|
140
141
|
* | :---------------- | :---- | :------------------------------- |
|
|
141
142
|
* | datetime | Date | The known datetime used to generate a hybrid timestamp. |
|
|
142
143
|
*
|
|
143
144
|
*
|
|
144
145
|
*
|
|
145
|
-
* @
|
|
146
|
-
* | Property | Type
|
|
146
|
+
* @returns
|
|
147
|
+
* | Property | Type | Description |
|
|
147
148
|
* | :-----------| :--- | :------------------------------- |
|
|
148
149
|
* | Hybrid timetamp | String | Hybrid timetamp is a non-negative interger range from 0 to 18446744073709551615. |
|
|
149
150
|
*
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Format.js","sourceRoot":"","sources":["../../utils/Format.ts"],"names":[],"mappings":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M,QAAQ,GAAG,CAAC,SAAS,GAAG,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,YAAY,CAAC;IAC5D,OAAO,QAAQ,CAAC,QAAQ,EAAE,CAAC;AAC7B,CAAC,CAAC;AARW,QAAA,kBAAkB,sBAQ7B;AAEF;;;;;;;;;;;;;;;;;;;;;GAqBG;AACI,IAAM,iBAAiB,GAAG,UAAC,QAAc;IAC9C,IAAI,CAAC,CAAC,QAAQ,YAAY,IAAI,CAAC,EAAE;QAC/B,MAAM,IAAI,KAAK,CAAC,mBAAY,2BAAa,CAAC,eAAe,CAAE,CAAC,CAAC;KAC9D;IACD,OAAO,IAAA,0BAAkB,EAAC,CAAC,QAAQ,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC;AACpE,CAAC,CAAC;AALW,QAAA,iBAAiB,qBAK5B;AAEK,IAAM,cAAc,GAAG,UAAC,GAAW;IACxC,OAAA,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC;AAA5C,CAA4C,CAAC;AADlC,QAAA,cAAc,kBACoB;AAExC,IAAM,aAAa,GAAG,UAAC,OAAe;IAC3C,2CAA2C;IAC3C,IAAM,EAAE,GAAG,OAAO,CAAC,OAAO,CAAC,oBAAoB,EAAE,EAAE,CAAC,CAAC;IACrD,OAAO,EAAE,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,UAAG,EAAE,cAAI,4BAAmB,CAAE,CAAC;AAChE,CAAC,CAAC;AAJW,QAAA,aAAa,iBAIxB"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { KeyValuePair } from '../milvus/types/Common';
|
|
2
|
+
export declare function promisify(obj: any, target: string, params: any, timeout?: number): Promise<any>;
|
|
3
|
+
export declare const findKeyValue: (obj: KeyValuePair[], key: string) => string | number | undefined;
|
|
4
|
+
export declare const sleep: (time: number) => Promise<unknown>;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.sleep = exports.findKeyValue = exports.promisify = void 0;
|
|
4
|
+
var Milvus_1 = require("../milvus/const/Milvus");
|
|
5
|
+
function promisify(obj, target, params, timeout) {
|
|
6
|
+
var deadline = timeout
|
|
7
|
+
? new Date(Date.now() + timeout)
|
|
8
|
+
: new Date(Date.now() + Milvus_1.DEFAULT_CONNECT_TIMEOUT);
|
|
9
|
+
var res = new Promise(function (resolve, reject) {
|
|
10
|
+
try {
|
|
11
|
+
obj[target](params, { deadline: deadline }, function (err, result) {
|
|
12
|
+
if (err) {
|
|
13
|
+
reject(err);
|
|
14
|
+
}
|
|
15
|
+
resolve(result);
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
catch (e) {
|
|
19
|
+
throw new Error(e);
|
|
20
|
+
}
|
|
21
|
+
}).catch(function (err) {
|
|
22
|
+
throw new Error(err);
|
|
23
|
+
});
|
|
24
|
+
return res;
|
|
25
|
+
}
|
|
26
|
+
exports.promisify = promisify;
|
|
27
|
+
var findKeyValue = function (obj, key) { var _a; return (_a = obj.find(function (v) { return v.key === key; })) === null || _a === void 0 ? void 0 : _a.value; };
|
|
28
|
+
exports.findKeyValue = findKeyValue;
|
|
29
|
+
var sleep = function (time) {
|
|
30
|
+
return new Promise(function (resolve) { return setTimeout(resolve, time); });
|
|
31
|
+
};
|
|
32
|
+
exports.sleep = sleep;
|
|
33
|
+
//# sourceMappingURL=Function.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Function.js","sourceRoot":"","sources":["../../utils/Function.ts"],"names":[],"mappings":";;;AAAA,iDAAiE;AAGjE,SAAgB,SAAS,CACvB,GAAQ,EACR,MAAc,EACd,MAAW,EACX,OAAgB;IAEhB,IAAM,QAAQ,GAAG,OAAO;QACtB,CAAC,CAAC,IAAI,IAAI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|
+
protoPath: string;
|
|
4
|
+
serviceName: string;
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Returns a gRPC service client constructor for the given proto file and service name.
|
|
8
|
+
* @param proto An object containing the proto file path and service name.
|
|
9
|
+
* @returns A gRPC service client constructor.
|
|
10
|
+
*/
|
|
11
|
+
export declare const getGRPCService: (proto: IServiceDetails) => ServiceClientConstructor;
|
|
12
|
+
/**
|
|
13
|
+
* Returns an interceptor function that adds an authorization header to the metadata of a gRPC call.
|
|
14
|
+
* @param username - The username to use for authentication.
|
|
15
|
+
* @param password - The password to use for authentication.
|
|
16
|
+
* @returns An interceptor function.
|
|
17
|
+
*/
|
|
18
|
+
export declare const getAuthInterceptor: (username: string, password: string) => (options: any, nextCall: any) => InterceptingCall;
|
|
19
|
+
export {};
|