@zilliz/milvus2-sdk-node 2.2.9 → 2.2.11

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 (149) hide show
  1. package/README.md +76 -12
  2. package/dist/milvus/MilvusClient.d.ts +21 -2
  3. package/dist/milvus/MilvusClient.js +35 -29
  4. package/dist/milvus/MilvusClient.js.map +1 -1
  5. package/dist/milvus/OrmClient.d.ts +19 -0
  6. package/dist/milvus/OrmClient.js +77 -0
  7. package/dist/milvus/OrmClient.js.map +1 -0
  8. package/dist/milvus/const/ErrorReason.d.ts +36 -31
  9. package/dist/milvus/const/ErrorReason.js +39 -32
  10. package/dist/milvus/const/ErrorReason.js.map +1 -1
  11. package/dist/milvus/const/Milvus.d.ts +2 -9
  12. package/dist/milvus/const/Milvus.js +16 -33
  13. package/dist/milvus/const/Milvus.js.map +1 -1
  14. package/dist/milvus/const/client.d.ts +5 -0
  15. package/dist/milvus/const/client.js +10 -0
  16. package/dist/milvus/const/client.js.map +1 -0
  17. package/dist/milvus/const/defaults.d.ts +11 -0
  18. package/dist/milvus/const/defaults.js +16 -0
  19. package/dist/milvus/const/defaults.js.map +1 -0
  20. package/dist/milvus/const/highLevel.d.ts +23 -0
  21. package/dist/milvus/const/highLevel.js +26 -0
  22. package/dist/milvus/const/highLevel.js.map +1 -0
  23. package/dist/milvus/const/index.d.ts +5 -0
  24. package/dist/milvus/{types.js → const/index.js} +7 -10
  25. package/dist/milvus/const/index.js.map +1 -0
  26. package/dist/milvus/const/limits.d.ts +2 -0
  27. package/dist/milvus/const/limits.js +7 -0
  28. package/dist/milvus/const/limits.js.map +1 -0
  29. package/dist/milvus/{BaseClient.d.ts → grpc/BaseClient.d.ts} +20 -8
  30. package/dist/milvus/grpc/BaseClient.js +83 -0
  31. package/dist/milvus/grpc/BaseClient.js.map +1 -0
  32. package/dist/milvus/{Collection.d.ts → grpc/Collection.d.ts} +32 -3
  33. package/dist/milvus/grpc/Collection.js +786 -0
  34. package/dist/milvus/grpc/Collection.js.map +1 -0
  35. package/dist/milvus/{Data.d.ts → grpc/Data.d.ts} +68 -10
  36. package/dist/milvus/grpc/Data.js +880 -0
  37. package/dist/milvus/grpc/Data.js.map +1 -0
  38. package/dist/milvus/grpc/Database.d.ts +69 -0
  39. package/dist/milvus/grpc/Database.js +98 -0
  40. package/dist/milvus/grpc/Database.js.map +1 -0
  41. package/dist/milvus/grpc/GrpcClient.d.ts +46 -0
  42. package/dist/milvus/grpc/GrpcClient.js +150 -0
  43. package/dist/milvus/grpc/GrpcClient.js.map +1 -0
  44. package/dist/milvus/{MilvusIndex.d.ts → grpc/MilvusIndex.d.ts} +1 -1
  45. package/dist/milvus/grpc/MilvusIndex.js +203 -0
  46. package/dist/milvus/grpc/MilvusIndex.js.map +1 -0
  47. package/dist/milvus/{Partition.d.ts → grpc/Partition.d.ts} +1 -1
  48. package/dist/milvus/grpc/Partition.js +265 -0
  49. package/dist/milvus/grpc/Partition.js.map +1 -0
  50. package/dist/milvus/{Resource.d.ts → grpc/Resource.d.ts} +2 -2
  51. package/dist/milvus/grpc/Resource.js +250 -0
  52. package/dist/milvus/grpc/Resource.js.map +1 -0
  53. package/dist/milvus/{User.d.ts → grpc/User.d.ts} +1 -1
  54. package/dist/milvus/grpc/User.js +619 -0
  55. package/dist/milvus/grpc/User.js.map +1 -0
  56. package/dist/milvus/index.d.ts +4 -13
  57. package/dist/milvus/index.js +6 -14
  58. package/dist/milvus/index.js.map +1 -1
  59. package/dist/milvus/orm/Collection.d.ts +45 -0
  60. package/dist/milvus/orm/Collection.js +172 -0
  61. package/dist/milvus/orm/Collection.js.map +1 -0
  62. package/dist/milvus/orm/index.d.ts +2 -0
  63. package/dist/milvus/orm/index.js +19 -0
  64. package/dist/milvus/orm/index.js.map +1 -0
  65. package/dist/milvus/orm/utils.d.ts +27 -0
  66. package/dist/milvus/orm/utils.js +27 -0
  67. package/dist/milvus/orm/utils.js.map +1 -0
  68. package/dist/milvus/types/Client.d.ts +12 -1
  69. package/dist/milvus/types/Collection.d.ts +18 -4
  70. package/dist/milvus/types/Common.d.ts +1 -1
  71. package/dist/milvus/types/Data.d.ts +41 -5
  72. package/dist/milvus/types/Database.d.ts +12 -0
  73. package/dist/milvus/types/{Index.js → Database.js} +1 -1
  74. package/dist/milvus/types/Database.js.map +1 -0
  75. package/dist/milvus/types/HighLevel.d.ts +13 -0
  76. package/dist/milvus/types/HighLevel.js +3 -0
  77. package/dist/milvus/types/HighLevel.js.map +1 -0
  78. package/dist/milvus/types/{Index.d.ts → MilvusIndex.d.ts} +3 -2
  79. package/dist/milvus/types/MilvusIndex.js +3 -0
  80. package/dist/milvus/types/MilvusIndex.js.map +1 -0
  81. package/dist/milvus/types/Resource.d.ts +1 -1
  82. package/dist/milvus/types/User.d.ts +1 -1
  83. package/dist/milvus/types/index.d.ts +12 -0
  84. package/dist/milvus/types/index.js +30 -0
  85. package/dist/milvus/types/index.js.map +1 -0
  86. package/dist/{utils → milvus/utils}/Blob.js +4 -4
  87. package/dist/milvus/utils/Blob.js.map +1 -0
  88. package/dist/{utils → milvus/utils}/Format.d.ts +66 -2
  89. package/dist/milvus/utils/Format.js +416 -0
  90. package/dist/milvus/utils/Format.js.map +1 -0
  91. package/dist/{utils → milvus/utils}/Function.d.ts +1 -1
  92. package/dist/{utils → milvus/utils}/Function.js +7 -7
  93. package/dist/milvus/utils/Function.js.map +1 -0
  94. package/dist/{utils → milvus/utils}/Grpc.d.ts +9 -8
  95. package/dist/milvus/utils/Grpc.js +190 -0
  96. package/dist/milvus/utils/Grpc.js.map +1 -0
  97. package/dist/{utils → milvus/utils}/Validate.d.ts +7 -1
  98. package/dist/milvus/utils/Validate.js +140 -0
  99. package/dist/milvus/utils/Validate.js.map +1 -0
  100. package/dist/{utils → milvus/utils}/index.d.ts +2 -0
  101. package/dist/{utils → milvus/utils}/index.js +2 -0
  102. package/dist/milvus/utils/index.js.map +1 -0
  103. package/dist/milvus/utils/logger.d.ts +1 -0
  104. package/dist/milvus/utils/logger.js +18 -0
  105. package/dist/milvus/utils/logger.js.map +1 -0
  106. package/dist/proto/proto/common.proto +38 -14
  107. package/dist/proto/proto/google/protobuf/descriptor.proto +8 -4
  108. package/dist/proto/proto/milvus.proto +86 -83
  109. package/dist/proto/proto/schema.proto +5 -0
  110. package/dist/sdk.json +1 -1
  111. package/package.json +14 -11
  112. package/dist/milvus/BaseClient.js +0 -62
  113. package/dist/milvus/BaseClient.js.map +0 -1
  114. package/dist/milvus/Collection.js +0 -960
  115. package/dist/milvus/Collection.js.map +0 -1
  116. package/dist/milvus/Data.js +0 -909
  117. package/dist/milvus/Data.js.map +0 -1
  118. package/dist/milvus/GrpcClient.d.ts +0 -32
  119. package/dist/milvus/GrpcClient.js +0 -236
  120. package/dist/milvus/GrpcClient.js.map +0 -1
  121. package/dist/milvus/MilvusIndex.js +0 -299
  122. package/dist/milvus/MilvusIndex.js.map +0 -1
  123. package/dist/milvus/Partition.js +0 -369
  124. package/dist/milvus/Partition.js.map +0 -1
  125. package/dist/milvus/Resource.js +0 -356
  126. package/dist/milvus/Resource.js.map +0 -1
  127. package/dist/milvus/User.js +0 -806
  128. package/dist/milvus/User.js.map +0 -1
  129. package/dist/milvus/Utils.d.ts +0 -1
  130. package/dist/milvus/Utils.js +0 -8
  131. package/dist/milvus/Utils.js.map +0 -1
  132. package/dist/milvus/types/Index.js.map +0 -1
  133. package/dist/milvus/types.d.ts +0 -9
  134. package/dist/milvus/types.js.map +0 -1
  135. package/dist/proto/proto/feder.proto +0 -40
  136. package/dist/proto/proto/msg.proto +0 -107
  137. package/dist/utils/Blob.js.map +0 -1
  138. package/dist/utils/Format.js +0 -252
  139. package/dist/utils/Format.js.map +0 -1
  140. package/dist/utils/Function.js.map +0 -1
  141. package/dist/utils/Grpc.js +0 -170
  142. package/dist/utils/Grpc.js.map +0 -1
  143. package/dist/utils/Validate.js +0 -124
  144. package/dist/utils/Validate.js.map +0 -1
  145. package/dist/utils/index.js.map +0 -1
  146. package/dist/utils/test.d.ts +0 -15
  147. package/dist/utils/test.js +0 -98
  148. package/dist/utils/test.js.map +0 -1
  149. /package/dist/{utils → milvus/utils}/Blob.d.ts +0 -0
