@zilliz/milvus2-sdk-node 2.2.8 → 2.2.9
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 +16 -4
- package/dist/milvus/BaseClient.d.ts +7 -4
- package/dist/milvus/BaseClient.js +8 -33
- package/dist/milvus/BaseClient.js.map +1 -1
- package/dist/milvus/Collection.js +19 -19
- package/dist/milvus/Collection.js.map +1 -1
- package/dist/milvus/Data.js +12 -12
- package/dist/milvus/Data.js.map +1 -1
- package/dist/milvus/GrpcClient.d.ts +32 -0
- package/dist/milvus/GrpcClient.js +236 -0
- package/dist/milvus/GrpcClient.js.map +1 -0
- package/dist/milvus/MilvusClient.d.ts +5 -16
- package/dist/milvus/MilvusClient.js +10 -138
- package/dist/milvus/MilvusClient.js.map +1 -1
- package/dist/milvus/MilvusIndex.js +5 -5
- package/dist/milvus/MilvusIndex.js.map +1 -1
- package/dist/milvus/Partition.js +7 -7
- package/dist/milvus/Partition.js.map +1 -1
- package/dist/milvus/Resource.js +6 -6
- package/dist/milvus/Resource.js.map +1 -1
- package/dist/milvus/User.js +15 -15
- package/dist/milvus/User.js.map +1 -1
- package/dist/milvus/const/Milvus.d.ts +3 -0
- package/dist/milvus/const/Milvus.js +4 -1
- package/dist/milvus/const/Milvus.js.map +1 -1
- package/dist/milvus/index.d.ts +2 -0
- package/dist/milvus/index.js +2 -0
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Client.d.ts +7 -1
- package/dist/proto/proto/google/protobuf/descriptor.proto +1 -1
- package/dist/sdk.json +1 -1
- package/dist/utils/Format.d.ts +7 -0
- package/dist/utils/Format.js +12 -1
- package/dist/utils/Format.js.map +1 -1
- package/dist/utils/Grpc.d.ts +14 -0
- package/dist/utils/Grpc.js +107 -1
- package/dist/utils/Grpc.js.map +1 -1
- package/dist/utils/Validate.d.ts +11 -0
- package/dist/utils/Validate.js +20 -1
- package/dist/utils/Validate.js.map +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
17
|
+
var __assign = (this && this.__assign) || function () {
|
|
18
|
+
__assign = Object.assign || function(t) {
|
|
19
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
20
|
+
s = arguments[i];
|
|
21
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
22
|
+
t[p] = s[p];
|
|
23
|
+
}
|
|
24
|
+
return t;
|
|
25
|
+
};
|
|
26
|
+
return __assign.apply(this, arguments);
|
|
27
|
+
};
|
|
28
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
29
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
30
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
31
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
32
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
33
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
34
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
35
|
+
});
|
|
36
|
+
};
|
|
37
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
38
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
39
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
40
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
41
|
+
function step(op) {
|
|
42
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
43
|
+
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
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
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
46
|
+
switch (op[0]) {
|
|
47
|
+
case 0: case 1: t = op; break;
|
|
48
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
49
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
50
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
51
|
+
default:
|
|
52
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
53
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
54
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
55
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
56
|
+
if (t[2]) _.ops.pop();
|
|
57
|
+
_.trys.pop(); continue;
|
|
58
|
+
}
|
|
59
|
+
op = body.call(thisArg, _);
|
|
60
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
61
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
65
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
66
|
+
};
|
|
67
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
68
|
+
exports.GRPCClient = void 0;
|
|
69
|
+
var path_1 = __importDefault(require("path"));
|
|
70
|
+
var _1 = require(".");
|
|
71
|
+
var User_1 = require("./User");
|
|
72
|
+
var utils_1 = require("../utils");
|
|
73
|
+
var sdk_json_1 = __importDefault(require("../sdk.json"));
|
|
74
|
+
var protobufjs_1 = __importDefault(require("protobufjs"));
|
|
75
|
+
var grpc_js_1 = require("@grpc/grpc-js");
|
|
76
|
+
var utils_2 = require("../utils");
|
|
77
|
+
// path
|
|
78
|
+
var protoPath = path_1.default.resolve(__dirname, '../proto/proto/milvus.proto');
|
|
79
|
+
var schemaProtoPath = path_1.default.resolve(__dirname, '../proto/proto/schema.proto');
|
|
80
|
+
var GRPCClient = /** @class */ (function (_super) {
|
|
81
|
+
__extends(GRPCClient, _super);
|
|
82
|
+
/**
|
|
83
|
+
* Connect to a Milvus gRPC client.
|
|
84
|
+
*
|
|
85
|
+
* @param configOrAddress The configuration object or the Milvus address as a string.
|
|
86
|
+
* @param ssl Whether to use SSL or not. Default is false.
|
|
87
|
+
* @param username The username for authentication. Required if password is provided.
|
|
88
|
+
* @param password The password for authentication. Required if username is provided.
|
|
89
|
+
*/
|
|
90
|
+
function GRPCClient(configOrAddress, ssl, username, password, channelOptions) {
|
|
91
|
+
var _this =
|
|
92
|
+
// setup configuration object
|
|
93
|
+
_super.call(this, configOrAddress, ssl, username, password, channelOptions) || this;
|
|
94
|
+
// load proto
|
|
95
|
+
_this.protoPath = protoPath;
|
|
96
|
+
_this.schemaProto = protobufjs_1.default.loadSync(schemaProtoPath);
|
|
97
|
+
_this.milvusProto = protobufjs_1.default.loadSync(protoPath);
|
|
98
|
+
return _this;
|
|
99
|
+
}
|
|
100
|
+
// overload
|
|
101
|
+
GRPCClient.prototype.connect = function () {
|
|
102
|
+
// if we need to create auth interceptors
|
|
103
|
+
var needAuth = this.config.username !== undefined && this.config.password !== undefined;
|
|
104
|
+
// get Milvus GRPC service
|
|
105
|
+
var MilvusService = (0, utils_2.getGRPCService)({
|
|
106
|
+
protoPath: this.protoPath,
|
|
107
|
+
serviceName: 'milvus.proto.milvus.MilvusService', // the name of the Milvus service
|
|
108
|
+
});
|
|
109
|
+
// auth interceptor
|
|
110
|
+
var authInterceptor = needAuth
|
|
111
|
+
? (0, utils_2.getAuthInterceptor)(this.config.username, this.config.password)
|
|
112
|
+
: null;
|
|
113
|
+
// retry interceptor
|
|
114
|
+
var retryInterceptor = (0, utils_2.getRetryInterceptor)({
|
|
115
|
+
maxRetries: typeof this.config.maxRetries === 'undefined'
|
|
116
|
+
? _1.DEFAULT_MAX_RETRIES
|
|
117
|
+
: this.config.maxRetries,
|
|
118
|
+
retryDelay: typeof this.config.retryDelay === 'undefined'
|
|
119
|
+
? _1.DEFAULT_RETRY_DELAY
|
|
120
|
+
: this.config.retryDelay,
|
|
121
|
+
debug: this.config.debug || _1.DEFAULT_DEBUG,
|
|
122
|
+
});
|
|
123
|
+
// interceptors
|
|
124
|
+
var interceptors = [authInterceptor, retryInterceptor];
|
|
125
|
+
// options
|
|
126
|
+
var options = __assign({ interceptors: interceptors,
|
|
127
|
+
// Milvus default max_receive_message_length is 100MB, but Milvus support change max_receive_message_length .
|
|
128
|
+
// So SDK should support max_receive_message_length unlimited.
|
|
129
|
+
'grpc.max_receive_message_length': -1 }, this.config.channelOptions);
|
|
130
|
+
// create grpc client
|
|
131
|
+
this.client = new MilvusService((0, utils_2.formatAddress)(this.config.address), // format the address
|
|
132
|
+
this.config.ssl ? grpc_js_1.credentials.createSsl() : grpc_js_1.credentials.createInsecure(), // create SSL or insecure credentials
|
|
133
|
+
options);
|
|
134
|
+
};
|
|
135
|
+
Object.defineProperty(GRPCClient, "sdkInfo", {
|
|
136
|
+
get: function () {
|
|
137
|
+
return {
|
|
138
|
+
version: sdk_json_1.default.version,
|
|
139
|
+
recommandMilvus: sdk_json_1.default.milvusVersion,
|
|
140
|
+
};
|
|
141
|
+
},
|
|
142
|
+
enumerable: false,
|
|
143
|
+
configurable: true
|
|
144
|
+
});
|
|
145
|
+
Object.defineProperty(GRPCClient.prototype, "collectionManager", {
|
|
146
|
+
// @deprecated
|
|
147
|
+
get: function () {
|
|
148
|
+
/* istanbul ignore next */
|
|
149
|
+
console.warn("collectionManager are no longer necessary, you can call methods directly on the client object.");
|
|
150
|
+
return this;
|
|
151
|
+
},
|
|
152
|
+
enumerable: false,
|
|
153
|
+
configurable: true
|
|
154
|
+
});
|
|
155
|
+
Object.defineProperty(GRPCClient.prototype, "partitionManager", {
|
|
156
|
+
get: function () {
|
|
157
|
+
/* istanbul ignore next */
|
|
158
|
+
console.warn("partitionManager are no longer necessary, you can call methods directly on the client object.");
|
|
159
|
+
return this;
|
|
160
|
+
},
|
|
161
|
+
enumerable: false,
|
|
162
|
+
configurable: true
|
|
163
|
+
});
|
|
164
|
+
Object.defineProperty(GRPCClient.prototype, "indexManager", {
|
|
165
|
+
get: function () {
|
|
166
|
+
/* istanbul ignore next */
|
|
167
|
+
console.warn("indexManager are no longer necessary, you can call methods directly on the client object.");
|
|
168
|
+
return this;
|
|
169
|
+
},
|
|
170
|
+
enumerable: false,
|
|
171
|
+
configurable: true
|
|
172
|
+
});
|
|
173
|
+
Object.defineProperty(GRPCClient.prototype, "dataManager", {
|
|
174
|
+
get: function () {
|
|
175
|
+
/* istanbul ignore next */
|
|
176
|
+
console.warn("dataManager are no longer necessary, you can call methods directly on the client object.");
|
|
177
|
+
return this;
|
|
178
|
+
},
|
|
179
|
+
enumerable: false,
|
|
180
|
+
configurable: true
|
|
181
|
+
});
|
|
182
|
+
Object.defineProperty(GRPCClient.prototype, "resourceManager", {
|
|
183
|
+
get: function () {
|
|
184
|
+
/* istanbul ignore next */
|
|
185
|
+
console.warn("resourceManager are no longer necessary, you can call methods directly on the client object.");
|
|
186
|
+
return this;
|
|
187
|
+
},
|
|
188
|
+
enumerable: false,
|
|
189
|
+
configurable: true
|
|
190
|
+
});
|
|
191
|
+
Object.defineProperty(GRPCClient.prototype, "userManager", {
|
|
192
|
+
get: function () {
|
|
193
|
+
/* istanbul ignore next */
|
|
194
|
+
console.warn("userManager are no longer necessary, you can call methods directly on the client object.");
|
|
195
|
+
return this;
|
|
196
|
+
},
|
|
197
|
+
enumerable: false,
|
|
198
|
+
configurable: true
|
|
199
|
+
});
|
|
200
|
+
// This method closes the gRPC client connection and returns the connectivity state of the channel.
|
|
201
|
+
GRPCClient.prototype.closeConnection = function () {
|
|
202
|
+
// Close the gRPC client connection
|
|
203
|
+
if (this.client) {
|
|
204
|
+
this.client.close();
|
|
205
|
+
}
|
|
206
|
+
// grpc client closed -> 4, connected -> 0
|
|
207
|
+
if (this.client) {
|
|
208
|
+
return this.client.getChannel().getConnectivityState(true);
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
// This method returns the version of the Milvus server.
|
|
212
|
+
GRPCClient.prototype.getVersion = function () {
|
|
213
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
214
|
+
return __generator(this, function (_a) {
|
|
215
|
+
switch (_a.label) {
|
|
216
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetVersion', {}, this.timeout)];
|
|
217
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
});
|
|
221
|
+
};
|
|
222
|
+
// This method checks the health of the Milvus server.
|
|
223
|
+
GRPCClient.prototype.checkHealth = function () {
|
|
224
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
225
|
+
return __generator(this, function (_a) {
|
|
226
|
+
switch (_a.label) {
|
|
227
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'CheckHealth', {}, this.timeout)];
|
|
228
|
+
case 1: return [2 /*return*/, _a.sent()];
|
|
229
|
+
}
|
|
230
|
+
});
|
|
231
|
+
});
|
|
232
|
+
};
|
|
233
|
+
return GRPCClient;
|
|
234
|
+
}(User_1.User));
|
|
235
|
+
exports.GRPCClient = GRPCClient;
|
|
236
|
+
//# sourceMappingURL=GrpcClient.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GrpcClient.js","sourceRoot":"","sources":["../../milvus/GrpcClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,8CAAwB;AACxB,sBAOW;AACX,+BAA8B;AAC9B,kCAAqC;AACrC,yDAAkC;AAClC,0DAA4C;AAC5C,yCAA4D;AAC5D,kCAKkB;AAElB,OAAO;AACP,IAAM,SAAS,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;AACzE,IAAM,eAAe,GAAG,cAAI,CAAC,OAAO,CAAC,SAAS,EAAE,6BAA6B,CAAC,CAAC;AAE/E;IAAgC,8BAAI;IAQlC;;;;;;;OAOG;IACH,oBACE,eAAsC,EACtC,GAAa,EACb,QAAiB,EACjB,QAAiB,EACjB,cAA+B;QALjC;QAOE,6BAA6B;QAC7B,kBAAM,eAAe,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC,SAKhE;QAJC,aAAa;QACb,KAAI,CAAC,SAAS,GAAG,SAAS,CAAC;QAC3B,KAAI,CAAC,WAAW,GAAG,oBAAQ,CAAC,QAAQ,CAAC,eAAe,CAAC,CAAC;QACtD,KAAI,CAAC,WAAW,GAAG,oBAAQ,CAAC,QAAQ,CAAC,SAAS,CAAC,CAAC;;IAClD,CAAC;IAED,WAAW;IACX,4BAAO,GAAP;QACE,yCAAyC;QACzC,IAAM,QAAQ,GACZ,IAAI,CAAC,MAAM,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI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C,IAAI,IAAI,CAAC,MAAM,EAAE;YACf,OAAO,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC,oBAAoB,CAAC,IAAI,CAAC,CAAC;SAC5D;IACH,CAAC;IAED,wDAAwD;IAClD,+BAAU,GAAhB;;;;4BACS,qBAAM,IAAA,iBAAS,EAAC,IAAI,CAAC,MAAM,EAAE,YAAY,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAA;4BAAnE,sBAAO,SAA4D,EAAC;;;;KACrE;IAED,sDAAsD;IAChD,gCAAW,GAAjB;;;;4BACS,qBAAM,IAAA,iBAAS,EAAC,IAAI,CAAC,MAAM,EAAE,aAAa,EAAE,EAAE,EAAE,IAAI,CAAC,OAAO,CAAC,EAAA;4BAApE,sBAAO,SAA6D,EAAC;;;;KACtE;IACH,iBAAC;AAAD,CAAC,AAvJD,CAAgC,WAAI,GAuJnC;AAvJY,gCAAU"}
|
|
@@ -1,17 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
export declare class MilvusClient extends
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
recommandMilvus: string;
|
|
7
|
-
};
|
|
8
|
-
get collectionManager(): this;
|
|
9
|
-
get partitionManager(): this;
|
|
10
|
-
get indexManager(): this;
|
|
11
|
-
get dataManager(): this;
|
|
12
|
-
get resourceManager(): this;
|
|
13
|
-
get userManager(): this;
|
|
14
|
-
closeConnection(): import("@grpc/grpc-js").connectivityState;
|
|
15
|
-
getVersion(): Promise<GetVersionResponse>;
|
|
16
|
-
checkHealth(): Promise<CheckHealthResponse>;
|
|
1
|
+
import { GRPCClient, ClientConfig } from '.';
|
|
2
|
+
import { ChannelOptions } from '@grpc/grpc-js';
|
|
3
|
+
export declare class MilvusClient extends GRPCClient {
|
|
4
|
+
constructor(configOrAddress: ClientConfig | string, ssl?: boolean, username?: string, password?: string, channelOptions?: ChannelOptions);
|
|
5
|
+
connect(): void;
|
|
17
6
|
}
|
|
@@ -14,150 +14,22 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
14
14
|
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
15
|
};
|
|
16
16
|
})();
|
|
17
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
18
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
19
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
20
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
21
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
22
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
23
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
24
|
-
});
|
|
25
|
-
};
|
|
26
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
27
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
28
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
29
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
30
|
-
function step(op) {
|
|
31
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
32
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
33
|
-
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;
|
|
34
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
35
|
-
switch (op[0]) {
|
|
36
|
-
case 0: case 1: t = op; break;
|
|
37
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
38
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
39
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
40
|
-
default:
|
|
41
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
42
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
43
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
44
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
45
|
-
if (t[2]) _.ops.pop();
|
|
46
|
-
_.trys.pop(); continue;
|
|
47
|
-
}
|
|
48
|
-
op = body.call(thisArg, _);
|
|
49
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
50
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
|
-
}
|
|
52
|
-
};
|
|
53
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
54
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
55
|
-
};
|
|
56
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
57
18
|
exports.MilvusClient = void 0;
|
|
58
|
-
var
|
|
59
|
-
var User_1 = require("./User");
|
|
60
|
-
var utils_1 = require("../utils");
|
|
19
|
+
var _1 = require(".");
|
|
61
20
|
var MilvusClient = /** @class */ (function (_super) {
|
|
62
21
|
__extends(MilvusClient, _super);
|
|
63
|
-
function MilvusClient() {
|
|
64
|
-
|
|
22
|
+
function MilvusClient(configOrAddress, ssl, username, password, channelOptions) {
|
|
23
|
+
var _this = _super.call(this, configOrAddress, ssl, username, password, channelOptions) || this;
|
|
24
|
+
// connect
|
|
25
|
+
_this.connect();
|
|
26
|
+
return _this;
|
|
65
27
|
}
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
version: sdk_json_1.default.version,
|
|
70
|
-
recommandMilvus: sdk_json_1.default.milvusVersion,
|
|
71
|
-
};
|
|
72
|
-
},
|
|
73
|
-
enumerable: false,
|
|
74
|
-
configurable: true
|
|
75
|
-
});
|
|
76
|
-
Object.defineProperty(MilvusClient.prototype, "collectionManager", {
|
|
77
|
-
// @deprecated
|
|
78
|
-
get: function () {
|
|
79
|
-
/* istanbul ignore next */
|
|
80
|
-
console.warn("collectionManager are no longer necessary, you can call methods directly on the client object.");
|
|
81
|
-
return this;
|
|
82
|
-
},
|
|
83
|
-
enumerable: false,
|
|
84
|
-
configurable: true
|
|
85
|
-
});
|
|
86
|
-
Object.defineProperty(MilvusClient.prototype, "partitionManager", {
|
|
87
|
-
get: function () {
|
|
88
|
-
/* istanbul ignore next */
|
|
89
|
-
console.warn("partitionManager are no longer necessary, you can call methods directly on the client object.");
|
|
90
|
-
return this;
|
|
91
|
-
},
|
|
92
|
-
enumerable: false,
|
|
93
|
-
configurable: true
|
|
94
|
-
});
|
|
95
|
-
Object.defineProperty(MilvusClient.prototype, "indexManager", {
|
|
96
|
-
get: function () {
|
|
97
|
-
/* istanbul ignore next */
|
|
98
|
-
console.warn("indexManager are no longer necessary, you can call methods directly on the client object.");
|
|
99
|
-
return this;
|
|
100
|
-
},
|
|
101
|
-
enumerable: false,
|
|
102
|
-
configurable: true
|
|
103
|
-
});
|
|
104
|
-
Object.defineProperty(MilvusClient.prototype, "dataManager", {
|
|
105
|
-
get: function () {
|
|
106
|
-
/* istanbul ignore next */
|
|
107
|
-
console.warn("dataManager are no longer necessary, you can call methods directly on the client object.");
|
|
108
|
-
return this;
|
|
109
|
-
},
|
|
110
|
-
enumerable: false,
|
|
111
|
-
configurable: true
|
|
112
|
-
});
|
|
113
|
-
Object.defineProperty(MilvusClient.prototype, "resourceManager", {
|
|
114
|
-
get: function () {
|
|
115
|
-
/* istanbul ignore next */
|
|
116
|
-
console.warn("resourceManager are no longer necessary, you can call methods directly on the client object.");
|
|
117
|
-
return this;
|
|
118
|
-
},
|
|
119
|
-
enumerable: false,
|
|
120
|
-
configurable: true
|
|
121
|
-
});
|
|
122
|
-
Object.defineProperty(MilvusClient.prototype, "userManager", {
|
|
123
|
-
get: function () {
|
|
124
|
-
/* istanbul ignore next */
|
|
125
|
-
console.warn("userManager are no longer necessary, you can call methods directly on the client object.");
|
|
126
|
-
return this;
|
|
127
|
-
},
|
|
128
|
-
enumerable: false,
|
|
129
|
-
configurable: true
|
|
130
|
-
});
|
|
131
|
-
// This method closes the gRPC client connection and returns the connectivity state of the channel.
|
|
132
|
-
MilvusClient.prototype.closeConnection = function () {
|
|
133
|
-
// Close the gRPC client connection
|
|
134
|
-
this.grpcClient.close();
|
|
135
|
-
// grpc client closed -> 4, connected -> 0
|
|
136
|
-
return this.grpcClient.getChannel().getConnectivityState(true);
|
|
137
|
-
};
|
|
138
|
-
// This method returns the version of the Milvus server.
|
|
139
|
-
MilvusClient.prototype.getVersion = function () {
|
|
140
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
141
|
-
return __generator(this, function (_a) {
|
|
142
|
-
switch (_a.label) {
|
|
143
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'GetVersion', {}, this.timeout)];
|
|
144
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
145
|
-
}
|
|
146
|
-
});
|
|
147
|
-
});
|
|
148
|
-
};
|
|
149
|
-
// This method checks the health of the Milvus server.
|
|
150
|
-
MilvusClient.prototype.checkHealth = function () {
|
|
151
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
152
|
-
return __generator(this, function (_a) {
|
|
153
|
-
switch (_a.label) {
|
|
154
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.grpcClient, 'CheckHealth', {}, this.timeout)];
|
|
155
|
-
case 1: return [2 /*return*/, _a.sent()];
|
|
156
|
-
}
|
|
157
|
-
});
|
|
158
|
-
});
|
|
28
|
+
// overload
|
|
29
|
+
MilvusClient.prototype.connect = function () {
|
|
30
|
+
_super.prototype.connect.call(this);
|
|
159
31
|
};
|
|
160
32
|
return MilvusClient;
|
|
161
|
-
}(
|
|
33
|
+
}(_1.GRPCClient));
|
|
162
34
|
exports.MilvusClient = MilvusClient;
|
|
163
35
|
//# sourceMappingURL=MilvusClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MilvusClient.js","sourceRoot":"","sources":["../../milvus/MilvusClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MilvusClient.js","sourceRoot":"","sources":["../../milvus/MilvusClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,sBAA6C;AAG7C;IAAkC,gCAAU;IAC1C,sBACE,eAAsC,EACtC,GAAa,EACb,QAAiB,EACjB,QAAiB,EACjB,cAA+B;QALjC,YAOE,kBAAM,eAAe,EAAE,GAAG,EAAE,QAAQ,EAAE,QAAQ,EAAE,cAAc,CAAC,SAIhE;QAFC,UAAU;QACV,KAAI,CAAC,OAAO,EAAE,CAAC;;IACjB,CAAC;IAED,WAAW;IACX,8BAAO,GAAP;QACE,iBAAM,OAAO,WAAE,CAAC;IAClB,CAAC;IACH,mBAAC;AAAD,CAAC,AAlBD,CAAkC,aAAU,GAkB3C;AAlBY,oCAAY"}
|
|
@@ -120,7 +120,7 @@ var Index = /** @class */ (function (_super) {
|
|
|
120
120
|
extra_params.params = JSON.stringify(data.params);
|
|
121
121
|
}
|
|
122
122
|
params = __assign(__assign({}, data), { extra_params: (0, utils_2.parseToKeyValue)(extra_params) });
|
|
123
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
123
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'CreateIndex', params, data.timeout || this.timeout)];
|
|
124
124
|
case 1:
|
|
125
125
|
promise = _a.sent();
|
|
126
126
|
return [2 /*return*/, promise];
|
|
@@ -160,7 +160,7 @@ var Index = /** @class */ (function (_super) {
|
|
|
160
160
|
switch (_a.label) {
|
|
161
161
|
case 0:
|
|
162
162
|
(0, utils_2.checkCollectionName)(data);
|
|
163
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
163
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DescribeIndex', data, data.timeout || this.timeout)];
|
|
164
164
|
case 1:
|
|
165
165
|
promise = _a.sent();
|
|
166
166
|
return [2 /*return*/, promise];
|
|
@@ -200,7 +200,7 @@ var Index = /** @class */ (function (_super) {
|
|
|
200
200
|
switch (_a.label) {
|
|
201
201
|
case 0:
|
|
202
202
|
(0, utils_2.checkCollectionName)(data);
|
|
203
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
203
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetIndexState', data, data.timeout || this.timeout)];
|
|
204
204
|
case 1:
|
|
205
205
|
promise = _a.sent();
|
|
206
206
|
return [2 /*return*/, promise];
|
|
@@ -243,7 +243,7 @@ var Index = /** @class */ (function (_super) {
|
|
|
243
243
|
switch (_a.label) {
|
|
244
244
|
case 0:
|
|
245
245
|
(0, utils_2.checkCollectionName)(data);
|
|
246
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
246
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetIndexBuildProgress', data, data.timeout || this.timeout)];
|
|
247
247
|
case 1:
|
|
248
248
|
promise = _a.sent();
|
|
249
249
|
return [2 /*return*/, promise];
|
|
@@ -285,7 +285,7 @@ var Index = /** @class */ (function (_super) {
|
|
|
285
285
|
switch (_a.label) {
|
|
286
286
|
case 0:
|
|
287
287
|
(0, utils_2.checkCollectionName)(data);
|
|
288
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
288
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DropIndex', data, data.timeout || this.timeout)];
|
|
289
289
|
case 1:
|
|
290
290
|
promise = _a.sent();
|
|
291
291
|
return [2 /*return*/, promise];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MilvusIndex.js","sourceRoot":"","sources":["../../milvus/MilvusIndex.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;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,EACX,uBAAuB,EACvB,IAAI,EACJ,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAC7B,EAAA;;wBALK,OAAO,GAAG,SAKf;wBACD,sBAAO,OAAO,EAAC;;;;KAChB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACG,yBAAS,GAAf,UAAgB,IAAkB;;;;;;wBAChC,IAAA,2BAAmB,EAAC,IAAI,CAAC,CAAC;wBACV,qBAAM,IAAA,iBAAS,EAC7B,IAAI,CAAC,MAAM,EACX,WAAW,EACX,IAAI,EACJ,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAC7B,EAAA;;wBALK,OAAO,GAAG,SAKf;wBACD,sBAAO,OAAO,EAAC;;;;KAChB;IACH,YAAC;AAAD,CAAC,AAzND,CAA2B,WAAI,GAyN9B;AAzNY,sBAAK"}
|
package/dist/milvus/Partition.js
CHANGED
|
@@ -93,7 +93,7 @@ var Partition = /** @class */ (function (_super) {
|
|
|
93
93
|
switch (_a.label) {
|
|
94
94
|
case 0:
|
|
95
95
|
(0, utils_1.checkCollectionAndPartitionName)(data);
|
|
96
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
96
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'CreatePartition', data, data.timeout || this.timeout)];
|
|
97
97
|
case 1:
|
|
98
98
|
promise = _a.sent();
|
|
99
99
|
return [2 /*return*/, promise];
|
|
@@ -134,7 +134,7 @@ var Partition = /** @class */ (function (_super) {
|
|
|
134
134
|
switch (_a.label) {
|
|
135
135
|
case 0:
|
|
136
136
|
(0, utils_1.checkCollectionAndPartitionName)(data);
|
|
137
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
137
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'HasPartition', data, data.timeout || this.timeout)];
|
|
138
138
|
case 1:
|
|
139
139
|
promise = _a.sent();
|
|
140
140
|
return [2 /*return*/, promise];
|
|
@@ -175,7 +175,7 @@ var Partition = /** @class */ (function (_super) {
|
|
|
175
175
|
switch (_a.label) {
|
|
176
176
|
case 0:
|
|
177
177
|
(0, utils_1.checkCollectionName)(data);
|
|
178
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
178
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ShowPartitions', data, data.timeout || this.timeout)];
|
|
179
179
|
case 1:
|
|
180
180
|
promise = _a.sent();
|
|
181
181
|
return [2 /*return*/, promise];
|
|
@@ -218,7 +218,7 @@ var Partition = /** @class */ (function (_super) {
|
|
|
218
218
|
switch (_a.label) {
|
|
219
219
|
case 0:
|
|
220
220
|
(0, utils_1.checkCollectionAndPartitionName)(data);
|
|
221
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
221
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'GetPartitionStatistics', data, data.timeout || this.timeout)];
|
|
222
222
|
case 1:
|
|
223
223
|
promise = _a.sent();
|
|
224
224
|
promise.data = (0, utils_1.formatKeyValueData)(promise.stats, ['row_count']);
|
|
@@ -264,7 +264,7 @@ var Partition = /** @class */ (function (_super) {
|
|
|
264
264
|
if (!Array.isArray(data.partition_names) || !data.partition_names.length) {
|
|
265
265
|
throw new Error(_1.ERROR_REASONS.PARTITION_NAMES_IS_REQUIRED);
|
|
266
266
|
}
|
|
267
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
267
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'LoadPartitions', data, data.timeout || this.timeout)];
|
|
268
268
|
case 1:
|
|
269
269
|
promise = _a.sent();
|
|
270
270
|
return [2 /*return*/, promise];
|
|
@@ -308,7 +308,7 @@ var Partition = /** @class */ (function (_super) {
|
|
|
308
308
|
if (!Array.isArray(data.partition_names) || !data.partition_names.length) {
|
|
309
309
|
throw new Error(_1.ERROR_REASONS.PARTITION_NAMES_IS_REQUIRED);
|
|
310
310
|
}
|
|
311
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
311
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ReleasePartitions', data, data.timeout || this.timeout)];
|
|
312
312
|
case 1:
|
|
313
313
|
promise = _a.sent();
|
|
314
314
|
return [2 /*return*/, promise];
|
|
@@ -355,7 +355,7 @@ var Partition = /** @class */ (function (_super) {
|
|
|
355
355
|
switch (_a.label) {
|
|
356
356
|
case 0:
|
|
357
357
|
(0, utils_1.checkCollectionAndPartitionName)(data);
|
|
358
|
-
return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
358
|
+
return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DropPartition', data, data.timeout || this.timeout)];
|
|
359
359
|
case 1:
|
|
360
360
|
promise = _a.sent();
|
|
361
361
|
return [2 /*return*/, promise];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Partition.js","sourceRoot":"","sources":["../../milvus/Partition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAsC;AACtC,kCAKkB;AAClB,sBAaW;AAEX;IAA+B,6BAAK;IAApC;;IAuRA,CAAC;IAtRC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,mCAAe,GAArB,UAAsB,IAAwB;;;;;;wBAC5C,IAAA,uCAA+B,EAAC,IAAI,CAAC,CAAC;wBACtB,qBAAM,IAAA,iBAAS,EAC7B,IAAI,CAAC,
|
|
1
|
+
{"version":3,"file":"Partition.js","sourceRoot":"","sources":["../../milvus/Partition.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAsC;AACtC,kCAKkB;AAClB,sBAaW;AAEX;IAA+B,6BAAK;IAApC;;IAuRA,CAAC;IAtRC;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACG,mCAAe,GAArB,UAAsB,IAAwB;;;;;;wBAC5C,IAAA,uCAA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AAI,CAAC,CAAC;wBACtB,qBAAM,IAAA,iBAAS,EAC7B,IAAI,CAAC,MAAM,EACX,eAAe,EACf,IAAI,EACJ,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAC7B,EAAA;;wBALK,OAAO,GAAG,SAKf;wBACD,sBAAO,OAAO,EAAC;;;;KAChB;IACH,gBAAC;AAAD,CAAC,AAvRD,CAA+B,mBAAK,GAuRnC;AAvRY,8BAAS"}
|
package/dist/milvus/Resource.js
CHANGED
|
@@ -88,7 +88,7 @@ var Resource = /** @class */ (function (_super) {
|
|
|
88
88
|
var promise;
|
|
89
89
|
return __generator(this, function (_a) {
|
|
90
90
|
switch (_a.label) {
|
|
91
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
91
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'CreateResourceGroup', data, data.timeout || this.timeout)];
|
|
92
92
|
case 1:
|
|
93
93
|
promise = _a.sent();
|
|
94
94
|
return [2 /*return*/, promise];
|
|
@@ -118,7 +118,7 @@ var Resource = /** @class */ (function (_super) {
|
|
|
118
118
|
var promise;
|
|
119
119
|
return __generator(this, function (_a) {
|
|
120
120
|
switch (_a.label) {
|
|
121
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
121
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'ListResourceGroups', {}, (data === null || data === void 0 ? void 0 : data.timeout) || this.timeout)];
|
|
122
122
|
case 1:
|
|
123
123
|
promise = _a.sent();
|
|
124
124
|
return [2 /*return*/, promise];
|
|
@@ -159,7 +159,7 @@ var Resource = /** @class */ (function (_super) {
|
|
|
159
159
|
var promise;
|
|
160
160
|
return __generator(this, function (_a) {
|
|
161
161
|
switch (_a.label) {
|
|
162
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
162
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DescribeResourceGroup', data, data.timeout || this.timeout)];
|
|
163
163
|
case 1:
|
|
164
164
|
promise = _a.sent();
|
|
165
165
|
return [2 /*return*/, promise];
|
|
@@ -194,7 +194,7 @@ var Resource = /** @class */ (function (_super) {
|
|
|
194
194
|
var promise;
|
|
195
195
|
return __generator(this, function (_a) {
|
|
196
196
|
switch (_a.label) {
|
|
197
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
197
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'DropResourceGroup', data, data.timeout || this.timeout)];
|
|
198
198
|
case 1:
|
|
199
199
|
promise = _a.sent();
|
|
200
200
|
return [2 /*return*/, promise];
|
|
@@ -237,7 +237,7 @@ var Resource = /** @class */ (function (_super) {
|
|
|
237
237
|
var promise;
|
|
238
238
|
return __generator(this, function (_a) {
|
|
239
239
|
switch (_a.label) {
|
|
240
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
240
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'TransferReplica', data, data.timeout || this.timeout)];
|
|
241
241
|
case 1:
|
|
242
242
|
promise = _a.sent();
|
|
243
243
|
return [2 /*return*/, promise];
|
|
@@ -278,7 +278,7 @@ var Resource = /** @class */ (function (_super) {
|
|
|
278
278
|
var promise;
|
|
279
279
|
return __generator(this, function (_a) {
|
|
280
280
|
switch (_a.label) {
|
|
281
|
-
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.
|
|
281
|
+
case 0: return [4 /*yield*/, (0, utils_1.promisify)(this.client, 'TransferNode', data, data.timeout || this.timeout)];
|
|
282
282
|
case 1:
|
|
283
283
|
promise = _a.sent();
|
|
284
284
|
return [2 /*return*/, promise];
|