@zilliz/milvus2-sdk-node 2.3.5 → 2.4.1

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.
Files changed (121) hide show
  1. package/README.md +154 -35
  2. package/dist/milvus/HttpClient.d.ts +165 -2
  3. package/dist/milvus/HttpClient.js +17 -3
  4. package/dist/milvus/HttpClient.js.map +1 -1
  5. package/dist/milvus/MilvusClient.d.ts +3 -3
  6. package/dist/milvus/MilvusClient.js +42 -8
  7. package/dist/milvus/MilvusClient.js.map +1 -1
  8. package/dist/milvus/const/client.d.ts +4 -3
  9. package/dist/milvus/const/client.js +4 -3
  10. package/dist/milvus/const/client.js.map +1 -1
  11. package/dist/milvus/const/defaults.d.ts +5 -4
  12. package/dist/milvus/const/defaults.js +14 -13
  13. package/dist/milvus/const/defaults.js.map +1 -1
  14. package/dist/milvus/const/error.js +1 -1
  15. package/dist/milvus/const/error.js.map +1 -1
  16. package/dist/milvus/const/milvus.d.ts +47 -8
  17. package/dist/milvus/const/milvus.js +42 -3
  18. package/dist/milvus/const/milvus.js.map +1 -1
  19. package/dist/milvus/grpc/BaseClient.d.ts +11 -9
  20. package/dist/milvus/grpc/BaseClient.js +59 -21
  21. package/dist/milvus/grpc/BaseClient.js.map +1 -1
  22. package/dist/milvus/grpc/Collection.d.ts +311 -366
  23. package/dist/milvus/grpc/Collection.js +355 -387
  24. package/dist/milvus/grpc/Collection.js.map +1 -1
  25. package/dist/milvus/grpc/Data.d.ts +244 -291
  26. package/dist/milvus/grpc/Data.js +402 -539
  27. package/dist/milvus/grpc/Data.js.map +1 -1
  28. package/dist/milvus/grpc/Database.d.ts +29 -41
  29. package/dist/milvus/grpc/Database.js +32 -44
  30. package/dist/milvus/grpc/Database.js.map +1 -1
  31. package/dist/milvus/grpc/GrpcClient.d.ts +34 -13
  32. package/dist/milvus/grpc/GrpcClient.js +80 -70
  33. package/dist/milvus/grpc/GrpcClient.js.map +1 -1
  34. package/dist/milvus/grpc/MilvusIndex.d.ts +127 -67
  35. package/dist/milvus/grpc/MilvusIndex.js +166 -70
  36. package/dist/milvus/grpc/MilvusIndex.js.map +1 -1
  37. package/dist/milvus/grpc/Partition.d.ts +78 -113
  38. package/dist/milvus/grpc/Partition.js +109 -119
  39. package/dist/milvus/grpc/Partition.js.map +1 -1
  40. package/dist/milvus/grpc/Resource.d.ts +63 -92
  41. package/dist/milvus/grpc/Resource.js +69 -98
  42. package/dist/milvus/grpc/Resource.js.map +1 -1
  43. package/dist/milvus/grpc/User.d.ts +263 -295
  44. package/dist/milvus/grpc/User.js +287 -310
  45. package/dist/milvus/grpc/User.js.map +1 -1
  46. package/dist/milvus/http/Alias.d.ts +37 -0
  47. package/dist/milvus/http/Alias.js +62 -0
  48. package/dist/milvus/http/Alias.js.map +1 -0
  49. package/dist/milvus/http/Collection.d.ts +15 -1
  50. package/dist/milvus/http/Collection.js +55 -9
  51. package/dist/milvus/http/Collection.js.map +1 -1
  52. package/dist/milvus/http/Import.d.ts +33 -0
  53. package/dist/milvus/http/Import.js +48 -0
  54. package/dist/milvus/http/Import.js.map +1 -0
  55. package/dist/milvus/http/MilvusIndex.d.ts +35 -0
  56. package/dist/milvus/http/MilvusIndex.js +55 -0
  57. package/dist/milvus/http/MilvusIndex.js.map +1 -0
  58. package/dist/milvus/http/Partition.d.ts +41 -0
  59. package/dist/milvus/http/Partition.js +76 -0
  60. package/dist/milvus/http/Partition.js.map +1 -0
  61. package/dist/milvus/http/Role.d.ts +39 -0
  62. package/dist/milvus/http/Role.js +69 -0
  63. package/dist/milvus/http/Role.js.map +1 -0
  64. package/dist/milvus/http/User.d.ts +41 -0
  65. package/dist/milvus/http/User.js +76 -0
  66. package/dist/milvus/http/User.js.map +1 -0
  67. package/dist/milvus/http/Vector.d.ts +5 -3
  68. package/dist/milvus/http/Vector.js +10 -7
  69. package/dist/milvus/http/Vector.js.map +1 -1
  70. package/dist/milvus/http/index.d.ts +6 -0
  71. package/dist/milvus/http/index.js +6 -0
  72. package/dist/milvus/http/index.js.map +1 -1
  73. package/dist/milvus/index.d.ts +0 -1
  74. package/dist/milvus/index.js +0 -1
  75. package/dist/milvus/index.js.map +1 -1
  76. package/dist/milvus/types/Client.d.ts +5 -0
  77. package/dist/milvus/types/Collection.d.ts +34 -9
  78. package/dist/milvus/types/Common.d.ts +1 -3
  79. package/dist/milvus/types/Data.d.ts +79 -23
  80. package/dist/milvus/types/Data.js +1 -0
  81. package/dist/milvus/types/Data.js.map +1 -1
  82. package/dist/milvus/types/HighLevel.d.ts +6 -3
  83. package/dist/milvus/types/Http.d.ts +191 -9
  84. package/dist/milvus/types/MilvusIndex.d.ts +17 -3
  85. package/dist/milvus/utils/Bytes.d.ts +84 -0
  86. package/dist/milvus/utils/Bytes.js +261 -0
  87. package/dist/milvus/utils/Bytes.js.map +1 -0
  88. package/dist/milvus/utils/Format.d.ts +126 -68
  89. package/dist/milvus/utils/Format.js +375 -94
  90. package/dist/milvus/utils/Format.js.map +1 -1
  91. package/dist/milvus/utils/Function.d.ts +4 -2
  92. package/dist/milvus/utils/Function.js +58 -25
  93. package/dist/milvus/utils/Function.js.map +1 -1
  94. package/dist/milvus/utils/Grpc.d.ts +3 -2
  95. package/dist/milvus/utils/Grpc.js +65 -98
  96. package/dist/milvus/utils/Grpc.js.map +1 -1
  97. package/dist/milvus/utils/Validate.d.ts +18 -3
  98. package/dist/milvus/utils/Validate.js +38 -12
  99. package/dist/milvus/utils/Validate.js.map +1 -1
  100. package/dist/milvus/utils/index.d.ts +1 -1
  101. package/dist/milvus/utils/index.js +1 -1
  102. package/dist/milvus/utils/index.js.map +1 -1
  103. package/dist/proto/proto/common.proto +26 -1
  104. package/dist/proto/proto/google/protobuf/descriptor.proto +90 -28
  105. package/dist/proto/proto/milvus.proto +168 -2
  106. package/dist/proto/proto/rg.proto +28 -0
  107. package/dist/proto/proto/schema.proto +34 -0
  108. package/dist/sdk.json +1 -1
  109. package/package.json +8 -5
  110. package/dist/milvus/OrmClient.d.ts +0 -19
  111. package/dist/milvus/OrmClient.js +0 -51
  112. package/dist/milvus/OrmClient.js.map +0 -1
  113. package/dist/milvus/orm/Collection.d.ts +0 -43
  114. package/dist/milvus/orm/Collection.js +0 -165
  115. package/dist/milvus/orm/Collection.js.map +0 -1
  116. package/dist/milvus/orm/index.d.ts +0 -1
  117. package/dist/milvus/orm/index.js +0 -18
  118. package/dist/milvus/orm/index.js.map +0 -1
  119. package/dist/milvus/utils/Blob.d.ts +0 -4
  120. package/dist/milvus/utils/Blob.js +0 -18
  121. package/dist/milvus/utils/Blob.js.map +0 -1
