easemob-websdk 4.8.1-beta → 4.9.0-beta

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,66 +1,80 @@
1
1
  # Changes to easemob chat
2
2
 
3
- # 4.8.1 (Jul 2, 2024)
3
+ # 4.9.0 (August 29, 2024)
4
4
 
5
- - Fix the mini program is not able to report logs
6
- - Fix not export types issue
5
+ - Add `onOfflineMessageSyncStart` and `onOfflineMessageSyncFinish` event.
6
+ - Add multi device events `setSilentModeForConversation` and `removeSilentModeForConversation`.
7
+ - Fix `ChatroomEvent` and `GroupEvent` missed `reason` field.
8
+ - PIN message support single chat.
9
+ - Add callback error when get DNS failed
10
+ - Remove redundant judgment at reconnecting.
11
+ - chore: fix type errors and debug logs
12
+
13
+ # 4.8.1 (Jul 15, 2024)
14
+
15
+ - Fix uploading logs takes too much time
16
+
17
+ # 4.8.1-beta (Jul 2, 2024)
18
+
19
+ - Fix the mini program is not able to report logs
20
+ - Fix not export types issue
7
21
 
8
22
  # 4.8.0 (June 28, 2024)
9
23
 
10
- - `onDisconnected` event add callback params to give the disconnected reason.
11
- - Adds allow extension field to be carried when the device logs in and passes them to the kicked device.
12
- - `setLoginInfoCustomExt` Set the device's login extension field.
13
- - `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.
14
- - Adds `Connection Parameters#isFixedDeviceId` initialization params, default is `true`, use fixed deviceId, precede version SDK is used random deviceId.
15
- - `destroyChatRoom` supports the chatroom owner to destroy a chatroom.
16
- - `joinChatRoom` supports passing in extension field and whether to exit other joined chatrooms when joining a chatroom.
17
- - Adds report SDK log feature.
18
- - Increase the timeout period for SDK to connect to the server.
19
- - Fix on uniapp vue3 platform SDK reconnect failed.
24
+ - `onDisconnected` event add callback params to give the disconnected reason.
25
+ - Adds allow extension field to be carried when the device logs in and passes them to the kicked device.
26
+ - `setLoginInfoCustomExt` Set the device's login extension field.
27
+ - `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.
28
+ - Adds `Connection Parameters#isFixedDeviceId` initialization params, default is `true`, use fixed deviceId, precede version SDK is used random deviceId.
29
+ - `destroyChatRoom` supports the chatroom owner to destroy a chatroom.
30
+ - `joinChatRoom` supports passing in extension field and whether to exit other joined chatrooms when joining a chatroom.
31
+ - Adds report SDK log feature.
32
+ - Increase the timeout period for SDK to connect to the server.
33
+ - Fix on uniapp vue3 platform SDK reconnect failed.
20
34
 
21
35
  # 4.7.0 (April 26, 2024)
22
36
 
23
- - `recallMessage` methods add custom field `ext` params.
24
- - Adds `getJoinedChatRooms` method to get the current user has joined chat room list.
25
- - Adds `logger.setConsoleLogVisibility` method to sets whether to output logs to the console.
26
- - Fix `allowGroupAck` status error
37
+ - `recallMessage` methods add custom field `ext` params.
38
+ - Adds `getJoinedChatRooms` method to get the current user has joined chat room list.
39
+ - Adds `logger.setConsoleLogVisibility` method to sets whether to output logs to the console.
40
+ - Fix `allowGroupAck` status error
27
41
 
28
42
  # 4.6.0 (April 2, 2024)
29
43
 
30
- - Adds pin message feature.
31
- - pinMessage
32
- - unpinMessage
33
- - getServerPinnedMessages
34
- - Adds `onMessagePinEvent` callback to handle the message pin event.
35
- - `onModifiedMessage` support custom message.
36
- - `getHistoryMessages` support get chat room history message.
37
- - Support custom chat room ID.
38
- - Optimize token login failed error code for make the reason more clearly.
39
- - Fix the message field `onlineState` status error.
44
+ - Adds pin message feature.
45
+ - pinMessage
46
+ - unpinMessage
47
+ - getServerPinnedMessages
48
+ - Adds `onMessagePinEvent` callback to handle the message pin event.
49
+ - `onModifiedMessage` support custom message.
50
+ - `getHistoryMessages` support get chat room history message.
51
+ - Support custom chat room ID.
52
+ - Optimize token login failed error code for make the reason more clearly.
53
+ - Fix the message field `onlineState` status error.
40
54
 
41
55
  # 4.5.1 (Feb 21, 2024)
