easemob-websdk 4.0.6-beta → 4.0.8-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,30 +1,37 @@
1
1
  # Changes to easemob chat
2
2
 
3
- ## ## 4.0.6 (May 21, 2022)
4
-
5
- - Add chatThread feature
6
- - Add the API to the session list to parse the last message
7
- - Modify the implementation of obtaining roaming messages
8
- - Add the mark of offline message in the message
9
-
10
- ## ## 4.0.5 (May 15, 2022)
11
-
12
- - Add reporting API for content auditing
13
- - Add push setting API to support different push configuration
14
- - Add the data reporting function
15
- - The API for getting groups that you have joined supports paging
16
- - When creating a group, the SDK supports setting the number of group members
17
- - Add thumbnail address parameter to receive picture message
18
- - Fixed group chat message cache issues
3
+ ## 4.0.8 (Jun 17, 2022)
4
+
5
+ - 'GetGroupInfo' supports bulk query
6
+ - Add group event:onGroupEvent
7
+ - Add chatroom event:onChatroomEvent
8
+ - Add the limit when sending group messages
9
+ - Invite to join the group callback returns the group name
10
+ ## 4.0.7 (May 25, 2022)
11
+
12
+ - Add chatThread feature
13
+ - Add the API to the session list to parse the last message
14
+ - Modify the implementation of obtaining roaming messages
15
+ - Add the mark of offline message in the message
16
+
17
+ ## 4.0.5 (May 15, 2022)
18
+
19
+ - Add reporting API for content auditing
20
+ - Add push setting API to support different push configuration
21
+ - Add the data reporting function
22
+ - The API for getting groups that you have joined supports paging
23
+ - When creating a group, the SDK supports setting the number of group members
24
+ - Add thumbnail address parameter to receive picture message
25
+ - Fixed group chat message cache issues
19
26
 
20
27
  ## 4.0.4 (April 19, 2022)
21
28
 
22
- - Add presence feature
23
- - Add translation feature
24
- - Optimizing miniProgram does not require the isHttpDNS parameter
25
- - Fixed failure to modify desc when creating a group
26
- - Fixed SSR compatibility
27
- - Fixed uni_SDK not running in browser
29
+ - Add presence feature
30
+ - Add translation feature
31
+ - Optimizing miniProgram does not require the isHttpDNS parameter
32
+ - Fixed failure to modify desc when creating a group
33
+ - Fixed SSR compatibility
34
+ - Fixed uni_SDK not running in browser
28
35
 
29
36
  ## 4.0.3 (January 19, 2022)
30
37
 
