@zilliz/milvus2-sdk-node 2.3.4 → 2.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +154 -35
- package/dist/milvus/HttpClient.d.ts +165 -2
- package/dist/milvus/HttpClient.js +17 -3
- package/dist/milvus/HttpClient.js.map +1 -1
- package/dist/milvus/MilvusClient.d.ts +3 -3
- package/dist/milvus/MilvusClient.js +42 -8
- package/dist/milvus/MilvusClient.js.map +1 -1
- package/dist/milvus/const/client.d.ts +4 -3
- package/dist/milvus/const/client.js +4 -3
- package/dist/milvus/const/client.js.map +1 -1
- package/dist/milvus/const/defaults.d.ts +5 -4
- package/dist/milvus/const/defaults.js +14 -13
- package/dist/milvus/const/defaults.js.map +1 -1
- package/dist/milvus/const/error.js +1 -1
- package/dist/milvus/const/error.js.map +1 -1
- package/dist/milvus/const/milvus.d.ts +45 -8
- package/dist/milvus/const/milvus.js +41 -3
- package/dist/milvus/const/milvus.js.map +1 -1
- package/dist/milvus/grpc/BaseClient.d.ts +11 -9
- package/dist/milvus/grpc/BaseClient.js +59 -21
- package/dist/milvus/grpc/BaseClient.js.map +1 -1
- package/dist/milvus/grpc/Collection.d.ts +311 -366
- package/dist/milvus/grpc/Collection.js +355 -387
- package/dist/milvus/grpc/Collection.js.map +1 -1
- package/dist/milvus/grpc/Data.d.ts +244 -291
- package/dist/milvus/grpc/Data.js +402 -539
- package/dist/milvus/grpc/Data.js.map +1 -1
- package/dist/milvus/grpc/Database.d.ts +29 -41
- package/dist/milvus/grpc/Database.js +32 -44
- package/dist/milvus/grpc/Database.js.map +1 -1
- package/dist/milvus/grpc/GrpcClient.d.ts +34 -13
- package/dist/milvus/grpc/GrpcClient.js +80 -70
- package/dist/milvus/grpc/GrpcClient.js.map +1 -1
- package/dist/milvus/grpc/MilvusIndex.d.ts +127 -67
- package/dist/milvus/grpc/MilvusIndex.js +166 -70
- package/dist/milvus/grpc/MilvusIndex.js.map +1 -1
- package/dist/milvus/grpc/Partition.d.ts +78 -113
- package/dist/milvus/grpc/Partition.js +109 -119
- package/dist/milvus/grpc/Partition.js.map +1 -1
- package/dist/milvus/grpc/Resource.d.ts +63 -92
- package/dist/milvus/grpc/Resource.js +69 -98
- package/dist/milvus/grpc/Resource.js.map +1 -1
- package/dist/milvus/grpc/User.d.ts +263 -295
- package/dist/milvus/grpc/User.js +287 -310
- package/dist/milvus/grpc/User.js.map +1 -1
- package/dist/milvus/http/Alias.d.ts +37 -0
- package/dist/milvus/http/Alias.js +62 -0
- package/dist/milvus/http/Alias.js.map +1 -0
- package/dist/milvus/http/Collection.d.ts +15 -1
- package/dist/milvus/http/Collection.js +55 -9
- package/dist/milvus/http/Collection.js.map +1 -1
- package/dist/milvus/http/Import.d.ts +33 -0
- package/dist/milvus/http/Import.js +48 -0
- package/dist/milvus/http/Import.js.map +1 -0
- package/dist/milvus/http/MilvusIndex.d.ts +35 -0
- package/dist/milvus/http/MilvusIndex.js +55 -0
- package/dist/milvus/http/MilvusIndex.js.map +1 -0
- package/dist/milvus/http/Partition.d.ts +41 -0
- package/dist/milvus/http/Partition.js +76 -0
- package/dist/milvus/http/Partition.js.map +1 -0
- package/dist/milvus/http/Role.d.ts +39 -0
- package/dist/milvus/http/Role.js +69 -0
- package/dist/milvus/http/Role.js.map +1 -0
- package/dist/milvus/http/User.d.ts +41 -0
- package/dist/milvus/http/User.js +76 -0
- package/dist/milvus/http/User.js.map +1 -0
- package/dist/milvus/http/Vector.d.ts +5 -3
- package/dist/milvus/http/Vector.js +10 -7
- package/dist/milvus/http/Vector.js.map +1 -1
- package/dist/milvus/http/index.d.ts +6 -0
- package/dist/milvus/http/index.js +6 -0
- package/dist/milvus/http/index.js.map +1 -1
- package/dist/milvus/index.d.ts +0 -1
- package/dist/milvus/index.js +0 -1
- package/dist/milvus/index.js.map +1 -1
- package/dist/milvus/types/Client.d.ts +5 -0
- package/dist/milvus/types/Collection.d.ts +34 -9
- package/dist/milvus/types/Common.d.ts +1 -3
- package/dist/milvus/types/Data.d.ts +79 -23
- package/dist/milvus/types/Data.js +1 -0
- package/dist/milvus/types/Data.js.map +1 -1
- package/dist/milvus/types/HighLevel.d.ts +6 -3
- package/dist/milvus/types/Http.d.ts +191 -9
- package/dist/milvus/types/MilvusIndex.d.ts +17 -3
- package/dist/milvus/types/User.d.ts +10 -9
- package/dist/milvus/utils/Bytes.d.ts +84 -0
- package/dist/milvus/utils/Bytes.js +261 -0
- package/dist/milvus/utils/Bytes.js.map +1 -0
- package/dist/milvus/utils/Format.d.ts +126 -68
- package/dist/milvus/utils/Format.js +375 -94
- package/dist/milvus/utils/Format.js.map +1 -1
- package/dist/milvus/utils/Function.d.ts +4 -2
- package/dist/milvus/utils/Function.js +58 -25
- package/dist/milvus/utils/Function.js.map +1 -1
- package/dist/milvus/utils/Grpc.d.ts +3 -2
- package/dist/milvus/utils/Grpc.js +65 -98
- package/dist/milvus/utils/Grpc.js.map +1 -1
- package/dist/milvus/utils/Validate.d.ts +18 -3
- package/dist/milvus/utils/Validate.js +38 -12
- package/dist/milvus/utils/Validate.js.map +1 -1
- package/dist/milvus/utils/index.d.ts +1 -1
- package/dist/milvus/utils/index.js +1 -1
- package/dist/milvus/utils/index.js.map +1 -1
- package/dist/proto/proto/common.proto +29 -1
- package/dist/proto/proto/google/protobuf/descriptor.proto +96 -34
- package/dist/proto/proto/milvus.proto +168 -2
- package/dist/proto/proto/rg.proto +28 -0
- package/dist/proto/proto/schema.proto +36 -0
- package/dist/sdk.json +1 -1
- package/package.json +8 -5
- package/dist/milvus/OrmClient.d.ts +0 -19
- package/dist/milvus/OrmClient.js +0 -51
- package/dist/milvus/OrmClient.js.map +0 -1
- package/dist/milvus/orm/Collection.d.ts +0 -43
- package/dist/milvus/orm/Collection.js +0 -165
- package/dist/milvus/orm/Collection.js.map +0 -1
- package/dist/milvus/orm/index.d.ts +0 -1
- package/dist/milvus/orm/index.js +0 -18
- package/dist/milvus/orm/index.js.map +0 -1
- package/dist/milvus/utils/Blob.d.ts +0 -4
- package/dist/milvus/utils/Blob.js +0 -18
- package/dist/milvus/utils/Blob.js.map +0 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { HttpBaseClient } from '../HttpClient';
|
|
2
|
+
import { Constructor, FetchOptions, HttpRolePrivilegeReq, HttpRoleDescribeResponse, HttpBaseResponse, HttpRoleBaseReq } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {Constructor<HttpBaseClient>} Base - The base class to be extended.
|
|
6
|
+
* @returns {class} - The extended class with additional methods for collection management.
|
|
7
|
+
*
|
|
8
|
+
* @method listRoles - Lists all roles in the system.
|
|
9
|
+
* @method describeRole - Describes a role.
|
|
10
|
+
* @method createRole - Creates a new role.
|
|
11
|
+
* @method dropRole - Deletes a role.
|
|
12
|
+
* @method grantPrivilegeToRole - Grants a privilege to a role.
|
|
13
|
+
* @method revokePrivilegeFromRole - Revokes a privilege from a role.
|
|
14
|
+
*/
|
|
15
|
+
export declare function Role<T extends Constructor<HttpBaseClient>>(Base: T): {
|
|
16
|
+
new (...args: any[]): {
|
|
17
|
+
readonly rolePrefix: string;
|
|
18
|
+
listRoles(options?: FetchOptions): Promise<HttpBaseResponse<string[]>>;
|
|
19
|
+
describeRole(params: HttpRoleBaseReq, options?: FetchOptions): Promise<HttpRoleDescribeResponse>;
|
|
20
|
+
createRole(params: HttpRoleBaseReq, options?: FetchOptions): Promise<HttpBaseResponse<{}>>;
|
|
21
|
+
dropRole(params: HttpRoleBaseReq, options?: FetchOptions): Promise<HttpBaseResponse<{}>>;
|
|
22
|
+
grantPrivilegeToRole(params: HttpRolePrivilegeReq, options?: FetchOptions): Promise<HttpBaseResponse<{}>>;
|
|
23
|
+
revokePrivilegeFromRole(params: HttpRolePrivilegeReq, options?: FetchOptions): Promise<HttpBaseResponse<{}>>;
|
|
24
|
+
config: import("../types").HttpClientConfig;
|
|
25
|
+
readonly baseURL: string;
|
|
26
|
+
readonly authorization: string;
|
|
27
|
+
readonly database: string;
|
|
28
|
+
readonly timeout: number;
|
|
29
|
+
readonly headers: {
|
|
30
|
+
Authorization: string;
|
|
31
|
+
Accept: string;
|
|
32
|
+
ContentType: string;
|
|
33
|
+
'Accept-Type-Allow-Int64': string;
|
|
34
|
+
};
|
|
35
|
+
readonly fetch: ((input: any, init?: any) => Promise<any>) | typeof fetch;
|
|
36
|
+
POST<T>(url: string, data?: Record<string, any>, options?: FetchOptions | undefined): Promise<T>;
|
|
37
|
+
GET<T_1>(url: string, params?: Record<string, any>, options?: FetchOptions | undefined): Promise<T_1>;
|
|
38
|
+
};
|
|
39
|
+
} & T;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.Role = void 0;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {Constructor<HttpBaseClient>} Base - The base class to be extended.
|
|
16
|
+
* @returns {class} - The extended class with additional methods for collection management.
|
|
17
|
+
*
|
|
18
|
+
* @method listRoles - Lists all roles in the system.
|
|
19
|
+
* @method describeRole - Describes a role.
|
|
20
|
+
* @method createRole - Creates a new role.
|
|
21
|
+
* @method dropRole - Deletes a role.
|
|
22
|
+
* @method grantPrivilegeToRole - Grants a privilege to a role.
|
|
23
|
+
* @method revokePrivilegeFromRole - Revokes a privilege from a role.
|
|
24
|
+
*/
|
|
25
|
+
function Role(Base) {
|
|
26
|
+
return class extends Base {
|
|
27
|
+
get rolePrefix() {
|
|
28
|
+
return '/vectordb/roles';
|
|
29
|
+
}
|
|
30
|
+
listRoles(options) {
|
|
31
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
+
const url = `${this.rolePrefix}/list`;
|
|
33
|
+
return yield this.POST(url, {}, options);
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
describeRole(params, options) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
const url = `${this.rolePrefix}/describe`;
|
|
39
|
+
return yield this.POST(url, params, options);
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
createRole(params, options) {
|
|
43
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
const url = `${this.rolePrefix}/create`;
|
|
45
|
+
return yield this.POST(url, params, options);
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
dropRole(params, options) {
|
|
49
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
50
|
+
const url = `${this.rolePrefix}/drop`;
|
|
51
|
+
return yield this.POST(url, params, options);
|
|
52
|
+
});
|
|
53
|
+
}
|
|
54
|
+
grantPrivilegeToRole(params, options) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
const url = `${this.rolePrefix}/grant_privilege`;
|
|
57
|
+
return yield this.POST(url, params, options);
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
revokePrivilegeFromRole(params, options) {
|
|
61
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
62
|
+
const url = `${this.rolePrefix}/revoke_privilege`;
|
|
63
|
+
return yield this.POST(url, params, options);
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
exports.Role = Role;
|
|
69
|
+
//# sourceMappingURL=Role.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Role.js","sourceRoot":"","sources":["../../../milvus/http/Role.ts"],"names":[],"mappings":";;;;;;;;;;;;AAUA;;;;;;;;;;;GAWG;AACH,SAAgB,IAAI,CAAwC,IAAO;IACjE,OAAO,KAAM,SAAQ,IAAI;QACvB,IAAI,UAAU;YACZ,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QAEK,SAAS,CAAC,OAAsB;;gBACpC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,OAAO,CAAC;gBACtC,OAAO,MAAM,IAAI,CAAC,IAAI,CAA6B,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YACvE,CAAC;SAAA;QAEK,YAAY,CAAC,MAAuB,EAAE,OAAsB;;gBAChE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,WAAW,CAAC;gBAC1C,OAAO,MAAM,IAAI,CAAC,IAAI,CAA2B,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACzE,CAAC;SAAA;QAEK,UAAU,CAAC,MAAuB,EAAE,OAAsB;;gBAC9D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,SAAS,CAAC;gBACxC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACjE,CAAC;SAAA;QAEK,QAAQ,CAAC,MAAuB,EAAE,OAAsB;;gBAC5D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,OAAO,CAAC;gBACtC,OAAO,MAAM,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACjE,CAAC;SAAA;QAEK,oBAAoB,CACxB,MAA4B,EAC5B,OAAsB;;gBAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,kBAAkB,CAAC;gBACjD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACjE,CAAC;SAAA;QAEK,uBAAuB,CAC3B,MAA4B,EAC5B,OAAsB;;gBAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,mBAAmB,CAAC;gBAClD,OAAO,MAAM,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACjE,CAAC;SAAA;KACF,CAAC;AACJ,CAAC;AA1CD,oBA0CC"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { HttpBaseClient } from '../HttpClient';
|
|
2
|
+
import { Constructor, FetchOptions, HttpUserBaseReq, HttpUserCreateReq, HttpUserRoleReq, HttpUserUpdatePasswordReq, HttpBaseResponse } from '../types';
|
|
3
|
+
/**
|
|
4
|
+
*
|
|
5
|
+
* @param {Constructor<HttpBaseClient>} Base - The base class to be extended.
|
|
6
|
+
* @returns {class} - The extended class with additional methods for collection management.
|
|
7
|
+
*
|
|
8
|
+
* @method createUser - Creates a new user in Milvus.
|
|
9
|
+
* @method updateUserPassword - Updates the password of a user.
|
|
10
|
+
* @method dropUser - Deletes a user from Milvus.
|
|
11
|
+
* @method describeUser - Retrieves the description of a specific user.
|
|
12
|
+
* @method listUsers - Lists all users in the Milvus cluster.
|
|
13
|
+
* @method grantRole - Grants a role to a user.
|
|
14
|
+
* @method revokeRole - Revokes a role from a user.
|
|
15
|
+
*/
|
|
16
|
+
export declare function User<T extends Constructor<HttpBaseClient>>(Base: T): {
|
|
17
|
+
new (...args: any[]): {
|
|
18
|
+
readonly userPrefix: string;
|
|
19
|
+
createUser(params: HttpUserCreateReq, options?: FetchOptions): Promise<HttpBaseResponse<{}>>;
|
|
20
|
+
updateUserPassword(params: HttpUserUpdatePasswordReq, options?: FetchOptions): Promise<HttpBaseResponse<{}>>;
|
|
21
|
+
dropUser(param: HttpUserBaseReq, options?: FetchOptions): Promise<HttpBaseResponse<{}>>;
|
|
22
|
+
describeUser(param: HttpUserBaseReq, options?: FetchOptions): Promise<HttpBaseResponse<string[]>>;
|
|
23
|
+
listUsers(options?: FetchOptions): Promise<HttpBaseResponse<string[]>>;
|
|
24
|
+
grantRoleToUser(params: HttpUserRoleReq, options?: FetchOptions): Promise<HttpBaseResponse<{}>>;
|
|
25
|
+
revokeRoleFromUser(params: HttpUserRoleReq, options?: FetchOptions): Promise<HttpBaseResponse<{}>>;
|
|
26
|
+
config: import("../types").HttpClientConfig;
|
|
27
|
+
readonly baseURL: string;
|
|
28
|
+
readonly authorization: string;
|
|
29
|
+
readonly database: string;
|
|
30
|
+
readonly timeout: number;
|
|
31
|
+
readonly headers: {
|
|
32
|
+
Authorization: string;
|
|
33
|
+
Accept: string;
|
|
34
|
+
ContentType: string;
|
|
35
|
+
'Accept-Type-Allow-Int64': string;
|
|
36
|
+
};
|
|
37
|
+
readonly fetch: ((input: any, init?: any) => Promise<any>) | typeof fetch;
|
|
38
|
+
POST<T>(url: string, data?: Record<string, any>, options?: FetchOptions | undefined): Promise<T>;
|
|
39
|
+
GET<T_1>(url: string, params?: Record<string, any>, options?: FetchOptions | undefined): Promise<T_1>;
|
|
40
|
+
};
|
|
41
|
+
} & T;
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.User = void 0;
|
|
13
|
+
/**
|
|
14
|
+
*
|
|
15
|
+
* @param {Constructor<HttpBaseClient>} Base - The base class to be extended.
|
|
16
|
+
* @returns {class} - The extended class with additional methods for collection management.
|
|
17
|
+
*
|
|
18
|
+
* @method createUser - Creates a new user in Milvus.
|
|
19
|
+
* @method updateUserPassword - Updates the password of a user.
|
|
20
|
+
* @method dropUser - Deletes a user from Milvus.
|
|
21
|
+
* @method describeUser - Retrieves the description of a specific user.
|
|
22
|
+
* @method listUsers - Lists all users in the Milvus cluster.
|
|
23
|
+
* @method grantRole - Grants a role to a user.
|
|
24
|
+
* @method revokeRole - Revokes a role from a user.
|
|
25
|
+
*/
|
|
26
|
+
function User(Base) {
|
|
27
|
+
return class extends Base {
|
|
28
|
+
get userPrefix() {
|
|
29
|
+
return '/vectordb/users';
|
|
30
|
+
}
|
|
31
|
+
createUser(params, options) {
|
|
32
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
33
|
+
const url = `${this.userPrefix}/create`;
|
|
34
|
+
return this.POST(url, params, options);
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
updateUserPassword(params, options) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
const url = `${this.userPrefix}/update_password`;
|
|
40
|
+
return this.POST(url, params, options);
|
|
41
|
+
});
|
|
42
|
+
}
|
|
43
|
+
dropUser(param, options) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const url = `${this.userPrefix}/drop`;
|
|
46
|
+
return this.POST(url, param, options);
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
describeUser(param, options) {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
const url = `${this.userPrefix}/describe`;
|
|
52
|
+
return this.POST(url, param, options);
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
listUsers(options) {
|
|
56
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
57
|
+
const url = `${this.userPrefix}/list`;
|
|
58
|
+
return this.POST(url, {}, options);
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
grantRoleToUser(params, options) {
|
|
62
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
63
|
+
const url = `${this.userPrefix}/grant_role`;
|
|
64
|
+
return this.POST(url, params, options);
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
revokeRoleFromUser(params, options) {
|
|
68
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
69
|
+
const url = `${this.userPrefix}/revoke_role`;
|
|
70
|
+
return this.POST(url, params, options);
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
};
|
|
74
|
+
}
|
|
75
|
+
exports.User = User;
|
|
76
|
+
//# sourceMappingURL=User.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../milvus/http/User.ts"],"names":[],"mappings":";;;;;;;;;;;;AAWA;;;;;;;;;;;;GAYG;AACH,SAAgB,IAAI,CAAwC,IAAO;IACjE,OAAO,KAAM,SAAQ,IAAI;QACvB,IAAI,UAAU;YACZ,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QAEK,UAAU,CAAC,MAAyB,EAAE,OAAsB;;gBAChE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,SAAS,CAAC;gBACxC,OAAO,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC3D,CAAC;SAAA;QAEK,kBAAkB,CACtB,MAAiC,EACjC,OAAsB;;gBAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,kBAAkB,CAAC;gBACjD,OAAO,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC3D,CAAC;SAAA;QAEK,QAAQ,CAAC,KAAsB,EAAE,OAAsB;;gBAC3D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,OAAO,CAAC;gBACtC,OAAO,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;YAC1D,CAAC;SAAA;QAEK,YAAY,CAAC,KAAsB,EAAE,OAAsB;;gBAC/D,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,WAAW,CAAC;gBAC1C,OAAO,IAAI,CAAC,IAAI,CAA6B,GAAG,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;YACpE,CAAC;SAAA;QAEK,SAAS,CAAC,OAAsB;;gBACpC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,OAAO,CAAC;gBACtC,OAAO,IAAI,CAAC,IAAI,CAA6B,GAAG,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;YACjE,CAAC;SAAA;QAEK,eAAe,CAAC,MAAuB,EAAE,OAAsB;;gBACnE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,aAAa,CAAC;gBAC5C,OAAO,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC3D,CAAC;SAAA;QAEK,kBAAkB,CAAC,MAAuB,EAAE,OAAsB;;gBACtE,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,UAAU,cAAc,CAAC;gBAC7C,OAAO,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YAC3D,CAAC;SAAA;KACF,CAAC;AACJ,CAAC;AA5CD,oBA4CC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpBaseClient } from '../HttpClient';
|
|
2
|
-
import { Constructor, HttpVectorGetReq, HttpVectorInsertReq, HttpVectorInsertResponse, HttpVectorQueryReq, HttpVectorQueryResponse, HttpVectorSearchReq, HttpVectorDeleteReq, HttpVectorSearchResponse, HttpBaseResponse, FetchOptions } from '../types';
|
|
2
|
+
import { Constructor, HttpVectorGetReq, HttpVectorInsertReq, HttpVectorInsertResponse, HttpVectorQueryReq, HttpVectorQueryResponse, HttpVectorSearchReq, HttpVectorDeleteReq, HttpVectorSearchResponse, HttpBaseResponse, FetchOptions, HttpVectorUpsertResponse } from '../types';
|
|
3
3
|
/**
|
|
4
4
|
* Vector is a mixin function that extends the functionality of a base class.
|
|
5
5
|
* It provides methods to interact with vectors in a Milvus cluster.
|
|
@@ -16,9 +16,10 @@ import { Constructor, HttpVectorGetReq, HttpVectorInsertReq, HttpVectorInsertRes
|
|
|
16
16
|
*/
|
|
17
17
|
export declare function Vector<T extends Constructor<HttpBaseClient>>(Base: T): {
|
|
18
18
|
new (...args: any[]): {
|
|
19
|
-
|
|
19
|
+
readonly vectorPrefix: string;
|
|
20
|
+
get(params: HttpVectorGetReq, options?: FetchOptions): Promise<HttpVectorQueryResponse>;
|
|
20
21
|
insert(data: HttpVectorInsertReq, options?: FetchOptions): Promise<HttpVectorInsertResponse>;
|
|
21
|
-
upsert(data: HttpVectorInsertReq, options?: FetchOptions): Promise<
|
|
22
|
+
upsert(data: HttpVectorInsertReq, options?: FetchOptions): Promise<HttpVectorUpsertResponse>;
|
|
22
23
|
query(data: HttpVectorQueryReq, options?: FetchOptions): Promise<HttpVectorQueryResponse>;
|
|
23
24
|
search(data: HttpVectorSearchReq, options?: FetchOptions): Promise<HttpVectorSearchResponse>;
|
|
24
25
|
delete(data: HttpVectorDeleteReq, options?: FetchOptions): Promise<HttpBaseResponse>;
|
|
@@ -31,6 +32,7 @@ export declare function Vector<T extends Constructor<HttpBaseClient>>(Base: T):
|
|
|
31
32
|
Authorization: string;
|
|
32
33
|
Accept: string;
|
|
33
34
|
ContentType: string;
|
|
35
|
+
'Accept-Type-Allow-Int64': string;
|
|
34
36
|
};
|
|
35
37
|
readonly fetch: ((input: any, init?: any) => Promise<any>) | typeof fetch;
|
|
36
38
|
POST<T>(url: string, data?: Record<string, any>, options?: FetchOptions | undefined): Promise<T>;
|
|
@@ -26,45 +26,48 @@ exports.Vector = void 0;
|
|
|
26
26
|
*/
|
|
27
27
|
function Vector(Base) {
|
|
28
28
|
return class extends Base {
|
|
29
|
+
get vectorPrefix() {
|
|
30
|
+
return '/vectordb/entities';
|
|
31
|
+
}
|
|
29
32
|
// GET get data
|
|
30
33
|
get(params, options) {
|
|
31
34
|
return __awaiter(this, void 0, void 0, function* () {
|
|
32
|
-
const url =
|
|
33
|
-
return yield this.
|
|
35
|
+
const url = `${this.vectorPrefix}/get`;
|
|
36
|
+
return yield this.POST(url, params, options);
|
|
34
37
|
});
|
|
35
38
|
}
|
|
36
39
|
// POST insert data
|
|
37
40
|
insert(data, options) {
|
|
38
41
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
-
const url =
|
|
42
|
+
const url = `${this.vectorPrefix}/insert`;
|
|
40
43
|
return yield this.POST(url, data, options);
|
|
41
44
|
});
|
|
42
45
|
}
|
|
43
46
|
// POST insert data
|
|
44
47
|
upsert(data, options) {
|
|
45
48
|
return __awaiter(this, void 0, void 0, function* () {
|
|
46
|
-
const url =
|
|
49
|
+
const url = `${this.vectorPrefix}/upsert`;
|
|
47
50
|
return yield this.POST(url, data, options);
|
|
48
51
|
});
|
|
49
52
|
}
|
|
50
53
|
// POST query data
|
|
51
54
|
query(data, options) {
|
|
52
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
53
|
-
const url =
|
|
56
|
+
const url = `${this.vectorPrefix}/query`;
|
|
54
57
|
return yield this.POST(url, data, options);
|
|
55
58
|
});
|
|
56
59
|
}
|
|
57
60
|
// POST search data
|
|
58
61
|
search(data, options) {
|
|
59
62
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
|
-
const url =
|
|
63
|
+
const url = `${this.vectorPrefix}/search`;
|
|
61
64
|
return yield this.POST(url, data, options);
|
|
62
65
|
});
|
|
63
66
|
}
|
|
64
67
|
// POST delete collection
|
|
65
68
|
delete(data, options) {
|
|
66
69
|
return __awaiter(this, void 0, void 0, function* () {
|
|
67
|
-
const url =
|
|
70
|
+
const url = `${this.vectorPrefix}/delete`;
|
|
68
71
|
return yield this.POST(url, data, options);
|
|
69
72
|
});
|
|
70
73
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Vector.js","sourceRoot":"","sources":["../../../milvus/http/Vector.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"Vector.js","sourceRoot":"","sources":["../../../milvus/http/Vector.ts"],"names":[],"mappings":";;;;;;;;;;;;AAgBA;;;;;;;;;;;;;GAaG;AACH,SAAgB,MAAM,CAAwC,IAAO;IACnE,OAAO,KAAM,SAAQ,IAAI;QACvB,IAAI,YAAY;YACd,OAAO,oBAAoB,CAAC;QAC9B,CAAC;QAED,eAAe;QACT,GAAG,CACP,MAAwB,EACxB,OAAsB;;gBAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,YAAY,MAAM,CAAC;gBACvC,OAAO,MAAM,IAAI,CAAC,IAAI,CAA0B,GAAG,EAAE,MAAM,EAAE,OAAO,CAAC,CAAC;YACxE,CAAC;SAAA;QAED,mBAAmB;QACb,MAAM,CACV,IAAyB,EACzB,OAAsB;;gBAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,YAAY,SAAS,CAAC;gBAC1C,OAAO,MAAM,IAAI,CAAC,IAAI,CAA2B,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACvE,CAAC;SAAA;QAED,mBAAmB;QACb,MAAM,CACV,IAAyB,EACzB,OAAsB;;gBAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,YAAY,SAAS,CAAC;gBAC1C,OAAO,MAAM,IAAI,CAAC,IAAI,CAA2B,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACvE,CAAC;SAAA;QAED,kBAAkB;QACZ,KAAK,CACT,IAAwB,EACxB,OAAsB;;gBAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,YAAY,QAAQ,CAAC;gBACzC,OAAO,MAAM,IAAI,CAAC,IAAI,CAA0B,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACtE,CAAC;SAAA;QAED,mBAAmB;QACb,MAAM,CACV,IAAyB,EACzB,OAAsB;;gBAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,YAAY,SAAS,CAAC;gBAC1C,OAAO,MAAM,IAAI,CAAC,IAAI,CAA2B,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YACvE,CAAC;SAAA;QAED,yBAAyB;QACnB,MAAM,CACV,IAAyB,EACzB,OAAsB;;gBAEtB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,YAAY,SAAS,CAAC;gBAC1C,OAAO,MAAM,IAAI,CAAC,IAAI,CAAmB,GAAG,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;YAC/D,CAAC;SAAA;KACF,CAAC;AACJ,CAAC;AA5DD,wBA4DC"}
|
|
@@ -16,4 +16,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
17
|
__exportStar(require("./Collection"), exports);
|
|
18
18
|
__exportStar(require("./Vector"), exports);
|
|
19
|
+
__exportStar(require("./User"), exports);
|
|
20
|
+
__exportStar(require("./Role"), exports);
|
|
21
|
+
__exportStar(require("./Partition"), exports);
|
|
22
|
+
__exportStar(require("./Alias"), exports);
|
|
23
|
+
__exportStar(require("./MilvusIndex"), exports);
|
|
24
|
+
__exportStar(require("./Import"), exports);
|
|
19
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../milvus/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../milvus/http/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,2CAAyB;AACzB,yCAAuB;AACvB,yCAAuB;AACvB,8CAA4B;AAC5B,0CAAwB;AACxB,gDAA8B;AAC9B,2CAAwB"}
|
package/dist/milvus/index.d.ts
CHANGED
package/dist/milvus/index.js
CHANGED
|
@@ -23,6 +23,5 @@ __exportStar(require("./types"), exports);
|
|
|
23
23
|
// clients
|
|
24
24
|
__exportStar(require("./grpc/GrpcClient"), exports);
|
|
25
25
|
__exportStar(require("./MilvusClient"), exports);
|
|
26
|
-
__exportStar(require("./OrmClient"), exports);
|
|
27
26
|
__exportStar(require("./HttpClient"), exports);
|
|
28
27
|
//# 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":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,0CAAwB;AACxB,QAAQ;AACR,0CAAwB;AACxB,QAAQ;AACR,0CAAwB;AACxB,UAAU;AACV,oDAAkC;AAClC,iDAA+B;AAC/B
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../milvus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,0CAAwB;AACxB,QAAQ;AACR,0CAAwB;AACxB,QAAQ;AACR,0CAAwB;AACxB,UAAU;AACV,oDAAkC;AAClC,iDAA+B;AAC/B,+CAA6B"}
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import { ChannelOptions } from '@grpc/grpc-js';
|
|
2
|
+
import { Options as LoaderOption } from '@grpc/proto-loader';
|
|
3
|
+
import { Options } from 'generic-pool';
|
|
2
4
|
/**
|
|
3
5
|
* Configuration options for the Milvus client.
|
|
4
6
|
*/
|
|
@@ -26,6 +28,9 @@ export interface ClientConfig {
|
|
|
26
28
|
verifyOptions?: Record<string, any>;
|
|
27
29
|
serverName?: string;
|
|
28
30
|
};
|
|
31
|
+
pool?: Options;
|
|
32
|
+
__SKIP_CONNECT__?: boolean;
|
|
33
|
+
loaderOptions?: LoaderOption;
|
|
29
34
|
}
|
|
30
35
|
export interface ServerInfo {
|
|
31
36
|
build_tags?: string;
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import { ResStatus, KeyValuePair, GrpcTimeOut, TimeStamp, TimeStampArray, resStatusResponse, collectionNameReq } from './Common';
|
|
2
2
|
import { CompactionState, DataType, LoadState, DataTypeMap, ShowCollectionsType } from '../';
|
|
3
3
|
export interface FieldSchema {
|
|
4
|
+
type_params: KeyValuePair[];
|
|
5
|
+
index_params: KeyValuePair[];
|
|
6
|
+
fieldID: string | number;
|
|
4
7
|
name: string;
|
|
8
|
+
is_primary_key?: boolean;
|
|
5
9
|
description: string;
|
|
6
10
|
data_type: keyof typeof DataType;
|
|
11
|
+
autoID: boolean;
|
|
12
|
+
state: string;
|
|
7
13
|
element_type?: keyof typeof DataType;
|
|
8
|
-
|
|
9
|
-
|
|
14
|
+
default_value?: number | string;
|
|
15
|
+
dataType: DataType;
|
|
10
16
|
is_partition_key?: boolean;
|
|
11
17
|
is_dynamic?: boolean;
|
|
12
|
-
|
|
13
|
-
index_params: KeyValuePair[];
|
|
14
|
-
autoID: boolean;
|
|
15
|
-
default_value?: number | string;
|
|
18
|
+
is_clustering_key?: boolean;
|
|
16
19
|
}
|
|
17
20
|
export interface CollectionData {
|
|
18
21
|
name: string;
|
|
@@ -55,17 +58,23 @@ export interface ShowCollectionsReq extends GrpcTimeOut {
|
|
|
55
58
|
type?: ShowCollectionsType;
|
|
56
59
|
collection_names?: string[];
|
|
57
60
|
}
|
|
58
|
-
export interface
|
|
61
|
+
export interface BaseCreateCollectionReq extends GrpcTimeOut {
|
|
59
62
|
collection_name: string;
|
|
60
63
|
shards_num?: number;
|
|
61
64
|
description?: string;
|
|
62
65
|
consistency_level?: 'Strong' | 'Session' | 'Bounded' | 'Eventually' | 'Customized';
|
|
63
|
-
fields: FieldType[];
|
|
64
66
|
num_partitions?: number;
|
|
65
67
|
partition_key_field?: string;
|
|
66
68
|
enable_dynamic_field?: boolean;
|
|
67
69
|
enableDynamicField?: boolean;
|
|
68
70
|
}
|
|
71
|
+
export interface CreateCollectionWithFieldsReq extends BaseCreateCollectionReq {
|
|
72
|
+
fields: FieldType[];
|
|
73
|
+
}
|
|
74
|
+
export interface CreateCollectionWithSchemaReq extends BaseCreateCollectionReq {
|
|
75
|
+
schema: FieldType[];
|
|
76
|
+
}
|
|
77
|
+
export type CreateCollectionReq = CreateCollectionWithFieldsReq | CreateCollectionWithSchemaReq;
|
|
69
78
|
export interface HasCollectionReq extends collectionNameReq {
|
|
70
79
|
}
|
|
71
80
|
export interface DescribeCollectionReq extends collectionNameReq {
|
|
@@ -85,11 +94,16 @@ export interface DropCollectionReq extends collectionNameReq {
|
|
|
85
94
|
export interface CreateAliasReq extends collectionNameReq {
|
|
86
95
|
alias: string;
|
|
87
96
|
}
|
|
97
|
+
export interface DescribeAliasReq extends CreateAliasReq {
|
|
98
|
+
alias: string;
|
|
99
|
+
}
|
|
88
100
|
export interface DropAliasReq extends GrpcTimeOut {
|
|
89
101
|
alias: string;
|
|
90
102
|
}
|
|
91
103
|
export interface AlterAliasReq extends CreateAliasReq {
|
|
92
104
|
}
|
|
105
|
+
export interface ListAliasesReq extends collectionNameReq {
|
|
106
|
+
}
|
|
93
107
|
export interface CompactReq extends collectionNameReq {
|
|
94
108
|
timetravel?: number | string;
|
|
95
109
|
}
|
|
@@ -116,6 +130,7 @@ export interface CollectionSchema {
|
|
|
116
130
|
name: string;
|
|
117
131
|
description: string;
|
|
118
132
|
enable_dynamic_field: boolean;
|
|
133
|
+
autoID: boolean;
|
|
119
134
|
fields: FieldSchema[];
|
|
120
135
|
}
|
|
121
136
|
export interface DescribeCollectionResponse extends TimeStamp {
|
|
@@ -173,5 +188,15 @@ export interface GetLoadStateResponse extends resStatusResponse {
|
|
|
173
188
|
state: LoadState;
|
|
174
189
|
}
|
|
175
190
|
export interface AlterCollectionReq extends collectionNameReq {
|
|
176
|
-
properties: Record<string, string | number>;
|
|
191
|
+
properties: Record<string, string | number | boolean>;
|
|
192
|
+
}
|
|
193
|
+
export interface DescribeAliasResponse extends resStatusResponse {
|
|
194
|
+
db_name: string;
|
|
195
|
+
alias: string;
|
|
196
|
+
collection: string;
|
|
197
|
+
}
|
|
198
|
+
export interface ListAliasesResponse extends resStatusResponse {
|
|
199
|
+
db_name: string;
|
|
200
|
+
aliases: string[];
|
|
201
|
+
collection_name: string;
|
|
177
202
|
}
|
|
@@ -40,9 +40,7 @@ export interface TimeStampArray {
|
|
|
40
40
|
created_timestamps: string[];
|
|
41
41
|
created_utc_timestamps: string[];
|
|
42
42
|
}
|
|
43
|
-
export
|
|
44
|
-
[key: string]: string | number;
|
|
45
|
-
}
|
|
43
|
+
export type keyValueObj = Record<string, string | number | string[] | number[]>;
|
|
46
44
|
export interface collectionNameReq extends GrpcTimeOut {
|
|
47
45
|
collection_name: string;
|
|
48
46
|
}
|