easemob-websdk 4.1.4 → 4.1.5

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,4 +1,9 @@
1
1
  # Changes to easemob chat
2
+ ## 4.1.5 (April 13, 2023)
3
+
4
+ - 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.
5
+
6
+ Adds The error code 511, MESSAGE_SIZE_LIMIT, to notify you when the size of the message body exceeds the upper limit.
2
7
  ## 4.1.4 (Mar 16, 2023)
3
8
 
4
9
  - Add Group Member Attributes feature
package/Easemob-chat.d.ts CHANGED
@@ -1205,6 +1205,10 @@ export declare namespace EasemobChat {
1205
1205
  MESSAGE_MODERATION_BLOCKED = 508,
1206
1206
  /** Group chat ID current limiting. */
1207
1207
  MESSAGE_CURRENT_LIMITING = 509,
1208
+ /** The network is disconnected, causing message sending failure. */
1209
+ MESSAGE_WEBSOCKET_DISCONNECTED = 510,
1210
+ /** You have exceeded the maximum allowed size of a message body.*/
1211
+ MESSAGE_SIZE_LIMIT = 511,
1208
1212
  /** The group is not found. */
1209
1213
  GROUP_NOT_EXIST = 605,
1210
1214
  /** The user being operated is not in the group. */
@@ -4095,7 +4099,7 @@ export declare namespace EasemobChat {
4095
4099
  * Gets the message history.
4096
4100
  *
4097
4101
  * ```typescript
4098
- * connection.getHistoryMessages({targetId:'user1',chatType:'groupChat', pageSize: 20})
4102
+ * connection.getHistoryMessages({targetId:'targetId',chatType:'groupChat', pageSize: 20})
4099
4103
  * ```
4100
4104
  */
4101
4105
  getHistoryMessages(
@@ -4110,16 +4114,28 @@ export declare namespace EasemobChat {
4110
4114
  /** The chat type:
4111
4115
  * - `singleChat`: one-to-one chat;
4112
4116
  * - `groupChat`: group chat;
4113
- * - `chatRoom`: chat room.
4114
4117
  * - (Default)`singleChat`: No.
4115
4118
  */
4116
- chatType?: 'singleChat' | 'groupChat' | 'chatRoom';
4119
+ chatType?: 'singleChat' | 'groupChat';
4117
4120
  /** Whether to select pull history messages in positive order(Pull message from the oldest to the latest).
4118
4121
  * - `up`: means searching from the newer messages to the older messages.
4119
4122
  * - `down`: means searching from the older messages to the newer messages.
4120
4123
  * - (Default)`up`.
4121
4124
  */
4122
- searchDirection?: string;
4125
+ searchDirection?: 'down' | 'up';
4126
+ /** Query conditions. */
4127
+ searchOptions?: {
4128
+ /** The user ID of the message sender. This parameter is used only for group chat. */
4129
+ from?: UserId;
4130
+ /** An array of message types for query. If no value is passed in, all message types will be queried. */
4131
+ msgTypes?: Array<
4132
+ Exclude<MessageType, 'read' | 'delivery' | 'channel'>
4133
+ >;
4134
+ /** The start timestamp for query. The unit is millisecond. */
4135
+ startTime?: number;
4136
+ /** The end timestamp for query. The unit is millisecond. */
4137
+ endTime?: number;
4138
+ };
4123
4139
  success?: (res: MessageBody[]) => void;
4124
4140
  fail?: (error: ErrorEvent) => void;
4125
4141
  }