package/Easemob-chat.d.ts CHANGED
@@ -978,8 +978,8 @@ export declare namespace EasemobChat {
978
978
  lastMessage: LastMessage;
979
979
  /** The number of unread messages. */
980
980
  unread_num: number;
981
- }
982
-
981
+ }
982
+
983
983
  interface GetReactionDetailResult {
984
984
  /** The reaction to be added to the message. The length is limited to 128 characters. */
985
985
  reaction: string;
@@ -1022,34 +1022,31 @@ export declare namespace EasemobChat {
1022
1022
  REQUEST_TIMEOUT = -1,
1023
1023
  REQUEST_UNKNOWN = -2,
1024
1024
  REQUEST_PARAMETER_ERROR = -3,
1025
+ REQUEST_ABORT = -4,
1025
1026
  WEBIM_CONNCTION_USER_NOT_ASSIGN_ERROR = 0,
1026
1027
  WEBIM_CONNCTION_OPEN_ERROR = 1,
1027
1028
  WEBIM_CONNCTION_AUTH_ERROR = 2,
1028
1029
  WEBIM_CONNCTION_OPEN_USERGRID_ERROR = 3,
1029
- WEBIM_CONNCTION_ATTACH_ERROR = 4, // unused
1030
- WEBIM_CONNCTION_ATTACH_USERGRID_ERROR = 5, // unused
1031
- WEBIM_CONNCTION_REOPEN_ERROR = 6, // unused
1032
- WEBIM_CONNCTION_SERVER_CLOSE_ERROR = 7, //7 = client-side network offline (netE= RR_INTERNET_DISCONNECTED) unused
1033
- WEBIM_CONNCTION_SERVER_ERROR = 8, //8 = offline by multi login unused
1030
+ WEBIM_CONNCTION_ATTACH_ERROR = 4,
1031
+ WEBIM_CONNCTION_ATTACH_USERGRID_ERROR = 5,
1032
+ WEBIM_CONNCTION_REOPEN_ERROR = 6,
1033
+ WEBIM_CONNCTION_SERVER_CLOSE_ERROR = 7,
1034
+ WEBIM_CONNCTION_SERVER_ERROR = 8,
1034
1035
  WEBIM_CONNCTION_IQ_ERROR = 9,
1035
- WEBIM_CONNCTION_USER_REMOVED = 207,
1036
- WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE = 206,
1037
- WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD = 216,
1038
- WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE = 217,
1039
1036
  WEBIM_CONNCTION_PING_ERROR = 10,
1040
1037
  WEBIM_CONNCTION_NOTIFYVERSION_ERROR = 11,
1041
1038
  WEBIM_CONNCTION_GETROSTER_ERROR = 12,
1042
1039
  WEBIM_CONNCTION_CROSSDOMAIN_ERROR = 13,
1043
1040
  WEBIM_CONNCTION_LISTENING_OUTOF_MAXRETRIES = 14,
1044
1041
  WEBIM_CONNCTION_RECEIVEMSG_CONTENTERROR = 15,
1045
- WEBIM_CONNCTION_DISCONNECTED = 16, //16 = server-side close the websocket connection
1046
- WEBIM_CONNCTION_AJAX_ERROR = 17, // ajax error
1042
+ WEBIM_CONNCTION_DISCONNECTED = 16,
1043
+ WEBIM_CONNCTION_AJAX_ERROR = 17,
1047
1044
  WEBIM_CONNCTION_JOINROOM_ERROR = 18,
1048
1045
  WEBIM_CONNCTION_GETROOM_ERROR = 19,
1049
- WEBIM_CONNCTION_GETROOMINFO_ERROR = 20, // unused
1050
- WEBIM_CONNCTION_GETROOMMEMBER_ERROR = 21, // unused
1051
- WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR = 22, // unused
1052
- WEBIM_CONNCTION_LOAD_CHATROOM_ERROR = 23, // 获取聊天室失败,拉取历史消息失败(后面去掉)
1046
+ WEBIM_CONNCTION_GETROOMINFO_ERROR = 20,
1047
+ WEBIM_CONNCTION_GETROOMMEMBER_ERROR = 21,
1048
+ WEBIM_CONNCTION_GETROOMOCCUPANTS_ERROR = 22,
1049
+ WEBIM_CONNCTION_LOAD_CHATROOM_ERROR = 23,
1053
1050
  WEBIM_CONNCTION_NOT_SUPPORT_CHATROOM_ERROR = 24,
1054
1051
  WEBIM_CONNCTION_JOINCHATROOM_ERROR = 25,
1055
1052
  WEBIM_CONNCTION_QUITCHATROOM_ERROR = 26,
@@ -1057,24 +1054,34 @@ export declare namespace EasemobChat {
1057
1054
  WEBIM_CONNCTION_TOKEN_NOT_ASSIGN_ERROR = 28,
1058
1055
  WEBIM_CONNCTION_SESSIONID_NOT_ASSIGN_ERROR = 29,
1059
1056
  WEBIM_CONNCTION_RID_NOT_ASSIGN_ERROR = 30,
1060
- WEBIM_CONNCTION_CALLBACK_INNER_ERROR = 31, //31 = 处理下行消息出错 try/catch抛出异常
1061
- WEBIM_CONNCTION_CLIENT_OFFLINE = 32, //32 = client offline
1062
- WEBIM_CONNCTION_CLIENT_LOGOUT = 33, //33 = client logout
1063
- WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR = 34, // 34 = Over amount of the tabs a user opened in the same browser
1057
+ WEBIM_CONNCTION_CALLBACK_INNER_ERROR = 31,
1058
+ WEBIM_CONNCTION_CLIENT_OFFLINE = 32,
1059
+ WEBIM_CONNCTION_CLIENT_LOGOUT = 33,
1060
+ WEBIM_CONNCTION_CLIENT_TOO_MUCH_ERROR = 34,
1064
1061
  WEBIM_CONNECTION_ACCEPT_INVITATION_FROM_GROUP = 35,
1065
1062
  WEBIM_CONNECTION_DECLINE_INVITATION_FROM_GROUP = 36,
1066
1063
  WEBIM_CONNECTION_ACCEPT_JOIN_GROUP = 37,
1067
1064
  WEBIM_CONNECTION_DECLINE_JOIN_GROUP = 38,
1068
1065
  WEBIM_CONNECTION_CLOSED = 39,
1069
1066
  WEBIM_CONNECTION_ERROR = 40,
1067
+ MAX_LIMIT = 50,
1068
+ MESSAGE_NOT_FOUND = 51,
1069
+ NO_PERMISSION = 52,
1070
+ OPERATION_UNSUPPORTED = 53,
1070
1071
  WEBIM_UPLOADFILE_BROWSER_ERROR = 100,
1071
1072
  WEBIM_UPLOADFILE_ERROR = 101,
1072
1073
  WEBIM_UPLOADFILE_NO_LOGIN = 102,
1073
1074
  WEBIM_UPLOADFILE_NO_FILE = 103,
1074
- WEBIM_DOWNLOADFILE_ERROR = 200, // unused
1075
- WEBIM_DOWNLOADFILE_NO_LOGIN = 201, // unused
1076
- WEBIM_DOWNLOADFILE_BROWSER_ERROR = 202, // unused
1077
- USER_NOT_FOUND = 204, // 用户不存在,如创建群拉人时不存在的用户报次错误
1075
+ WEBIM_DOWNLOADFILE_ERROR = 200,
1076
+ WEBIM_DOWNLOADFILE_NO_LOGIN = 201,
1077
+ WEBIM_DOWNLOADFILE_BROWSER_ERROR = 202,
1078
+ USER_NOT_FOUND = 204,
1079
+ WEBIM_CONNCTION_USER_LOGIN_ANOTHER_DEVICE = 206,
1080
+ WEBIM_CONNCTION_USER_REMOVED = 207,
1081
+ WEBIM_CONNCTION_USER_KICKED_BY_CHANGE_PASSWORD = 216,
1082
+ WEBIM_CONNCTION_USER_KICKED_BY_OTHER_DEVICE = 217,
1083
+ USER_MUTED_BY_ADMIN = 219,
1084
+ USER_NOT_FRIEND = 221,
1078
1085
  WEBIM_MESSAGE_REC_TEXT = 300,
1079
1086
  WEBIM_MESSAGE_REC_TEXT_ERROR = 301,
1080
1087
  WEBIM_MESSAGE_REC_EMOTION = 302,
@@ -1101,23 +1108,34 @@ export declare namespace EasemobChat {
1101
1108
  STATUS_CLOSED = 405,
1102
1109
  STATUS_ERROR = 406,
1103
1110
  SERVER_BUSY = 500,
1104
- GROUP_NOT_EXIST = 605,
1105
- GROUP_NOT_JOINED = 602, // 禁言等操作的人员不在群组中
1111
+ MESSAGE_INCLUDE_ILLEGAL_CONTENT = 501,
1112
+ MESSAGE_EXTERNAL_LOGIC_BLOCKED = 502,
1113
+ SERVER_UNKNOWN_ERROR = 503,
1106
1114
  MESSAGE_RECALL_TIME_LIMIT = 504,
1107
1115
  SERVICE_NOT_ENABLED = 505,
1108
1116
  SERVICE_NOT_ALLOW_MESSAGING = 506,
1109
- SERVICE_NOT_ALLOW_MESSAGING_MUTE = 507, // @since 4.0 被禁言
1110
- SERVER_UNKNOWN_ERROR = 503, //未知异常
1111
- MESSAGE_INCLUDE_ILLEGAL_CONTENT = 501, //消息内容包含非法或敏感词
1112
- MESSAGE_EXTERNAL_LOGIC_BLOCKED = 502, // 消息被拦截
1113
- PERMISSION_DENIED = 603, //权限问题
1114
- WEBIM_LOAD_MSG_ERROR = 604, //消息发送失败下行
1115
- GROUP_ALREADY_JOINED = 601, //|已在该群组中|调用 加入群组的 API 时如果已经在该群组中则提示该错误|
1116
- // 700 参数校验
1117
+ SERVICE_NOT_ALLOW_MESSAGING_MUTE = 507,
1118
+ MESSAGE_MODERATION_BLOCKED = 508,
1119
+ GROUP_NOT_EXIST = 605,
1120
+ GROUP_NOT_JOINED = 602,
1121
+ GROUP_MEMBERS_FULL = 606,
1122
+ PERMISSION_DENIED = 603,
1123
+ WEBIM_LOAD_MSG_ERROR = 604,
1124
+ GROUP_ALREADY_JOINED = 601,
1125
+ GROUP_MEMBERS_LIMIT = 607,
1117
1126
  REST_PARAMS_STATUS = 700,
1118
- CHATROOM_MEMBERS_FULL = 704, // 聊天室人数达到上限
1119
- CHATROOM_NOT_EXIST = 705, // The chat room does not exist
1127
+ CHATROOM_MEMBERS_FULL = 704,
1128
+ CHATROOM_NOT_EXIST = 705,
1120
1129
  SDK_RUNTIME_ERROR = 999,
1130
+ PRESENCE_PARAM_EXCEED = 1100,
1131
+ REACTION_ALREADY_ADDED = 1101,
1132
+ REACTION_CREATING = 1102,
1133
+ REACTION_OPERATION_IS_ILLEGAL = 1103,
1134
+ TRANSLATION_NOT_VALID = 1200,
1135
+ TRANSLATION_TEXT_TOO_LONG = 1201,
1136
+ TRANSLATION_FAILED = 1204,
1137
+ THREAD_NOT_EXIST = 1300,
1138
+ THREAD_ALREADY_EXIST = 1301,
1121
1139
  }
1122
1140
 
1123
1141
  /**
@@ -3085,7 +3103,11 @@ export declare namespace EasemobChat {
3085
3103
  success?: (res: AsyncResult<SessionInfo[]>) => void;
3086
3104
  error?: (error: ErrorEvent) => void;
3087
3105
  }
3088
- ): Promise<AsyncResult<SessionInfo[]>>;
3106
+ ): Promise<
3107
+ AsyncResult<{
3108
+ channel_infos: SessionInfo[];
3109
+ }>
3110
+ >;
3089
3111
 
3090
3112
  /**
3091
3113
  * Gets the conversation list and the latest message under the conversation.
@@ -3145,9 +3167,12 @@ export declare namespace EasemobChat {
3145
3167
  fetchUserInfoById(
3146
3168
  this: Connection,
3147
3169
  userId: UserId | UserId[],
3148
- properties: ConfigurableKey[] | ConfigurableKey
3149
- ): Promise<AsyncResult<UpdateOwnUserInfoParams>>;
3150
-
3170
+ properties?: ConfigurableKey[] | ConfigurableKey
3171
+ ): Promise<
3172
+ AsyncResult<{
3173
+ [key: string]: UpdateOwnUserInfoParams;
3174
+ }>
3175
+ >;
3151
3176
  /**
3152
3177
  * When registering, you can set a nickname, which is used to display when pushing messages. You can call the following API to modify the nickname.
3153
3178
  *
@@ -3458,8 +3483,8 @@ export declare namespace EasemobChat {
3458
3483
  reportMessage(
3459
3484
  this: Connection,
3460
3485
  params: {
3461
- reportType: string; // 举报类型。
3462
- reportReason: string; // 举报原因。
3486
+ reportType: string;
3487
+ reportReason: string;
3463
3488
  messageId: string;
3464
3489
  }
3465
3490
  ): Promise<void>;
@@ -3667,9 +3692,10 @@ export declare namespace EasemobChat {
3667
3692
  params: {
3668
3693
  /** The chatThread ID. */
3669
3694
  chatThreadId: string;
3670
- }
3671
- ): Promise<void>;
3672
-
3695
+ }
3696
+ ): Promise<void>;
3697
+
3698
+ /**
3673
3699
  * Adds a reaction to the message.
3674
3700
  *
3675
3701
  * ```typescript
@@ -3698,9 +3724,10 @@ export declare namespace EasemobChat {
3698
3724
  params: {
3699
3725
  /** The chatThread ID. */