42
56
 
43
- - Format the attachment file url.
44
- - Fixed bug when UniApp run ios platform send receiverList msg
57
+ - Format the attachment file url.
58
+ - Fixed bug when UniApp run ios platform send receiverList msg
45
59
 
46
60
  # 4.5.0 (Jan 30, 2024)
47
61
 
48
62
  - The member absence and presence events of chat rooms and groups have added a `memberCount` field
49
63
  - Adds the `deleteAllMessagesAndConversations` methods, which can clear the chat history of the current user, including messages and conversations
50
64
  - 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
51
- - Removed unnecessary unique fields from the Web local database
52
- - Format the customExts field of the most recent custom message in the conversation list
53
- - Fix the issue of pulling messages repeatedly
54
- - Fix the issue of abnormal message order in the `onMessage` callback
55
- - Fix the error of introducing the MiniCore plugin in vite electron
56
- - Fix the issue of abnormal API request parameters for `updateOwnUserInfo` after introducing the WeChat SDK in H5
65
+ - Removed unnecessary unique fields from the Web local database
66
+ - Format the customExts field of the most recent custom message in the conversation list
67
+ - Fix the issue of pulling messages repeatedly
68
+ - Fix the issue of abnormal message order in the `onMessage` callback
69
+ - Fix the error of introducing the MiniCore plugin in vite electron
70
+ - Fix the issue of abnormal API request parameters for `updateOwnUserInfo` after introducing the WeChat SDK in H5
57
71
 
58
72
  # 4.4.0 (Dec 22, 2023)
59
73
 
60
74
  - Adds conversation Conversation Mark
61
- - addConversationMark
62
- - removeConversationMark
63
- - getServerConversationsByFilter
75
+ - addConversationMark
76
+ - removeConversationMark
77
+ - getServerConversationsByFilter
64
78
  - Adds Attach Slice Upload
65
79
  - Adds `onMessage` Event
66
80
  - Adds thumbnail to video message
@@ -76,21 +90,22 @@
76
90
  # 4.3.0 (Nov 13, 2023)
77
91
 
78
92
  - Adds contact API
79
- - setContactRemark
80
- - getAllContacts
81
- - getContactsWithCursor
93
+ - setContactRemark
94
+ - getAllContacts
95
+ - getContactsWithCursor
82
96
  - Adds chatRoom broadcast
83
97
  - Adds token expiration callback
84
98
 
85
99
  # 4.2.1 (SEP 26, 2023)
86
100
 
87
101
  - Adds LocalCache API
88
- - getLocalConversations
89
- - setLocalConversationCustomField
90
- - getLocalConversation
91
- - removeLocalConversation
92
- - clearConversationUnreadCount
102
+ - getLocalConversations
103
+ - setLocalConversationCustomField
104
+ - getLocalConversation
105
+ - removeLocalConversation
106
+ - clearConversationUnreadCount
93
107
  - onGroupEvent `joinPublicGroupDeclined` callback add the applicant userID
108
+
94
109
  # 4.2.0 (Jul 27, 2023)
95
110
 
96
111
  - Adds editing message after sent function
