@turinhub/tale-js-sdk 1.3.0 → 2.0.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.
Files changed (46) hide show
  1. package/README.md +6 -6
  2. package/dist/acl/index.d.ts +62 -49
  3. package/dist/acl/index.js +262 -67
  4. package/dist/acl/types.d.ts +63 -98
  5. package/dist/attachment/index.d.ts +17 -0
  6. package/dist/attachment/index.js +247 -0
  7. package/dist/attachment/types.d.ts +82 -0
  8. package/dist/attachment/types.js +1 -0
  9. package/dist/attachment-type/index.d.ts +15 -0
  10. package/dist/attachment-type/index.js +203 -0
  11. package/dist/attachment-type/types.d.ts +60 -0
  12. package/dist/attachment-type/types.js +1 -0
  13. package/dist/auth/index.d.ts +21 -21
  14. package/dist/auth/index.js +66 -66
  15. package/dist/auth/types.d.ts +51 -51
  16. package/dist/cms/file.d.ts +88 -70
  17. package/dist/cms/file.js +228 -77
  18. package/dist/cms/folder.d.ts +9 -9
  19. package/dist/cms/folder.js +18 -18
  20. package/dist/cms/types.d.ts +58 -38
  21. package/dist/common/types.d.ts +47 -63
  22. package/dist/index.d.ts +4 -1
  23. package/dist/index.js +2 -0
  24. package/dist/rbac/index.d.ts +37 -42
  25. package/dist/rbac/index.js +96 -98
  26. package/dist/rbac/types.d.ts +38 -40
  27. package/dist/status.d.ts +11 -11
  28. package/dist/status.js +30 -3
  29. package/dist/task/index.d.ts +15 -147
  30. package/dist/task/index.js +170 -161
  31. package/dist/task/types.d.ts +57 -81
  32. package/dist/task-type/index.d.ts +7 -7
  33. package/dist/task-type/index.js +12 -12
  34. package/dist/task-type/types.d.ts +18 -34
  35. package/dist/token.d.ts +3 -3
  36. package/dist/token.js +4 -4
  37. package/dist/user/index.d.ts +28 -29
  38. package/dist/user/index.js +69 -74
  39. package/dist/user/types.d.ts +32 -33
  40. package/dist/user-attribute/index.d.ts +4 -7
  41. package/dist/user-attribute/index.js +19 -22
  42. package/dist/user-attribute/types.d.ts +29 -29
  43. package/dist/user-group/index.d.ts +4 -223
  44. package/dist/user-group/index.js +61 -479
  45. package/dist/user-group/types.d.ts +1 -1
  46. package/package.json +1 -1
@@ -20,7 +20,7 @@ import { ApiError, ConfigurationError, NetworkError } from "../errors.js";
20
20
  * nickname: 'John Doe',
21
21
  * email: 'john@example.com'
22
22
  * });
23
- * console.log('User created:', result.user.user_id);
23
+ * console.log('User created:', result.user.userId);
24
24
  * } catch (error) {
25
25
  * console.error('Failed to create user:', error.message);
26
26
  * }