3700
3726
  chatThreadId: string;
3701
- }
3727
+ }
3702
3728
  ): Promise<void>;
3703
-
3729
+
3730
+ /**
3704
3731
  * Removes a reaction from a message.
3705
3732
  *
3706
3733
  * ```typescript
@@ -3837,7 +3864,8 @@ export declare namespace EasemobChat {
3837
3864
  }
3838
3865
  ): Promise<AsyncResult<ChatThreadDetail>>;
3839
3866
 
3840
- * Gets the reaction list for the message.
3867
+ /**
3868
+ * Gets the reaction list for the message.
3841
3869
  *
3842
3870
  * ```typescript
3843
3871
  * connection.getReactionList({chatType: 'chatType', messageId: 'messageId'})
@@ -3909,6 +3937,24 @@ export declare namespace EasemobChat {
3909
3937
  ts: number;
3910
3938
  }
3911
3939
 
3940
+ interface EventData {
3941
+ /** The type of operation. */
3942
+ /** 操作类型。 */
3943
+ operation: string;
3944
+ /** The ID of a group or chatroom. */
3945
+ /** 群组或者聊天室 ID。 */
3946
+ id: string;
3947
+ /** Message sender. */
3948
+ /** 消息发送者。 */
3949
+ from: string;
3950
+ /** Message receiver. */
3951
+ /** 消息接收者。 */
3952
+ to: string;
3953
+ /** Additional data for the operation event. */
3954
+ /** 操作事件的其他数据。 */
3955
+ data?: any;
3956
+ }
3957
+
3912
3958
  type Event =