@@ -0,0 +1,619 @@
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
+ const Resource_1 = require("./Resource");
14
+ const __1 = require("../");
15
+ class User extends Resource_1.Resource {
16
+ /**
17
+ * Create user in milvus
18
+ *
19
+ * @param data
20
+ * | Property | Type | Description |
21
+ * | :-- | :-- | :-- |
22
+ * | username | String | username |
23
+ * | password | String | user password |
24
+ * | 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 |
25
+ *
26
+ * @returns
27
+ * | Property | Description |
28
+ * | :-- | :-- |
29
+ * | error_code | Error code number |
30
+ * | reason | Error cause|
31
+ *
32
+ * #### Example
33
+ *
34
+ * ```
35
+ * milvusClient.createUser({
36
+ * username: NAME,
37
+ * password: PASSWORD,
38
+ * });
39
+ * ```
40
+ */
41
+ createUser(data) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ if (data.username === undefined || data.password === undefined) {
44
+ throw new Error(__1.ERROR_REASONS.USERNAME_PWD_ARE_REQUIRED);
45
+ }
46
+ const encryptedPassword = (0, __1.stringToBase64)(data.password);
47
+ const promise = yield (0, __1.promisify)(this.client, 'CreateCredential', {
48
+ username: data.username,
49
+ password: encryptedPassword,
50
+ }, data.timeout || this.timeout);
51
+ return promise;
52
+ });
53
+ }
54
+ /**
55
+ * Update user in milvus
56
+ *
57
+ * @param data
58
+ * | Property | Type | Description |
59
+ * | :-- | :-- | :-- |
60
+ * | username | String | username |
61
+ * | password | String | user password |
62
+ * | 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 |
63
+ *
64
+ * @returns
65
+ * | Property | Description |
66
+ * | :-- | :-- |
67
+ * | error_code | Error code number |
68
+ * | reason | Error cause|
69
+ *
70
+ * #### Example
71
+ *
72
+ * ```
73
+ * milvusClient.updateUser({
74
+ * username: NAME,
75
+ * newPassword: PASSWORD,
76
+ * oldPassword: PASSWORD,
77
+ * });
78
+ * ```
79
+ */
80
+ updateUser(data) {
81
+ return __awaiter(this, void 0, void 0, function* () {
82
+ if (data.username === undefined ||
83
+ data.newPassword === undefined ||
84
+ data.oldPassword === undefined) {
85
+ throw new Error(__1.ERROR_REASONS.USERNAME_PWD_ARE_REQUIRED);
86
+ }
87
+ const encryptedOldPwd = (0, __1.stringToBase64)(data.oldPassword);
88
+ const encryptedNewPwd = (0, __1.stringToBase64)(data.newPassword);
89
+ const promise = yield (0, __1.promisify)(this.client, 'UpdateCredential', {
90
+ username: data.username,
91
+ oldPassword: encryptedOldPwd,
92
+ newPassword: encryptedNewPwd,
93
+ }, data.timeout || this.timeout);
94
+ return promise;
95
+ });
96
+ }
97
+ /**
98
+ * Delete user in milvus
99
+ *
100
+ * @param data
101
+ * | Property | Type | Description |
102
+ * | :-- | :-- | :-- |
103
+ * | username | String | username |
104
+ * | 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 |
105
+ *
106
+ * @returns
107
+ * | Property | Description |
108
+ * | :-- | :-- |
109
+ * | error_code | Error code number |
110
+ * | reason | Error cause|
111
+ *
112
+ * #### Example
113
+ *
114
+ * ```
115
+ * milvusClient.deleteUser({
116
+ * username: NAME,
117
+ * });
118
+ * ```
119
+ */
120
+ deleteUser(data) {
121
+ return __awaiter(this, void 0, void 0, function* () {
122
+ if (!data.username) {
123
+ throw new Error(__1.ERROR_REASONS.USERNAME_IS_REQUIRED);
124
+ }
125
+ const promise = yield (0, __1.promisify)(this.client, 'DeleteCredential', {
126
+ username: data.username,
127
+ }, data.timeout || this.timeout);
128
+ return promise;
129
+ });
130
+ }
131
+ /**
132
+ * List user in milvus
133
+ *
134
+ * @param data
135
+ * | Property | Type | Description |
136
+ * | :-- | :-- | :-- |
137
+ * | 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 |
138
+ *
139
+ * @returns
140
+ * | Property | Description |
141
+ * | :-- | :-- |
142
+ * | status | { error_code: number, reason: string } |
143
+ * | usernames | string[] |
144
+ *
145
+ * #### Example
146
+ *
147
+ * ```
148
+ * milvusClient.listUsers();
149
+ * ```
150
+ */
151
+ listUsers(data) {
152
+ return __awaiter(this, void 0, void 0, function* () {
153
+ const promise = yield (0, __1.promisify)(this.client, 'ListCredUsers', {}, (data === null || data === void 0 ? void 0 : data.timeout) || this.timeout);
154
+ return promise;
155
+ });
156
+ }
157
+ /**
158
+ * Create user role
159
+ *
160
+ * @param data
161
+ * | Property | Type | Description |
162
+ * | :-- | :-- | :-- |
163
+ * | roleName | String | role name |
164
+ * | 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 |
165
+ *
166
+ * @returns
167
+ * | Property | Description |
168
+ * | :-- | :-- |
169
+ * | status | { error_code: number, reason: string } |
170
+ * | reason | '' |
171
+ *
172
+ * #### Example
173
+ *
174
+ * ```
175
+ * milvusClient.createRole({roleName: 'myrole'});
176
+ * ```
177
+ */
178
+ createRole(data) {
179
+ return __awaiter(this, void 0, void 0, function* () {
180
+ const promise = yield (0, __1.promisify)(this.client, 'CreateRole', {
181
+ entity: { name: data.roleName },
182
+ }, data.timeout || this.timeout);
183
+ return promise;
184
+ });
185
+ }
186
+ /**
187
+ * Drop user role
188
+ *
189
+ * @param data
190
+ * | Property | Type | Description |
191
+ * | :-- | :-- | :-- |
192
+ * | roleName | String | User name |
193
+ * | 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 |
194
+ *
195
+ * @returns
196
+ * | Property | Description |
197
+ * | :-- | :-- |
198
+ * | status | { error_code: number, reason: string } |
199
+ * | reason | '' |
200
+ *
201
+ * #### Example
202
+ *
203
+ * ```
204
+ * milvusClient.dropRole({roleName: 'myrole'});
205
+ * ```
206
+ */
207
+ dropRole(data) {
208
+ return __awaiter(this, void 0, void 0, function* () {
209
+ const promise = yield (0, __1.promisify)(this.client, 'DropRole', {
210
+ role_name: data.roleName,
211
+ }, data.timeout || this.timeout);
212
+ return promise;
213
+ });
214
+ }
215
+ /**
216
+ * add user to role
217
+ *
218
+ * @param data
219
+ * | Property | Type | Description |
220
+ * | :-- | :-- | :-- |
221
+ * | username | String | User name |
222
+ * | roleName | String | Role name |
223
+ * | 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 |
224
+ *
225
+ * @returns
226
+ * | Property | Description |
227
+ * | :-- | :-- |
228
+ * | status | { error_code: number, reason: string } |
229
+ * | reason | '' |
230
+ *
231
+ * #### Example
232
+ *
233
+ * ```
234
+ * milvusClient.addUserToRole({username: 'my', roleName: 'myrole'});
235
+ * ```
236
+ */
237
+ addUserToRole(data) {
238
+ return __awaiter(this, void 0, void 0, function* () {
239
+ const promise = yield (0, __1.promisify)(this.client, 'OperateUserRole', {
240
+ username: data.username,
241
+ role_name: data.roleName,
242
+ type: __1.OperateUserRoleType.AddUserToRole,
243
+ }, data.timeout || this.timeout);
244
+ return promise;
245
+ });
246
+ }
247
+ /**
248
+ * remove user from role
249
+ *
250
+ * @param data
251
+ * | Property | Type | Description |
252
+ * | :-- | :-- | :-- |
253
+ * | username | String | User name |
254
+ * | roleName | String | Role name |
255
+ * | 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 |
256
+ *
257
+ * @returns
258
+ * | Property | Description |
259
+ * | :-- | :-- |
260
+ * | status | { error_code: number, reason: string } |
261
+ * | reason | '' |
262
+ *
263
+ * #### Example
264
+ *
265
+ * ```
266
+ * milvusClient.removeUserFromRole({username: 'my', roleName: 'myrole'});
267
+ * ```
268
+ */
269
+ removeUserFromRole(data) {
270
+ return __awaiter(this, void 0, void 0, function* () {
271
+ const promise = yield (0, __1.promisify)(this.client, 'OperateUserRole', {
272
+ username: data.username,
273
+ role_name: data.roleName,
274
+ type: __1.OperateUserRoleType.RemoveUserFromRole,
275
+ }, data.timeout || this.timeout);
276
+ return promise;
277
+ });
278
+ }
279
+ /**
280
+ * gets all users that belong to a specified role
281
+ *
282
+ * @param data
283
+ * | Property | Type | Description |
284
+ * | :-- | :-- | :-- |
285
+ * | roleName | String | Role name |
286
+ * | includeUserInfo? | boolean | should result including user info, by default: true |
287
+ * | 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 |
288
+
289
+ * @returns
290
+ * | Property | Description |
291
+ * | :-- | :-- |
292
+ * | status | { error_code: number, reason: string } |
293
+ * | results | { users: {name: string}[]; role: {name: string} }[] |
294
+ *
295
+ * #### Example
296
+ *
297
+ * ```
298
+ * milvusClient.selectRole({roleName: 'myrole'});
299
+ * ```
300
+ */
301
+ selectRole(data) {
302
+ return __awaiter(this, void 0, void 0, function* () {
303
+ const promise = yield (0, __1.promisify)(this.client, 'SelectRole', {
304
+ role: { name: data.roleName },
305
+ include_user_info: data.includeUserInfo || true,
306
+ }, data.timeout || this.timeout);
307
+ return promise;
308
+ });
309
+ }
310
+ /**
311
+ * list all roles
312
+ *
313
+ * @param data
314
+ * | Property | Type | Description |
315
+ * | :-- | :-- | :-- |
316
+ * | 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 |
317
+ *
318
+ * @returns
319
+ * | Property | Description |
320
+ * | :-- | :-- |
321
+ * | status | { error_code: number, reason: string } |
322
+ * | reason | '' |
323
+ *
324
+ * #### Example
325
+ *
326
+ * ```
327
+ * milvusClient.listRoles();
328
+ * ```
329
+ */
330
+ listRoles(data) {
331
+ return __awaiter(this, void 0, void 0, function* () {
332
+ const promise = yield (0, __1.promisify)(this.client, 'SelectRole', {}, (data === null || data === void 0 ? void 0 : data.timeout) || this.timeout);
333
+ return promise;
334
+ });
335
+ }
336
+ /**
337
+ * gets all users that belong to a specified role
338
+ *
339
+ * @param data
340
+ * | Property | Type | Description |
341
+ * | :-- | :-- | :-- |
342
+ * | userName | String | User name |
343
+ * | includeUserInfo? | boolean | should result including user info, by default: true |
344
+ * | 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 |
345
+ *
346
+ * @returns
347
+ * | Property | Description |
348
+ * | :-- | :-- |
349
+ * | status | { error_code: number, reason: string } |
350
+ * | results | user: {name: string}; roles: {name: string}[] |
351
+ *
352
+ * #### Example
353
+ *
354
+ * ```
355
+ * milvusClient.selectUser({username: 'name'});
356
+ * ```
357
+ */
358
+ selectUser(data) {
359
+ return __awaiter(this, void 0, void 0, function* () {
360
+ const promise = yield (0, __1.promisify)(this.client, 'SelectUser', {
361
+ user: { name: data.username },
362
+ include_role_info: data.includeRoleInfo || true,
363
+ }, data.timeout || this.timeout);
364
+ return promise;
365
+ });
366
+ }
367
+ /**
368
+ * grant privileges to a role
369
+ *
370
+ * @param data
371
+ * | Property | Type | Description |
372
+ * | :-- | :-- | :-- |
373
+ * | roleName | String | Role name |
374
+ * | object | string | Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive.|
375
+ * | objectName | string | Name of the object to which the role is granted the specified prvilege. |
376
+ * | privilegeName | string | Name of the privilege to be granted to the role. This parameter is case-sensitive. |
377
+ * | 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 |
378
+ *
379
+ * @returns
380
+ * | Property | Description |
381
+ * | :-- | :-- |
382
+ * | status | { error_code: number, reason: string } |
383
+ * | reason | '' |
384
+ *
385
+ * #### Example
386
+ *
387
+ * ```
388
+ * milvusClient.grantRolePrivilege({
389
+ * roleName: 'roleName',
390
+ * object: '*',
391
+ * objectName: 'Collection',
392
+ * privilegeName: 'CreateIndex'
393
+ * });
394
+ * ```
395
+ */
396
+ grantRolePrivilege(data) {
397
+ return __awaiter(this, void 0, void 0, function* () {
398
+ const promise = yield (0, __1.promisify)(this.client, 'OperatePrivilege', {
399
+ entity: {
400
+ role: { name: data.roleName },
401
+ object: { name: data.object },
402
+ object_name: data.objectName,
403
+ grantor: {
404
+ privilege: { name: data.privilegeName },
405
+ },
406
+ },
407
+ type: __1.OperatePrivilegeType.Grant,
408
+ }, data.timeout || this.timeout);
409
+ return promise;
410
+ });
411
+ }
412
+ /**
413
+ * revoke privileges to a role
414
+ *
415
+ * @param data
416
+ * | Property | Type | Description |
417
+ * | :-- | :-- | :-- |
418
+ * | roleName | String | Role name |
419
+ * | object | string | Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive.|
420
+ * | objectName | string | Name of the object to which the role is granted the specified prvilege. |
421
+ * | privilegeName | string | Name of the privilege to be granted to the role. This parameter is case-sensitive. |
422
+ * | 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 |
423
+ *
424
+ * @returns
425
+ * | Property | Description |
426
+ * | :------------- | :-------- |
427
+ * | status | { error_code: number, reason: string } |
428
+ * | reason | '' |
429
+ *
430
+ * #### Example
431
+ *
432
+ * ```
433
+ * milvusClient.grantRolePrivilege({
434
+ * roleName: 'roleName',
435
+ * object: '*',
436
+ * objectName: 'Collection',
437
+ * privilegeName: 'CreateIndex'
438
+ * });
439
+ * ```
440
+ */
441
+ revokeRolePrivilege(data) {
442
+ return __awaiter(this, void 0, void 0, function* () {
443
+ const promise = yield (0, __1.promisify)(this.client, 'OperatePrivilege', {
444
+ entity: {
445
+ role: { name: data.roleName },
446
+ object: { name: data.object },
447
+ object_name: data.objectName,
448
+ grantor: {
449
+ privilege: { name: data.privilegeName },
450
+ },
451
+ },
452
+ type: __1.OperatePrivilegeType.Revoke,
453
+ }, data.timeout || this.timeout);
454
+ return promise;
455
+ });
456
+ }
457
+ /**
458
+ * revoke all roles priviledges
459
+ * @param data
460
+ * | Property | Type | Description |
461
+ * | :-- | :-- | :-- |
462
+ * | 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 |
463
+ *
464
+ * @returns
465
+ * | Property | Description |
466
+ * | :-- | :-- |
467
+ * | status | { error_code: number, reason: string } |
468
+ * | reason | '' |
469
+ *
470
+ * #### Example
471
+ *
472
+ * ```
473
+ * milvusClient.revokeAllRolesPrivileges();
474
+ * ```
475
+ */
476
+ /* istanbul ignore next */
477
+ dropAllRoles(data) {
478
+ return __awaiter(this, void 0, void 0, function* () {
479
+ // find all roles
480
+ const res = yield this.listRoles({ timeout: data === null || data === void 0 ? void 0 : data.timeout });
481
+ const promises = [];
482
+ // iterate through roles
483
+ for (let i = 0; i < res.results.length; i++) {
484
+ const r = res.results[i];
485
+ // get all grants that specific to the role
486
+ const grants = yield this.listGrants({
487
+ roleName: r.role.name,
488
+ });
489
+ // iterate throught these grant
490
+ for (let j = 0; j < grants.entities.length; j++) {
491
+ const entity = grants.entities[j];
492
+ // revoke grant
493
+ yield this.revokeRolePrivilege({
494
+ roleName: entity.role.name,
495
+ object: entity.object.name,
496
+ objectName: entity.object_name,
497
+ privilegeName: entity.grantor.privilege.name,
498
+ timeout: data === null || data === void 0 ? void 0 : data.timeout,
499
+ });
500
+ }
501
+ promises.push(
502
+ // drop the role
503
+ yield this.dropRole({
504
+ roleName: r.role.name,
505
+ timeout: data === null || data === void 0 ? void 0 : data.timeout,
506
+ }));
507
+ }
508
+ return promises;
509
+ });
510
+ }
511
+ /**
512
+ * select a grant
513
+ * @param data
514
+ * | Property | Type | Description |
515
+ * | :-- | :-- | :-- |
516
+ * | roleName | String | Role name |
517
+ * | object | string | Type of the operational object to which the specified privilege belongs, such as Collection, Index, Partition, etc. This parameter is case-sensitive.|
518
+ * | objectName | string | Name of the object to which the role is granted the specified prvilege. |
519
+ * | privilegeName | string | Name of the privilege to be granted to the role. This parameter is case-sensitive. |
520
+ * | 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 |
521
+ *
522
+ * @returns
523
+ * | Property | Description |
524
+ * | :-- | :-- |
525
+ * | status | { error_code: number, reason: string } |
526
+ * | reason | '' |
527
+ *
528
+ * #### Example
529
+ *
530
+ * ```
531
+ * milvusClient.selectGrant({
532
+ * roleName: 'roleName',
533
+ * object: '*',
534
+ * objectName: 'Collection',
535
+ * privilegeName: 'CreateIndex'
536
+ * });
537
+ * ```
538
+ */
539
+ selectGrant(data) {
540
+ return __awaiter(this, void 0, void 0, function* () {
541
+ const promise = yield (0, __1.promisify)(this.client, 'SelectGrant', {
542
+ entity: {
543
+ role: { name: data.roleName },
544
+ object: { name: data.object },
545
+ object_name: data.objectName,
546
+ grantor: {
547
+ privilege: { name: data.privilegeName },
548
+ },
549
+ },
550
+ }, data.timeout || this.timeout);
551
+ return promise;
552
+ });
553
+ }
554
+ /**
555
+ * list all grants for a role
556
+ * @param data
557
+ * | Property | Type | Description |
558
+ * | :-- | :-- | :-- |
559
+ * | roleName | String | Role name |
560
+ * | 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 |
561
+ *
562
+ * @returns
563
+ * | Property | Description |
564
+ * | :-- | :-- |
565
+ * | status | { error_code: number, reason: string } |
566
+ * | reason | '' |
567
+ *
568
+ * #### Example
569
+ *
570
+ * ```
571
+ * milvusClient.listGrants({
572
+ * roleName: 'roleName',
573
+ * });
574
+ * ```
575
+ */
576
+ listGrants(data) {
577
+ return __awaiter(this, void 0, void 0, function* () {
578
+ const promise = yield (0, __1.promisify)(this.client, 'SelectGrant', {
579
+ entity: {
580
+ role: { name: data.roleName },
581
+ },
582
+ }, data.timeout || this.timeout);
583
+ return promise;
584
+ });
585
+ }
586
+ /**
587
+ * check if the role is existing
588
+ * @param data
589
+ * | Property | Type | Description |
590
+ * | :-- | :-- | :-- |
591
+ * | roleName | String | Role name |
592
+ * | 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 |
593
+ *
594
+ * @returns
595
+ * | Property | Description |
596
+ * | :-- | :-- |
597
+ * | status | { error_code: number, reason: string } |
598
+ * | reason | '' |
599
+ *
600
+ * #### Example
601
+ *
602
+ * ```
603
+ * milvusClient.hasRole({
604
+ * roleName: 'roleName',
605
+ * });
606
+ * ```
607
+ */
608
+ hasRole(data) {
609
+ return __awaiter(this, void 0, void 0, function* () {
610
+ const result = yield this.listRoles();
611
+ return {
612
+ status: result.status,
613
+ hasRole: result.results.map(r => r.role.name).includes(data.roleName),
614
+ };
615
+ });
616
+ }
617
+ }
618
+ exports.User = User;
619
+ //# sourceMappingURL=User.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"User.js","sourceRoot":"","sources":["../../../milvus/grpc/User.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yCAAsC;AACtC,2BA2Ba;AAEb,MAAa,IAAK,SAAQ,mBAAQ;IAChC;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACG,UAAU,CAAC,IAAmB;;YAClC,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,IAAI,IAAI,CAAC,QAAQ,KAAK,SAAS,EAAE;gBAC9D,MAAM,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,EACb;gBACE,MAAM,EAAE;oBACN,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,CAAC,QAAQ,EAAE;iBAC9B;aACF,EACD,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO,CAC7B,CAAC;YAEF,OAAO,OAAO,CAAC;QACjB,CAAC;KAAA;IAED;;;;;;;;;;;;;;;;;;;;;OAqBG;IACG,OAAO,CAAC,IAAgB;;YAC5B,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,SAAS,EAAE,CAAC;YAEtC,OAAO;gBACL,MAAM,EAAE,MAAM,CAAC,MAAM;gBACrB,OAAO,EAAE,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,IAAI,CAAC,QAAQ,CAAC;aACtE,CAAC;QACJ,CAAC;KAAA;CACF;AAnqBD,oBAmqBC"}
@@ -1,14 +1,5 @@
1
- export * from './const/ErrorReason';
2
- export * from './const/Milvus';
3
- export * from './types/Collection';
4
- export * from './types/Data';
5
- export * from './types/Common';
6
- export * from './types/Index';
7
- export * from './types/Partition';
8
- export * from './types/Response';
9
- export * from './types/User';
10
- export * from './types/Resource';
11
- export * from './types/Client';
12
- export * from './BaseClient';
13
- export * from './GrpcClient';
1
+ export * from './const';
2
+ export * from './utils';
3
+ export * from './types';
4
+ export * from './grpc/GrpcClient';
14
5
  export * from './MilvusClient';