package/Easemob-chat.d.ts CHANGED
@@ -154,7 +154,10 @@ export declare namespace EasemobChat {
154
154
  | 'chatThreadDestroy'
155
155
  | 'chatThreadJoin'
156
156
  | 'chatThreadLeave'
157
- | 'chatThreadNameUpdate';
157
+ | 'chatThreadNameUpdate'
158
+ | 'setSilentModeForUser'
159
+ | 'removeSilentModeForConversation'
160
+ | 'setSilentModeForConversation';
158
161
 
159
162
  interface ThreadMultiDeviceInfo {
160
163
  /** Event name of thread multi device event. */
@@ -211,11 +214,37 @@ export declare namespace EasemobChat {
211
214
  timestamp: number;
212
215
  }
213
216
 
217
+ interface NotificationConMultiDeviceInfo {
218
+ operation:
219
+ | 'setSilentModeForConversation'
220
+ | 'removeSilentModeForConversation';
221
+ resource: string;
222
+ conversationId: string;
223
+ type: 'singleChat' | 'groupChat';
224
+ data: {
225
+ type?: 'AT' | 'NONE' | 'ALL';
226
+ ignoreDuration?: number;
227
+ };
228
+ }
229
+ interface NotificationUserMultiDeviceInfo {
230
+ operation: 'setSilentModeForUser';
231
+ resource: string;
232
+ // user: string;
233
+ data: {
234
+ ignoreInterval: string;
235
+ };
236
+ }
237
+
238
+ type NotificationMultiDeviceInfo =
239
+ | NotificationConMultiDeviceInfo
240
+ | NotificationUserMultiDeviceInfo;
241
+
214
242
  type MultiDeviceEvent =
215
243
  | ThreadMultiDeviceInfo
216
244
  | ConversationChangedInfo
217
245
  | RoamingDeleteMultiDeviceInfo
218
- | GroupMemberAttributesUpdateMultiDeviceInfo;
246
+ | GroupMemberAttributesUpdateMultiDeviceInfo
247
+ | NotificationMultiDeviceInfo;
219
248
 
220
249
  interface ConnectionParameters {
221
250
  /** The unique application key registered in console. */
@@ -1230,6 +1259,22 @@ export declare namespace EasemobChat {
1230
1259
  | SilentModeDuration
1231
1260
  | SilentModeInterval;
1232
1261
 
1262
+ interface ConversationWithRemindType {
1263
+ /** Conversation id. */
1264
+ conversationId: string;
1265
+ /** Conversation type. */
1266
+ type: 'singleChat' | 'groupChat';
1267
+ /** Silent mode type. */
1268
+ remindType: SILENTMODETYPE;
1269
+ }
1270
+
1271
+ interface GetSilentModeRemindTypeConversationsResult {
1272
+ /** The cursor that specifies where to start to get data. */
1273
+ cursor: string;
1274
+ /** conversations with remind type. */
1275
+ conversations: ConversationWithRemindType[];
1276
+ }
1277
+
1233
1278
  interface GetReactionDetailResult {
1234
1279
  /** The reaction to be added to the message. The length is limited to 128 characters. */
1235
1280
  reaction: string;
@@ -1358,6 +1403,9 @@ export declare namespace EasemobChat {
1358
1403
  */
1359
1404
  USER_NOT_FRIEND = 221,
1360
1405
 
1406
+ /** get DNS failed */
1407
+ SERVER_GET_DNSLIST_FAILED = 304,
1408
+
1361
1409
  /** The server is busy. */
1362
1410
  SERVER_BUSY = 500,
1363
1411
  /** The message content contains illegal or sensitive words. */
@@ -1642,10 +1690,12 @@ export declare namespace EasemobChat {
1642
1690
  params: {
1643
1691
  /** The chat room ID. */
1644
1692
  chatRoomId: string;
1645
- success?: (res: AsyncResult<GetChatRoomDetailsResult>) => void;
1693
+ success?: (
1694
+ res: AsyncResult<Array<GetChatRoomDetailsResult>>
1695
+ ) => void;
1646
1696
  error?: (error: ErrorEvent) => void;
1647
1697
  }
1648
- ): Promise<AsyncResult<GetChatRoomDetailsResult>>;
1698
+ ): Promise<AsyncResult<Array<GetChatRoomDetailsResult>>>;
1649
1699
 
1650
1700
  /**
1651
1701
  * Modifies the specifications of the chat room.
@@ -5110,7 +5160,7 @@ export declare namespace EasemobChat {
5110
5160
  /** The conversation ID. */
5111
5161
  conversationId: string;
5112
5162
  /** The conversation type. */
5113
- conversationType: 'groupChat' | 'chatRoom';
5163
+ conversationType: ChatType;
5114
5164
  /** The ID of the message to be pinned. */
5115
5165
  messageId: string;
5116
5166
  }
@@ -5131,7 +5181,7 @@ export declare namespace EasemobChat {
5131
5181
  /** The conversation ID. */
5132
5182
  conversationId: string;
5133
5183
  /** The conversation type. */
5134
- conversationType: 'groupChat' | 'chatRoom';
5184
+ conversationType: ChatType;
5135
5185
  /** The ID of the message to be unpinned. */
5136
5186
  messageId: string;
5137
5187
  }
@@ -5153,7 +5203,7 @@ export declare namespace EasemobChat {
5153
5203
  /** The conversation ID. */
5154
5204
  conversationId: string;
5155
5205
  /** The conversation type. */
5156
- conversationType: 'groupChat' | 'chatRoom';
5206
+ conversationType: ChatType;
5157
5207
  /** The number of pinned messages to retrieve on each page. The value range is [1,50] and the default value is `10`. */
5158
5208
  pageSize?: number;
5159
5209
  /** The position from which to start getting data. For the first call of the method, an empty string ('') is passed in and the SDK returns the list of pinned messages in the descending order of when they are pinned. */
@@ -5608,6 +5658,8 @@ export declare namespace EasemobChat {
5608
5658
  memberCount?: number;
5609
5659
  /** The extension fields. */
5610
5660
  ext?: string;
5661
+ /** The reason for the event. */
5662
+ reason?: string;
5611
5663
  }
5612
5664
 
5613
5665
  interface GetChatroomAttributesResult {
@@ -5655,6 +5707,7 @@ export declare namespace EasemobChat {
5655
5707
  | 'onTokenExpired'
5656
5708
  | 'onContactInvited'
5657
5709
  | 'onConnected'
5710
+ | 'onReconnecting'
5658
5711
  | 'onDisconnected'
5659
5712
  | 'onGroupChange'
5660
5713
  | 'onChatroomChange'
@@ -5666,7 +5719,9 @@ export declare namespace EasemobChat {
5666
5719
  | 'onMultiDeviceEvent'
5667
5720
  | 'onGroupEvent'
5668
5721
  | 'onChatroomEvent'
5669
- | 'onMessagePinEvent';
5722
+ | 'onMessagePinEvent'
5723
+ | 'onOfflineMessageSyncStart'
5724
+ | 'onOfflineMessageSyncFinish';
5670
5725
 
5671
5726
  interface GroupEvent {
5672
5727
  /** The type of operation. <br/>
@@ -5732,12 +5787,16 @@ export declare namespace EasemobChat {
5732
5787
  id: string;
5733
5788
  /** Message sender. */
5734
5789
  from: string;
5790
+ /** The userId of a group event. */
5791
+ userId?: string;
5735
5792
  /** The name of a group. */
5736
5793
  name?: string;
5737
5794
  /** The modified group info. */
5738
5795
  detail?: GroupModifyInfo;
5739
5796
  /** The member count. */
5740
5797
  memberCount?: number;
5798
+ /** The reason for the event. */
5799
+ reason?: string;
5741
5800
  }
5742
5801
 
5743
5802
  interface ChatroomEvent {
@@ -5796,11 +5855,13 @@ export declare namespace EasemobChat {
5796
5855
  memberCount?: number;
5797
5856
  /** The extension fields. */
5798
5857
  ext?: string;
5858
+ /** The reason for the event. */
5859
+ reason?: string;
5799
5860
  }
5800
5861
 
5801
5862
  interface MessagePinEvent {
5802
5863
  /** The conversation type. */
5803
- conversationType: 'groupChat' | 'chatRoom';
5864
+ conversationType: ChatType;
5804
5865
  /** The conversation ID. */
5805
5866
  conversationId: string;
5806
5867
  /** The ID of the message that is pinned or unpinned. */
@@ -5880,6 +5941,8 @@ export declare namespace EasemobChat {
5880
5941
  onContactInvited?: (msg: ContactMsgBody) => void;
5881
5942
  /** The callback for successful connection. */
5882
5943
  onConnected?: () => void;
5944
+ /** The callback for reconnecting. */
5945
+ onReconnecting?: () => void;
5883
5946
  /** The callback for disconnected. */
5884
5947
  onDisconnected?: (error?: ErrorEvent) => void;
5885
5948
  /** @deprecated Use { onGroupEvent } instead. */
@@ -5902,6 +5965,10 @@ export declare namespace EasemobChat {
5902
5965
  onChatroomEvent?: (eventData: ChatroomEvent) => void;
5903
5966
  /** The callback to receive a pin message event. */
5904
5967
  onMessagePinEvent?: (eventData: MessagePinEvent) => void;
5968
+ /** Occurs when the SDK starts pulling offline messages from the server. */
5969
+ onOfflineMessageSyncStart?: () => void;
5970
+ /** Occurs when the SDK finishes pulling offline messages from the server.*/
5971
+ onOfflineMessageSyncFinish?: () => void;
5905
5972
  }
5906
5973
 
5907
5974
  interface HandlerData {
@@ -6149,6 +6216,7 @@ export declare namespace EasemobChat {
6149
6216
  reason?: string;
6150
6217
  kicked?: string;
6151
6218
  detail?: GroupModifyInfo;
6219
+ ext?: string;
6152
6220
  }
6153
6221
 
6154
6222
  interface ReadMsgSetParameters {
@@ -7633,6 +7701,9 @@ export declare namespace EasemobChat {
7633
7701
  static createOldMsg(options: NewMessageParamters): MessageBody;
7634
7702
  /** Create messages. */
7635
7703
  static create(options: CreateMsgType): MessageBody;
7704
+ /** When sending attachment messages, use this method to obtain the file path. */
7705
+ static getFileUrl: (fileInputId: string | HTMLInputElement) => FileObj;
7706
+
7636
7707
  /** @deprecated */
7637
7708
  set(options: MessageSetParameters): void;
7638
7709
  }