easemob-websdk 4.7.0 → 4.8.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,5 +1,18 @@
1
1
  # Changes to easemob chat
2
2
 
3
+ # 4.8.0 (June 28, 2024)
4
+
5
+ - `onDisconnected` event add callback params to give the disconnected reason.
6
+ - Adds allow extension field to be carried when the device logs in and passes them to the kicked device.
7
+ - `setLoginInfoCustomExt` Set the device's login extension field.
8
+ - `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.
9
+ - Adds `Connection Parameters#isFixedDeviceId` initialization params, default is `true`, use fixed deviceId, precede version SDK is used random deviceId.
10
+ - `destroyChatRoom` supports the chatroom owner to destroy a chatroom.
11
+ - `joinChatRoom` supports passing in extension field and whether to exit other joined chatrooms when joining a chatroom.
12
+ - Adds report SDK log feature.
13
+ - Increase the timeout period for SDK to connect to the server.
14
+ - Fix on uniapp vue3 platform SDK reconnect failed.
15
+
3
16
  # 4.7.0 (April 26, 2024)
4
17
 
5
18
  - `recallMessage` methods add custom field `ext` params.
package/Easemob-chat.d.ts CHANGED
@@ -240,6 +240,12 @@ export declare namespace EasemobChat {
240
240
  url?: string;
241
241
  /** Whether to use HTTPS only. By default, the browser determines whether to use HTTPS only according to the domain name. */
242
242
  https?: boolean;
243
+ /** Whether to use a fixed device ID (deviceId).
244
+ * <br> - (Default) `true`: The SDK generates a device ID for a browser and saves it to the local storage. Then in the browser, all SDK instances use the same device.
245
+ * <br> -`false`: A random device ID is used for connections of each SDK instance. That is to say, each SDK instance uses a different device for connections.
246
+ * <br> This parameter has an impact on the kicking policy during a multi-device login scenario.
247
+ */
248
+ isFixedDeviceId?: boolean;
243
249
  }
244
250
 
245
251
  interface RegisterUserResult extends AsyncResult {
@@ -1326,8 +1332,6 @@ export declare namespace EasemobChat {
1326
1332
  OPERATION_UNSUPPORTED = 53,
1327
1333
  /** An operation that is not allowed. */
1328
1334
  OPERATION_NOT_ALLOWED = 54,
1329
- /** A local database operation failed. */
1330
- LOCAL_DB_OPERATION_FAILED = 55,
1331
1335
  /** The uploading of the file failed. */
1332
1336
  WEBIM_UPLOADFILE_ERROR = 101,
1333
1337
  /** The current user is not logged in when uploading the file. */
@@ -1404,6 +1408,8 @@ export declare namespace EasemobChat {
1404
1408
  CHATROOM_MEMBERS_FULL = 704,
1405
1409
  /** The chatroom is not found. */
1406
1410
  CHATROOM_NOT_EXIST = 705,
1411
+ /** A local database operation failed. */
1412
+ LOCAL_DB_OPERATION_FAILED = 800,
1407
1413
  /** Websocket error. */
1408
1414
  SDK_RUNTIME_ERROR = 999,
1409
1415
  /** The parameter length exceeds the limit when posting custom presence status. */
@@ -1760,8 +1766,15 @@ export declare namespace EasemobChat {
1760
1766
  params: {
1761
1767
  /** The chat room ID. */
1762
1768
  roomId: string;
1763
- /** The reason for joining the chat room. Not enabled. */
1769
+ /** The reason for joining the chat room. This parameter does not take effect. You can ignore it. */
1764
1770
  message?: string;
1771
+ /** Extension fields carried when joining a chat room. */
1772
+ ext?: string;
1773
+ /** Whether to leave all the currently joined chat rooms when joining a chat room.
1774
+ * - `true`: The user joins the chat room, while leaving all other chat rooms.
1775
+ * - (Default) `false`: The user joins the chat room, without leaving all other chat rooms.
1776
+ */
1777
+ leaveOtherRooms?: boolean;
1765
1778
  success?: (res: AsyncResult<CommonRequestResult>) => void;
1766
1779
  error?: (error: ErrorEvent) => void;
1767
1780
  }
@@ -5591,6 +5604,8 @@ export declare namespace EasemobChat {
5591
5604
  attributes?: Array<string> | { [key: string]: string };
5592
5605
  /** The member count. For a chat room with more than 2000 members, `memberCount` will not be returned. */
5593
5606
  memberCount?: number;
5607
+ /** The extension fields. */
5608
+ ext?: string;
5594
5609
  }
5595
5610
 
5596
5611
  interface GetChatroomAttributesResult {
@@ -5777,6 +5792,8 @@ export declare namespace EasemobChat {
5777
5792
  attributes?: Array<string> | { [key: string]: string };
5778
5793
  /** The member count. For a chat room with more than 2000 members, `memberCount` will not be returned. */
5779
5794
  memberCount?: number;
5795
+ /** The extension fields. */
5796
+ ext?: string;
5780
5797
  }
5781
5798
 
5782
5799
  interface MessagePinEvent {
@@ -5862,7 +5879,7 @@ export declare namespace EasemobChat {
5862
5879
  /** The callback for successful connection. */
5863
5880
  onConnected?: () => void;
5864
5881
  /** The callback for disconnected. */
5865
- onDisconnected?: () => void;
5882
+ onDisconnected?: (error?: ErrorEvent) => void;
5866
5883
  /** @deprecated Use { onGroupEvent } instead. */
5867
5884
  onGroupChange?: (msg: any) => void;
5868
5885
  /** @deprecated Use { onChatroomEvent } instead. */