@@ -39,7 +39,7 @@ export async function createUser(userData, options) {
39
39
  if (!base) {
40
40
  throw new ConfigurationError("Missing required environment variable: TALE_BASE_URL");
41
41
  }
42
- const url = String(base).replace(/\/+$/, "") + "/account/v1/user";
42
+ const url = String(base).replace(/\/+$/, "") + "/account/v2/user";
43
43
  let response;
44
44
  try {
45
45
  response = await globalThis.fetch(url, {
@@ -76,7 +76,7 @@ export async function createUser(userData, options) {
76
76
  /**
77
77
  * Retrieves user information by ID or open ID.
78
78
  *
79
- * @param userId - Optional user ID (open_id) to query. If not provided, returns current user info
79
+ * @param userId - Optional user ID (openId) to query. If not provided, returns current user info
80
80
  * @param options - Optional parameters for inclusion flags and configuration
81
81
  * @returns Promise resolving to the user information
82
82
  * @throws {ConfigurationError} When required environment variables are missing
@@ -88,7 +88,7 @@ export async function createUser(userData, options) {
88
88
  * import { getUserById } from '@tale/client';
89
89
  *
90
90
  * try {
91
- * const result = await getUserById('user_open_id_here');
91
+ * const result = await getUserById('userOpenId_here');
92
92
  * console.log('User info:', result.user.username);
93
93
  * } catch (error) {
94
94
  * console.error('Failed to get user:', error.message);
@@ -105,14 +105,14 @@ export async function getUserById(userId, options) {
105
105
  throw new ConfigurationError("Missing required environment variable: TALE_BASE_URL");
106
106
  }
107
107
  // Build URL with query parameters
108
- const url = new URL(String(base).replace(/\/+$/, "") + "/account/v1/user");
108
+ const url = new URL(String(base).replace(/\/+$/, "") + "/account/v2/user");
109
109
  // Add query parameters
110
110
  const queryParams = {
111
- user_id: userId,
112
- include_rbac: true,
113
- include_login_methods: true,
114
- include_user_groups: true,
115
- include_acl: false,
111
+ userId: userId,
112
+ includeRbac: true,
113
+ includeLoginMethods: true,
114
+ includeUserGroups: true,
115
+ includeAcl: false,
116
116
  ...options,
117
117
  };
118
118
  Object.entries(queryParams).forEach(([key, value]) => {
@@ -155,7 +155,7 @@ export async function getUserById(userId, options) {
155
155
  /**
156
156
  * Deletes a user by ID or open ID.
157
157
  *
158
- * @param userId - User ID (open_id) to delete
158
+ * @param userId - User ID (openId) to delete
159
159
  * @param options - Optional configuration for the request
160
160
  * @returns Promise resolving to the deletion result
161
161
  * @throws {ConfigurationError} When required environment variables are missing
@@ -167,7 +167,7 @@ export async function getUserById(userId, options) {
167
167
  * import { deleteUser } from '@tale/client';
168
168
  *
169
169
  * try {
170
- * const result = await deleteUser('user_open_id_here');
170
+ * const result = await deleteUser('userOpenId_here');
171
171
  * console.log('User deleted:', result.deleted);
172
172
  * } catch (error) {
173
173
  * console.error('Failed to delete user:', error.message);
@@ -177,7 +177,7 @@ export async function getUserById(userId, options) {
177
177
  export async function deleteUser(userId, options) {
178
178
  // Validate required fields
179
179
  if (!userId || userId.trim() === "") {
180
- throw new ApiError("user_id is required for deletion", 400, "9400");
180
+ throw new ApiError("userId is required for deletion", 400, "9400");
181
181
  }
182
182
  // Use provided app token or get one from token service
183
183
  const token = options?.appToken ?? (await getAppToken(options));
@@ -188,7 +188,7 @@ export async function deleteUser(userId, options) {
188
188
  throw new ConfigurationError("Missing required environment variable: TALE_BASE_URL");
189
189
  }
190
190
  const url = String(base).replace(/\/+$/, "") +
191
- `/account/v1/users/${encodeURIComponent(userId)}`;
191
+ `/account/v2/users/${encodeURIComponent(userId)}`;
192
192
  let response;
193
193
  try {
194
194
  response = await globalThis.fetch(url, {
@@ -239,10 +239,9 @@ export async function deleteUser(userId, options) {
239
239
  * page: 0,
240
240
  * size: 20,
241
241
  * keyword: 'john',
242
- * sort_by: 'username',
243
- * sort_direction: 'asc'
242
+ * sort: 'username,asc'
244
243
  * });
245
- * console.log(`Found ${result.totalElements} users`);
244
+ * console.log(`Found ${result.total} users`);
246
245
  * console.log('First user:', result.content[0].user.username);
247
246
  * } catch (error) {
248
247
  * console.error('Failed to list users:', error.message);
@@ -259,25 +258,24 @@ export async function listUsers(options) {
259
258
  throw new ConfigurationError("Missing required environment variable: TALE_BASE_URL");
260
259
  }
261
260
  // Build URL with query parameters
262
- const url = new URL(String(base).replace(/\/+$/, "") + "/account/v1/users");
261
+ const url = new URL(String(base).replace(/\/+$/, "") + "/account/v2/users");
263
262
  // Add query parameters with defaults
264
263
  const queryParams = {
265
264
  page: 0,
266
265
  size: 20,
267
- sort_by: "createdAt",
268
- sort_direction: "desc",
269
- include_attributes: false,
266
+ sort: "createdAt,desc",
267
+ includeAttributes: false,
270
268
  ...options,
271
269
  };
272
270
  // Handle array parameters (need to be comma-separated)
273
- if (queryParams.user_groups && queryParams.user_groups.length > 0) {
274
- url.searchParams.append("user_groups", queryParams.user_groups.join(","));
271
+ if (queryParams.userGroups && queryParams.userGroups.length > 0) {
272
+ url.searchParams.append("userGroups", queryParams.userGroups.join(","));
275
273
  }
276
- if (queryParams.user_roles && queryParams.user_roles.length > 0) {
277
- url.searchParams.append("user_roles", queryParams.user_roles.join(","));
274
+ if (queryParams.userRoles && queryParams.userRoles.length > 0) {
275
+ url.searchParams.append("userRoles", queryParams.userRoles.join(","));
278
276
  }
279
- if (queryParams.user_ids && queryParams.user_ids.length > 0) {
280
- url.searchParams.append("user_ids", queryParams.user_ids.join(","));
277
+ if (queryParams.userIds && queryParams.userIds.length > 0) {
278
+ url.searchParams.append("userIds", queryParams.userIds.join(","));
281
279
  }
282
280
  // Add other parameters
283
281
  if (queryParams.page !== undefined) {
@@ -286,17 +284,14 @@ export async function listUsers(options) {
286
284
  if (queryParams.size !== undefined) {
287
285
  url.searchParams.append("size", String(queryParams.size));
288
286
  }
289
- if (queryParams.sort_by) {
290
- url.searchParams.append("sort_by", queryParams.sort_by);
291
- }
292
- if (queryParams.sort_direction) {
293
- url.searchParams.append("sort_direction", queryParams.sort_direction);
287
+ if (queryParams.sort) {
288
+ url.searchParams.append("sort", queryParams.sort);
294
289
  }
295
290
  if (queryParams.keyword) {
296
291
  url.searchParams.append("keyword", queryParams.keyword);
297
292
  }
298
- if (queryParams.include_attributes !== undefined) {
299
- url.searchParams.append("include_attributes", String(queryParams.include_attributes));
293
+ if (queryParams.includeAttributes !== undefined) {
294
+ url.searchParams.append("includeAttributes", String(queryParams.includeAttributes));
300
295
  }
301
296
  let response;
302
297
  try {
@@ -333,7 +328,7 @@ export async function listUsers(options) {
333
328
  /**
334
329
  * Updates user information by user ID or open ID.
335
330
  *
336
- * @param userId - User ID (open_id) to update
331
+ * @param userId - User ID (openId) to update
337
332
  * @param userData - User data to update
338
333
  * @param options - Optional configuration for the request
339
334
  * @returns Promise resolving to the update result
@@ -346,8 +341,8 @@ export async function listUsers(options) {
346
341
  * import { updateUser } from '@tale/client';
347
342
  *
348
343
  * try {
349
- * const result = await updateUser('user_open_id_here', {
350
- * nick_name: 'John Doe',
344
+ * const result = await updateUser('userOpenId_here', {
345
+ * nickName: 'John Doe',
351
346
  * email: 'john@example.com'
352
347
  * });
353
348
  * console.log('User updated:', result.success);
@@ -370,7 +365,7 @@ export async function updateUser(userId, userData, options) {
370
365
  throw new ConfigurationError("Missing required environment variable: TALE_BASE_URL");
371
366
  }
372
367
  const url = String(base).replace(/\/+$/, "") +
373
- `/account/v1/user/${encodeURIComponent(userId)}`;
368
+ `/account/v2/user/${encodeURIComponent(userId)}`;
374
369
  let response;
375
370
  try {
376
371
  response = await globalThis.fetch(url, {
@@ -400,13 +395,13 @@ export async function updateUser(userId, userData, options) {
400
395
  }
401
396
  return {
402
397
  success: true,
403
- user_id: userId,
398
+ userId: userId,
404
399
  };
405
400
  }
406
401
  /**
407
402
  * Updates user password.
408
403
  *
409
- * @param passwordData - Password data including user_id and encrypted password
404
+ * @param passwordData - Password data including userId and encrypted password
410
405
  * @param options - Optional configuration for the request
411
406
  * @returns Promise resolving to the update result
412
407
  * @throws {ConfigurationError} When required environment variables are missing
@@ -419,8 +414,8 @@ export async function updateUser(userId, userData, options) {
419
414
  *
420
415
  * try {
421
416
  * const result = await updateUserPassword({
422
- * user_id: 'user_open_id_here',
423
- * password_encrypted: 'encrypted_password_here'
417
+ * userId: 'userOpenId_here',
418
+ * passwordEncrypted: 'encrypted_password_here'
424
419
  * });
425
420
  * console.log('Password updated:', result.success);
426
421
  * } catch (error) {
@@ -430,12 +425,12 @@ export async function updateUser(userId, userData, options) {
430
425
  */
431
426
  export async function updateUserPassword(passwordData, options) {
432
427
  // Validate required fields
433
- if (!passwordData.user_id || passwordData.user_id.trim() === "") {
434
- throw new ApiError("user_id is required for password update", 400, "9400");
428
+ if (!passwordData.userId || passwordData.userId.trim() === "") {
429
+ throw new ApiError("userId is required for password update", 400, "9400");
435
430
  }
436
- if (!passwordData.password_encrypted ||
437
- passwordData.password_encrypted.trim() === "") {
438
- throw new ApiError("password_encrypted is required", 400, "9400");
431
+ if (!passwordData.passwordEncrypted ||
432
+ passwordData.passwordEncrypted.trim() === "") {
433
+ throw new ApiError("passwordEncrypted is required", 400, "9400");
439
434
  }
440
435
  // Use provided app token or get one from token service
441
436
  const token = options?.appToken ?? (await getAppToken(options));
@@ -445,7 +440,7 @@ export async function updateUserPassword(passwordData, options) {
445
440
  if (!base) {
446
441
  throw new ConfigurationError("Missing required environment variable: TALE_BASE_URL");
447
442
  }
448
- const url = String(base).replace(/\/+$/, "") + "/account/v1/user/password";
443
+ const url = String(base).replace(/\/+$/, "") + "/account/v2/user/password";
449
444
  let response;
450
445
  try {
451
446
  response = await globalThis.fetch(url, {
@@ -475,14 +470,14 @@ export async function updateUserPassword(passwordData, options) {
475
470
  }
476
471
  return {
477
472
  success: true,
478
- user_id: passwordData.user_id,
473
+ userId: passwordData.userId,
479
474
  };
480
475
  }
481
476
  /**
482
477
  * Uploads user avatar image.
483
478
  *
484
479
  * @param file - File object to upload as avatar
485
- * @param userId - User ID (open_id) of the user
480
+ * @param userId - User ID (openId) of the user
486
481
  * @param options - Optional configuration for the request
487
482
  * @returns Promise resolving to the upload result with avatar OSS key
488
483
  * @throws {ConfigurationError} When required environment variables are missing
@@ -496,8 +491,8 @@ export async function updateUserPassword(passwordData, options) {
496
491
  * try {
497
492
  * const fileInput = document.querySelector('input[type="file"]');
498
493
  * const file = fileInput.files[0];
499
- * const result = await uploadAvatar(file, 'user_open_id_here');
500
- * console.log('Avatar uploaded:', result.avatar_oss_key);
494
+ * const result = await uploadAvatar(file, 'userOpenId_here');
495
+ * console.log('Avatar uploaded:', result.avatarOssKey);
501
496
  * } catch (error) {
502
497
  * console.error('Failed to upload avatar:', error.message);
503
498
  * }
@@ -519,11 +514,11 @@ export async function uploadAvatar(file, userId, options) {
519
514
  if (!base) {
520
515
  throw new ConfigurationError("Missing required environment variable: TALE_BASE_URL");
521
516
  }
522
- const url = String(base).replace(/\/+$/, "") + "/account/v1/user/avatar/upload";
517
+ const url = String(base).replace(/\/+$/, "") + "/account/v2/user/avatar/upload";
523
518
  // Create FormData
524
519
  const formData = new FormData();
525
520
  formData.append("file", file);
526
- formData.append("user_open_id", userId);
521
+ formData.append("userOpenId", userId);
527
522
  let response;
528
523
  try {
529
524
  response = await globalThis.fetch(url, {
@@ -551,8 +546,8 @@ export async function uploadAvatar(file, userId, options) {
551
546
  throw new ApiError(errorMsg, response.status, json.code);
552
547
  }
553
548
  // Validate response structure
554
- if (!json.data || !json.data.avatar_oss_key) {
555
- throw new ApiError("Invalid avatar upload response: missing avatar_oss_key", response.status);
549
+ if (!json.data || !json.data.avatarOssKey) {
550
+ throw new ApiError("Invalid avatar upload response: missing avatarOssKey", response.status);
556
551
  }
557
552
  return json.data;
558
553
  }
@@ -629,8 +624,8 @@ export async function getAvatarPresignedUrl(ossKey, options) {
629
624
  /**
630
625
  * Updates user frozen status (freeze or unfreeze a user account).
631
626
  *
632
- * @param userId - User ID (open_id) to update frozen status
633
- * @param frozenData - Frozen status data including is_frozen flag and optional remark
627
+ * @param userId - User ID (openId) to update frozen status
628
+ * @param frozenData - Frozen status data including isFrozen flag and optional remark
634
629
  * @param options - Optional configuration for the request
635
630
  * @returns Promise resolving to the updated frozen status information
636
631
  * @throws {ConfigurationError} When required environment variables are missing
@@ -643,18 +638,18 @@ export async function getAvatarPresignedUrl(ossKey, options) {
643
638
  *
644
639
  * try {
645
640
  * // Freeze a user account
646
- * const result = await updateUserFrozenStatus('user_open_id_here', {
647
- * is_frozen: true,
641
+ * const result = await updateUserFrozenStatus('userOpenId_here', {
642
+ * isFrozen: true,
648
643
  * remark: 'Violated community guidelines'
649
644
  * });
650
- * console.log('User frozen:', result.is_frozen);
645
+ * console.log('User frozen:', result.isFrozen);
651
646
  *
652
647
  * // Unfreeze a user account
653
- * const unfrozenResult = await updateUserFrozenStatus('user_open_id_here', {
654
- * is_frozen: false,
648
+ * const unfrozenResult = await updateUserFrozenStatus('userOpenId_here', {
649
+ * isFrozen: false,
655
650
  * remark: 'Account reactivated'
656
651
  * });
657
- * console.log('User unfrozen:', !unfrozenResult.is_frozen);
652
+ * console.log('User unfrozen:', !unfrozenResult.isFrozen);
658
653
  * } catch (error) {
659
654
  * console.error('Failed to update frozen status:', error.message);
660
655
  * }
@@ -665,8 +660,8 @@ export async function updateUserFrozenStatus(userId, frozenData, options) {
665
660
  if (!userId || userId.trim() === "") {
666
661
  throw new ApiError("userId is required for updating frozen status", 400, "9400");
667
662
  }
668
- if (frozenData.is_frozen === undefined || frozenData.is_frozen === null) {
669
- throw new ApiError("is_frozen is required", 400, "9400");
663
+ if (frozenData.isFrozen === undefined || frozenData.isFrozen === null) {
664
+ throw new ApiError("isFrozen is required", 400, "9400");
670
665
  }
671
666
  // Use provided app token or get one from token service
672
667
  const token = options?.appToken ?? (await getAppToken(options));
@@ -677,7 +672,7 @@ export async function updateUserFrozenStatus(userId, frozenData, options) {
677
672
  throw new ConfigurationError("Missing required environment variable: TALE_BASE_URL");
678
673
  }
679
674
  const url = String(base).replace(/\/+$/, "") +
680
- `/account/v1/user/${encodeURIComponent(userId)}/frozen-status`;
675
+ `/account/v2/user/${encodeURIComponent(userId)}/frozen-status`;
681
676
  let response;
682
677
  try {
683
678
  response = await globalThis.fetch(url, {
@@ -708,7 +703,7 @@ export async function updateUserFrozenStatus(userId, frozenData, options) {
708
703
  throw new ApiError(errorMsg, response.status, json.code);
709
704
  }
710
705
  // Validate response structure
711
- if (!json.data || json.data.user_id === undefined) {
706
+ if (!json.data || json.data.userId === undefined) {
712
707
  throw new ApiError("Invalid frozen status update response: missing required data", response.status);
713
708
  }
714
709
  return json.data;
@@ -716,7 +711,7 @@ export async function updateUserFrozenStatus(userId, frozenData, options) {
716
711
  /**
717
712
  * Gets user frozen status by user ID.
718
713
  *
719
- * @param userId - User ID (open_id) to query frozen status
714
+ * @param userId - User ID (openId) to query frozen status
720
715
  * @param options - Optional configuration for the request
721
716
  * @returns Promise resolving to the user frozen status information
722
717
  * @throws {ConfigurationError} When required environment variables are missing
@@ -728,10 +723,10 @@ export async function updateUserFrozenStatus(userId, frozenData, options) {
728
723
  * import { getUserFrozenStatus } from '@tale/client';
729
724
  *
730
725
  * try {
731
- * const status = await getUserFrozenStatus('user_open_id_here');
732
- * console.log('User is frozen:', status.is_frozen);
726
+ * const status = await getUserFrozenStatus('userOpenId_here');
727
+ * console.log('User is frozen:', status.isFrozen);
733
728
  * console.log('Remark:', status.remark);
734
- * console.log('Last updated:', status.updated_at);
729
+ * console.log('Last updated:', status.updatedAt);
735
730
  * } catch (error) {
736
731
  * console.error('Failed to get frozen status:', error.message);
737
732
  * }
@@ -751,7 +746,7 @@ export async function getUserFrozenStatus(userId, options) {
751
746
  throw new ConfigurationError("Missing required environment variable: TALE_BASE_URL");
752
747
  }
753
748
  const url = String(base).replace(/\/+$/, "") +
754
- `/account/v1/user/${encodeURIComponent(userId)}/frozen-status`;
749
+ `/account/v2/user/${encodeURIComponent(userId)}/frozen-status`;
755
750
  let response;
756
751
  try {
757
752
  response = await globalThis.fetch(url, {
@@ -779,7 +774,7 @@ export async function getUserFrozenStatus(userId, options) {
779
774
  throw new ApiError(errorMsg, response.status, json.code);
780
775
  }
781
776
  // Validate response structure
782
- if (!json.data || json.data.user_id === undefined) {
777
+ if (!json.data || json.data.userId === undefined) {
783
778
  throw new ApiError("Invalid frozen status response: missing required data", response.status);
784
779
  }
785
780
  return json.data;
@@ -3,12 +3,12 @@ import type { UserAttributeItemDTO } from "../user-attribute/types.js";
3
3
  export type { AppInfo, User, UserGroup, Role, Privilege, CommonOptions, PageResponse, UserAttributeItemDTO, };
4
4
  export interface CreateUserRequest {
5
5
  username: string;
6
- password_encrypted?: string;
6
+ passwordEncrypted?: string;
7
7
  nickname?: string;
8
8
  phone?: string;
9
9
  email?: string;
10
- avatar_url?: string;
11
- role_ids?: string[];
10
+ avatarUrl?: string;
11
+ roleIds?: string[];
12
12
  }
13
13
  export interface UserLoginMethod {
14
14
  method: string;
@@ -17,10 +17,10 @@ export interface UserLoginMethod {
17
17
  export interface CreateUserResponse {
18
18
  app: AppInfo;
19
19
  user: User;
20
- user_roles: Role[];
21
- user_privileges: Privilege[];
22
- user_groups: UserGroup[];
23
- user_login_methods: UserLoginMethod[];
20
+ userRoles: Role[];
21
+ userPrivileges: Privilege[];
22
+ userGroups: UserGroup[];
23
+ userLoginMethods: UserLoginMethod[];
24
24
  }
25
25
  export interface CreateUserJson {
26
26
  data: CreateUserResponse;
@@ -34,15 +34,15 @@ export interface CreateUserOptions {
34
34
  appToken?: string;
35
35
  }
36
36
  export interface GetUserRequest {
37
- user_id?: string;
38
- include_rbac?: boolean;
39
- include_login_methods?: boolean;
40
- include_user_groups?: boolean;
41
- include_acl?: boolean;
37
+ userId?: string;
38
+ includeRbac?: boolean;
39
+ includeLoginMethods?: boolean;
40
+ includeUserGroups?: boolean;
41
+ includeAcl?: boolean;
42
42
  }
43
43
  export interface DeleteUserResponse {
44
44
  deleted: boolean;
45
- user_id: string;
45
+ userId: string;
46
46
  }
47
47
  export interface DeleteUserJson {
48
48
  data: DeleteUserResponse;
@@ -52,21 +52,20 @@ export interface DeleteUserJson {
52
52
  export interface ListUsersRequest {
53
53
  page?: number;
54
54
  size?: number;
55
- sort_by?: string;
56
- sort_direction?: "asc" | "desc";
57
- user_groups?: string[];
58
- user_roles?: string[];
59
- user_ids?: string[];
55
+ sort?: string;
56
+ userGroups?: string[];
57
+ userRoles?: string[];
58
+ userIds?: string[];
60
59
  keyword?: string;
61
- include_attributes?: boolean;
60
+ includeAttributes?: boolean;
62
61
  }
63
62
  export interface UserListItem {
64
63
  app: AppInfo;
65
64
  user: User;
66
- user_roles: Role[];
67
- user_privileges: Privilege[];
68
- user_groups: UserGroup[];
69
- user_attributes?: UserAttributeItemDTO[];
65
+ userRoles: Role[];
66
+ userPrivileges: Privilege[];
67
+ userGroups: UserGroup[];
68
+ userAttributes?: UserAttributeItemDTO[];
70
69
  }
71
70
  export interface ListUsersResponse extends PageResponse<UserListItem> {
72
71
  content: UserListItem[];
@@ -78,14 +77,14 @@ export interface ListUsersJson {
78
77
  }
79
78
  export interface UpdateUserRequest {
80
79
  username?: string;
81
- nick_name?: string;
80
+ nickname?: string;
82
81
  email?: string;
83
82
  phone?: string;
84
83
  remark?: string;
85
84
  }
86
85
  export interface UpdateUserResponse {
87
86
  success: boolean;
88
- user_id: string;
87
+ userId: string;
89
88
  }
90
89
  export interface UpdateUserJson {
91
90
  data?: UpdateUserResponse;
@@ -93,12 +92,12 @@ export interface UpdateUserJson {
93
92
  msg: string;
94
93
  }
95
94
  export interface UpdateUserPasswordRequest {
96
- user_id: string;
97
- password_encrypted: string;
95
+ userId: string;
96
+ passwordEncrypted: string;
98
97
  }
99
98
  export interface UpdateUserPasswordResponse {
100
99
  success: boolean;
101
- user_id: string;
100
+ userId: string;
102
101
  }
103
102
  export interface UpdateUserPasswordJson {
104
103
  data?: UpdateUserPasswordResponse;
@@ -106,7 +105,7 @@ export interface UpdateUserPasswordJson {
106
105
  msg: string;
107
106
  }
108
107
  export interface UploadAvatarResponse {
109
- avatar_oss_key: string;
108
+ avatarOssKey: string;
110
109
  }
111
110
  export interface UploadAvatarJson {
112
111
  data: UploadAvatarResponse;
@@ -124,14 +123,14 @@ export interface AvatarPresignedUrlJson {
124
123
  msg: string;
125
124
  }
126
125
  export interface UpdateUserFrozenStatusRequest {
127
- is_frozen: boolean;
126
+ isFrozen: boolean;
128
127
  remark?: string;
129
128
  }
130
129
  export interface UserFrozenStatusResponse {
131
- user_id: string;
132
- is_frozen: boolean;
130
+ userId: string;
131
+ isFrozen: boolean;
133
132
  remark: string;
134
- updated_at: string;
133
+ updatedAt: string;
135
134
  }
136
135
  export interface UpdateUserFrozenStatusJson {
137
136
  data: UserFrozenStatusResponse;
@@ -14,10 +14,10 @@ export type { UserAttributeDefinition, UserAttributeDTO, UserAttributeItemDTO, U
14
14
  * @example
15
15
  * ```typescript
16
16
  * const definition = await createUserAttributeDefinition({
17
- * attribute_name: "department",
17
+ * attributeName: "department",
18
18
  * description: "User's department",
19
- * schema_definition: { type: "string" },
20
- * is_enabled: true,
19
+ * schemaDefinition: { type: "string" },
20
+ * isEnabled: true,
21
21
  * });
22
22
  * ```
23
23
  */
@@ -169,10 +169,7 @@ export declare function listUserAttributes(userId: string, request?: ListUserAtt
169
169
  * @throws {ApiError} When API request fails
170
170
  * @throws {NetworkError} When network request fails
171
171
  */
172
- export declare function listAttributeUsers(attributeDefinitionId: string, request?: ListUserAttributesRequest & UserAttributeOptions): Promise<{
173
- content: UserAttributeDTO[];
174
- totalElements: number;
175
- }>;
172
+ export declare function listAttributeUsers(attributeDefinitionId: string, request?: ListUserAttributesRequest & UserAttributeOptions): Promise<PageResponse<UserAttributeDTO>>;
176
173
  /**
177
174
  * Lists all user attributes grouped by user with pagination.
178
175
  *