easemob-websdk 4.0.5 → 4.0.6-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 +7 -0
- package/Easemob-chat.d.ts +575 -1
- package/Easemob-chat.js +1 -1
- package/package.json +1 -1
package/Easemob-chat.d.ts
CHANGED
|
@@ -114,6 +114,19 @@ export declare namespace EasemobChat {
|
|
|
114
114
|
owner?: string;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
+
type multiDeviceEventType =
|
|
118
|
+
| 'chatThreadCreate'
|
|
119
|
+
| 'chatThreadDestroy'
|
|
120
|
+
| 'chatThreadJoin'
|
|
121
|
+
| 'chatThreadLeave'
|
|
122
|
+
| 'chatThreadNameUpdate';
|
|
123
|
+
interface ThreadMultiDeviceInfo {
|
|
124
|
+
operation: multiDeviceEventType;
|
|
125
|
+
chatThreadId?: string;
|
|
126
|
+
chatThreadName?: string;
|
|
127
|
+
parentId?: string;
|
|
128
|
+
}
|
|
129
|
+
|
|
117
130
|
/**
|
|
118
131
|
* The connection module is the module where the SDK creates long link, And all about links, friends, groups, and chat apis are all in this module
|
|
119
132
|
*
|
|
@@ -815,6 +828,195 @@ export declare namespace EasemobChat {
|
|
|
815
828
|
| SilentModeDuration
|
|
816
829
|
| SilentModeInterval;
|
|
817
830
|
|
|
831
|
+
interface ChatThread {
|
|
832
|
+
/** The Message ID for creating thread. */
|
|
833
|
+
messageId: string;
|
|
834
|
+
/** Generally refers to the group ID. */
|
|
835
|
+
parentId: string;
|
|
836
|
+
/** The chatThread name. */
|
|
837
|
+
chatThreadName: SVGStringList;
|
|
838
|
+
}
|
|
839
|
+
interface ChatThreadOverview {
|
|
840
|
+
/** The thread ID. */
|
|
841
|
+
id: string;
|
|
842
|
+
/** Generally refers to the group ID. */
|
|
843
|
+
parentId: string; //parent
|
|
844
|
+
/** The thread name. */
|
|
845
|
+
name: string;
|
|
846
|
+
/** Overview of the latest news. */
|
|
847
|
+
lastMessage: LastMessage;
|
|
848
|
+
/** The thread create timestamp. */
|
|
849
|
+
createTimestamp: number;
|
|
850
|
+
/** The timestamp to update the thread overview. */
|
|
851
|
+
updateTimestamp: number;
|
|
852
|
+
/** The thread message count. */
|
|
853
|
+
messageCount: number;
|
|
854
|
+
}
|
|
855
|
+
interface LastMessage {
|
|
856
|
+
/** The message id. */
|
|
857
|
+
id: string;
|
|
858
|
+
/** The sender id. */
|
|
859
|
+
from: string;
|
|
860
|
+
/** The receiver id. */
|
|
861
|
+
to: string;
|
|
862
|
+
/** The time stamp. */
|
|
863
|
+
timestamp: number;
|
|
864
|
+
/** The message content. */
|
|
865
|
+
payload: any;
|
|
866
|
+
}
|
|
867
|
+
type Operation = 'create' | 'update' | 'delete' | 'update_msg';
|
|
868
|
+
interface ThreadNotifyServerMsg {
|
|
869
|
+
/** The event type. */
|
|
870
|
+
operation: Operation;
|
|
871
|
+
/** The message ID for creating thread. */
|
|
872
|
+
msg_parent_id?: string;
|
|
873
|
+
/** The thread ID. */
|
|
874
|
+
id: string;
|
|
875
|
+
/** The group ID of the thread. */
|
|
876
|
+
muc_parent_id: string;
|
|
877
|
+
/** The Thread Name. */
|
|
878
|
+
name: string;
|
|
879
|
+
/** The action occurrence time. */
|
|
880
|
+
timestamp: number;
|
|
881
|
+
/** The operator. */
|
|
882
|
+
from?: string;
|
|
883
|
+
/** The last message of Thread. */
|
|
884
|
+
last_message?: LastMessage;
|
|
885
|
+
/** The Thread message count. */
|
|
886
|
+
message_count?: number;
|
|
887
|
+
}
|
|
888
|
+
interface CreateChatThreadResult {
|
|
889
|
+
/** The Thread ID. */
|
|
890
|
+
chatThreadId: string;
|
|
891
|
+
}
|
|
892
|
+
interface ChangeChatThreadName {
|
|
893
|
+
/** The thread name. */
|
|
894
|
+
name: string;
|
|
895
|
+
}
|
|
896
|
+
|
|
897
|
+
interface ChatThreadMembers {
|
|
898
|
+
/** The list of thread members. */
|
|
899
|
+
affiliations: string[];
|
|
900
|
+
}
|
|
901
|
+
|
|
902
|
+
type RemoveMemberResult = {
|
|
903
|
+
/** The operation results. */
|
|
904
|
+
result: boolean;
|
|
905
|
+
/** The ID of thread member. */
|
|
906
|
+
user: UserId;
|
|
907
|
+
};
|
|
908
|
+
|
|
909
|
+
interface ChatThreadDetail {
|
|
910
|
+
/** The thread ID. */
|
|
911
|
+
id: string;
|
|
912
|
+
/** The thread name. */
|
|
913
|
+
name: string;
|
|
914
|
+
/** The thread owner. */
|
|
915
|
+
owner: string;
|
|
916
|
+
/** The creation time of the thread. */
|
|
917
|
+
created: number;
|
|
918
|
+
/** The number of thread members. */
|
|
919
|
+
affiliationsCount?: number;
|
|
920
|
+
//** Generally refers to the group ID. */
|
|
921
|
+
parentId: string;
|
|
922
|
+
/** The parent message ID. */
|
|
923
|
+
messageId: string;
|
|
924
|
+
}
|
|
925
|
+
interface JoinChatThreadResult {
|
|
926
|
+
/** Operation results. */
|
|
927
|
+
status: 'ok';
|
|
928
|
+
/** The chatThread detail. */
|
|
929
|
+
detail: ChatThreadDetail;
|
|
930
|
+
}
|
|
931
|
+
interface ChatThreadLastMessage {
|
|
932
|
+
/** The chatThread ID. */
|
|
933
|
+
chatThreadId: string;
|
|
934
|
+
/** The last message. */
|
|
935
|
+
lastMessage: MessageBody;
|
|
936
|
+
}
|
|
937
|
+
|
|
938
|
+
type onChatThreadChangeType =
|
|
939
|
+
| 'create'
|
|
940
|
+
| 'update'
|
|
941
|
+
| 'destroy'
|
|
942
|
+
| 'userRemove';
|
|
943
|
+
interface ThreadChangeInfo {
|
|
944
|
+
/** The thread ID. */
|
|
945
|
+
id: string;
|
|
946
|
+
/** The thread name. */
|
|
947
|
+
name: string;
|
|
948
|
+
/** The operator. */
|
|
949
|
+
operator: string;
|
|
950
|
+
/** The type of operation. */
|
|
951
|
+
operation: onChatThreadChangeType;
|
|
952
|
+
/** Generally refers to the group ID. */
|
|
953
|
+
parentId: string;
|
|
954
|
+
/** The parent message ID. */
|
|
955
|
+
messageId?: string;
|
|
956
|
+
/** The thread message count. */
|
|
957
|
+
messageCount?: number;
|
|
958
|
+
/** Overview of the latest news. */
|
|
959
|
+
// eslint-disable-next-line @typescript-eslint/ban-types
|
|
960
|
+
lastMessage?: MessageBody | {};
|
|
961
|
+
/** The operated object. */
|
|
962
|
+
userName?: string;
|
|
963
|
+
/** Operation time. */
|
|
964
|
+
timestamp?: number;
|
|
965
|
+
/** The creation time. */
|
|
966
|
+
createTimestamp?: number;
|
|
967
|
+
}
|
|
968
|
+
interface HistoryMessages {
|
|
969
|
+
//** 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 empty string, the data of the first page will be fetched.*/
|
|
970
|
+
cursor?: string;
|
|
971
|
+
/** The Historical messages. */
|
|
972
|
+
messages: MessageBody[];
|
|
973
|
+
}
|
|
974
|
+
interface conversationList {
|
|
975
|
+
/** The conversation ID. */
|
|
976
|
+
channel_id: string;
|
|
977
|
+
/** Overview of the latest news. */
|
|
978
|
+
lastMessage: LastMessage;
|
|
979
|
+
/** The number of unread messages. */
|
|
980
|
+
unread_num: number;
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
interface GetReactionDetailResult {
|
|
984
|
+
/** The reaction to be added to the message. The length is limited to 128 characters. */
|
|
985
|
+
reaction: string;
|
|
986
|
+
/** Whether the current user added this reaction.
|
|
987
|
+
* - `true`: Yes;
|
|
988
|
+
* - `false`: No.
|
|
989
|
+
*/
|
|
990
|
+
isAddedBySelf: boolean;
|
|
991
|
+
/** The number of users that added this reaction. */
|
|
992
|
+
userCount: number;
|
|
993
|
+
/** The IDs of the users who added the reaction. */
|
|
994
|
+
userList: UserId[];
|
|
995
|
+
/** The cursor that specifies where to start to get data. If there is data on the next page, this method will return the cursor to indicate where to start to get data for the next query. If it is `null`, the data of the first page will be returned.*/
|
|
996
|
+
cursor: string;
|
|
997
|
+
}
|
|
998
|
+
|
|
999
|
+
interface ReactionListItem {
|
|
1000
|
+
/** The reaction added to the message. It cannot exceed 128 characters. */
|
|
1001
|
+
reaction: string;
|
|
1002
|
+
/** Whether the current user added this reaction.
|
|
1003
|
+
* - `true`: Yes;
|
|
1004
|
+
* - `false`: No.
|
|
1005
|
+
*/
|
|
1006
|
+
isAddedBySelf: boolean;
|
|
1007
|
+
/** The number of users that added this reaction. */
|
|
1008
|
+
userCount: number;
|
|
1009
|
+
/** The IDs of the users who added the reaction. */
|
|
1010
|
+
userList: UserId[];
|
|
1011
|
+
}
|
|
1012
|
+
|
|
1013
|
+
interface GetReactionListResult {
|
|
1014
|
+
/** The ID of the message to which this reaction was added. */
|
|
1015
|
+
msgId: string;
|
|
1016
|
+
/** The reaction list of this message. */
|
|
1017
|
+
reactionList: ReactionListItem[];
|
|
1018
|
+
}
|
|
1019
|
+
|
|
818
1020
|
enum Code {
|
|
819
1021
|
REQUEST_SUCCESS = 0,
|
|
820
1022
|
REQUEST_TIMEOUT = -1,
|
|
@@ -2885,6 +3087,21 @@ export declare namespace EasemobChat {
|
|
|
2885
3087
|
}
|
|
2886
3088
|
): Promise<AsyncResult<SessionInfo[]>>;
|
|
2887
3089
|
|
|
3090
|
+
/**
|
|
3091
|
+
* Gets the conversation list and the latest message under the conversation.
|
|
3092
|
+
*
|
|
3093
|
+
* ```typescript
|
|
3094
|
+
* connection.getConversationList()
|
|
3095
|
+
* ```
|
|
3096
|
+
*/
|
|
3097
|
+
getConversationList(
|
|
3098
|
+
this: Connection,
|
|
3099
|
+
params?: {
|
|
3100
|
+
success?: (res: AsyncResult<SessionInfo[]>) => void;
|
|
3101
|
+
error?: (error: ErrorEvent) => void;
|
|
3102
|
+
}
|
|
3103
|
+
): Promise<AsyncResult<conversationList[]>>;
|
|
3104
|
+
|
|
2888
3105
|
/**
|
|
2889
3106
|
* Delete the session.
|
|
2890
3107
|
*
|
|
@@ -2963,6 +3180,40 @@ export declare namespace EasemobChat {
|
|
|
2963
3180
|
}
|
|
2964
3181
|
): Promise<MessageBody[]>;
|
|
2965
3182
|
|
|
3183
|
+
/**
|
|
3184
|
+
* Gets the message history.
|
|
3185
|
+
*
|
|
3186
|
+
* ```typescript
|
|
3187
|
+
* connection.getHistoryMessages({targetId:'user1',chatType:'groupChat', pageSize: 20})
|
|
3188
|
+
* ```
|
|
3189
|
+
*/
|
|
3190
|
+
getHistoryMessages(
|
|
3191
|
+
this: Connection,
|
|
3192
|
+
options: {
|
|
3193
|
+
/** The user ID of the other party or the group ID. */
|
|
3194
|
+
targetId: string;
|
|
3195
|
+
/** The starting message ID for this query. The default value is -1, which means to start retrieving from the latest message. */
|
|
3196
|
+
cursor?: number | string | null;
|
|
3197
|
+
/** The number of messages to retrieve each time. The default value is 20,The maximum value is 50. */
|
|
3198
|
+
pageSize?: number;
|
|
3199
|
+
/** The chat type for SDK V4.0:
|
|
3200
|
+
* - `singleChat`: one-to-one chat;
|
|
3201
|
+
* - `groupchat`: group chat;
|
|
3202
|
+
* - `chatroom`: chat room.
|
|
3203
|
+
* - (Default)`singleChat`: No.
|
|
3204
|
+
*/
|
|
3205
|
+
chatType?: 'singleChat' | 'groupChat' | 'chatRoom';
|
|
3206
|
+
/** Whether to select pull history messages in positive order(Pull message from the oldest to the latest).
|
|
3207
|
+
* - `up`: means searching from the newer messages to the older messages.
|
|
3208
|
+
* - `down`: means searching from the older messages to the newer messages.
|
|
3209
|
+
* - (Default)`up`.
|
|
3210
|
+
*/
|
|
3211
|
+
searchDirection?: string;
|
|
3212
|
+
success?: (res: MessageBody[]) => void;
|
|
3213
|
+
fail?: (error: ErrorEvent) => void;
|
|
3214
|
+
}
|
|
3215
|
+
): Promise<HistoryMessages>;
|
|
3216
|
+
|
|
2966
3217
|
/**
|
|
2967
3218
|
* Adds Contact.
|
|
2968
3219
|
*
|
|
@@ -3069,7 +3320,7 @@ export declare namespace EasemobChat {
|
|
|
3069
3320
|
* Recall a message
|
|
3070
3321
|
*
|
|
3071
3322
|
* ```typescript
|
|
3072
|
-
* connection.recallMessage({mid: 'messageId', to: 'user1', type: 'singleChat'})
|
|
3323
|
+
* connection.recallMessage({mid: 'messageId', to: 'user1', type: 'singleChat', isChatThread: false})
|
|
3073
3324
|
* ```
|
|
3074
3325
|
*/
|
|
3075
3326
|
recallMessage(
|
|
@@ -3079,6 +3330,7 @@ export declare namespace EasemobChat {
|
|
|
3079
3330
|
to: UserId;
|
|
3080
3331
|
type?: 'chat' | 'groupchat' | 'chatroom'; // v3.0
|
|
3081
3332
|
chatType?: 'singleChat' | 'groupChat' | 'chatRoom'; // v4.0
|
|
3333
|
+
isChatThread?: boolean;
|
|
3082
3334
|
success?: (res: number) => void;
|
|
3083
3335
|
fail?: (error: ErrorEvent) => void;
|
|
3084
3336
|
}
|
|
@@ -3368,6 +3620,264 @@ export declare namespace EasemobChat {
|
|
|
3368
3620
|
error?: (error: ErrorEvent) => void;
|
|
3369
3621
|
}
|
|
3370
3622
|
): Promise<AsyncResult<TranslationLanguageType>>;
|
|
3623
|
+
|
|
3624
|
+
/**
|
|
3625
|
+
* Creates a chatThread.
|
|
3626
|
+
*
|
|
3627
|
+
* ```typescript
|
|
3628
|
+
* connection.createChatThread({parentId: 'parentId',name: 'threadName',messageId: 'messageId'})
|
|
3629
|
+
* ```
|
|
3630
|
+
*/
|
|
3631
|
+
createChatThread(
|
|
3632
|
+
this: Connection,
|
|
3633
|
+
params: {
|
|
3634
|
+
/** Generally refers to the group ID. */
|
|
3635
|
+
parentId: string;
|
|
3636
|
+
/** The chatThread name. */
|
|
3637
|
+
name: string;
|
|
3638
|
+
/** The parent message ID. */
|
|
3639
|
+
messageId: string;
|
|
3640
|
+
}
|
|
3641
|
+
): Promise<AsyncResult<CreateChatThreadResult>>;
|
|
3642
|
+
|
|
3643
|
+
/**
|
|
3644
|
+
* Joins the chatThread.
|
|
3645
|
+
*
|
|
3646
|
+
* ```typescript
|
|
3647
|
+
* connection.joinChatThread({chatThreadId: 'chatThreadId'})
|
|
3648
|
+
* ```
|
|
3649
|
+
*/
|
|
3650
|
+
joinChatThread(
|
|
3651
|
+
this: Connection,
|
|
3652
|
+
params: {
|
|
3653
|
+
/** The chatThread ID. */
|
|
3654
|
+
chatThreadId: string;
|
|
3655
|
+
}
|
|
3656
|
+
): Promise<AsyncResult<JoinChatThreadResult>>;
|
|
3657
|
+
|
|
3658
|
+
/**
|
|
3659
|
+
* Leaves the chatThread.
|
|
3660
|
+
*
|
|
3661
|
+
* ```typescript
|
|
3662
|
+
* connection.leaveChatThread({chatThreadId: 'chatThreadId'})
|
|
3663
|
+
* ```
|
|
3664
|
+
*/
|
|
3665
|
+
leaveChatThread(
|
|
3666
|
+
this: Connection,
|
|
3667
|
+
params: {
|
|
3668
|
+
/** The chatThread ID. */
|
|
3669
|
+
chatThreadId: string;
|
|
3670
|
+
}
|
|
3671
|
+
): Promise<void>;
|
|
3672
|
+
|
|
3673
|
+
* Adds a reaction to the message.
|
|
3674
|
+
*
|
|
3675
|
+
* ```typescript
|
|
3676
|
+
* connection.addReaction({messageId: 'messageId', action: 'action'})
|
|
3677
|
+
* ```
|
|
3678
|
+
*/
|
|
3679
|
+
addReaction(
|
|
3680
|
+
this: Connection,
|
|
3681
|
+
params: {
|
|
3682
|
+
/** The message ID. */
|
|
3683
|
+
messageId: string;
|
|
3684
|
+
/** The reaction to be added to the message. The length is limited to 128 characters. */
|
|
3685
|
+
reaction: string;
|
|
3686
|
+
}
|
|
3687
|
+
): Promise<void>;
|
|
3688
|
+
|
|
3689
|
+
/**
|
|
3690
|
+
* Deletes the chatThread,group leader and administrator have this permission.
|
|
3691
|
+
*
|
|
3692
|
+
* ```typescript
|
|
3693
|
+
* connection.destroyChatThread({chatThreadId: 'chatThreadId'})
|
|
3694
|
+
* ```
|
|
3695
|
+
*/
|
|
3696
|
+
destroyChatThread(
|
|
3697
|
+
this: Connection,
|
|
3698
|
+
params: {
|
|
3699
|
+
/** The chatThread ID. */
|
|
3700
|
+
chatThreadId: string;
|
|
3701
|
+
}
|
|
3702
|
+
): Promise<void>;
|
|
3703
|
+
|
|
3704
|
+
* Removes a reaction from a message.
|
|
3705
|
+
*
|
|
3706
|
+
* ```typescript
|
|
3707
|
+
* connection.deleteReaction({reactionId: 'reactionId'})
|
|
3708
|
+
* ```
|
|
3709
|
+
*/
|
|
3710
|
+
deleteReaction(
|
|
3711
|
+
this: Connection,
|
|
3712
|
+
params: {
|
|
3713
|
+
/** The message reaction to delete. */
|
|
3714
|
+
reaction: string;
|
|
3715
|
+
/** The message ID. */
|
|
3716
|
+
messageId: string;
|
|
3717
|
+
}
|
|
3718
|
+
): Promise<void>;
|
|
3719
|
+
|
|
3720
|
+
/**
|
|
3721
|
+
* Modifies the chatThread name.
|
|
3722
|
+
*
|
|
3723
|
+
* ```typescript
|
|
3724
|
+
* connection.changeChatThreadName({chatThreadId: 'chatThreadId',name: 'name'})
|
|
3725
|
+
* ```
|
|
3726
|
+
*/
|
|
3727
|
+
changeChatThreadName(
|
|
3728
|
+
this: Connection,
|
|
3729
|
+
params: {
|
|
3730
|
+
/** The chatThread ID. */
|
|
3731
|
+
chatThreadId: string;
|
|
3732
|
+
/** The chatThread name. */
|
|
3733
|
+
name: string;
|
|
3734
|
+
}
|
|
3735
|
+
): Promise<AsyncResult<ChangeChatThreadName>>;
|
|
3736
|
+
|
|
3737
|
+
/**
|
|
3738
|
+
* Lists all members of the chatThread with pagination.
|
|
3739
|
+
*
|
|
3740
|
+
* ```typescript
|
|
3741
|
+
* connection.getChatThreadMembers({chatThreadId: 'chatThreadId',pageSize:20,cursor:'cursor'})
|
|
3742
|
+
* ```
|
|
3743
|
+
*/
|
|
3744
|
+
getChatThreadMembers(
|
|
3745
|
+
this: Connection,
|
|
3746
|
+
params: {
|
|
3747
|
+
/** The Thread ID. */
|
|
3748
|
+
chatThreadId: string;
|
|
3749
|
+
/** The number of members per page. The default value is 20, and the maximum value is 50.*/
|
|
3750
|
+
pageSize?: number;
|
|
3751
|
+
/** 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 empty string, the data of the first page will be fetched.*/
|
|
3752
|
+
cursor?: string;
|
|
3753
|
+
}
|
|
3754
|
+
): Promise<AsyncResult<ChatThreadMembers>>;
|
|
3755
|
+
|
|
3756
|
+
/**
|
|
3757
|
+
* Removes a member from the chatThread.
|
|
3758
|
+
*
|
|
3759
|
+
* ```typescript
|
|
3760
|
+
* connection.removeChatThreadMember({chatThreadId: 'chatThreadId',username:'username'})
|
|
3761
|
+
* ```
|
|
3762
|
+
*/
|
|
3763
|
+
removeChatThreadMember(
|
|
3764
|
+
this: Connection,
|
|
3765
|
+
params: {
|
|
3766
|
+
/** The chatThread ID. */
|
|
3767
|
+
chatThreadId: string;
|
|
3768
|
+
/** The member ID to remove. */
|
|
3769
|
+
username: string;
|
|
3770
|
+
}
|
|
3771
|
+
): Promise<AsyncResult<RemoveMemberResult>>;
|
|
3772
|
+
|
|
3773
|
+
/**
|
|
3774
|
+
* Gets the list of joined chatThreads with pagination.When parentId is not null, get the list of chatThread under the specified group.
|
|
3775
|
+
*
|
|
3776
|
+
* ```typescript
|
|
3777
|
+
* connection.getJoinedChatThreads({parentId: 'parentId',cursor: 'cursor',pageSize: 50})
|
|
3778
|
+
* ```
|
|
3779
|
+
*/
|
|
3780
|
+
getJoinedChatThreads(
|
|
3781
|
+
this: Connection,
|
|
3782
|
+
params: {
|
|
3783
|
+
/** Generally refers to the group ID. */
|
|
3784
|
+
parentId?: string;
|
|
3785
|
+
/** The number of thread per page. The default value is 20, and the maximum value is 50. */
|
|
3786
|
+
pageSize?: number;
|
|
3787
|
+
/** 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.*/
|
|
3788
|
+
cursor?: string;
|
|
3789
|
+
}
|
|
3790
|
+
): Promise<AsyncResult<ChatThreadDetail[]>>;
|
|
3791
|
+
|
|
3792
|
+
/**
|
|
3793
|
+
* Gets the thread list of the specified group with pagination.
|
|
3794
|
+
* ```typescript
|
|
3795
|
+
* connection.getChatThreads({parentId: 'parentId, cursor:'cursor' ,pageSize: 50})
|
|
3796
|
+
* ```
|
|
3797
|
+
*/
|
|
3798
|
+
getChatThreads(
|
|
3799
|
+
this: Connection,
|
|
3800
|
+
params: {
|
|
3801
|
+
/** Generally refers to the group ID. */
|
|
3802
|
+
parentId: string;
|
|
3803
|
+
/** The number of thread per page. The default value is 20, and the maximum value is 50. */
|
|
3804
|
+
pageSize?: number;
|
|
3805
|
+
/** 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 empty string, the data of the first page will be fetched.*/
|
|
3806
|
+
cursor?: string;
|
|
3807
|
+
}
|
|
3808
|
+
): Promise<AsyncResult<ChatThreadDetail[]>>;
|
|
3809
|
+
|
|
3810
|
+
/**
|
|
3811
|
+
* Gets the latest message content of the chatThread in batch,with a maximum of 20 messages.
|
|
3812
|
+
*
|
|
3813
|
+
* ```typescript
|
|
3814
|
+
* connection.getChatThreadLastMessage({chatThreadIds: ['chatThreadId1','chatThreadId2']})
|
|
3815
|
+
* ```
|
|
3816
|
+
*/
|
|
3817
|
+
getChatThreadLastMessage(
|
|
3818
|
+
this: Connection,
|
|
3819
|
+
params: {
|
|
3820
|
+
/** The array of chatThread IDs to query.*/
|
|
3821
|
+
chatThreadIds: string[];
|
|
3822
|
+
}
|
|
3823
|
+
): Promise<AsyncResult<ChatThreadLastMessage>>;
|
|
3824
|
+
|
|
3825
|
+
/**
|
|
3826
|
+
* Gets detail of the chatThread.
|
|
3827
|
+
*
|
|
3828
|
+
* ```typescript
|
|
3829
|
+
* connection.getChatThreadDetail({chatThreadId: 'chatThreadId'})
|
|
3830
|
+
* ```
|
|
3831
|
+
*/
|
|
3832
|
+
getChatThreadDetail(
|
|
3833
|
+
this: Connection,
|
|
3834
|
+
params: {
|
|
3835
|
+
/** The chatThread ID. */
|
|
3836
|
+
chatThreadId: string;
|
|
3837
|
+
}
|
|
3838
|
+
): Promise<AsyncResult<ChatThreadDetail>>;
|
|
3839
|
+
|
|
3840
|
+
* Gets the reaction list for the message.
|
|
3841
|
+
*
|
|
3842
|
+
* ```typescript
|
|
3843
|
+
* connection.getReactionList({chatType: 'chatType', messageId: 'messageId'})
|
|
3844
|
+
* ```
|
|
3845
|
+
*/
|
|
3846
|
+
getReactionList(
|
|
3847
|
+
this: Connection,
|
|
3848
|
+
params: {
|
|
3849
|
+
/** The conversation type:
|
|
3850
|
+
* - singleChat;
|
|
3851
|
+
* - groupChat;
|
|
3852
|
+
*/
|
|
3853
|
+
chatType: 'singleChat' | 'groupChat';
|
|
3854
|
+
/** The message ID. */
|
|
3855
|
+
messageId: string | Array<string>;
|
|
3856
|
+
/** The group ID. */
|
|
3857
|
+
groupId?: string;
|
|
3858
|
+
}
|
|
3859
|
+
): Promise<AsyncResult<GetReactionListResult[]>>;
|
|
3860
|
+
|
|
3861
|
+
/**
|
|
3862
|
+
* Gets the details of a reaction.
|
|
3863
|
+
*
|
|
3864
|
+
* ```typescript
|
|
3865
|
+
* getReactionDetail({messageId: 'messageId', reaction: 'reaction', cursor: '', pageSize: 20})
|
|
3866
|
+
* ```
|
|
3867
|
+
*/
|
|
3868
|
+
getReactionDetail(
|
|
3869
|
+
this: Connection,
|
|
3870
|
+
params: {
|
|
3871
|
+
/** The message ID. */
|
|
3872
|
+
messageId: string;
|
|
3873
|
+
/** The reactions to retrieve. */
|
|
3874
|
+
reaction: string;
|
|
3875
|
+
/** 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 retrieved.*/
|
|
3876
|
+
cursor?: string; // 默认为 null
|
|
3877
|
+
/** The number of reactions per page. The default value is 20, and the maximum value is 100. */
|
|
3878
|
+
pageSize?: number;
|
|
3879
|
+
}
|
|
3880
|
+
): Promise<AsyncResult<GetReactionDetailResult>>;
|
|
3371
3881
|
}
|
|
3372
3882
|
|
|
3373
3883
|
/**
|
|
@@ -3384,6 +3894,21 @@ export declare namespace EasemobChat {
|
|
|
3384
3894
|
| RecallMsgBody
|
|
3385
3895
|
| ChannelMsgBody;
|
|
3386
3896
|
|
|
3897
|
+
interface ReactionMessage {
|
|
3898
|
+
/** The message sender. */
|
|
3899
|
+
from: string;
|
|
3900
|
+
/** The message recipient. */
|
|
3901
|
+
to: string;
|
|
3902
|
+
/** The conversation type. */
|
|
3903
|
+
chatType: 'singleChat' | 'groupChat';
|
|
3904
|
+
/** The reaction to be added to the message. The length is limited to 128 characters. */
|
|
3905
|
+
reactions: Reaction[];
|
|
3906
|
+
/** The ID of the message whose reaction updated. */
|
|
3907
|
+
messageId: string;
|
|
3908
|
+
/** The Unix timestamp for updating the reaction. */
|
|
3909
|
+
ts: number;
|
|
3910
|
+
}
|
|
3911
|
+
|
|
3387
3912
|
type Event =
|
|
3388
3913
|
| 'onOpened'
|
|
3389
3914
|
| 'onPresence'
|
|
@@ -3455,6 +3980,9 @@ export declare namespace EasemobChat {
|
|
|
3455
3980
|
onChatroomChange?: (msg: any) => void;
|
|
3456
3981
|
onContactChange?: (msg: any) => void;
|
|
3457
3982
|
onPresenceStatusChange?: (msg: PresenceType[]) => void;
|
|
3983
|
+
onChatThreadChange?: (msg: ThreadChangeInfo) => void;
|
|
3984
|
+
onMultiDeviceEvent?: (msg: ThreadMultiDeviceInfo) => void;
|
|
3985
|
+
onReactionChange?: (msg: ReactionMessage) => void;
|
|
3458
3986
|
}
|
|
3459
3987
|
|
|
3460
3988
|
interface HandlerData {
|
|
@@ -3625,6 +4153,23 @@ export declare namespace EasemobChat {
|
|
|
3625
4153
|
filetype: string;
|
|
3626
4154
|
data: File;
|
|
3627
4155
|
}
|
|
4156
|
+
|
|
4157
|
+
interface Reaction {
|
|
4158
|
+
/** The content of the reaction to be added to the message. The length is limited to 128 characters. */
|
|
4159
|
+
reaction: string;
|
|
4160
|
+
/** The reaction count. */
|
|
4161
|
+
count: number;
|
|
4162
|
+
/** The reaction update operation. Once the reaction is updated, the onReactionChange callback is triggered. */
|
|
4163
|
+
op?: { operator: UserId; reactionType: 'create' | 'delete' }[];
|
|
4164
|
+
/** The IDs of the users that added the reaction. */
|
|
4165
|
+
userList: UserId[];
|
|
4166
|
+
/** Whether the current user has added this reaction.
|
|
4167
|
+
* - `true`: Yes.
|
|
4168
|
+
* - `false`: No.
|
|
4169
|
+
*/
|
|
4170
|
+
isAddedBySelf?: boolean;
|
|
4171
|
+
}
|
|
4172
|
+
|
|
3628
4173
|
interface PresenceMsg {
|
|
3629
4174
|
type: OnPresenceMsgType;
|
|
3630
4175
|
to: string;
|
|
@@ -3652,6 +4197,7 @@ export declare namespace EasemobChat {
|
|
|
3652
4197
|
groupReadCount?: { [key: string]: number };
|
|
3653
4198
|
ackContent?: string;
|
|
3654
4199
|
chatType: 'singleChat' | 'groupChat';
|
|
4200
|
+
isChatThread?: boolean;
|
|
3655
4201
|
}
|
|
3656
4202
|
interface ReadParameters {
|
|
3657
4203
|
type: 'read';
|
|
@@ -3665,6 +4211,7 @@ export declare namespace EasemobChat {
|
|
|
3665
4211
|
id: string;
|
|
3666
4212
|
ackContent?: string;
|
|
3667
4213
|
chatType: 'singleChat' | 'groupChat';
|
|
4214
|
+
isChatThread?: boolean;
|
|
3668
4215
|
}
|
|
3669
4216
|
|
|
3670
4217
|
interface DeliveryParameters {
|
|
@@ -3683,6 +4230,7 @@ export declare namespace EasemobChat {
|
|
|
3683
4230
|
type: 'delivery';
|
|
3684
4231
|
to: string;
|
|
3685
4232
|
from?: string;
|
|
4233
|
+
isChatThread?: boolean;
|
|
3686
4234
|
}
|
|
3687
4235
|
|
|
3688
4236
|
interface CreateDeliveryMsgParameters {
|
|
@@ -3690,6 +4238,7 @@ export declare namespace EasemobChat {
|
|
|
3690
4238
|
type: 'delivery';
|
|
3691
4239
|
to: string;
|
|
3692
4240
|
from?: string;
|
|
4241
|
+
isChatThread?: boolean;
|
|
3693
4242
|
}
|
|
3694
4243
|
|
|
3695
4244
|
interface ChannelMsgSetParameters {
|
|
@@ -3703,6 +4252,7 @@ export declare namespace EasemobChat {
|
|
|
3703
4252
|
group?: string;
|
|
3704
4253
|
type: 'channel';
|
|
3705
4254
|
time: number;
|
|
4255
|
+
isChatThread?: boolean;
|
|
3706
4256
|
}
|
|
3707
4257
|
interface ChannelParameters {
|
|
3708
4258
|
type: 'channel';
|
|
@@ -3714,6 +4264,7 @@ export declare namespace EasemobChat {
|
|
|
3714
4264
|
chatType: ChatType;
|
|
3715
4265
|
to: string;
|
|
3716
4266
|
from?: string;
|
|
4267
|
+
isChatThread?: boolean;
|
|
3717
4268
|
}
|
|
3718
4269
|
|
|
3719
4270
|
interface TextParameters {
|
|
@@ -3746,6 +4297,8 @@ export declare namespace EasemobChat {
|
|
|
3746
4297
|
msgConfig?: { allowGroupAck?: boolean; languages?: string[] };
|
|
3747
4298
|
translations?: TranslationResult;
|
|
3748
4299
|
time: number;
|
|
4300
|
+
isChatThread?: boolean;
|
|
4301
|
+
reactions?: Reaction;
|
|
3749
4302
|
}
|
|
3750
4303
|
|
|
3751
4304
|
interface CreateTextMsgParameters {
|
|
@@ -3756,6 +4309,7 @@ export declare namespace EasemobChat {
|
|
|
3756
4309
|
from?: string;
|
|
3757
4310
|
ext?: { [key: string]: any };
|
|
3758
4311
|
msgConfig?: { allowGroupAck?: boolean; languages?: string[] };
|
|
4312
|
+
isChatThread?: boolean;
|
|
3759
4313
|
}
|
|
3760
4314
|
|
|
3761
4315
|
interface CmdParameters {
|
|
@@ -3787,6 +4341,8 @@ export declare namespace EasemobChat {
|
|
|
3787
4341
|
ext?: { [key: string]: any };
|
|
3788
4342
|
msgConfig?: { [key: string]: any };
|
|
3789
4343
|
time: number;
|
|
4344
|
+
isChatThread?: boolean;
|
|
4345
|
+
reactions?: Reaction;
|
|
3790
4346
|
}
|
|
3791
4347
|
|
|
3792
4348
|
interface CreateCmdMsgParameters {
|
|
@@ -3798,6 +4354,7 @@ export declare namespace EasemobChat {
|
|
|
3798
4354
|
roomType?: boolean;
|
|
3799
4355
|
ext?: { [key: string]: any };
|
|
3800
4356
|
msgConfig?: { allowGroupAck: boolean };
|
|
4357
|
+
isChatThread?: boolean;
|
|
3801
4358
|
}
|
|
3802
4359
|
|
|
3803
4360
|
interface CustomParameters {
|
|
@@ -3832,6 +4389,8 @@ export declare namespace EasemobChat {
|
|
|
3832
4389
|
ext?: { [key: string]: any };
|
|
3833
4390
|
msgConfig?: { [key: string]: any };
|
|
3834
4391
|
time: number;
|
|
4392
|
+
isChatThread?: boolean;
|
|
4393
|
+
reactions?: Reaction;
|
|
3835
4394
|
}
|
|
3836
4395
|
|
|
3837
4396
|
interface CreateCustomMsgParameters {
|
|
@@ -3843,6 +4402,7 @@ export declare namespace EasemobChat {
|
|
|
3843
4402
|
from?: string;
|
|
3844
4403
|
ext?: { [key: string]: any };
|
|
3845
4404
|
msgConfig?: { allowGroupAck: boolean };
|
|
4405
|
+
isChatThread?: boolean;
|
|
3846
4406
|
}
|
|
3847
4407
|
|
|
3848
4408
|
interface LocationParameters {
|
|
@@ -3880,6 +4440,8 @@ export declare namespace EasemobChat {
|
|
|
3880
4440
|
ext?: { [key: string]: any };
|
|
3881
4441
|
time: number;
|
|
3882
4442
|
msgConfig?: { allowGroupAck: boolean };
|
|
4443
|
+
isChatThread?: boolean;
|
|
4444
|
+
reactions?: Reaction;
|
|
3883
4445
|
}
|
|
3884
4446
|
|
|
3885
4447
|
interface CreateLocationMsgParameters {
|
|
@@ -3893,6 +4455,7 @@ export declare namespace EasemobChat {
|
|
|
3893
4455
|
from?: string;
|
|
3894
4456
|
ext?: { [key: string]: any };
|
|
3895
4457
|
msgConfig?: { allowGroupAck: boolean };
|
|
4458
|
+
isChatThread?: boolean;
|
|
3896
4459
|
}
|
|
3897
4460
|
|
|
3898
4461
|
interface FileParameters {
|
|
@@ -3933,6 +4496,7 @@ export declare namespace EasemobChat {
|
|
|
3933
4496
|
accessToken?: string;
|
|
3934
4497
|
msgConfig?: { allowGroupAck: boolean };
|
|
3935
4498
|
time: number;
|
|
4499
|
+
reactions?: Reaction;
|
|
3936
4500
|
}
|
|
3937
4501
|
|
|
3938
4502
|
interface CreateFileMsgParameters {
|
|
@@ -3954,6 +4518,7 @@ export declare namespace EasemobChat {
|
|
|
3954
4518
|
filename: string;
|
|
3955
4519
|
};
|
|
3956
4520
|
msgConfig?: { allowGroupAck: boolean };
|
|
4521
|
+
isChatThread?: boolean;
|
|
3957
4522
|
}
|
|
3958
4523
|
|
|
3959
4524
|
interface ImgParameters {
|
|
@@ -3995,6 +4560,8 @@ export declare namespace EasemobChat {
|
|
|
3995
4560
|
secret?: string;
|
|
3996
4561
|
thumb?: string;
|
|
3997
4562
|
thumb_secret?: string;
|
|
4563
|
+
isChatThread?: boolean;
|
|
4564
|
+
reactions?: Reaction;
|
|
3998
4565
|
}
|
|
3999
4566
|
|
|
4000
4567
|
interface CreateImgMsgParameters {
|
|
@@ -4018,6 +4585,7 @@ export declare namespace EasemobChat {
|
|
|
4018
4585
|
filename: string;
|
|
4019
4586
|
};
|
|
4020
4587
|
msgConfig?: { allowGroupAck: boolean };
|
|
4588
|
+
isChatThread?: boolean;
|
|
4021
4589
|
}
|
|
4022
4590
|
|
|
4023
4591
|
interface AudioParameters {
|
|
@@ -4058,6 +4626,8 @@ export declare namespace EasemobChat {
|
|
|
4058
4626
|
group?: string;
|
|
4059
4627
|
msgConfig?: { [key: string]: any };
|
|
4060
4628
|
time: number;
|
|
4629
|
+
isChatThread?: boolean;
|
|
4630
|
+
reactions?: Reaction;
|
|
4061
4631
|
}
|
|
4062
4632
|
|
|
4063
4633
|
interface CreateAudioMsgParameters {
|
|
@@ -4084,6 +4654,7 @@ export declare namespace EasemobChat {
|
|
|
4084
4654
|
filename: string;
|
|
4085
4655
|
};
|
|
4086
4656
|
msgConfig?: { allowGroupAck: boolean };
|
|
4657
|
+
isChatThread?: boolean;
|
|
4087
4658
|
}
|
|
4088
4659
|
|
|
4089
4660
|
interface VideoParameters {
|
|
@@ -4124,6 +4695,8 @@ export declare namespace EasemobChat {
|
|
|
4124
4695
|
msgConfig?: { [key: string]: any };
|
|
4125
4696
|
group?: string;
|
|
4126
4697
|
time: number;
|
|
4698
|
+
isChatThread?: boolean;
|
|
4699
|
+
reactions?: Reaction;
|
|
4127
4700
|
}
|
|
4128
4701
|
|
|
4129
4702
|
interface CreateVideoMsgParameters {
|
|
@@ -4147,6 +4720,7 @@ export declare namespace EasemobChat {
|
|
|
4147
4720
|
filename: string;
|
|
4148
4721
|
};
|
|
4149
4722
|
msgConfig?: { allowGroupAck: boolean };
|
|
4723
|
+
isChatThread?: boolean;
|
|
4150
4724
|
}
|
|
4151
4725
|
|
|
4152
4726
|
interface ReceivedMsgBody {
|