@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
package/dist/milvus/index.js
CHANGED
|
@@ -10,192 +10,22 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
|
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
11
11
|
o[k2] = m[k];
|
|
12
12
|
}));
|
|
13
|
-
var
|
|
14
|
-
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
26
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
27
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
28
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
29
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
30
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
31
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
35
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
36
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
37
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
38
|
-
function step(op) {
|
|
39
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
40
|
-
while (_) try {
|
|
41
|
-
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;
|
|
42
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
43
|
-
switch (op[0]) {
|
|
44
|
-
case 0: case 1: t = op; break;
|
|
45
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
46
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
47
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
48
|
-
default:
|
|
49
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
50
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
51
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
52
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
53
|
-
if (t[2]) _.ops.pop();
|
|
54
|
-
_.trys.pop(); continue;
|
|
55
|
-
}
|
|
56
|
-
op = body.call(thisArg, _);
|
|
57
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
58
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
59
|
-
}
|
|
60
|
-
};
|
|
61
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
62
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
63
15
|
};
|
|
64
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
var protoPath = path_1.default.resolve(__dirname, '../proto/proto/milvus.proto');
|
|
80
|
-
var MilvusClient = /** @class */ (function () {
|
|
81
|
-
/**
|
|
82
|
-
* Connect to milvus grpc client.
|
|
83
|
-
* CollectionManager: control collection crud api
|
|
84
|
-
* PartitionManager: control partition crud api
|
|
85
|
-
* IndexManager: control index crud api
|
|
86
|
-
* DataManager: Search | Query | Insert | Flush
|
|
87
|
-
* UserManager: control user crud api
|
|
88
|
-
*
|
|
89
|
-
* @param address milvus address like: 127.0.0.1:19530
|
|
90
|
-
* @param ssl ssl connect or not, default is false
|
|
91
|
-
* @param username After created user in Milvus, username is required
|
|
92
|
-
* @param password After created user in Milvus, password is required
|
|
93
|
-
*
|
|
94
|
-
*/
|
|
95
|
-
function MilvusClient(address, ssl, username, password) {
|
|
96
|
-
if (!address) {
|
|
97
|
-
throw new Error(ErrorReason_1.ERROR_REASONS.MILVUS_ADDRESS_IS_REQUIRED);
|
|
98
|
-
}
|
|
99
|
-
var authInterceptor = null;
|
|
100
|
-
if (username !== undefined && password !== undefined) {
|
|
101
|
-
authInterceptor = function (options, nextCall) {
|
|
102
|
-
return new grpc_js_1.InterceptingCall(nextCall(options), {
|
|
103
|
-
start: function (metadata, listener, next) {
|
|
104
|
-
var auth = Buffer.from("".concat(username, ":").concat(password), 'utf-8').toString('base64');
|
|
105
|
-
metadata.add('authorization', auth);
|
|
106
|
-
next(metadata, listener);
|
|
107
|
-
},
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
|
-
}
|
|
111
|
-
var packageDefinition = protoLoader.loadSync(protoPath, {
|
|
112
|
-
keepCase: true,
|
|
113
|
-
longs: String,
|
|
114
|
-
enums: String,
|
|
115
|
-
defaults: true,
|
|
116
|
-
oneofs: true,
|
|
117
|
-
});
|
|
118
|
-
var grpcObject = (0, grpc_js_1.loadPackageDefinition)(packageDefinition);
|
|
119
|
-
var milvusProto = grpcObject.milvus.proto.milvus;
|
|
120
|
-
var client = new milvusProto.MilvusService((0, Format_1.formatAddress)(address), ssl ? grpc_js_1.credentials.createSsl() : grpc_js_1.credentials.createInsecure(), {
|
|
121
|
-
interceptors: [authInterceptor],
|
|
122
|
-
// Milvus default max_receive_message_length is 100MB, but Milvus support change max_receive_message_length .
|
|
123
|
-
// So SDK should support max_receive_message_length unlimited.
|
|
124
|
-
'grpc.max_receive_message_length': -1,
|
|
125
|
-
});
|
|
126
|
-
this.client = client;
|
|
127
|
-
this.collectionManager = new Collection_1.Collection(this.client);
|
|
128
|
-
this.partitionManager = new Partition_1.Partition(this.client);
|
|
129
|
-
this.indexManager = new MilvusIndex_1.Index(this.client);
|
|
130
|
-
this.dataManager = new Data_1.Data(this.client, this.collectionManager);
|
|
131
|
-
this.userManager = new User_1.User(this.client);
|
|
132
|
-
}
|
|
133
|
-
Object.defineProperty(MilvusClient, "sdkInfo", {
|
|
134
|
-
get: function () {
|
|
135
|
-
return {
|
|
136
|
-
version: sdk_json_1.default.version,
|
|
137
|
-
recommandMilvus: sdk_json_1.default.milvusVersion,
|
|
138
|
-
};
|
|
139
|
-
},
|
|
140
|
-
enumerable: false,
|
|
141
|
-
configurable: true
|
|
142
|
-
});
|
|
143
|
-
/**
|
|
144
|
-
* @ignore
|
|
145
|
-
* Everytime build sdk will rewrite sdk.json depend on version, milvusVersion fields in package.json.
|
|
146
|
-
* @returns
|
|
147
|
-
*/
|
|
148
|
-
MilvusClient.prototype.checkVersion = function () {
|
|
149
|
-
var _a, _b, _c;
|
|
150
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
151
|
-
var res, curMilvusVersion;
|
|
152
|
-
return __generator(this, function (_d) {
|
|
153
|
-
switch (_d.label) {
|
|
154
|
-
case 0: return [4 /*yield*/, this.dataManager.getMetric({
|
|
155
|
-
request: { metric_type: 'system_info' },
|
|
156
|
-
})];
|
|
157
|
-
case 1:
|
|
158
|
-
res = _d.sent();
|
|
159
|
-
curMilvusVersion = (_c = (_b = (_a = res.response.nodes_info[0]) === null || _a === void 0 ? void 0 : _a.infos) === null || _b === void 0 ? void 0 : _b.system_info) === null || _c === void 0 ? void 0 : _c.build_version;
|
|
160
|
-
if (curMilvusVersion !== MilvusClient.sdkInfo.recommandMilvus) {
|
|
161
|
-
console.warn('------- Warning ---------');
|
|
162
|
-
console.warn("Node sdk ".concat(MilvusClient.sdkInfo.version, " recommend Milvus Version ").concat(MilvusClient.sdkInfo.recommandMilvus, ".\nDifferent version may cause some error."));
|
|
163
|
-
return [2 /*return*/, { error_code: Response_1.ErrorCode.SUCCESS, match: false }];
|
|
164
|
-
}
|
|
165
|
-
return [2 /*return*/, { error_code: Response_1.ErrorCode.SUCCESS, match: true }];
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
};
|
|
170
|
-
MilvusClient.prototype.closeConnection = function () {
|
|
171
|
-
this.client.close();
|
|
172
|
-
// grpc client closed -> 4, connected -> 0
|
|
173
|
-
return this.client.getChannel().getConnectivityState(true);
|
|
174
|
-
};
|
|
175
|
-
MilvusClient.prototype.getVersion = function () {
|
|
176
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
177
|
-
var promise;
|
|
178
|
-
return __generator(this, function (_a) {
|
|
179
|
-
switch (_a.label) {
|
|
180
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetVersion', {})];
|
|
181
|
-
case 1:
|
|
182
|
-
promise = _a.sent();
|
|
183
|
-
return [2 /*return*/, promise];
|
|
184
|
-
}
|
|
185
|
-
});
|
|
186
|
-
});
|
|
187
|
-
};
|
|
188
|
-
MilvusClient.prototype.checkHealth = function () {
|
|
189
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
190
|
-
return __generator(this, function (_a) {
|
|
191
|
-
switch (_a.label) {
|
|
192
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'CheckHealth', {})];
|
|
193
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
});
|
|
197
|
-
};
|
|
198
|
-
return MilvusClient;
|
|
199
|
-
}());
|
|
200
|
-
exports.MilvusClient = MilvusClient;
|
|
17
|
+
// consts
|
|
18
|
+
__exportStar(require("./const/ErrorReason"), exports);
|
|
19
|
+
__exportStar(require("./const/Milvus"), exports);
|
|
20
|
+
// types
|
|
21
|
+
__exportStar(require("./types/Collection"), exports);
|
|
22
|
+
__exportStar(require("./types/Data"), exports);
|
|
23
|
+
__exportStar(require("./types/Common"), exports);
|
|
24
|
+
__exportStar(require("./types/Index"), exports);
|
|
25
|
+
__exportStar(require("./types/Partition"), exports);
|
|
26
|
+
__exportStar(require("./types/Response"), exports);
|
|
27
|
+
__exportStar(require("./types/User"), exports);
|
|
28
|
+
__exportStar(require("./types/Resource"), exports);
|
|
29
|
+
// client
|
|
30
|
+
__exportStar(require("./MilvusClient"), exports);
|
|
201
31
|
//# sourceMappingURL=index.js.map
|
package/dist/milvus/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../milvus/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../milvus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,sDAAoC;AACpC,iDAA+B;AAC/B,QAAQ;AACR,qDAAmC;AACnC,+CAA6B;AAC7B,iDAA+B;AAC/B,gDAA8B;AAC9B,oDAAkC;AAClC,mDAAiC;AACjC,+CAA6B;AAC7B,mDAAiC;AACjC,SAAS;AACT,iDAA+B"}
|
|
@@ -1,4 +1,33 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResStatus, KeyValuePair, GrpcTimeOut, TimeStamp, TimeStampArray } from './Common';
|
|
2
|
+
import { ConsistencyLevelEnum, CompactionState, DataType } from '../const/Milvus';
|
|
3
|
+
export interface FieldSchema {
|
|
4
|
+
name: string;
|
|
5
|
+
description: string;
|
|
6
|
+
data_type: string;
|
|
7
|
+
is_primary_key?: boolean;
|
|
8
|
+
type_params: KeyValuePair[];
|
|
9
|
+
index_params: KeyValuePair[];
|
|
10
|
+
autoID: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CollectionData {
|
|
13
|
+
name: string;
|
|
14
|
+
id: string;
|
|
15
|
+
timestamp: string;
|
|
16
|
+
loadedPercentage: string;
|
|
17
|
+
}
|
|
18
|
+
export interface ShardReplica {
|
|
19
|
+
leaderID: number;
|
|
20
|
+
leader_addr: string;
|
|
21
|
+
dm_channel_name: string;
|
|
22
|
+
node_ids: number[];
|
|
23
|
+
}
|
|
24
|
+
export interface ReplicaInfo {
|
|
25
|
+
replicaID: number;
|
|
26
|
+
collectionID: number;
|
|
27
|
+
partition_ids: number[];
|
|
28
|
+
shard_replicas: ShardReplica[];
|
|
29
|
+
node_ids: number[];
|
|
30
|
+
}
|
|
2
31
|
export interface FieldType {
|
|
3
32
|
name: string;
|
|
4
33
|
description: string;
|
|
@@ -25,13 +54,6 @@ export interface CreateCollectionReq extends GrpcTimeOut {
|
|
|
25
54
|
consistency_level?: 'Strong' | 'Session' | 'Bounded' | 'Eventually' | 'Customized';
|
|
26
55
|
fields: FieldType[];
|
|
27
56
|
}
|
|
28
|
-
export declare enum ConsistencyLevelEnum {
|
|
29
|
-
Strong = 0,
|
|
30
|
-
Session = 1,
|
|
31
|
-
Bounded = 2,
|
|
32
|
-
Eventually = 3,
|
|
33
|
-
Customized = 4
|
|
34
|
-
}
|
|
35
57
|
interface CollectionNameReq extends GrpcTimeOut {
|
|
36
58
|
/**
|
|
37
59
|
* @param collection_name collection name string
|
|
@@ -46,6 +68,8 @@ export interface GetCollectionStatisticsReq extends CollectionNameReq {
|
|
|
46
68
|
}
|
|
47
69
|
export interface LoadCollectionReq extends CollectionNameReq {
|
|
48
70
|
replica_number?: number;
|
|
71
|
+
resource_groups?: string[];
|
|
72
|
+
refresh?: boolean;
|
|
49
73
|
}
|
|
50
74
|
export interface ReleaseLoadCollectionReq extends CollectionNameReq {
|
|
51
75
|
}
|
|
@@ -77,4 +101,60 @@ export interface GetReplicaReq extends GrpcTimeOut {
|
|
|
77
101
|
collectionID: number | string;
|
|
78
102
|
with_shard_nodes?: boolean;
|
|
79
103
|
}
|
|
104
|
+
export interface RenameCollectionReq extends GrpcTimeOut {
|
|
105
|
+
collection_name: string;
|
|
106
|
+
new_collection_name: string;
|
|
107
|
+
}
|
|
108
|
+
export interface BoolResponse {
|
|
109
|
+
status: ResStatus;
|
|
110
|
+
value: Boolean;
|
|
111
|
+
}
|
|
112
|
+
export interface CompactionResponse {
|
|
113
|
+
status: ResStatus;
|
|
114
|
+
compactionID: number;
|
|
115
|
+
}
|
|
116
|
+
export interface CollectionSchema {
|
|
117
|
+
name: string;
|
|
118
|
+
description: string;
|
|
119
|
+
fields: FieldSchema[];
|
|
120
|
+
}
|
|
121
|
+
export interface DescribeCollectionResponse extends TimeStamp {
|
|
122
|
+
status: ResStatus;
|
|
123
|
+
schema: CollectionSchema;
|
|
124
|
+
collectionID: string;
|
|
125
|
+
consistency_level: ConsistencyLevelEnum;
|
|
126
|
+
aliases: string[];
|
|
127
|
+
virtual_channel_names: string[];
|
|
128
|
+
physical_channel_names: string[];
|
|
129
|
+
}
|
|
130
|
+
export interface GetCompactionPlansResponse {
|
|
131
|
+
status: ResStatus;
|
|
132
|
+
state: CompactionState;
|
|
133
|
+
mergeInfos: {
|
|
134
|
+
sources: number[];
|
|
135
|
+
target: number;
|
|
136
|
+
}[];
|
|
137
|
+
}
|
|
138
|
+
export interface GetCompactionStateResponse {
|
|
139
|
+
status: ResStatus;
|
|
140
|
+
state: CompactionState;
|
|
141
|
+
executingPlanNo: number;
|
|
142
|
+
timeoutPlanNo: number;
|
|
143
|
+
completedPlanNo: number;
|
|
144
|
+
}
|
|
145
|
+
export interface ShowCollectionsResponse extends TimeStampArray {
|
|
146
|
+
status: ResStatus;
|
|
147
|
+
data: CollectionData[];
|
|
148
|
+
}
|
|
149
|
+
export interface StatisticsResponse {
|
|
150
|
+
status: ResStatus;
|
|
151
|
+
stats: KeyValuePair[];
|
|
152
|
+
data: {
|
|
153
|
+
[x: string]: any;
|
|
154
|
+
};
|
|
155
|
+
}
|
|
156
|
+
export interface ReplicasResponse {
|
|
157
|
+
status: ResStatus;
|
|
158
|
+
replicas: ReplicaInfo[];
|
|
159
|
+
}
|
|
80
160
|
export {};
|
|
@@ -1,17 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ShowCollectionsType = void 0;
|
|
4
4
|
var ShowCollectionsType;
|
|
5
5
|
(function (ShowCollectionsType) {
|
|
6
6
|
ShowCollectionsType[ShowCollectionsType["All"] = 0] = "All";
|
|
7
7
|
ShowCollectionsType[ShowCollectionsType["Loaded"] = 1] = "Loaded";
|
|
8
8
|
})(ShowCollectionsType = exports.ShowCollectionsType || (exports.ShowCollectionsType = {}));
|
|
9
|
-
var ConsistencyLevelEnum;
|
|
10
|
-
(function (ConsistencyLevelEnum) {
|
|
11
|
-
ConsistencyLevelEnum[ConsistencyLevelEnum["Strong"] = 0] = "Strong";
|
|
12
|
-
ConsistencyLevelEnum[ConsistencyLevelEnum["Session"] = 1] = "Session";
|
|
13
|
-
ConsistencyLevelEnum[ConsistencyLevelEnum["Bounded"] = 2] = "Bounded";
|
|
14
|
-
ConsistencyLevelEnum[ConsistencyLevelEnum["Eventually"] = 3] = "Eventually";
|
|
15
|
-
ConsistencyLevelEnum[ConsistencyLevelEnum["Customized"] = 4] = "Customized";
|
|
16
|
-
})(ConsistencyLevelEnum = exports.ConsistencyLevelEnum || (exports.ConsistencyLevelEnum = {}));
|
|
17
9
|
//# sourceMappingURL=Collection.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../../milvus/types/Collection.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"Collection.js","sourceRoot":"","sources":["../../../milvus/types/Collection.ts"],"names":[],"mappings":";;;AAyDA,IAAY,mBAGX;AAHD,WAAY,mBAAmB;IAC7B,2DAAG,CAAA;IACH,iEAAM,CAAA;AACR,CAAC,EAHW,mBAAmB,GAAnB,2BAAmB,KAAnB,2BAAmB,QAG9B"}
|
|
@@ -1,134 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
GHOST = 0,
|
|
3
|
-
L2 = 1,
|
|
4
|
-
IP = 2,
|
|
5
|
-
HAMMING = 3,
|
|
6
|
-
JACCARD = 4,
|
|
7
|
-
TANIMOTO = 5,
|
|
8
|
-
SUBSTRUCTURE = 6,
|
|
9
|
-
SUPERSTRUCTURE = 7
|
|
10
|
-
}
|
|
11
|
-
export declare enum IndexType {
|
|
12
|
-
INVALID = 0,
|
|
13
|
-
FLAT = 1,
|
|
14
|
-
IVFFLAT = 2,
|
|
15
|
-
IVFSQ8 = 3,
|
|
16
|
-
RNSG = 4,
|
|
17
|
-
IVFSQ8H = 5,
|
|
18
|
-
IVFPQ = 6,
|
|
19
|
-
SPTAGKDT = 7,
|
|
20
|
-
SPTAGBKT = 8,
|
|
21
|
-
HNSW = 11,
|
|
22
|
-
ANNOY = 12
|
|
23
|
-
}
|
|
24
|
-
export declare enum MsgType {
|
|
25
|
-
Undefined = 0,
|
|
26
|
-
CreateCollection = 100,
|
|
27
|
-
DropCollection = 101,
|
|
28
|
-
HasCollection = 102,
|
|
29
|
-
DescribeCollection = 103,
|
|
30
|
-
ShowCollections = 104,
|
|
31
|
-
GetSystemConfigs = 105,
|
|
32
|
-
LoadCollection = 106,
|
|
33
|
-
ReleaseCollection = 107,
|
|
34
|
-
CreateAlias = 108,
|
|
35
|
-
DropAlias = 109,
|
|
36
|
-
AlterAlias = 110,
|
|
37
|
-
AlterCollection = 111,
|
|
38
|
-
CreatePartition = 200,
|
|
39
|
-
DropPartition = 201,
|
|
40
|
-
HasPartition = 202,
|
|
41
|
-
DescribePartition = 203,
|
|
42
|
-
ShowPartitions = 204,
|
|
43
|
-
LoadPartitions = 205,
|
|
44
|
-
ReleasePartitions = 206,
|
|
45
|
-
ShowSegments = 250,
|
|
46
|
-
DescribeSegment = 251,
|
|
47
|
-
LoadSegments = 252,
|
|
48
|
-
ReleaseSegments = 253,
|
|
49
|
-
HandoffSegments = 254,
|
|
50
|
-
LoadBalanceSegments = 255,
|
|
51
|
-
DescribeSegments = 256,
|
|
52
|
-
CreateIndex = 300,
|
|
53
|
-
DescribeIndex = 301,
|
|
54
|
-
DropIndex = 302,
|
|
55
|
-
Insert = 400,
|
|
56
|
-
Delete = 401,
|
|
57
|
-
Flush = 402,
|
|
58
|
-
ResendSegmentStats = 403,
|
|
59
|
-
Search = 500,
|
|
60
|
-
SearchResult = 501,
|
|
61
|
-
GetIndexState = 502,
|
|
62
|
-
GetIndexBuildProgress = 503,
|
|
63
|
-
GetCollectionStatistics = 504,
|
|
64
|
-
GetPartitionStatistics = 505,
|
|
65
|
-
Retrieve = 506,
|
|
66
|
-
RetrieveResult = 507,
|
|
67
|
-
WatchDmChannels = 508,
|
|
68
|
-
RemoveDmChannels = 509,
|
|
69
|
-
WatchQueryChannels = 510,
|
|
70
|
-
RemoveQueryChannels = 511,
|
|
71
|
-
SealedSegmentsChangeInfo = 512,
|
|
72
|
-
WatchDeltaChannels = 513,
|
|
73
|
-
GetShardLeaders = 514,
|
|
74
|
-
GetReplicas = 515,
|
|
75
|
-
UnsubDmChannel = 516,
|
|
76
|
-
GetDistribution = 517,
|
|
77
|
-
SyncDistribution = 518,
|
|
78
|
-
SegmentInfo = 600,
|
|
79
|
-
SystemInfo = 601,
|
|
80
|
-
GetRecoveryInfo = 602,
|
|
81
|
-
GetSegmentState = 603,
|
|
82
|
-
TimeTick = 1200,
|
|
83
|
-
QueryNodeStats = 1201,
|
|
84
|
-
LoadIndex = 1202,
|
|
85
|
-
RequestID = 1203,
|
|
86
|
-
RequestTSO = 1204,
|
|
87
|
-
AllocateSegment = 1205,
|
|
88
|
-
SegmentStatistics = 1206,
|
|
89
|
-
SegmentFlushDone = 1207,
|
|
90
|
-
DataNodeTt = 1208,
|
|
91
|
-
CreateCredential = 1500,
|
|
92
|
-
GetCredential = 1501,
|
|
93
|
-
DeleteCredential = 1502,
|
|
94
|
-
UpdateCredential = 1503,
|
|
95
|
-
ListCredUsernames = 1504,
|
|
96
|
-
CreateRole = 1600,
|
|
97
|
-
DropRole = 1601,
|
|
98
|
-
OperateUserRole = 1602,
|
|
99
|
-
SelectRole = 1603,
|
|
100
|
-
SelectUser = 1604,
|
|
101
|
-
SelectResource = 1605,
|
|
102
|
-
OperatePrivilege = 1606,
|
|
103
|
-
SelectGrant = 1607,
|
|
104
|
-
RefreshPolicyInfoCache = 1608,
|
|
105
|
-
ListPolicy = 1609
|
|
106
|
-
}
|
|
1
|
+
import { CollectionPrivileges, UserPrivileges, GlobalPrivileges, MsgType } from '../const/Milvus';
|
|
107
2
|
export interface MsgBase {
|
|
108
3
|
base: {
|
|
109
4
|
msg_type: MsgType;
|
|
110
5
|
};
|
|
111
6
|
}
|
|
112
|
-
/**
|
|
113
|
-
* @brief Field data type
|
|
114
|
-
*/
|
|
115
|
-
export declare enum DataType {
|
|
116
|
-
None = 0,
|
|
117
|
-
Bool = 1,
|
|
118
|
-
Int8 = 2,
|
|
119
|
-
Int16 = 3,
|
|
120
|
-
Int32 = 4,
|
|
121
|
-
Int64 = 5,
|
|
122
|
-
Float = 10,
|
|
123
|
-
Double = 11,
|
|
124
|
-
String = 20,
|
|
125
|
-
VarChar = 21,
|
|
126
|
-
BinaryVector = 100,
|
|
127
|
-
FloatVector = 101
|
|
128
|
-
}
|
|
129
|
-
export declare const DataTypeMap: {
|
|
130
|
-
[x: string]: number;
|
|
131
|
-
};
|
|
132
7
|
export interface KeyValuePair {
|
|
133
8
|
key: string;
|
|
134
9
|
value: string | number;
|
|
@@ -156,151 +31,20 @@ export interface NumberArrayId {
|
|
|
156
31
|
export interface StringArrayId {
|
|
157
32
|
str_id: StringArray;
|
|
158
33
|
}
|
|
159
|
-
export declare enum SegmentState {
|
|
160
|
-
SegmentStateNone = 0,
|
|
161
|
-
NotExist = 1,
|
|
162
|
-
Growing = 2,
|
|
163
|
-
Sealed = 3,
|
|
164
|
-
Flushed = "Flushed",
|
|
165
|
-
Flushing = "Flushing"
|
|
166
|
-
}
|
|
167
|
-
export declare enum CompactionState {
|
|
168
|
-
UndefiedState = 0,
|
|
169
|
-
Executing = 1,
|
|
170
|
-
Completed = 2
|
|
171
|
-
}
|
|
172
34
|
export interface GrpcTimeOut {
|
|
173
35
|
timeout?: number;
|
|
174
36
|
}
|
|
175
|
-
export
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
Eventually = 3,
|
|
180
|
-
Customized = 4
|
|
181
|
-
}
|
|
182
|
-
export declare enum ImportState {
|
|
183
|
-
ImportPending = "ImportPending",
|
|
184
|
-
ImportFailed = "ImportFailed",
|
|
185
|
-
ImportStarted = "ImportStarted",
|
|
186
|
-
ImportPersisted = "ImportPersisted",
|
|
187
|
-
ImportCompleted = "ImportCompleted",
|
|
188
|
-
ImportFailedAndCleaned = "ImportFailedAndCleaned"
|
|
189
|
-
}
|
|
190
|
-
export declare enum ObjectType {
|
|
191
|
-
Collection = 0,
|
|
192
|
-
Global = 1,
|
|
193
|
-
User = 2
|
|
194
|
-
}
|
|
195
|
-
export declare enum ObjectPrivilege {
|
|
196
|
-
PrivilegeAll = 0,
|
|
197
|
-
PrivilegeCreateCollection = 1,
|
|
198
|
-
PrivilegeDropCollection = 2,
|
|
199
|
-
PrivilegeDescribeCollection = 3,
|
|
200
|
-
PrivilegeShowCollections = 4,
|
|
201
|
-
PrivilegeLoad = 5,
|
|
202
|
-
PrivilegeRelease = 6,
|
|
203
|
-
PrivilegeCompaction = 7,
|
|
204
|
-
PrivilegeInsert = 8,
|
|
205
|
-
PrivilegeDelete = 9,
|
|
206
|
-
PrivilegeGetStatistics = 10,
|
|
207
|
-
PrivilegeCreateIndex = 11,
|
|
208
|
-
PrivilegeIndexDetail = 12,
|
|
209
|
-
PrivilegeDropIndex = 13,
|
|
210
|
-
PrivilegeSearch = 14,
|
|
211
|
-
PrivilegeFlush = 15,
|
|
212
|
-
PrivilegeQuery = 16,
|
|
213
|
-
PrivilegeLoadBalance = 17,
|
|
214
|
-
PrivilegeImport = 18,
|
|
215
|
-
PrivilegeCreateOwnership = 19,
|
|
216
|
-
PrivilegeUpdateUser = 20,
|
|
217
|
-
PrivilegeDropOwnership = 21,
|
|
218
|
-
PrivilegeSelectOwnership = 22,
|
|
219
|
-
PrivilegeManageOwnership = 23,
|
|
220
|
-
PrivilegeSelectUser = 24
|
|
221
|
-
}
|
|
222
|
-
export declare enum StateCode {
|
|
223
|
-
Initializing = 0,
|
|
224
|
-
Healthy = 1,
|
|
225
|
-
Abnormal = 2,
|
|
226
|
-
StandBy = 3
|
|
227
|
-
}
|
|
228
|
-
export declare enum OperateUserRoleType {
|
|
229
|
-
AddUserToRole = 0,
|
|
230
|
-
RemoveUserFromRole = 1
|
|
231
|
-
}
|
|
232
|
-
export declare enum OperatePrivilegeType {
|
|
233
|
-
Grant = 0,
|
|
234
|
-
Revoke = 1
|
|
235
|
-
}
|
|
236
|
-
export declare enum Roles {
|
|
237
|
-
ADMIN = "admin",
|
|
238
|
-
PUBLIC = "public"
|
|
239
|
-
}
|
|
240
|
-
export declare enum RbacObjects {
|
|
241
|
-
Collection = "Collection",
|
|
242
|
-
Global = "Global",
|
|
243
|
-
User = "User"
|
|
244
|
-
}
|
|
245
|
-
export declare enum CollectionPrivileges {
|
|
246
|
-
CreateIndex = "CreateIndex",
|
|
247
|
-
DropIndex = "DropIndex",
|
|
248
|
-
IndexDetail = "IndexDetail",
|
|
249
|
-
Load = "Load",
|
|
250
|
-
Release = "Release",
|
|
251
|
-
Insert = "Insert",
|
|
252
|
-
Delete = "Delete",
|
|
253
|
-
Search = "Search",
|
|
254
|
-
Flush = "Flush",
|
|
255
|
-
Query = "Query",
|
|
256
|
-
GetStatistics = "GetStatistics",
|
|
257
|
-
Compaction = "Compaction",
|
|
258
|
-
Alias = "Alias",
|
|
259
|
-
Import = "Import",
|
|
260
|
-
LoadBalance = "LoadBalance"
|
|
37
|
+
export type PrivilegesTypes = CollectionPrivileges | UserPrivileges | GlobalPrivileges;
|
|
38
|
+
export interface ResStatus {
|
|
39
|
+
error_code: string | number;
|
|
40
|
+
reason: string;
|
|
261
41
|
}
|
|
262
|
-
export
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
DropCollection = "DropCollection",
|
|
266
|
-
DescribeCollection = "DescribeCollection",
|
|
267
|
-
ShowCollections = "ShowCollections",
|
|
268
|
-
CreateOwnership = "CreateOwnership",
|
|
269
|
-
DropOwnership = "DropOwnership",
|
|
270
|
-
SelectOwnership = "SelectOwnership",
|
|
271
|
-
ManageOwnership = "ManageOwnership"
|
|
42
|
+
export interface TimeStamp {
|
|
43
|
+
created_timestamp: string;
|
|
44
|
+
created_utc_timestamp: string;
|
|
272
45
|
}
|
|
273
|
-
export
|
|
274
|
-
|
|
275
|
-
|
|
46
|
+
export interface TimeStampArray {
|
|
47
|
+
created_timestamps: string[];
|
|
48
|
+
created_utc_timestamps: string[];
|
|
276
49
|
}
|
|
277
|
-
export declare const Privileges: {
|
|
278
|
-
All: GlobalPrivileges.All;
|
|
279
|
-
CreateCollection: GlobalPrivileges.CreateCollection;
|
|
280
|
-
DropCollection: GlobalPrivileges.DropCollection;
|
|
281
|
-
DescribeCollection: GlobalPrivileges.DescribeCollection;
|
|
282
|
-
ShowCollections: GlobalPrivileges.ShowCollections;
|
|
283
|
-
CreateOwnership: GlobalPrivileges.CreateOwnership;
|
|
284
|
-
DropOwnership: GlobalPrivileges.DropOwnership;
|
|
285
|
-
SelectOwnership: GlobalPrivileges.SelectOwnership;
|
|
286
|
-
ManageOwnership: GlobalPrivileges.ManageOwnership;
|
|
287
|
-
UpdateUser: UserPrivileges.UpdateUser;
|
|
288
|
-
SelectUser: UserPrivileges.SelectUser;
|
|
289
|
-
CreateIndex: CollectionPrivileges.CreateIndex;
|
|
290
|
-
DropIndex: CollectionPrivileges.DropIndex;
|
|
291
|
-
IndexDetail: CollectionPrivileges.IndexDetail;
|
|
292
|
-
Load: CollectionPrivileges.Load;
|
|
293
|
-
Release: CollectionPrivileges.Release;
|
|
294
|
-
Insert: CollectionPrivileges.Insert;
|
|
295
|
-
Delete: CollectionPrivileges.Delete;
|
|
296
|
-
Search: CollectionPrivileges.Search;
|
|
297
|
-
Flush: CollectionPrivileges.Flush;
|
|
298
|
-
Query: CollectionPrivileges.Query;
|
|
299
|
-
GetStatistics: CollectionPrivileges.GetStatistics;
|
|
300
|
-
Compaction: CollectionPrivileges.Compaction;
|
|
301
|
-
Alias: CollectionPrivileges.Alias;
|
|
302
|
-
Import: CollectionPrivileges.Import;
|
|
303
|
-
LoadBalance: CollectionPrivileges.LoadBalance;
|
|
304
|
-
};
|
|
305
|
-
export declare type Privileges = CollectionPrivileges | UserPrivileges | GlobalPrivileges;
|
|
306
50
|
export {};
|