3913
3959
  | 'onOpened'
3914
3960
  | 'onPresence'
@@ -3943,7 +3989,12 @@ export declare namespace EasemobChat {
3943
3989
  | 'onGroupChange'
3944
3990
  | 'onChatroomChange'
3945
3991
  | 'onContactChange'
3946
- | 'onPresenceStatusChange';
3992
+ | 'onPresenceStatusChange'
3993
+ | 'onReactionChange'
3994
+ | 'onChatThreadChange'
3995
+ | 'onMultiDeviceEvent'
3996
+ | 'onGroupEvent'
3997
+ | 'onChatroomEvent';
3947
3998
 
3948
3999
  interface EventHandlerType {
3949
4000
  onOpened?: (msg: any) => void;
@@ -3983,6 +4034,8 @@ export declare namespace EasemobChat {
3983
4034
  onChatThreadChange?: (msg: ThreadChangeInfo) => void;
3984
4035
  onMultiDeviceEvent?: (msg: ThreadMultiDeviceInfo) => void;
3985
4036
  onReactionChange?: (msg: ReactionMessage) => void;
4037
+ onGroupEvent?: (eventData: EventData) => void;
4038
+ onChatroomEvent?: (eventData: EventData) => void;
3986
4039
  }
3987
4040
 
3988
4041
  interface HandlerData {