@@ -2,412 +2,380 @@ import { Resource } from './Resource';
2
2
  import { CreateUserReq, DeleteUserReq, ListUsersReq, UpdateUserReq, CreateRoleReq, DropRoleReq, AddUserToRoleReq, RemoveUserFromRoleReq, SelectRoleReq, SelectUserReq, OperateRolePrivilegeReq, SelectGrantReq, ListGrantsReq, HasRoleReq, listRoleReq, GrpcTimeOut, ListCredUsersResponse, ResStatus, SelectRoleResponse, SelectUserResponse, SelectGrantResponse, HasRoleResponse } from '../';
3
3
  export declare class User extends Resource {
4
4
  /**
5
- * Create user in milvus
5
+ * Creates a new user in Milvus.
6
6
  *
7
- * @param data
8
- * | Property | Type | Description |
9
- * | :-- | :-- | :-- |
10
- * | username | String | username |
11
- * | password | String | user password |
12
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
7
+ * @param {CreateUserReq} data - The user data.
8
+ * @param {string} data.username - The username of the new user.
9
+ * @param {string} data.password - The password for the new user.
10
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
13
11
  *
14
- * @returns
15
- * | Property | Description |
16
- * | :-- | :-- |
17
- * | error_code | Error code number |
18
- * | reason | Error cause|
12
+ * @returns {Promise<ResStatus>} The response status.
13
+ * @returns {number} ResStatus.error_code - The error code number.
14
+ * @returns {string} ResStatus.reason - The cause of the error, if any.
19
15
  *
20
- * #### Example
21
- *
22
- * ```
16
+ * @example
17
+ * ```javascript
23
18
  * milvusClient.createUser({
24
- * username: NAME,
25
- * password: PASSWORD,
19
+ * username: 'exampleUser',
20
+ * password: 'examplePassword',
26
21
  * });
27
22
  * ```
28
23
  */
29
24
  createUser(data: CreateUserReq): Promise<ResStatus>;
30
25
  /**
31
- * Update user in milvus
26
+ * Update user in Milvus.
32
27
  *
33
- * @param data
34
- * | Property | Type | Description |
35
- * | :-- | :-- | :-- |
36
- * | username | String | username |
37
- * | password | String | user password |
38
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
28
+ * @param {UpdateUserReq} data - The user data.
29
+ * @param {string} data.username - The username of the user to be updated.
30
+ * @param {string} data.newPassword - The new password for the user.
31
+ * @param {string} data.oldPassword - The old password of the user.
32
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
39
33
  *
40
- * @returns
41
- * | Property | Description |
42
- * | :-- | :-- |
43
- * | error_code | Error code number |
44
- * | reason | Error cause|
34
+ * @returns {Promise<ResStatus>} The response status.
35
+ * @returns {number} ResStatus.error_code - The error code number.
36
+ * @returns {string} ResStatus.reason - The cause of the error, if any.
45
37
  *
46
- * #### Example
47
- *
48
- * ```
38
+ * @example
39
+ * ```javascript
49
40
  * milvusClient.updateUser({
50
- * username: NAME,
51
- * newPassword: PASSWORD,
52
- * oldPassword: PASSWORD,
41
+ * username: 'exampleUser',
42
+ * newPassword: 'newPassword',
43
+ * oldPassword: 'oldPassword',
53
44
  * });
54
45
  * ```
55
46
  */
56
47
  updateUser(data: UpdateUserReq): Promise<ResStatus>;
48
+ updatePassword: (data: UpdateUserReq) => Promise<ResStatus>;
57
49
  /**
58
- * Delete user in milvus
50
+ * Lists all users in Milvus.
59
51
  *
60
- * @param data
61
- * | Property | Type | Description |
62
- * | :-- | :-- | :-- |
63
- * | username | String | username |
64
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
52
+ * @param {Object} data - The data object.
53
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
65
54
  *
66
- * @returns
67
- * | Property | Description |
68
- * | :-- | :-- |
69
- * | error_code | Error code number |
70
- * | reason | Error cause|
55
+ * @returns {Promise<Object>} The response object.
56
+ * @returns {Object} response.status - The response status.
57
+ * @returns {number} response.status.error_code - The error code number.
58
+ * @returns {string} response.status.reason - The cause of the error, if any.
59
+ * @returns {string[]} response.usernames - An array of usernames.
71
60
  *
72
- * #### Example
73
- *
74
- * ```
75
- * milvusClient.deleteUser({
76
- * username: NAME,
77
- * });
61
+ * @example
62
+ * ```javascript
63
+ * milvusClient.listUsers();
78
64
  * ```
79
65
  */
80
66
  deleteUser(data: DeleteUserReq): Promise<ResStatus>;
67
+ dropUser: (data: DeleteUserReq) => Promise<ResStatus>;
81
68
  /**
82
- * List user in milvus
69
+ * Lists all users in Milvus.
83
70
  *
84
- * @param data
85
- * | Property | Type | Description |
86
- * | :-- | :-- | :-- |
87
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
71
+ * @param {ListUsersReq} data - The data object.
72
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
88
73
  *
89
- * @returns
90
- * | Property | Description |
91
- * | :-- | :-- |
92
- * | status | { error_code: number, reason: string } |
93
- * | usernames | string[] |
74
+ * @returns {Promise<ListCredUsersResponse>} The response object.
75
+ * @returns {ResStatus} response.status - The response status.
76
+ * @returns {number} response.status.error_code - The error code number.
77
+ * @returns {string} response.status.reason - The cause of the error, if any.
78
+ * @returns {string[]} response.usernames - An array of usernames.
94
79
  *
95
- * #### Example
96
- *
97
- * ```
80
+ * @example
81
+ * ```javascript
98
82
  * milvusClient.listUsers();
99
83
  * ```
100
84
  */
101
85
  listUsers(data?: ListUsersReq): Promise<ListCredUsersResponse>;
102
86
  /**
103
- * Create user role
87
+ * Create a new role in Milvus.
104
88
  *
105
- * @param data
106
- * | Property | Type | Description |
107
- * | :-- | :-- | :-- |
108
- * | roleName | String | role name |
109
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
89
+ * @param {CreateRoleReq} data - The role data.
90
+ * @param {string} data.roleName - The name of the new role.
91
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
110
92
  *
111
- * @returns
112
- * | Property | Description |
113
- * | :-- | :-- |
114
- * | status | { error_code: number, reason: string } |
115
- * | reason | '' |
93
+ * @returns {Promise<ResStatus>} The response status.
94
+ * @returns {number} ResStatus.error_code - The error code number.
95
+ * @returns {string} ResStatus.reason - The cause of the error, if any.
116
96
  *
117
- * #### Example
118
- *
119
- * ```
120
- * milvusClient.createRole({roleName: 'myrole'});
97
+ * @example
98
+ * ```javascript
99
+ * milvusClient.createRole({
100
+ * roleName: 'exampleRole',
101
+ * });
121
102
  * ```
122
103
  */
123
104
  createRole(data: CreateRoleReq): Promise<ResStatus>;
124
105
  /**
125
- * Drop user role
126
- *
127
- * @param data
128
- * | Property | Type | Description |
129
- * | :-- | :-- | :-- |
130
- * | roleName | String | User name |
131
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
106
+ * Drops a user role in Milvus.
132
107
  *
133
- * @returns
134
- * | Property | Description |
135
- * | :-- | :-- |
136
- * | status | { error_code: number, reason: string } |
137
- * | reason | '' |
108
+ * @param {DropRoleReq} data - The data object.
109
+ * @param {string} data.roleName - The name of the role to be dropped.
110
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
138
111
  *
139
- * #### Example
112
+ * @returns {Promise<ResStatus>} The response status.
113
+ * @returns {number} ResStatus.error_code - The error code number.
114
+ * @returns {string} ResStatus.reason - The cause of the error, if any.
140
115
  *
141
- * ```
142
- * milvusClient.dropRole({roleName: 'myrole'});
116
+ * @example
117
+ * ```javascript
118
+ * milvusClient.dropRole({
119
+ * roleName: 'exampleRole',
120
+ * });
143
121
  * ```
144
122
  */
145
123
  dropRole(data: DropRoleReq): Promise<ResStatus>;
146
124
  /**
147
- * add user to role
148
- *
149
- * @param data
150
- * | Property | Type | Description |
151
- * | :-- | :-- | :-- |
152
- * | username | String | User name |
153
- * | roleName | String | Role name |
154
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
155
- *
156
- * @returns
157
- * | Property | Description |
158
- * | :-- | :-- |
159
- * | status | { error_code: number, reason: string } |
160
- * | reason | '' |
161
- *
162
- * #### Example
163
- *
164
- * ```
165
- * milvusClient.addUserToRole({username: 'my', roleName: 'myrole'});
125
+ * Adds a user to a role.
126
+ *
127
+ * @param {AddUserToRoleReq} data - The data object.
128
+ * @param {string} data.username - The username of the user to be added to the role.
129
+ * @param {string} data.roleName - The name of the role to which the user will be added.
130
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
131
+ *
132
+ * @returns {Promise<ResStatus>} The response status.
133
+ * @returns {number} ResStatus.error_code - The error code number.
134
+ * @returns {string} ResStatus.reason - The cause of the error, if any.
135
+ *
136
+ * @example
137
+ * ```javascript
138
+ * milvusClient.addUserToRole({
139
+ * username: 'my',
140
+ * roleName: 'myrole'
141
+ * });
166
142
  * ```
167
143
  */
168
144
  addUserToRole(data: AddUserToRoleReq): Promise<ResStatus>;
145
+ grantRole: (data: AddUserToRoleReq) => Promise<ResStatus>;
169
146
  /**
170
- * remove user from role
171
- *
172
- * @param data
173
- * | Property | Type | Description |
174
- * | :-- | :-- | :-- |
175
- * | username | String | User name |
176
- * | roleName | String | Role name |
177
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
178
- *
179
- * @returns
180
- * | Property | Description |
181
- * | :-- | :-- |
182
- * | status | { error_code: number, reason: string } |
183
- * | reason | '' |
184
- *
185
- * #### Example
186
- *
187
- * ```
188
- * milvusClient.removeUserFromRole({username: 'my', roleName: 'myrole'});
147
+ * Removes a user from a role.
148
+ *
149
+ * @param {RemoveUserFromRoleReq} data - The data object.
150
+ * @param {string} data.username - The username of the user to be removed from the role.
151
+ * @param {string} data.roleName - The name of the role from which the user will be removed.
152
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
153
+ *
154
+ * @returns {Promise<ResStatus>} The response status.
155
+ * @returns {number} ResStatus.error_code - The error code number.
156
+ * @returns {string} ResStatus.reason - The cause of the error, if any.
157
+ *
158
+ * @example
159
+ * ```javascript
160
+ * milvusClient.removeUserFromRole({
161
+ * username: 'my',
162
+ * roleName: 'myrole'
163
+ * });
189
164
  * ```
190
165
  */
191
166
  removeUserFromRole(data: RemoveUserFromRoleReq): Promise<ResStatus>;
167
+ revokeRole: (data: RemoveUserFromRoleReq) => Promise<ResStatus>;
192
168
  /**
193
- * gets all users that belong to a specified role
194
- *
195
- * @param data
196
- * | Property | Type | Description |
197
- * | :-- | :-- | :-- |
198
- * | roleName | String | Role name |
199
- * | includeUserInfo? | boolean | should result including user info, by default: true |
200
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
201
-
202
- * @returns
203
- * | Property | Description |
204
- * | :-- | :-- |
205
- * | status | { error_code: number, reason: string } |
206
- * | results | { users: {name: string}[]; role: {name: string} }[] |
207
- *
208
- * #### Example
209
- *
210
- * ```
211
- * milvusClient.selectRole({roleName: 'myrole'});
169
+ * Gets all users that belong to a specified role.
170
+ *
171
+ * @param {Object} data - The data object.
172
+ * @param {string} data.roleName - The name of the role.
173
+ * @param {boolean} [data.includeUserInfo=true] - Determines whether the result should include user info.
174
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
175
+ *
176
+ * @returns {Promise<Object>} The response object.
177
+ * @returns {Object} response.status - The response status.
178
+ * @returns {number} response.status.error_code - The error code number.
179
+ * @returns {string} response.status.reason - The cause of the error, if any.
180
+ * @returns {Object[]} response.results - An array of objects, each containing a list of users and a role.
181
+ * @returns {Object[]} response.results.users - An array of user objects.
182
+ * @returns {string} response.results.users.name - The name of the user.
183
+ * @returns {Object} response.results.role - The role object.
184
+ * @returns {string} response.results.role.name - The name of the role.
185
+ *
186
+ * @example
187
+ * ```javascript
188
+ * milvusClient.describeRole({roleName: 'myrole'});
212
189
  * ```
213
190
  */
214
- selectRole(data: SelectRoleReq): Promise<SelectRoleResponse>;
191
+ describeRole(data: SelectRoleReq): Promise<SelectRoleResponse>;
192
+ selectRole: (data: SelectRoleReq) => Promise<SelectRoleResponse>;
215
193
  /**
216
- * list all roles
194
+ * Lists all roles in Milvus.
217
195
  *
218
- * @param data
219
- * | Property | Type | Description |
220
- * | :-- | :-- | :-- |
221
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
196
+ * @param {Object} data - The data object.
197
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
222
198
  *
223
- * @returns
224
- * | Property | Description |
225
- * | :-- | :-- |
226
- * | status | { error_code: number, reason: string } |
227
- * | reason | '' |
199
+ * @returns {Promise<Object>} The response object.
200
+ * @returns {Object} response.status - The response status.
201
+ * @returns {number} response.status.error_code - The error code number.
202
+ * @returns {string} response.status.reason - The cause of the error, if any.
203
+ * @returns {Object[]} response.results - An array of objects, each containing a role.
204
+ * @returns {string} response.results.role.name - The name of the role.
228
205
  *
229
- * #### Example
230
- *
231
- * ```
206
+ * @example
207
+ * ```javascript
232
208
  * milvusClient.listRoles();
233
209
  * ```
234
210
  */
235
211
  listRoles(data?: listRoleReq): Promise<SelectRoleResponse>;
236
212
  /**
237
- * gets all users that belong to a specified role
238
- *
239
- * @param data
240
- * | Property | Type | Description |
241
- * | :-- | :-- | :-- |
242
- * | userName | String | User name |
243
- * | includeUserInfo? | boolean | should result including user info, by default: true |
244
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
245
- *
246
- * @returns
247
- * | Property | Description |
248
- * | :-- | :-- |
249
- * | status | { error_code: number, reason: string } |
250
- * | results | user: {name: string}; roles: {name: string}[] |
251
- *
252
- * #### Example
253
- *
254
- * ```
255
- * milvusClient.selectUser({username: 'name'});
213
+ * Gets all users that belong to a specified role.
214
+ *
215
+ * @param {Object} data - The data object.
216
+ * @param {string} data.userName - The username of the user.
217
+ * @param {boolean} [data.includeUserInfo=true] - Determines whether the result should include user info.
218
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
219
+ *
220
+ * @returns {Promise<Object>} The response object.
221
+ * @returns {Object} response.status - The response status.
222
+ * @returns {number} response.status.error_code - The error code number.
223
+ * @returns {string} response.status.reason - The cause of the error, if any.
224
+ * @returns {Object[]} response.results - An array of objects, each containing a user and a list of roles.
225
+ * @returns {Object} response.results.user - The user object.
226
+ * @returns {string} response.results.user.name - The name of the user.
227
+ * @returns {Object[]} response.results.roles - An array of role objects.
228
+ * @returns {string} response.results.roles.name - The name of the role.
229
+ *
230
+ * @example
231
+ * ```javascript
232
+ * milvusClient.describeUser({username: 'name'});
256
233
  * ```
257
234
  */
258
- selectUser(data: SelectUserReq): Promise<SelectUserResponse>;
235
+ describeUser(data: SelectUserReq): Promise<SelectUserResponse>;
236
+ selectUser: (data: SelectUserReq) => Promise<SelectUserResponse>;
259
237
  /**
260
- * grant privileges to a role
261
- *
262
- * @param data
263
- * | Property | Type | Description |
264
- * | :-- | :-- | :-- |
265
- * | roleName | String | Role name |
266
- * | object | string | Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive.|
267
- * | objectName | string | Name of the object to which the role is granted the specified prvilege. |
268
- * | privilegeName | string | Name of the privilege to be granted to the role. This parameter is case-sensitive. |
269
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
270
- *
271
- * @returns
272
- * | Property | Description |
273
- * | :-- | :-- |
274
- * | status | { error_code: number, reason: string } |
275
- * | reason | '' |
276
- *
277
- * #### Example
278
- *
279
- * ```
280
- * milvusClient.grantRolePrivilege({
238
+ * Grants privileges to a role.
239
+ *
240
+ * @param {Object} data - The data object.
241
+ * @param {string} data.roleName - The name of the role.
242
+ * @param {string} data.object - The type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive.
243
+ * @param {string} data.objectName - The name of the object to which the role is granted the specified privilege.
244
+ * @param {string} data.privilegeName - The name of the privilege to be granted to the role. This parameter is case-sensitive.
245
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
246
+ *
247
+ * @returns {Promise<Object>} The response object.
248
+ * @returns {Object} response.status - The response status.
249
+ * @returns {number} response.status.error_code - The error code number.
250
+ * @returns {string} response.status.reason - The cause of the error, if any.
251
+ *
252
+ * @example
253
+ * ```javascript
254
+ * milvusClient.grantPrivilege({
281
255
  * roleName: 'roleName',
282
256
  * object: '*',
283
257
  * objectName: 'Collection',
284
258
  * privilegeName: 'CreateIndex'
285
- * });
259
+ * });
286
260
  * ```
287
261
  */
288
- grantRolePrivilege(data: OperateRolePrivilegeReq): Promise<ResStatus>;
262
+ grantPrivilege(data: OperateRolePrivilegeReq): Promise<ResStatus>;
263
+ grantRolePrivilege: (data: OperateRolePrivilegeReq) => Promise<ResStatus>;
289
264
  /**
290
- * revoke privileges to a role
291
- *
292
- * @param data
293
- * | Property | Type | Description |
294
- * | :-- | :-- | :-- |
295
- * | roleName | String | Role name |
296
- * | object | string | Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive.|
297
- * | objectName | string | Name of the object to which the role is granted the specified prvilege. |
298
- * | privilegeName | string | Name of the privilege to be granted to the role. This parameter is case-sensitive. |
299
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
300
- *
301
- * @returns
302
- * | Property | Description |
303
- * | :------------- | :-------- |
304
- * | status | { error_code: number, reason: string } |
305
- * | reason | '' |
306
- *
307
- * #### Example
308
- *
309
- * ```
310
- * milvusClient.grantRolePrivilege({
265
+ * Revokes privileges from a role.
266
+ *
267
+ * @param {Object} data - The data object.
268
+ * @param {string} data.roleName - The name of the role.
269
+ * @param {string} data.object - The type of the operational object from which the specified privilege is revoked, such as Collection, Index, Partition, etc. This parameter is case-sensitive.
270
+ * @param {string} data.objectName - The name of the object from which the role's specified privilege is revoked.
271
+ * @param {string} data.privilegeName - The name of the privilege to be revoked from the role. This parameter is case-sensitive.
272
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
273
+ *
274
+ * @returns {Promise<Object>} The response object.
275
+ * @returns {Object} response.status - The response status.
276
+ * @returns {number} response.status.error_code - The error code number.
277
+ * @returns {string} response.status.reason - The cause of the error, if any.
278
+ *
279
+ * @example
280
+ * ```javascript
281
+ * milvusClient.revokePrivilege({
311
282
  * roleName: 'roleName',
312
283
  * object: '*',
313
284
  * objectName: 'Collection',
314
285
  * privilegeName: 'CreateIndex'
315
- * });
286
+ * });
316
287
  * ```
317
288
  */
318
- revokeRolePrivilege(data: OperateRolePrivilegeReq): Promise<ResStatus>;
289
+ revokePrivilege(data: OperateRolePrivilegeReq): Promise<ResStatus>;
290
+ revokeRolePrivilege: (data: OperateRolePrivilegeReq) => Promise<ResStatus>;
319
291
  /**
320
- * revoke all roles priviledges
321
- * @param data
322
- * | Property | Type | Description |
323
- * | :-- | :-- | :-- |
324
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
292
+ * Revokes all privileges from all roles.
325
293
  *
326
- * @returns
327
- * | Property | Description |
328
- * | :-- | :-- |
329
- * | status | { error_code: number, reason: string } |
330
- * | reason | '' |
294
+ * @param {Object} data - The data object.
295
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
331
296
  *
332
- * #### Example
297
+ * @returns {Promise<ResStatus[]>} - An array of response statuses for each role.
298
+ * @returns {number} ResStatus.error_code - The error code number for each role.
299
+ * @returns {string} ResStatus.reason - The cause of the error, if any, for each role.
333
300
  *
334
- * ```
301
+ * @example
302
+ * ```javascript
335
303
  * milvusClient.revokeAllRolesPrivileges();
336
304
  * ```
337
305
  */
338
306
  dropAllRoles(data?: GrpcTimeOut): Promise<ResStatus[]>;
339
307
  /**
340
- * select a grant
341
- * @param data
342
- * | Property | Type | Description |
343
- * | :-- | :-- | :-- |
344
- * | roleName | String | Role name |
345
- * | object | string | Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive.|
346
- * | objectName | string | Name of the object to which the role is granted the specified prvilege. |
347
- * | privilegeName | string | Name of the privilege to be granted to the role. This parameter is case-sensitive. |
348
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
349
- *
350
- * @returns
351
- * | Property | Description |
352
- * | :-- | :-- |
353
- * | status | { error_code: number, reason: string } |
354
- * | reason | '' |
355
- *
356
- * #### Example
357
- *
358
- * ```
308
+ * Selects a grant for a specific role.
309
+ *
310
+ * @param {Object} data - The data object.
311
+ * @param {string} data.roleName - The name of the role.
312
+ * @param {string} data.object - The type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive.
313
+ * @param {string} data.objectName - The name of the object to which the role is granted the specified privilege.
314
+ * @param {string} data.privilegeName - The name of the privilege to be granted to the role. This parameter is case-sensitive.
315
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
316
+ *
317
+ * @returns {Promise<Object>} The response object.
318
+ * @returns {Object} response.status - The response status.
319
+ * @returns {number} response.status.error_code - The error code number.
320
+ * @returns {string} response.status.reason - The cause of the error, if any.
321
+ *
322
+ * @example
323
+ * ```javascript
359
324
  * milvusClient.selectGrant({
360
325
  * roleName: 'roleName',
361
326
  * object: '*',
362
327
  * objectName: 'Collection',
363
328
  * privilegeName: 'CreateIndex'
364
- * });
329
+ * });
365
330
  * ```
366
331
  */
367
332
  selectGrant(data: SelectGrantReq): Promise<SelectGrantResponse>;
368
333
  /**
369
- * list all grants for a role
370
- * @param data
371
- * | Property | Type | Description |
372
- * | :-- | :-- | :-- |
373
- * | roleName | String | Role name |
374
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
375
- *
376
- * @returns
377
- * | Property | Description |
378
- * | :-- | :-- |
379
- * | status | { error_code: number, reason: string } |
380
- * | reason | '' |
381
- *
382
- * #### Example
383
- *
384
- * ```
334
+ * Lists all grants for a specific role.
335
+ *
336
+ * @param {Object} data - The data object.
337
+ * @param {string} data.roleName - The name of the role.
338
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
339
+ *
340
+ * @returns {Promise<SelectGrantResponse>} The response object.
341
+ * @returns {Object} response.status - The response status.
342
+ * @returns {number} response.status.error_code - The error code number.
343
+ * @returns {string} response.status.reason - The cause of the error, if any.
344
+ * @returns {Object[]} response.entities - An array of entities, each containing a role, an object, an object name, and a grantor.
345
+ * @returns {Object} response.entities.role - The role object.
346
+ * @returns {string} response.entities.role.name - The name of the role.
347
+ * @returns {Object} response.entities.object - The object to which the specified privilege belongs.
348
+ * @returns {string} response.entities.object.name - The name of the object.
349
+ * @returns {string} response.entities.object_name - The name of the object to which the role is granted the specified privilege.
350
+ * @returns {Object} response.entities.grantor - The grantor object.
351
+ * @returns {string} response.entities.grantor.privilege.name - The name of the privilege granted to the role.
352
+ *
353
+ * @example
354
+ * ```javascript
385
355
  * milvusClient.listGrants({
386
356
  * roleName: 'roleName',
387
- * });
357
+ * });
388
358
  * ```
389
359
  */
390
360
  listGrants(data: ListGrantsReq): Promise<SelectGrantResponse>;
391
361
  /**
392
- * check if the role is existing
393
- * @param data
394
- * | Property | Type | Description |
395
- * | :-- | :-- | :-- |
396
- * | roleName | String | Role name |
397
- * | timeout? | number | An optional duration of time in millisecond to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined |
362
+ * Checks if a role exists.
398
363
  *
399
- * @returns
400
- * | Property | Description |
401
- * | :-- | :-- |
402
- * | status | { error_code: number, reason: string } |
403
- * | reason | '' |
364
+ * @param {HasRoleReq} data - The data object.
365
+ * @param {string} data.roleName - The name of the role.
366
+ * @param {number} [data.timeout] - An optional duration of time in milliseconds to allow for the RPC. If it is set to undefined, the client keeps waiting until the server responds or error occurs. Default is undefined.
404
367
  *
405
- * #### Example
368
+ * @returns {Promise<HasRoleResponse>} The response object.
369
+ * @returns {ResStatus} response.status - The response status.
370
+ * @returns {number} response.status.error_code - The error code number.
371
+ * @returns {string} response.status.reason - The cause of the error, if any.
372
+ * @returns {boolean} response.hasRole - A boolean indicating whether the role exists.
406
373
  *
407
- * ```
374
+ * @example
375
+ * ```javascript
408
376
  * milvusClient.hasRole({
409
377
  * roleName: 'roleName',
410
- * });
378
+ * });
411
379
  * ```
412
380
  */
413
381
  hasRole(data: HasRoleReq): Promise<HasRoleResponse>;