@@ -15,20 +15,12 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  // consts
18
- __exportStar(require("./const/ErrorReason"), exports);
19
- __exportStar(require("./const/Milvus"), exports);
18
+ __exportStar(require("./const"), exports);
19
+ // utils
20
+ __exportStar(require("./utils"), exports);
20
21
  // types
21
- __exportStar(require("./types/Collection"), exports);
22
- __exportStar(require("./types/Data"), exports);
23
- __exportStar(require("./types/Common"), exports);
24
- __exportStar(require("./types/Index"), exports);
25
- __exportStar(require("./types/Partition"), exports);
26
- __exportStar(require("./types/Response"), exports);
27
- __exportStar(require("./types/User"), exports);
28
- __exportStar(require("./types/Resource"), exports);
29
- __exportStar(require("./types/Client"), exports);
30
- // client
31
- __exportStar(require("./BaseClient"), exports);
32
- __exportStar(require("./GrpcClient"), exports);
22
+ __exportStar(require("./types"), exports);
23
+ // clients
24
+ __exportStar(require("./grpc/GrpcClient"), exports);
33
25
  __exportStar(require("./MilvusClient"), exports);
34
26
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../milvus/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,SAAS;AACT,sDAAoC;AACpC,iDAA+B;AAC/B,QAAQ;AACR,qDAAmC;AACnC,+CAA6B;AAC7B,iDAA+B;AAC/B,gDAA8B;AAC9B,oDAAkC;AAClC,mDAAiC;AACjC,+CAA6B;AAC7B,mDAAiC;AACjC,iDAA+B;AAC/B,SAAS;AACT,+CAA6B;AAC7B,+CAA6B;AAC7B,iDAA+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"}