@rongcloud/engine 5.0.0 → 5.0.1-custom-qihoo.3

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/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * RCEngine - v5.0.0
3
- * CommitId - c0ac4fad54a82abde97440721d302088e229b0b8
4
- * Mon Nov 15 2021 17:47:36 GMT+0800 (China Standard Time)
2
+ * RCEngine - v5.0.1-custom-qihoo.3
3
+ * CommitId - f511810a05b1ef295d16225d99189c244ea0fdfc
4
+ * Wed Nov 24 2021 15:31:55 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  /**
@@ -365,6 +365,13 @@ interface IConversationOption {
365
365
  targetId: string;
366
366
  channelId?: string;
367
367
  }
368
+ interface IServerRTCRoomEntry {
369
+ key: string;
370
+ value: string;
371
+ status: number;
372
+ timestamp: number;
373
+ uid: string;
374
+ }
368
375
  interface IChrmKVEntry {
369
376
  key: string;
370
377
  value?: string;
@@ -434,13 +441,6 @@ interface IGetConversationListOption {
434
441
  interface IClearMsgOption {
435
442
  timestamp?: number;
436
443
  }
437
- interface IServerRTCRoomEntry {
438
- key: string;
439
- value: string;
440
- status: number;
441
- timestamp: number;
442
- uid: string;
443
- }
444
444
 
445
445
  /**
446
446
  * 聊天室 kv 存储操作类型. 对方操作, 己方收到消息(RC:chrmKVNotiMsg)中会带入此值. 根据此值判断是删除还是更新
@@ -1611,6 +1611,10 @@ interface IReceivedConversation {
1611
1611
  * 搜索到的会话数量
1612
1612
  */
1613
1613
  matchCount?: number;
1614
+ /**
1615
+ * @ 消息未读数
1616
+ */
1617
+ unreadMentionedCount?: number;
1614
1618
  }
