easemob-websdk 4.6.0 → 4.7.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Changes to easemob chat
2
2
 
3
+ # 4.7.0 (April 26, 2024)
4
+
5
+ - `recallMessage` methods add custom field `ext` params.
6
+ - Adds `getJoinedChatRooms` method to get the current user has joined chat room list.
7
+ - Adds `logger.setConsoleLogVisibility` method to sets whether to output logs to the console.
8
+ - Fix `allowGroupAck` status error
3
9
 
4
10
  # 4.6.0 (April 2, 2024)
5
11
 
package/Easemob-chat.d.ts CHANGED
@@ -259,6 +259,13 @@ export declare namespace EasemobChat {
259
259
  }
260
260
  type GetChatRoomsResult = ChatRoomBaseInfo[];
261
261
 
262
+ type JoinedChatRoomInfo = Pick<
263
+ GetChatRoomDetailsResult,
264
+ 'id' | 'name' | 'owner' | 'created' | 'description' | 'maxusers'
265
+ >;
266
+
267
+ type JoinedChatRoomsResult = JoinedChatRoomInfo[];
268
+
262
269
  type BaseMembers = { member: string } | { owner: string };
263
270
 
264
271
  interface GetChatRoomDetailsResult {
@@ -1530,11 +1537,11 @@ export declare namespace EasemobChat {
1530
1537
  open(parameters: {
1531
1538
  /** The User ID. */
1532
1539
  user: string;
1533
- /** The password. It is recommended to use `accessToken` params. */
1540
+ /** @deprecated The password. It is recommended to use `accessToken` params.*/
1534
1541
  pwd?: string;
1535
1542
  /** Token required to connect to the message service. */
1536
1543
  accessToken?: string;
1537
- /** @deprecated Use 'accessToken' instead. */
1544
+ /** @deprecated It is recommended to use `accessToken` params. */
1538
1545
  agoraToken?: string;
1539
1546
  success?: (res: any) => void;
1540
1547
  error?: (res: any) => void;
@@ -2712,7 +2719,7 @@ export declare namespace EasemobChat {
2712
2719
  * Lists all the groups a user has joined.
2713
2720
  *
2714
2721
  * @note
2715
- * If either `needAffiliations` or `needAffiliations` is set `true`, when you get data with pagination, the current page number (pageNum) starts from 0 and you can get a maximum of 20 groups (pageSize) on each page and
2722
+ * If either `needAffiliations` or `needRole` is set `true`, when you get data with pagination, the current page number (pageNum) starts from 0 and you can get a maximum of 20 groups (pageSize) on each page and
2716
2723
  * the function return type is `Promise<AsyncResult<GroupTypes.GroupInfo[]>`
2717
2724
  *
2718
2725
  * If neither of the parameters is set, when you get data with pagination, the current page number (pageNum) starts from 1 and you can get a maximum of 500 groups (pageSize) on each page and and
@@ -2731,13 +2738,13 @@ export declare namespace EasemobChat {
2731
2738
  this: Connection,
2732
2739
  params: {
2733
2740
  /**
2734
- * If either `needAffiliations` or `needAffiliations` is set, when you get data with pagination, the current page number (pageNum) starts from 0.
2741
+ * If either `needAffiliations` or `needRole` is set, when you get data with pagination, the current page number (pageNum) starts from 0.
2735
2742
  *
2736
2743
  * If neither of the parameters is set, when you get data with pagination, the current page number (pageNum) starts from 1.
2737
2744
  * */
2738
2745
  pageNum: number;
2739
2746
  /**
2740
- * If either `needAffiliations` or `needAffiliations` is set, when you get data with pagination, you can get a maximum of 20 groups (pageSize) on each page.
2747
+ * If either `needAffiliations` or `needRole` is set, when you get data with pagination, you can get a maximum of 20 groups (pageSize) on each page.
2741
2748
  *
2742
2749
  * If neither of the parameters is set, when you get data with pagination, you can get a maximum of 500 groups (pageSize) on each page.
2743
2750
  * */
@@ -4478,6 +4485,8 @@ export declare namespace EasemobChat {
4478
4485
  chatType?: 'singleChat' | 'groupChat' | 'chatRoom';
4479
4486
  /** Whether the message is in the thread. */
4480
4487
  isChatThread?: boolean;
4488
+ /** Custom extension fields. */
4489
+ ext?: string;
4481
4490
  success?: (res: number) => void;
4482
4491
  fail?: (error: ErrorEvent) => void;
4483
4492
  }
@@ -5519,6 +5528,24 @@ export declare namespace EasemobChat {
5519
5528
  isForced?: boolean;
5520
5529
  }
5521
5530
  ): Promise<void>;
5531
+
5532
+ /**
5533
+ *
5534
+ * Gets the list of chat rooms that a user has joined.
5535
+ *
5536
+ * ```typescript
5537
+ * connection.getJoinedChatRooms({pageNum: 1, pageSize: 20})
5538
+ * ```
5539
+ */
5540
+ getJoinedChatRooms(
5541
+ this: Connection,
5542
+ params: {
5543
+ /** The page number, starting from 1. */
5544
+ pageNum: number;
5545
+ /** The number of chat rooms to get per page. The value cannot exceed 500. */
5546
+ pageSize: number;
5547
+ }
5548
+ ): Promise<AsyncResult<JoinedChatRoomsResult>>;
5522
5549
  }
5523
5550
 
5524
5551
  // ----- for EventHandler ------
@@ -6031,6 +6058,8 @@ export declare namespace EasemobChat {
6031
6058
  /** The log content. */
6032
6059
  logs: any[];
6033
6060
  }): void;
6061
+ /** Sets whether to output logs to the console. */
6062
+ setConsoleLogVisibility(visible: boolean): void;
6034
6063
  }
6035
6064
 
6036
6065
  // --- for Message ---
@@ -7482,6 +7511,8 @@ export declare namespace EasemobChat {
7482
7511
  mid: string;
7483
7512
  /** Message online state type. */
7484
7513
  onlineState?: ONLINESTATETYPE;
7514
+ /** Custom extension fields. */
7515
+ ext: string;
7485
7516
  }
7486
7517
 
7487
7518
  interface ContactMsgBody {