easemob-websdk 4.14.0 → 4.15.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.
- package/CHANGELOG.md +39 -0
- package/Easemob-chat.d.ts +107 -6
- package/Easemob-chat.js +1 -1
- package/chatroom/chatroom.d.ts +24 -0
- package/chatroom/chatroom.js +1 -1
- package/contact/contact.js +1 -1
- package/group/group.d.ts +55 -3
- package/group/group.js +1 -1
- package/localCache/localCache.js +1 -1
- package/miniCore/miniCore.js +1 -1
- package/miniProgram/Easemob-chat.js +1 -1
- package/package.json +1 -1
- package/presence/presence.js +1 -1
- package/readme.md +3 -3
- package/silent/silent.js +1 -1
- package/thread/thread.js +1 -1
- package/translation/translation.js +1 -1
- package/types/common.d.ts +3 -1
- package/types/eventHandler.d.ts +7 -3
- package/types/groupApi.d.ts +8 -0
- package/uniApp/Easemob-chat.js +1 -1
- package/websdk/Easemob-chat.js +1 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,44 @@
|
|
|
1
1
|
# Changes to easemob chat
|
|
2
2
|
|
|
3
|
+
## 4.15.1 (June 6, 2025)
|
|
4
|
+
|
|
5
|
+
### 新增特性
|
|
6
|
+
|
|
7
|
+
1. 获取加入的群组数量
|
|
8
|
+
|
|
9
|
+
自 WEB SDK 4.15.1 开始,增加 `getJoinedGroupCount`方法,用来获取加入的群组数量。
|
|
10
|
+
|
|
11
|
+
2. 屏蔽群消息
|
|
12
|
+
|
|
13
|
+
自 WEB SDK 4.15.1 开始,增加 `blockGroupMessage`方法,用来屏蔽群组消息,增加`unblockGroupMessage`方法解除屏蔽。
|
|
14
|
+
|
|
15
|
+
### 修复
|
|
16
|
+
|
|
17
|
+
1. 修复撤回消息时报错。
|
|
18
|
+
|
|
19
|
+
## 4.15.0 (May 20, 2025)
|
|
20
|
+
|
|
21
|
+
### 新增特性
|
|
22
|
+
|
|
23
|
+
1. 获取群成员
|
|
24
|
+
|
|
25
|
+
自 WEB SDK 4.15.0 开始,增加`getGroupMembers`方法,用来获取群成员, 同时返回成员角色, 原`listGroupMembers`方法废弃。
|
|
26
|
+
|
|
27
|
+
2. 获取聊天室成员
|
|
28
|
+
|
|
29
|
+
自 WEB SDK 4.15.0 开始,增加`getChatRoomMembers`方法,用来获取聊天室成员, 同时返回成员角色, 原`listChatRoomMembers`方法废弃。
|
|
30
|
+
|
|
31
|
+
3. 当群组发生以下操作时,SDK 改为仅回调单条事件,事件中包含所有加入/退出的成员:
|
|
32
|
+
|
|
33
|
+
- 创建群组时拉多人入群
|
|
34
|
+
- 批量成员加入或退出群组
|
|
35
|
+
- 因解散群组导致用户退出
|
|
36
|
+
调整前:SDK 会为每个加入/退出的成员单独回调一条事件。
|
|
37
|
+
|
|
38
|
+
自 WEB SDK 4.15.0 开始,群组事件增加 `membersPresence`, `membersAbsence` 事件,表示多人加入群组、退出群组。
|
|
39
|
+
|
|
40
|
+
4. 修改 token 将要过期事件 `onTokenWillExpire` 的触发时机,SDK 会在 Token 有效期达到 80% 时(之前版本为 50% )回调即将过期通知。
|
|
41
|
+
|
|
3
42
|
## 4.14.0 (Apr 18, 2025)
|
|
4
43
|
|
|
5
44
|
### 新增特性
|
package/Easemob-chat.d.ts
CHANGED
|
@@ -742,6 +742,13 @@ export declare namespace EasemobChat {
|
|
|
742
742
|
|
|
743
743
|
type GetGroupMembersAttributesResult = Record<UserId, MemberAttributes>;
|
|
744
744
|
|
|
745
|
+
type GroupMemberRole = 'owner' | 'admin' | 'member';
|
|
746
|
+
interface FetchedGroupMember {
|
|
747
|
+
role: GroupMemberRole;
|
|
748
|
+
userId: UserId;
|
|
749
|
+
joinedTime: number;
|
|
750
|
+
}
|
|
751
|
+
|
|
745
752
|
interface GroupModifyInfo {
|
|
746
753
|
/** The name of a group. */
|
|
747
754
|
name?: string;
|
|
@@ -1926,6 +1933,8 @@ export declare namespace EasemobChat {
|
|
|
1926
1933
|
/**
|
|
1927
1934
|
* Lists all chat room members with pagination.
|
|
1928
1935
|
*
|
|
1936
|
+
* @deprecated Use {@link getChatRoomMembers} instead.
|
|
1937
|
+
*
|
|
1929
1938
|
* ```typescript
|
|
1930
1939
|
* connection.listChatRoomMembers({pageNum: 1, pageSize: 20, chatRoomId: 'chatRoomId'})
|
|
1931
1940
|
* ```
|
|
@@ -1944,6 +1953,30 @@ export declare namespace EasemobChat {
|
|
|
1944
1953
|
}
|
|
1945
1954
|
): Promise<AsyncResult<{ member: string }[]>>;
|
|
1946
1955
|
|
|
1956
|
+
/**
|
|
1957
|
+
* Gets the list chat room members with pagination.
|
|
1958
|
+
*
|
|
1959
|
+
* ```typescript
|
|
1960
|
+
* connection.getChatRoomMembers({cursor: '', limit: 50, chatRoomId: 'chatRoomId'})
|
|
1961
|
+
* ```
|
|
1962
|
+
*/
|
|
1963
|
+
getChatRoomMembers(
|
|
1964
|
+
this: Connection,
|
|
1965
|
+
params: {
|
|
1966
|
+
/** The chat room ID. */
|
|
1967
|
+
chatRoomId: string;
|
|
1968
|
+
/** The cursor that specifies where to start to get data. If there will be data on the next page, this method will return the value of this field to indicate the position to start to get data of the next page. If it is null, the data of the first page will be fetched. */
|
|
1969
|
+
cursor?: string;
|
|
1970
|
+
/** The number of members retrieved per page. The value range is [1,50], with 50 as the default.*/
|
|
1971
|
+
limit?: number;
|
|
1972
|
+
}
|
|
1973
|
+
): Promise<
|
|
1974
|
+
AsyncResult<{
|
|
1975
|
+
cursor: string | undefined;
|
|
1976
|
+
members: FetchedGroupMember[];
|
|
1977
|
+
}>
|
|
1978
|
+
>;
|
|
1979
|
+
|
|
1947
1980
|
/**
|
|
1948
1981
|
* Gets all admins of the chat room.
|
|
1949
1982
|
*
|
|
@@ -3007,6 +3040,7 @@ export declare namespace EasemobChat {
|
|
|
3007
3040
|
|
|
3008
3041
|
/**
|
|
3009
3042
|
* Lists all members of the group with pagination.
|
|
3043
|
+
* @deprecated use {@link getGroupMembers} instead.
|
|
3010
3044
|
*
|
|
3011
3045
|
* ```typescript
|
|
3012
3046
|
* connection.listGroupMembers({pageNum: 1, pageSize: 20, groupId: 'groupId'})
|
|
@@ -3026,6 +3060,30 @@ export declare namespace EasemobChat {
|
|
|
3026
3060
|
}
|
|
3027
3061
|
): Promise<AsyncResult<GroupMember[]>>;
|
|
3028
3062
|
|
|
3063
|
+
/**
|
|
3064
|
+
* Gets the list group members with pagination.
|
|
3065
|
+
*
|
|
3066
|
+
* ```typescript
|
|
3067
|
+
* connection.getGroupMembers({cursor: '', limit: 50, groupId: 'groupId'})
|
|
3068
|
+
* ```
|
|
3069
|
+
*/
|
|
3070
|
+
getGroupMembers(
|
|
3071
|
+
this: Connection,
|
|
3072
|
+
params: {
|
|
3073
|
+
/** The group ID. */
|
|
3074
|
+
groupId: string;
|
|
3075
|
+
/** The cursor that specifies where to start to get data. If there will be data on the next page, this method will return the value of this field to indicate the position to start to get data of the next page. If it is null, the data of the first page will be fetched. */
|
|
3076
|
+
cursor?: string;
|
|
3077
|
+
/** The number of members retrieved per page. The value range is [1,50], with 50 as the default.*/
|
|
3078
|
+
limit?: number;
|
|
3079
|
+
}
|
|
3080
|
+
): Promise<
|
|
3081
|
+
AsyncResult<{
|
|
3082
|
+
cursor: string | undefined;
|
|
3083
|
+
members: FetchedGroupMember[];
|
|
3084
|
+
}>
|
|
3085
|
+
>;
|
|
3086
|
+
|
|
3029
3087
|
/**
|
|
3030
3088
|
* Gets all admins in the group.
|
|
3031
3089
|
* ```typescript
|
|
@@ -4148,6 +4206,42 @@ export declare namespace EasemobChat {
|
|
|
4148
4206
|
}
|
|
4149
4207
|
): Promise<AsyncResult<GetGroupMembersAttributesResult>>;
|
|
4150
4208
|
|
|
4209
|
+
/**
|
|
4210
|
+
* Gets the count of groups that the user has joined.
|
|
4211
|
+
* ```typescript
|
|
4212
|
+
* connection.getJoinedGroupsCount()
|
|
4213
|
+
* ```
|
|
4214
|
+
*/
|
|
4215
|
+
getJoinedGroupsCount(this: Connection): Promise<AsyncResult<number>>;
|
|
4216
|
+
|
|
4217
|
+
/**
|
|
4218
|
+
* Blocks group messages.
|
|
4219
|
+
* ```typescript
|
|
4220
|
+
* connection.blockGroupMessage({groupId: 'groupId'})
|
|
4221
|
+
* ```
|
|
4222
|
+
*/
|
|
4223
|
+
blockGroupMessage(
|
|
4224
|
+
this: Connection,
|
|
4225
|
+
params: {
|
|
4226
|
+
/** The group ID. */
|
|
4227
|
+
groupId: string;
|
|
4228
|
+
}
|
|
4229
|
+
): Promise<AsyncResult<GroupRequestResult>>;
|
|
4230
|
+
|
|
4231
|
+
/**
|
|
4232
|
+
* Unblocks group messages.
|
|
4233
|
+
* ```typescript
|
|
4234
|
+
* connection.unblockGroupMessage({groupId: 'groupId'})
|
|
4235
|
+
* ```
|
|
4236
|
+
*/
|
|
4237
|
+
unblockGroupMessage(
|
|
4238
|
+
this: Connection,
|
|
4239
|
+
params: {
|
|
4240
|
+
/** The group ID. */
|
|
4241
|
+
groupId: string;
|
|
4242
|
+
}
|
|
4243
|
+
): Promise<AsyncResult<GroupRequestResult>>;
|
|
4244
|
+
|
|
4151
4245
|
// Contact API
|
|
4152
4246
|
/**
|
|
4153
4247
|
* @deprecated Use {@link getBlocklist} instead.
|
|
@@ -5767,7 +5861,7 @@ export declare namespace EasemobChat {
|
|
|
5767
5861
|
/** The ID of a group or chatroom. */
|
|
5768
5862
|
id: string;
|
|
5769
5863
|
/** Message sender. */
|
|
5770
|
-
from
|
|
5864
|
+
from?: string;
|
|
5771
5865
|
/** The modified group info. */
|
|
5772
5866
|
detail?: GroupModifyInfo;
|
|
5773
5867
|
/** The name of a group or chatroom. */
|
|
@@ -5786,6 +5880,8 @@ export declare namespace EasemobChat {
|
|
|
5786
5880
|
announcement?: string;
|
|
5787
5881
|
/** Expiration time for user mute. */
|
|
5788
5882
|
muteTimestamp?: { [key: string]: number };
|
|
5883
|
+
/** User IDs of group members. */
|
|
5884
|
+
members?: Array<string>;
|
|
5789
5885
|
}
|
|
5790
5886
|
|
|
5791
5887
|
interface GetChatroomAttributesResult {
|
|
@@ -5862,8 +5958,10 @@ export declare namespace EasemobChat {
|
|
|
5862
5958
|
* removeMember: Occurs when you are removed from a group or added to block list. Only the removed person receives this event.<br/>
|
|
5863
5959
|
* unblockMember: Occurs when being removed from the block list. Only the removed person receives this event.<br/>
|
|
5864
5960
|
* updateInfo: Occurs when modifying group. <br/>
|
|
5865
|
-
* memberPresence: Occurs when
|
|
5866
|
-
*
|
|
5961
|
+
* memberPresence: Occurs when a user joined the group. <br/>
|
|
5962
|
+
* membersPresence: Occurs when more than one user joined the group. <br/>
|
|
5963
|
+
* memberAbsence: Occurs when a user leaved the group.<br/>
|
|
5964
|
+
* membersAbsence: Occurs when more than one user leaved the group. <br/>
|
|
5867
5965
|
* directJoined: Occurs when you are directly pulled into the group and no consent is required. <br/>
|
|
5868
5966
|
* changeOwner: Occurs when transferring group. Only new and old group owners can receive this event. <br/>
|
|
5869
5967
|
* setAdmin: Occurs when being set as administrator. Only the person who is set to administrator can receive this event.<br/>
|
|
@@ -5893,7 +5991,9 @@ export declare namespace EasemobChat {
|
|
|
5893
5991
|
| 'unblockMember'
|
|
5894
5992
|
| 'updateInfo'
|
|
5895
5993
|
| 'memberPresence'
|
|
5994
|
+
| 'membersPresence'
|
|
5896
5995
|
| 'memberAbsence'
|
|
5996
|
+
| 'membersAbsence'
|
|
5897
5997
|
| 'directJoined'
|
|
5898
5998
|
| 'changeOwner'
|
|
5899
5999
|
| 'setAdmin'
|
|
@@ -5934,7 +6034,7 @@ export declare namespace EasemobChat {
|
|
|
5934
6034
|
* unblockMember: Occurs when being removed from the block list. Only the removed person receives this event.<br/>
|
|
5935
6035
|
* updateInfo: Occurs when modifying chat room. <br/>
|
|
5936
6036
|
* memberPresence: Occurs when someone joined the chat room. <br/>
|
|
5937
|
-
* memberAbsence: Occurs when someone leaved the chat room.
|
|
6037
|
+
* memberAbsence: Occurs when someone leaved the chat room. <br/>
|
|
5938
6038
|
* setAdmin: Occurs when being set as administrator. Only the person who is set to administrator can receive this event.<br/>
|
|
5939
6039
|
* removeAdmin: Occurs when you are removed as an administrator. Only the removed person can receive this event. <br/>
|
|
5940
6040
|
* muteMember: Occurs when you are muted. Only the person who is muted can receive this event. <br/>
|
|
@@ -6063,7 +6163,7 @@ export declare namespace EasemobChat {
|
|
|
6063
6163
|
onContactDeleted?: (msg: ContactMsgBody) => void;
|
|
6064
6164
|
/** The callback to added a contact. */
|
|
6065
6165
|
onContactAdded?: (msg: ContactMsgBody) => void;
|
|
6066
|
-
/**
|
|
6166
|
+
/** Occurs when the token is about to expire. This event is triggered from when 20% of the validity period is left.*/
|
|
6067
6167
|
onTokenWillExpire?: () => void;
|
|
6068
6168
|
/** The callback whose token has expired. */
|
|
6069
6169
|
onTokenExpired?: () => void;
|
|
@@ -6291,7 +6391,8 @@ export declare namespace EasemobChat {
|
|
|
6291
6391
|
| 'img'
|
|
6292
6392
|
| 'audio'
|
|
6293
6393
|
| 'file'
|
|
6294
|
-
| 'video'
|
|
6394
|
+
| 'video'
|
|
6395
|
+
| 'combine';
|
|
6295
6396
|
|
|
6296
6397
|
type ChatType = 'singleChat' | 'groupChat' | 'chatRoom';
|
|
6297
6398
|
interface FileObj {
|