easemob-websdk 4.13.0 → 4.15.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 +350 -0
- package/Easemob-chat.d.ts +147 -9
- 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 +79 -6
- package/group/group.js +1 -1
- package/localCache/localCache.js +1 -1
- package/miniCore/miniCore.d.ts +4 -0
- 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 +59 -0
- package/silent/silent.js +1 -1
- package/status.d.ts +4 -0
- 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 +14 -0
- package/uniApp/Easemob-chat.js +1 -1
- package/websdk/Easemob-chat.js +1 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,350 @@
|
|
|
1
|
+
# Changes to easemob chat
|
|
2
|
+
|
|
3
|
+
## 4.15.0 (May 20, 2025)
|
|
4
|
+
|
|
5
|
+
### 新增特性
|
|
6
|
+
|
|
7
|
+
1. 获取群成员
|
|
8
|
+
|
|
9
|
+
自 WEB SDK 4.15.0 开始,增加`getGroupMembers`方法,用来获取群成员, 同时返回成员角色, 原`listGroupMembers`方法废弃。
|
|
10
|
+
|
|
11
|
+
2. 获取聊天室成员
|
|
12
|
+
|
|
13
|
+
自 WEB SDK 4.15.0 开始,增加`getChatRoomMembers`方法,用来获取聊天室成员, 同时返回成员角色, 原`listChatRoomMembers`方法废弃。
|
|
14
|
+
|
|
15
|
+
3. 当群组发生以下操作时,SDK 改为仅回调单条事件,事件中包含所有加入/退出的成员:
|
|
16
|
+
|
|
17
|
+
- 创建群组时拉多人入群
|
|
18
|
+
- 批量成员加入或退出群组
|
|
19
|
+
- 因解散群组导致用户退出
|
|
20
|
+
调整前:SDK 会为每个加入/退出的成员单独回调一条事件。
|
|
21
|
+
|
|
22
|
+
自 WEB SDK 4.15.0 开始,群组事件增加 `membersPresence`, `membersAbsence` 事件,表示多人加入群组、退出群组。
|
|
23
|
+
|
|
24
|
+
4. 修改 token 将要过期事件 `onTokenWillExpire` 的触发时机,SDK 会在 Token 有效期达到 80% 时(之前版本为 50% )回调即将过期通知。
|
|
25
|
+
|
|
26
|
+
## 4.14.0 (Apr 18, 2025)
|
|
27
|
+
|
|
28
|
+
### 新增特性
|
|
29
|
+
|
|
30
|
+
- 支持 [GIF 图片消息]。
|
|
31
|
+
- 支持 [群组头像功能]。
|
|
32
|
+
- 支持 [附件鉴权功能]。该功能需要联系商务开通,开通后必须调用 SDK 的 API 才能下载消息附件。
|
|
33
|
+
- 支持 [支持自定义设备平台]。
|
|
34
|
+
- unipush 推送安卓平台支持 Google FCM
|
|
35
|
+
|
|
36
|
+
## 4.13.0 (Mar 12, 2025)
|
|
37
|
+
|
|
38
|
+
### 新增特性
|
|
39
|
+
|
|
40
|
+
1. `modifyMessage` 发送后修改消息接口新增可修改的消息类型:
|
|
41
|
+
支持修改的消息类型如下:
|
|
42
|
+
- 文本消息:支持修改 `msg` 和 `ext` 字段。
|
|
43
|
+
- 自定义消息:支持修改 `customEvent` 、 `customExts` 和 `ext` 字段。
|
|
44
|
+
- 图片/语音/视频/文件/位置/合并消息:仅支持修改 `ext` 字段。
|
|
45
|
+
- 命令消息:不支持修改。
|
|
46
|
+
2. 小程序 SDK 支持运行到微信小游戏平台
|
|
47
|
+
|
|
48
|
+
### 优化
|
|
49
|
+
|
|
50
|
+
1. SDK 内部捕获重试 DNS 失败的错误
|
|
51
|
+
|
|
52
|
+
## 4.12.0 (Jan 9, 2025)
|
|
53
|
+
|
|
54
|
+
### 新增特性
|
|
55
|
+
|
|
56
|
+
1. `onModifiedMessage` 事件回调中增加 ext 字段。
|
|
57
|
+
2. 加入聊天室 `joinChatRoom` 成功回调新增当前聊天室信息。
|
|
58
|
+
|
|
59
|
+
### 修复
|
|
60
|
+
|
|
61
|
+
1. 格式化小程序 SDK API 请求失败错误码, 和 Web 端统一。
|
|
62
|
+
2. 修复 uniapp sdk 在 4.36 版本运行到鸿蒙平台,无限重连的问题。
|
|
63
|
+
3. 修复偶现无法拉取消息的问题。
|
|
64
|
+
|
|
65
|
+
### 优化
|
|
66
|
+
|
|
67
|
+
1. 优化重连时间间隔
|
|
68
|
+
2. 小程序 SDK 支持 httpDNS, 默认开启
|
|
69
|
+
|
|
70
|
+
## 4.11.0 (Nov 29, 2024)
|
|
71
|
+
|
|
72
|
+
### 新增特性
|
|
73
|
+
|
|
74
|
+
1. 获取历史消息时,消息体内增加 isRead, isDelivery 字段,只支持单聊。
|
|
75
|
+
2. 禁言回调中携带禁言到期的时间戳。
|
|
76
|
+
3. 去掉 sockjs
|
|
77
|
+
4. 群组/聊天室禁言事件增加 userId 字段,表示被禁言的人
|
|
78
|
+
5. uniapp sdk 支持鸿蒙系统
|
|
79
|
+
|
|
80
|
+
### 修复
|
|
81
|
+
|
|
82
|
+
1. 修复 pin 消息事件 conversationId 不对
|
|
83
|
+
|
|
84
|
+
## 4.10.0 (Oct 10, 2024)
|
|
85
|
+
|
|
86
|
+
### 新增特性
|
|
87
|
+
|
|
88
|
+
1. 聊天室修改公告时回调中增加公告内容, updateAnnouncement 事件中增加 announcement 字段,表示更新的公告
|
|
89
|
+
2. 增加错误码 :
|
|
90
|
+
WEBIM_USER_ALREADY_LOGIN 208 用户已登录
|
|
91
|
+
MESSAGE_SEND_TIMEOUT 512 发送消息超时
|
|
92
|
+
3. 增加 onShow 方法, 小程序或 uniapp 在 onShow 生命周期里执行这个方法, 可以优化重连速度
|
|
93
|
+
|
|
94
|
+
### 优化
|
|
95
|
+
|
|
96
|
+
登录方法优化, 调整 open 方法执行 open().then 时机, 调整为在连接鉴权成功之后触发, 在 open().then 中就可以发送消息, 不用再等 onConnected 事件, 同时鉴权失败等登录的错误会在 open.catch 中抛出
|
|
97
|
+
|
|
98
|
+
# 4.9.2 (Sep 19, 2024)
|
|
99
|
+
|
|
100
|
+
- feat: `removeHistoryMessages` support chatRoom.
|
|
101
|
+
|
|
102
|
+
# 4.9.1 (Sep 5, 2024)
|
|
103
|
+
|
|
104
|
+
- feat: support uni-push plugin.
|
|
105
|
+
- chore: fix type errors and debug logs.
|
|
106
|
+
|
|
107
|
+
# 4.9.0 (August 29, 2024)
|
|
108
|
+
|
|
109
|
+
- Add `onOfflineMessageSyncStart` and `onOfflineMessageSyncFinish` event.
|
|
110
|
+
- Add multi device events `setSilentModeForConversation` and `removeSilentModeForConversation`.
|
|
111
|
+
- Fix `ChatroomEvent` and `GroupEvent` missed `reason` field.
|
|
112
|
+
- PIN message support single chat.
|
|
113
|
+
- Add callback error when get DNS failed
|
|
114
|
+
- Remove redundant judgment at reconnecting.
|
|
115
|
+
- chore: fix type errors and debug logs
|
|
116
|
+
|
|
117
|
+
# 4.8.1 (Jul 15, 2024)
|
|
118
|
+
|
|
119
|
+
- Fix uploading logs takes too much time
|
|
120
|
+
|
|
121
|
+
# 4.8.1-beta (Jul 2, 2024)
|
|
122
|
+
|
|
123
|
+
- Fix the mini program is not able to report logs
|
|
124
|
+
- Fix not export types issue
|
|
125
|
+
|
|
126
|
+
# 4.8.0 (June 28, 2024)
|
|
127
|
+
|
|
128
|
+
- `onDisconnected` event add callback params to give the disconnected reason.
|
|
129
|
+
- Adds allow extension field to be carried when the device logs in and passes them to the kicked device.
|
|
130
|
+
- `setLoginInfoCustomExt` Set the device's login extension field.
|
|
131
|
+
- `onDisconnected` In a multi-device login scenario, if the current device is kicked offline by the newly logged-in device, the event received by the kicked device will carry the extended information of the new device.
|
|
132
|
+
- Adds `Connection Parameters#isFixedDeviceId` initialization params, default is `true`, use fixed deviceId, precede version SDK is used random deviceId.
|
|
133
|
+
- `destroyChatRoom` supports the chatroom owner to destroy a chatroom.
|
|
134
|
+
- `joinChatRoom` supports passing in extension field and whether to exit other joined chatrooms when joining a chatroom.
|
|
135
|
+
- Adds report SDK log feature.
|
|
136
|
+
- Increase the timeout period for SDK to connect to the server.
|
|
137
|
+
- Fix on uniapp vue3 platform SDK reconnect failed.
|
|
138
|
+
|
|
139
|
+
# 4.7.0 (April 26, 2024)
|
|
140
|
+
|
|
141
|
+
- `recallMessage` methods add custom field `ext` params.
|
|
142
|
+
- Adds `getJoinedChatRooms` method to get the current user has joined chat room list.
|
|
143
|
+
- Adds `logger.setConsoleLogVisibility` method to sets whether to output logs to the console.
|
|
144
|
+
- Fix `allowGroupAck` status error
|
|
145
|
+
|
|
146
|
+
# 4.6.0 (April 2, 2024)
|
|
147
|
+
|
|
148
|
+
- Adds pin message feature.
|
|
149
|
+
- pinMessage
|
|
150
|
+
- unpinMessage
|
|
151
|
+
- getServerPinnedMessages
|
|
152
|
+
- Adds `onMessagePinEvent` callback to handle the message pin event.
|
|
153
|
+
- `onModifiedMessage` support custom message.
|
|
154
|
+
- `getHistoryMessages` support get chat room history message.
|
|
155
|
+
- Support custom chat room ID.
|
|
156
|
+
- Optimize token login failed error code for make the reason more clearly.
|
|
157
|
+
- Fix the message field `onlineState` status error.
|
|
158
|
+
|
|
159
|
+
# 4.5.1 (Feb 21, 2024)
|
|
160
|
+
|
|
161
|
+
- Format the attachment file url.
|
|
162
|
+
- Fixed bug when UniApp run ios platform send receiverList msg
|
|
163
|
+
|
|
164
|
+
# 4.5.0 (Jan 30, 2024)
|
|
165
|
+
|
|
166
|
+
- The member absence and presence events of chat rooms and groups have added a `memberCount` field
|
|
167
|
+
- Adds the `deleteAllMessagesAndConversations` methods, which can clear the chat history of the current user, including messages and conversations
|
|
168
|
+
- Adds the getSelfIdsOnOtherPlatform method, which can get a list of login IDs of the current user on other login devices, and realize sending messages to specified devices
|
|
169
|
+
- Removed unnecessary unique fields from the Web local database
|
|
170
|
+
- Format the customExts field of the most recent custom message in the conversation list
|
|
171
|
+
- Fix the issue of pulling messages repeatedly
|
|
172
|
+
- Fix the issue of abnormal message order in the `onMessage` callback
|
|
173
|
+
- Fix the error of introducing the MiniCore plugin in vite electron
|
|
174
|
+
- Fix the issue of abnormal API request parameters for `updateOwnUserInfo` after introducing the WeChat SDK in H5
|
|
175
|
+
|
|
176
|
+
# 4.4.0 (Dec 22, 2023)
|
|
177
|
+
|
|
178
|
+
- Adds conversation Conversation Mark
|
|
179
|
+
- addConversationMark
|
|
180
|
+
- removeConversationMark
|
|
181
|
+
- getServerConversationsByFilter
|
|
182
|
+
- Adds Attach Slice Upload
|
|
183
|
+
- Adds `onMessage` Event
|
|
184
|
+
- Adds thumbnail to video message
|
|
185
|
+
|
|
186
|
+
# 4.3.1 (Dec 13, 2023)
|
|
187
|
+
|
|
188
|
+
- Adds use replaced message contents
|
|
189
|
+
- Adds MiniCore SDK logger
|
|
190
|
+
- Verify that the `open` parameter user is not defined
|
|
191
|
+
- Types `SendMsgResult` add a message field
|
|
192
|
+
- Fixed the socket not closing when the network is offline on some device
|
|
193
|
+
|
|
194
|
+
# 4.3.0 (Nov 13, 2023)
|
|
195
|
+
|
|
196
|
+
- Adds contact API
|
|
197
|
+
- setContactRemark
|
|
198
|
+
- getAllContacts
|
|
199
|
+
- getContactsWithCursor
|
|
200
|
+
- Adds chatRoom broadcast
|
|
201
|
+
- Adds token expiration callback
|
|
202
|
+
|
|
203
|
+
# 4.2.1 (SEP 26, 2023)
|
|
204
|
+
|
|
205
|
+
- Adds LocalCache API
|
|
206
|
+
- getLocalConversations
|
|
207
|
+
- setLocalConversationCustomField
|
|
208
|
+
- getLocalConversation
|
|
209
|
+
- removeLocalConversation
|
|
210
|
+
- clearConversationUnreadCount
|
|
211
|
+
- onGroupEvent `joinPublicGroupDeclined` callback add the applicant userID
|
|
212
|
+
|
|
213
|
+
# 4.2.0 (Jul 27, 2023)
|
|
214
|
+
|
|
215
|
+
- Adds editing message after sent function
|
|
216
|
+
- Adds message merging and forwarding function
|
|
217
|
+
- Fix sending unnecessary delivery messages
|
|
218
|
+
|
|
219
|
+
# 4.1.7 (Jun 8, 2023)
|
|
220
|
+
|
|
221
|
+
- Adds the `pinConversation` method to pin or unpin a conversation.
|
|
222
|
+
- Adds the `getServerPinnedConversations` method to gets the list of pinned conversations from the server with pagination.
|
|
223
|
+
- Adds the `getServerConversations` method to get the sorted list of conversations from the server with pagination.
|
|
224
|
+
- Adds the feature of sending targeted messages in a group or chat room conversation by adding the `receiverList` parameter to the `create` method.
|
|
225
|
+
- Adds the `isLast` parameter to the `getHistoryMessages` method to indicate whether the returned data is that of the last page.
|
|
226
|
+
- Adds the `thumbnailWidth` and `thumbnailHeight` parameters to the `create` method to allow you to set the width and height of the thumbnail when sending an image.
|
|
227
|
+
- Adds the following errors to error codes 2 (WEBIM_CONNCTION_AUTH_ERROR) and 50 (MAX_LIMIT) and to explain the reasons for SDK login failures on the console:
|
|
228
|
+
- Error code 50: The number of daily active users (DAU) has exceeded the upper limit; the number of online users has exceeds the upper limit; the number of monthly active users (MAU) has exceeded the upper limit.
|
|
229
|
+
- Error code 2: The token is invalid.
|
|
230
|
+
- Adds success and failure callbacks (Promise) for the execution of the following methods:
|
|
231
|
+
- addContact: Adds a contact.
|
|
232
|
+
- deleteContact: Deletes a contact.
|
|
233
|
+
- acceptContactInvite: Accepts a friend request.
|
|
234
|
+
- declineContactInvite: Rejects a friend request.
|
|
235
|
+
- addUsersToBlocklist: Adds a friend to the block list.
|
|
236
|
+
- removeUserFromBlocklist: Removes a friend from the block list.
|
|
237
|
+
|
|
238
|
+
## 4.1.5 (April 13, 2023)
|
|
239
|
+
|
|
240
|
+
- Adds four parameters, `from`, `msgTypes`, `startTime`, and `endTime` in `searchOptions` in the ` getHistoryMessages` method to allow you to retrieve historical messages from the server by message sender, message type, or period.
|
|
241
|
+
|
|
242
|
+
Adds The error code 511, MESSAGE_SIZE_LIMIT, to notify you when the size of the message body exceeds the upper limit.
|
|
243
|
+
|
|
244
|
+
## 4.1.4 (Mar 16, 2023)
|
|
245
|
+
|
|
246
|
+
- Add Group Member Attributes feature
|
|
247
|
+
- Fix `getHistoryMessages` catch error failed
|
|
248
|
+
- Optimize the implementation of chat room join and leave to improve performance
|
|
249
|
+
- Add `deliverOnlineOnly` field in the message creation parameters
|
|
250
|
+
|
|
251
|
+
## 4.1.3 (Feb 20, 2023)
|
|
252
|
+
|
|
253
|
+
- `getConversationlist` Getting the conversation list supports paging
|
|
254
|
+
- Group notification event added `op: create`
|
|
255
|
+
- `useOwnUploadFun` Self-uploaded images support the `size` field
|
|
256
|
+
- ios miniapp multi-device login kick failed
|
|
257
|
+
- Alipay mini program reconnection failed
|
|
258
|
+
- Fixes HIM-8557- Important -- getConversationlist api returns missing fields
|
|
259
|
+
- Added interface to check if you are on the chat room mute list
|
|
260
|
+
- Login failures caused by authentication are not retried
|
|
261
|
+
|
|
262
|
+
## 4.1.2 (Nov 7, 2022)
|
|
263
|
+
|
|
264
|
+
- Chat room message priority
|
|
265
|
+
- Added unidirectional delete roaming function
|
|
266
|
+
- Create a group, Modify group information, Support 'ext' fields
|
|
267
|
+
- Optimize the timing of trigger message send failures
|
|
268
|
+
- 'muteGroupMembers' api supports blocking multiple users at the same time
|
|
269
|
+
- Fix Attachment message file_length field is invalid
|
|
270
|
+
|
|
271
|
+
## 4.1.1 (Sep 26, 2022)
|
|
272
|
+
|
|
273
|
+
- Fix chat room KV
|
|
274
|
+
- Fix miniCore uploadFile method
|
|
275
|
+
- miniCore support 'isHttpDns' = false
|
|
276
|
+
|
|
277
|
+
## 4.1.0 (Sep 16, 2022)
|
|
278
|
+
|
|
279
|
+
- SDK modular split
|
|
280
|
+
- Chat room KV
|
|
281
|
+
- Add log callback
|
|
282
|
+
- Add in-line comments
|
|
283
|
+
- Fix file upload failure without callback error
|
|
284
|
+
- `getJoinedGroups` supports getting your own roles
|
|
285
|
+
- Fix the compatibility with Internet Explorer
|
|
286
|
+
- Fixed bug where UniApp could not find 'addEventListener' when running on the phone
|
|
287
|
+
- Optimize reconnection logic
|
|
288
|
+
|
|
289
|
+
## 4.0.9 (July 29, 2022)
|
|
290
|
+
|
|
291
|
+
- Add disaster preparedness strategies
|
|
292
|
+
- Optimize protocols to reduce data volume
|
|
293
|
+
- Fixed message delay in some cases
|
|
294
|
+
- Add a resourceId to the group and chat room APIs
|
|
295
|
+
- The getJoinedGroups API allows you to return the number of group members and their roles
|
|
296
|
+
|
|
297
|
+
## 4.0.8 (Jun 17, 2022)
|
|
298
|
+
|
|
299
|
+
- 'GetGroupInfo' supports bulk query
|
|
300
|
+
- Add group event:onGroupEvent
|
|
301
|
+
- Add chatroom event:onChatroomEvent
|
|
302
|
+
- Add the limit when sending group messages
|
|
303
|
+
- Invite to join the group callback returns the group name
|
|
304
|
+
|
|
305
|
+
## 4.0.7 (May 25, 2022)
|
|
306
|
+
|
|
307
|
+
- Add chatThread feature
|
|
308
|
+
- Add the API to the session list to parse the last message
|
|
309
|
+
- Modify the implementation of obtaining roaming messages
|
|
310
|
+
- Add the mark of offline message in the message
|
|
311
|
+
|
|
312
|
+
## 4.0.5 (May 15, 2022)
|
|
313
|
+
|
|
314
|
+
- Add reporting API for content auditing
|
|
315
|
+
- Add push setting API to support different push configuration
|
|
316
|
+
- Add the data reporting function
|
|
317
|
+
- The API for getting groups that you have joined supports paging
|
|
318
|
+
- When creating a group, the SDK supports setting the number of group members
|
|
319
|
+
- Add thumbnail address parameter to receive picture message
|
|
320
|
+
- Fixed group chat message cache issues
|
|
321
|
+
|
|
322
|
+
## 4.0.4 (April 19, 2022)
|
|
323
|
+
|
|
324
|
+
- Add presence feature
|
|
325
|
+
- Add translation feature
|
|
326
|
+
- Optimizing miniProgram does not require the isHttpDNS parameter
|
|
327
|
+
- Fixed failure to modify desc when creating a group
|
|
328
|
+
- Fixed SSR compatibility
|
|
329
|
+
- Fixed uni_SDK not running in browser
|
|
330
|
+
|
|
331
|
+
## 4.0.3 (January 19, 2022)
|
|
332
|
+
|
|
333
|
+
- Fixed 'renewtoken' failed to replace the token
|
|
334
|
+
- Add 'downloadGroupSharedFile' api
|
|
335
|
+
- 'fetchGroupSharedFileList' supports paging
|
|
336
|
+
|
|
337
|
+
## 4.0.2 (January 14, 2022)
|
|
338
|
+
|
|
339
|
+
- Add delete session api
|
|
340
|
+
- Add field 'buildingName' to the location message
|
|
341
|
+
- Add restrictions on messages sent by non-friends
|
|
342
|
+
- Add the error event of sending failure due to global mute
|
|
343
|
+
- Support DD mini program
|
|
344
|
+
- Fixed alipay mini program login problem
|
|
345
|
+
- Fixed missing onChannelMessage callback
|
|
346
|
+
- Fixed some known bugs
|
|
347
|
+
|
|
348
|
+
## 4.0.1 (December 10, 2021)
|
|
349
|
+
|
|
350
|
+
- 4.0.1 version init
|
package/Easemob-chat.d.ts
CHANGED
|
@@ -274,6 +274,10 @@ export declare namespace EasemobChat {
|
|
|
274
274
|
* <br> This parameter has an impact on the kicking policy during a multi-device login scenario.
|
|
275
275
|
*/
|
|
276
276
|
isFixedDeviceId?: boolean;
|
|
277
|
+
/** Custom platform, optional values [1-100]. Please refer to the multi device login document for details. */
|
|
278
|
+
customOSPlatform?: number;
|
|
279
|
+
/** Customize device name. The device name can only be set through this parameter after configuring customOSPlatform. */
|
|
280
|
+
customDeviceName?: string;
|
|
277
281
|
};
|
|
278
282
|
|
|
279
283
|
interface RegisterUserResult extends AsyncResult {
|
|
@@ -551,6 +555,8 @@ export declare namespace EasemobChat {
|
|
|
551
555
|
public: boolean;
|
|
552
556
|
/** Whether on the blacklist. */
|
|
553
557
|
shieldgroup: boolean;
|
|
558
|
+
/** The group avatar. */
|
|
559
|
+
avatar: string;
|
|
554
560
|
}
|
|
555
561
|
|
|
556
562
|
interface ModifyGroupResult {
|
|
@@ -564,6 +570,8 @@ export declare namespace EasemobChat {
|
|
|
564
570
|
membersonly?: boolean;
|
|
565
571
|
/** Whether the permission invitation is modified successfully. */
|
|
566
572
|
allowinvites?: boolean;
|
|
573
|
+
/** Whether the group avatar is changed successfully. -`true`: Yes; -`false`: No. */
|
|
574
|
+
avatar?: boolean;
|
|
567
575
|
}
|
|
568
576
|
|
|
569
577
|
type GroupMember = { owner: UserId } | { member: UserId };
|
|
@@ -734,12 +742,19 @@ export declare namespace EasemobChat {
|
|
|
734
742
|
|
|
735
743
|
type GetGroupMembersAttributesResult = Record<UserId, MemberAttributes>;
|
|
736
744
|
|
|
745
|
+
type GroupMemberRole = 'owner' | 'admin' | 'member';
|
|
746
|
+
interface FetchedGroupMember {
|
|
747
|
+
role: GroupMemberRole;
|
|
748
|
+
userId: UserId;
|
|
749
|
+
joinedTime: number;
|
|
750
|
+
}
|
|
751
|
+
|
|
737
752
|
interface GroupModifyInfo {
|
|
738
753
|
/** The name of a group. */
|
|
739
754
|
name?: string;
|
|
740
755
|
/** The description of a group. */
|
|
741
756
|
description?: string;
|
|
742
|
-
/** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `
|
|
757
|
+
/** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `getPublicGroups`. */
|
|
743
758
|
public?: boolean;
|
|
744
759
|
/** Whether a user requires the approval from the group owner or admin to join the group. -`true`: Yes; -`false`: No. */
|
|
745
760
|
approval?: boolean;
|
|
@@ -756,6 +771,8 @@ export declare namespace EasemobChat {
|
|
|
756
771
|
ext?: string;
|
|
757
772
|
/** Last Modified Timestamp. */
|
|
758
773
|
lastModified?: number;
|
|
774
|
+
/** The group avatar. */
|
|
775
|
+
avatar?: string;
|
|
759
776
|
}
|
|
760
777
|
|
|
761
778
|
// The group api result end.
|
|
@@ -1420,6 +1437,11 @@ export declare namespace EasemobChat {
|
|
|
1420
1437
|
*/
|
|
1421
1438
|
USER_NOT_FRIEND = 221,
|
|
1422
1439
|
|
|
1440
|
+
/** No permission to download file. */
|
|
1441
|
+
WEBIM_DOWNLOADFILE_ERROR_NO_PERMISSION = 222,
|
|
1442
|
+
/** The file has expired. */
|
|
1443
|
+
WEBIM_DOWNLOADFILE_ERROR_EXPIRED = 223,
|
|
1444
|
+
|
|
1423
1445
|
/** get DNS failed */
|
|
1424
1446
|
SERVER_GET_DNSLIST_FAILED = 304,
|
|
1425
1447
|
|
|
@@ -1911,6 +1933,8 @@ export declare namespace EasemobChat {
|
|
|
1911
1933
|
/**
|
|
1912
1934
|
* Lists all chat room members with pagination.
|
|
1913
1935
|
*
|
|
1936
|
+
* @deprecated Use {@link getChatRoomMembers} instead.
|
|
1937
|
+
*
|
|
1914
1938
|
* ```typescript
|
|
1915
1939
|
* connection.listChatRoomMembers({pageNum: 1, pageSize: 20, chatRoomId: 'chatRoomId'})
|
|
1916
1940
|
* ```
|
|
@@ -1929,6 +1953,30 @@ export declare namespace EasemobChat {
|
|
|
1929
1953
|
}
|
|
1930
1954
|
): Promise<AsyncResult<{ member: string }[]>>;
|
|
1931
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
|
+
|
|
1932
1980
|
/**
|
|
1933
1981
|
* Gets all admins of the chat room.
|
|
1934
1982
|
*
|
|
@@ -2641,11 +2689,13 @@ export declare namespace EasemobChat {
|
|
|
2641
2689
|
data: {
|
|
2642
2690
|
/** The group name. */
|
|
2643
2691
|
groupname: string;
|
|
2692
|
+
/** The group avatar. */
|
|
2693
|
+
avatar?: string;
|
|
2644
2694
|
/** The description of the group. */
|
|
2645
2695
|
desc: string;
|
|
2646
2696
|
/** The array of member IDs to add to the group. These users will be added directly into the group and receive "operation: 'directJoined'" in the callback of onGroupEvent. */
|
|
2647
2697
|
members: UserId[];
|
|
2648
|
-
/** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `
|
|
2698
|
+
/** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `getPublicGroups`. */
|
|
2649
2699
|
public: boolean;
|
|
2650
2700
|
/** Whether a user requires the approval from the group admin to join the group. -`true`: Yes; -`false`: No.*/
|
|
2651
2701
|
approval: boolean;
|
|
@@ -2668,11 +2718,13 @@ export declare namespace EasemobChat {
|
|
|
2668
2718
|
|
|
2669
2719
|
/**
|
|
2670
2720
|
* Creates group
|
|
2721
|
+
* @deprecated Use {@link createGroupVNext instead.}
|
|
2671
2722
|
*
|
|
2672
2723
|
* ```typescript
|
|
2673
2724
|
* connection.createGroup({
|
|
2674
2725
|
data: {
|
|
2675
2726
|
groupname: 'groupname',
|
|
2727
|
+
avatar: 'avatar',
|
|
2676
2728
|
desc: 'this is my group',
|
|
2677
2729
|
members: ['user1', 'user2'],
|
|
2678
2730
|
public: true,
|
|
@@ -2690,11 +2742,13 @@ export declare namespace EasemobChat {
|
|
|
2690
2742
|
data: {
|
|
2691
2743
|
/** The group name. */
|
|
2692
2744
|
groupname: string;
|
|
2745
|
+
/** The group avatar. */
|
|
2746
|
+
avatar?: string;
|
|
2693
2747
|
/** The description of the group. */
|
|
2694
2748
|
desc: string;
|
|
2695
2749
|
/** The array of member IDs to add to the group. These users will be added directly into the group and receive "operation: 'directJoined'" in the callback of onGroupEvent. */
|
|
2696
2750
|
members: UserId[];
|
|
2697
|
-
/** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `
|
|
2751
|
+
/** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `getPublicGroups`. */
|
|
2698
2752
|
public: boolean;
|
|
2699
2753
|
/** Whether a user requires the approval from the group admin to join the group. -`true`: Yes; -`false`: No.*/
|
|
2700
2754
|
approval: boolean;
|
|
@@ -2715,6 +2769,54 @@ export declare namespace EasemobChat {
|
|
|
2715
2769
|
}
|
|
2716
2770
|
): Promise<AsyncResult<CreateGroupResult>>;
|
|
2717
2771
|
|
|
2772
|
+
/**
|
|
2773
|
+
* Creates a group instance.
|
|
2774
|
+
*
|
|
2775
|
+
* ```typescript
|
|
2776
|
+
* connection.createGroupVNext({
|
|
2777
|
+
* groupName: 'groupname',
|
|
2778
|
+
* avatar: 'group avatar',
|
|
2779
|
+
* description: 'this is my group',
|
|
2780
|
+
* members: ['user1', 'user2'],
|
|
2781
|
+
* isPublic: true,
|
|
2782
|
+
* needApprovalToJoin: false,
|
|
2783
|
+
* allowMemberToInvite: true,
|
|
2784
|
+
* inviteNeedConfirm: false,
|
|
2785
|
+
* maxMemberCount: 200,
|
|
2786
|
+
* extension: JSON.stringify({info: 'group info'})
|
|
2787
|
+
* })
|
|
2788
|
+
* ```
|
|
2789
|
+
*/
|
|
2790
|
+
createGroupVNext(
|
|
2791
|
+
this: Connection,
|
|
2792
|
+
params: {
|
|
2793
|
+
/** The group name. */
|
|
2794
|
+
groupName?: string;
|
|
2795
|
+
/** The group avatar. */
|
|
2796
|
+
avatar?: string;
|
|
2797
|
+
/** The description of the group. */
|
|
2798
|
+
description?: string;
|
|
2799
|
+
/** The array of member IDs to add to the group. These users will be added directly into the group and receive "operation: 'directJoined'" in the callback of onGroupEvent. */
|
|
2800
|
+
members?: UserId[];
|
|
2801
|
+
/** Whether it is a public group. -`true`: Yes; -`false`: No. Public group: the group that others can query by calling `getPublicGroups`. */
|
|
2802
|
+
isPublic?: boolean;
|
|
2803
|
+
/** Whether a user requires the approval from the group admin to join the group. -`true`: Yes; -`false`: No.*/
|
|
2804
|
+
needApprovalToJoin?: boolean;
|
|
2805
|
+
/** Whether to allow group members to invite others to the group. `true`: Allow; `false`: Do not allow.*/
|
|
2806
|
+
allowMemberToInvite?: boolean;
|
|
2807
|
+
/**
|
|
2808
|
+
* Whether the invitee needs to accept the invitation before joining the group.
|
|
2809
|
+
* - `true`: The invitee's consent is required. The default value is `true`.
|
|
2810
|
+
* - `false`: The invitee will be directly added to the group without confirmation.
|
|
2811
|
+
*/
|
|
2812
|
+
inviteNeedConfirm?: boolean;
|
|
2813
|
+
/** The group max users. */
|
|
2814
|
+
maxMemberCount?: number;
|
|
2815
|
+
/** Group detail extensions which can be in the JSON format to contain more group information. */
|
|
2816
|
+
extension?: string;
|
|
2817
|
+
}
|
|
2818
|
+
): Promise<AsyncResult<{ groupId: string }>>;
|
|
2819
|
+
|
|
2718
2820
|
/** @deprecated Use {@link blockGroupMessages instead.} */
|
|
2719
2821
|
blockGroup(
|
|
2720
2822
|
this: Connection,
|
|
@@ -2912,6 +3014,8 @@ export declare namespace EasemobChat {
|
|
|
2912
3014
|
groupName?: string;
|
|
2913
3015
|
/** The group description. */
|
|
2914
3016
|
description?: string;
|
|
3017
|
+
/** The group avatar. */
|
|
3018
|
+
avatar?: string;
|
|
2915
3019
|
/** Group detail extensions which can be in the JSON format to contain more group information. */
|
|
2916
3020
|
ext?: string;
|
|
2917
3021
|
success?: (res: AsyncResult<ModifyGroupResult>) => void;
|
|
@@ -2936,6 +3040,7 @@ export declare namespace EasemobChat {
|
|
|
2936
3040
|
|
|
2937
3041
|
/**
|
|
2938
3042
|
* Lists all members of the group with pagination.
|
|
3043
|
+
* @deprecated use {@link getGroupMembers} instead.
|
|
2939
3044
|
*
|
|
2940
3045
|
* ```typescript
|
|
2941
3046
|
* connection.listGroupMembers({pageNum: 1, pageSize: 20, groupId: 'groupId'})
|
|
@@ -2955,6 +3060,30 @@ export declare namespace EasemobChat {
|
|
|
2955
3060
|
}
|
|
2956
3061
|
): Promise<AsyncResult<GroupMember[]>>;
|
|
2957
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
|
+
|
|
2958
3087
|
/**
|
|
2959
3088
|
* Gets all admins in the group.
|
|
2960
3089
|
* ```typescript
|
|
@@ -5696,7 +5825,7 @@ export declare namespace EasemobChat {
|
|
|
5696
5825
|
/** The ID of a group or chatroom. */
|
|
5697
5826
|
id: string;
|
|
5698
5827
|
/** Message sender. */
|
|
5699
|
-
from
|
|
5828
|
+
from?: string;
|
|
5700
5829
|
/** The modified group info. */
|
|
5701
5830
|
detail?: GroupModifyInfo;
|
|
5702
5831
|
/** The name of a group or chatroom. */
|
|
@@ -5715,6 +5844,8 @@ export declare namespace EasemobChat {
|
|
|
5715
5844
|
announcement?: string;
|
|
5716
5845
|
/** Expiration time for user mute. */
|
|
5717
5846
|
muteTimestamp?: { [key: string]: number };
|
|
5847
|
+
/** User IDs of group members. */
|
|
5848
|
+
members?: Array<string>;
|
|
5718
5849
|
}
|
|
5719
5850
|
|
|
5720
5851
|
interface GetChatroomAttributesResult {
|
|
@@ -5791,8 +5922,10 @@ export declare namespace EasemobChat {
|
|
|
5791
5922
|
* removeMember: Occurs when you are removed from a group or added to block list. Only the removed person receives this event.<br/>
|
|
5792
5923
|
* unblockMember: Occurs when being removed from the block list. Only the removed person receives this event.<br/>
|
|
5793
5924
|
* updateInfo: Occurs when modifying group. <br/>
|
|
5794
|
-
* memberPresence: Occurs when
|
|
5795
|
-
*
|
|
5925
|
+
* memberPresence: Occurs when a user joined the group. <br/>
|
|
5926
|
+
* membersPresence: Occurs when more than one user joined the group. <br/>
|
|
5927
|
+
* memberAbsence: Occurs when a user leaved the group.<br/>
|
|
5928
|
+
* membersAbsence: Occurs when more than one user leaved the group. <br/>
|
|
5796
5929
|
* directJoined: Occurs when you are directly pulled into the group and no consent is required. <br/>
|
|
5797
5930
|
* changeOwner: Occurs when transferring group. Only new and old group owners can receive this event. <br/>
|
|
5798
5931
|
* setAdmin: Occurs when being set as administrator. Only the person who is set to administrator can receive this event.<br/>
|
|
@@ -5822,7 +5955,9 @@ export declare namespace EasemobChat {
|
|
|
5822
5955
|
| 'unblockMember'
|
|
5823
5956
|
| 'updateInfo'
|
|
5824
5957
|
| 'memberPresence'
|
|
5958
|
+
| 'membersPresence'
|
|
5825
5959
|
| 'memberAbsence'
|
|
5960
|
+
| 'membersAbsence'
|
|
5826
5961
|
| 'directJoined'
|
|
5827
5962
|
| 'changeOwner'
|
|
5828
5963
|
| 'setAdmin'
|
|
@@ -5863,7 +5998,7 @@ export declare namespace EasemobChat {
|
|
|
5863
5998
|
* unblockMember: Occurs when being removed from the block list. Only the removed person receives this event.<br/>
|
|
5864
5999
|
* updateInfo: Occurs when modifying chat room. <br/>
|
|
5865
6000
|
* memberPresence: Occurs when someone joined the chat room. <br/>
|
|
5866
|
-
* memberAbsence: Occurs when someone leaved the chat room.
|
|
6001
|
+
* memberAbsence: Occurs when someone leaved the chat room. <br/>
|
|
5867
6002
|
* setAdmin: Occurs when being set as administrator. Only the person who is set to administrator can receive this event.<br/>
|
|
5868
6003
|
* removeAdmin: Occurs when you are removed as an administrator. Only the removed person can receive this event. <br/>
|
|
5869
6004
|
* muteMember: Occurs when you are muted. Only the person who is muted can receive this event. <br/>
|
|
@@ -5992,7 +6127,7 @@ export declare namespace EasemobChat {
|
|
|
5992
6127
|
onContactDeleted?: (msg: ContactMsgBody) => void;
|
|
5993
6128
|
/** The callback to added a contact. */
|
|
5994
6129
|
onContactAdded?: (msg: ContactMsgBody) => void;
|
|
5995
|
-
/**
|
|
6130
|
+
/** Occurs when the token is about to expire. This event is triggered from when 20% of the validity period is left.*/
|
|
5996
6131
|
onTokenWillExpire?: () => void;
|
|
5997
6132
|
/** The callback whose token has expired. */
|
|
5998
6133
|
onTokenExpired?: () => void;
|
|
@@ -6220,7 +6355,8 @@ export declare namespace EasemobChat {
|
|
|
6220
6355
|
| 'img'
|
|
6221
6356
|
| 'audio'
|
|
6222
6357
|
| 'file'
|
|
6223
|
-
| 'video'
|
|
6358
|
+
| 'video'
|
|
6359
|
+
| 'combine';
|
|
6224
6360
|
|
|
6225
6361
|
type ChatType = 'singleChat' | 'groupChat' | 'chatRoom';
|
|
6226
6362
|
interface FileObj {
|
|
@@ -7379,6 +7515,8 @@ export declare namespace EasemobChat {
|
|
|
7379
7515
|
thumbnailWidth?: number;
|
|
7380
7516
|
/** The thumbnail height. */
|
|
7381
7517
|
thumbnailHeight?: number;
|
|
7518
|
+
/** Whether the image is a gif. */
|
|
7519
|
+
isGif?: boolean;
|
|
7382
7520
|
}
|
|
7383
7521
|
|
|
7384
7522
|
interface AudioParameters {
|