1615
1619
  interface IReceivedConversationByTag extends IReceivedConversation {
1616
1620
  isTopInTag: boolean;
@@ -1655,6 +1659,10 @@ interface IUpdatedConversation {
1655
1659
  */
1656
1660
  channelId?: string;
1657
1661
  tags?: IUpdatedConversation[];
1662
+ /**
1663
+ * @ 消息未读数
1664
+ */
1665
+ unreadMentionedCount?: number;
1658
1666
  }
1659
1667
  interface IBaseConversationInfo {
1660
1668
  conversationType: ConversationType;
@@ -2776,7 +2784,7 @@ interface IEngine {
2776
2784
  order: 0 | 1,
2777
2785
  /**
2778
2786
  * 会话的业务标识
2779
- */
2787
+ */
2780
2788
  channelId: string,
2781
2789
  /**
2782
2790
  * 消息类型
@@ -2787,12 +2795,12 @@ interface IEngine {
2787
2795
  }>;
2788
2796
  /**
2789
2797
  * 删除历史消息 通过 messageUId
2790
- */
2798
+ */
2791
2799
  deleteRemoteMessage(conversationType: ConversationType, targetId: string,
2792
2800
  /**
2793
2801
  * @description
2794
2802
  * message 中 messageUId、setTime、messageDirection 为必须参数
2795
- */
2803
+ */
2796
2804
  messages: {
2797
2805
  messageUId: string;
2798
2806
  sentTime: number;
@@ -2800,17 +2808,17 @@ interface IEngine {
2800
2808
  }[],
2801
2809
  /**
2802
2810
  * 会话的业务标识
2803
- */
2811
+ */
2804
2812
  channelId: string): Promise<ErrorCode>;
2805
2813
  recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
2806
2814
  /**
2807
2815
  * 删除历史消息 通过 时间戳
2808
2816
  * @param timestamp 小于等于传入时间戳的消息均删除
2809
- */
2817
+ */
2810
2818
  deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number,
2811
2819
  /**
2812
2820
  * 会话的业务标识
2813
- */
2821
+ */
2814
2822
  channelId: string): Promise<ErrorCode>;
2815
2823
  /**
2816
2824
  * 获取会话列表
@@ -2828,19 +2836,19 @@ interface IEngine {
2828
2836
  conversationType?: ConversationType,
2829
2837
  /**
2830
2838
  * 起始时间
2831
- */
2839
+ */
2832
2840
  startTime?: number,
2833
2841
  /**
2834
2842
  * 获取顺序
2835
- */
2843
+ */
2836
2844
  order?: 0 | 1,
2837
2845
  /**
2838
2846
  * 会话的业务标识
2839
- */
2847
+ */
2840
2848
  channelId?: string): IPromiseResult<IReceivedConversation[]>;
2841
2849
  /**
2842
2850
  * 获取指定会话
2843
- */
2851
+ */
2844
2852
  getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
2845
2853
  /**
2846
2854
  * 删除会话
@@ -2912,33 +2920,33 @@ interface IEngine {
2912
2920
  /**
2913
2921
  * 加入聊天室
2914
2922
  * @param count 拉取消息数量
2915
- */
2923
+ */
2916
2924
  joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
2917
2925
  /**
2918
2926
  * 加入已存在的聊天室
2919
2927
  * @param count 拉取消息数量
2920
- */
2928
+ */
2921
2929
  joinExistChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
2922
2930
  /**
2923
2931
  * 退出聊天室
2924
- */
2932
+ */
2925
2933
  quitChatroom(chatroomId: string): Promise<ErrorCode>;
2926
2934
  /**
2927
2935
  * 获取聊天室信息
2928
2936
  * @param count 获取人数, 范围 0 - 20
2929
2937
  * @param order 排序方式, 1 正序, 2 倒序
2930
- */
2938
+ */
2931
2939
  getChatroomInfo(chatroomId: string, count: number, order: number): IPromiseResult<IChatroomInfo>;
2932
2940
  /**
2933
2941
  * 获取聊天室历史消息
2934
- */
2942
+ */
2935
2943
  getChatroomHistoryMessages(chatroomId: string, timestamp: number, count: number, order: number): IPromiseResult<{
2936
2944
  list: IReceivedMessage[];
2937
2945
  hasMore: boolean;
2938
2946
  }>;
2939
2947
  /**
2940
2948
  * 设置聊天室属性
2941
- */
2949
+ */
2942
2950
  setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
2943
2951
  /**
2944
2952
  * 批量设置聊天室属性
@@ -2949,11 +2957,11 @@ interface IEngine {
2949
2957
  }>;
2950
2958
  /**
2951
2959
  * 强制设置聊天室属性
2952
- */
2960
+ */
2953
2961
  forceSetChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
2954
2962
  /**
2955
2963
  * 删除聊天室属性
2956
- */
2964
+ */
2957
2965
  removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
2958
2966
  /**
2959
2967
  * 批量删除聊天室属性
@@ -2964,15 +2972,15 @@ interface IEngine {
2964
2972
  }>;
2965
2973
  /**
2966
2974
  * 强制删除聊天室属性
2967
- */
2975
+ */
2968
2976
  forceRemoveChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
2969
2977
  /**
2970
- * 获取聊天室 key 对应 value
2971
- */
2978
+ * 获取聊天室 key 对应 value
2979
+ */
2972
2980
  getChatroomEntry(chatroomId: string, key: string): IPromiseResult<string | null>;
2973
2981
  /**
2974
- * 获取聊天室所有 key value
2975
- */
2982
+ * 获取聊天室所有 key value
2983
+ */
2976
2984
  getAllChatroomEntry(chatroomId: string): IPromiseResult<{
2977
2985
  [key: string]: string;
2978
2986
  }>;
@@ -2980,28 +2988,28 @@ interface IEngine {
2980
2988
  * 获取上传认证信息
2981
2989
  * @description
2982
2990
  * 若不传 fileName 百度上传认证字段(bosToken、bosDate、path)均返回 null
2983
- */
2991
+ */
2984
2992
  getFileToken(fileType: FileType, fileName?: string, httpMethod?: string, queryUriString?: string): Promise<IAsyncRes<IUploadAuth>>;
2985
2993
  /**
2986
2994
  * 获取文件上传后下载地址
2987
- */
2995
+ */
2988
2996
  getFileUrl(fileType: FileType, uploadMethod: UploadMethod, fileName?: string, originName?: string): IPromiseResult<{
2989
2997
  downloadUrl: string;
2990
2998
  }>;
2991
2999
  /**
2992
3000
  * 创建标签
2993
3001
  * @param tag 标签
2994
- */
3002
+ */
2995
3003
  createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
2996
3004
  /**
2997
3005
  * 删除标签
2998
3006
  * @param tagId 标签id
2999
- */
3007
+ */
3000
3008
  removeTag(tagId: string): IPromiseResult<IAsyncRes>;
3001
3009
  /**
3002
3010
  * 编辑标签
3003
3011
  * @param tag 标签
3004
- */
3012
+ */
3005
3013
  updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
3006
3014
  /**
3007
3015
  * 获取标签列表
@@ -3070,106 +3078,106 @@ interface IEngine {
3070
3078
  getCurrentUserId(): string;
3071
3079
  /**
3072
3080
  * 设置用户在线状态监听器
3073
- */
3081
+ */
3074
3082
  setUserStatusListener(config: {
3075
3083
  userIds: string[];
3076
3084
  }, listener: Function): void;
3077
3085
  /**
3078
3086
  * 设置当前用户在线状态
3079
- */
3087
+ */
3080
3088
  setUserStatus(status: number): Promise<ErrorCode>;
3081
3089
  /**
3082
3090
  * 订阅用户在线状态
3083
- */
3091
+ */
3084
3092
  subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
3085
3093
  /**
3086
3094
  * 获取用户状态
3087
- */
3095
+ */
3088
3096
  getUserStatus(userId: string): IPromiseResult<{
3089
3097
  status: string;
3090
3098
  }>;
3091
3099
  /**
3092
3100
  * 清空所有会话
3093
- */
3101
+ */
3094
3102
  clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
3095
3103
  /**
3096
3104
  * 加入黑名单
3097
- */
3105
+ */
3098
3106
  addToBlacklist(userId: string): Promise<ErrorCode>;
3099
3107
  /**
3100
- * 将指定用户移除黑名单
3101
- */
3108
+ * 将指定用户移除黑名单
3109
+ */
3102
3110
  removeFromBlacklist(userId: string): Promise<ErrorCode>;
3103
3111
  /**
3104
- * 获取黑名单列表
3105
- */
3112
+ * 获取黑名单列表
3113
+ */
3106
3114
  getBlacklist(): IPromiseResult<string[]>;
3107
3115
  /**
3108
- * 获取指定人员在黑名单中的状态
3109
- */
3116
+ * 获取指定人员在黑名单中的状态
3117
+ */
3110
3118
  getBlacklistStatus(userId: string): IPromiseResult<string>;
3111
3119
  /**
3112
3120
  * 向本地插入一条消息,不发送到服务器
3113
- */
3121
+ */
3114
3122
  insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
3115
3123
  /**
3116
3124
  * 删除本地消息
3117
- */
3125
+ */
3118
3126
  deleteMessages(timestamps: number[]): Promise<ErrorCode>;
3119
3127
  /**
3120
3128
  * 通过时间戳删除本地消息
3121
- */
3129
+ */
3122
3130
  deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
3123
3131
  /**
3124
3132
  * 清空会话下历史消息
3125
- */
3133
+ */
3126
3134
  clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3127
3135
  /**
3128
3136
  * 获取消息
3129
- */
3137
+ */
3130
3138
  getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
3131
3139
  /**
3132
3140
  * 设置消息内容
3133
- */
3141
+ */
3134
3142
  setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
3135
3143
  /**
3136
3144
  * 设置消息搜索字段
3137
- */
3145
+ */
3138
3146
  setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
3139
3147
  /**
3140
3148
  * 通过关键字搜索会话
3141
- */
3149
+ */
3142
3150
  searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
3143
3151
  /**
3144
3152
  * 按内容搜索会话内的消息
3145
- */
3153
+ */
3146
3154
  searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
3147
3155
  messages: IReceivedMessage[];
3148
3156
  count: number;
3149
3157
  }>;
3150
3158
  /**
3151
3159
  * 获取会话下所有未读的 @ 消息
3152
- */
3160
+ */
3153
3161
  getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
3154
3162
  /**
3155
3163
  * 设置消息发送状态
3156
- */
3164
+ */
3157
3165
  setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
3158
3166
  /**
3159
3167
  * 设置消息接收状态
3160
- */
3168
+ */
3161
3169
  setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
3162
3170
  /**
3163
3171
  * 删除时间戳前的未读数
3164
- */
3172
+ */
3165
3173
  clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
3166
3174
  /**
3167
3175
  * 获取会话免打扰状态
3168
- */
3176
+ */
3169
3177
  getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
3170
3178
  /**
3171
3179
  * 协议栈获取远端历史消息
3172
- */
3180
+ */
3173
3181
  getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
3174
3182
  list: IReceivedMessage[];
3175
3183
  hasMore: boolean;
@@ -3179,9 +3187,17 @@ interface IEngine {
3179
3187
  */
3180
3188
  getBlockConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
3181
3189
  /**
3182
- * 无差别获取本地置顶列表
3183
- */
3190
+ * 无差别获取本地置顶列表
3191
+ */
3184
3192
  getTopConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
3193
+ /**
3194
+ * 获取单个群聊会话 @ 消息未读数
3195
+ */
3196
+ getUnreadMentionedCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
3197
+ /**
3198
+ * 获取所有群聊会话 @ 消息未读数
3199
+ */
3200
+ getAllUnreadMentionedCount(): Promise<IAsyncRes<number>>;
3185
3201
  joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
3186
3202
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
3187
3203
  rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
@@ -4293,6 +4309,14 @@ declare class APIContext {
4293
4309
  * 获取所有本地置顶列表
4294
4310
  */
4295
4311
  getTopConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
4312
+ /**
4313
+ * 获取单个群聊会话 @ 消息未读数
4314
+ */
4315
+ getUnreadMentionedCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
4316
+ /**
4317
+ * 获取所有群聊会话 @ 消息未读数
4318
+ */
4319
+ getAllUnreadMentionedCount(): Promise<IAsyncRes<number>>;
4296
4320
  /**
4297
4321
  * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
4298
4322
  * 对于未实现的方法,接口响应 Unsupport 错误码
@@ -5158,6 +5182,14 @@ declare abstract class AEngine implements IEngine {
5158
5182
  * 无差别获取本地置顶列表
5159
5183
  */
5160
5184
  abstract getTopConversationList(): Promise<IAsyncRes<IBaseConversationInfo[]>>;
5185
+ /**
5186
+ * 获取单个群聊会话 @ 消息未读数
5187
+ */
5188
+ abstract getUnreadMentionedCount(conversation: IConversationOption): Promise<IAsyncRes<number>>;
5189
+ /**
5190
+ * 获取所有群聊会话 @ 消息未读数
5191
+ */
5192
+ abstract getAllUnreadMentionedCount(): Promise<IAsyncRes<number>>;
5161
5193
  abstract joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType): IPromiseResult<IJoinRTCRoomData>;
5162
5194
  abstract quitRTCRoom(roomId: string): Promise<ErrorCode>;
5163
5195
  abstract rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;