@rongcloud/engine 4.6.0-beem.1 → 4.6.0-beem.4

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 - v4.6.0-beem.1
3
- * CommitId - 4789dcdc52f61868235bcda3f31eff906bab3674
4
- * Wed Jan 05 2022 14:09:26 GMT+0800 (China Standard Time)
2
+ * RCEngine - v4.6.0-beem.4
3
+ * CommitId - 91772ec0ea266506f30b033d87f886e79ae4c209
4
+ * Fri Apr 01 2022 10:49:32 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  /**
@@ -2881,6 +2881,10 @@ declare enum MessageType {
2881
2881
  * 消息送达报告,仅单聊
2882
2882
  */
2883
2883
  DELIVERED = "RC:Delivered",
2884
+ /**
2885
+ * 消息送达状态报告,仅群聊
2886
+ */
2887
+ DELIVERED_MSG = "RC:DRMsg",
2884
2888
  CHATROOM_JOIN = "RC:ChrmJoinNtf",
2885
2889
  /**
2886
2890
  * 用户退出聊天室
@@ -3243,6 +3247,14 @@ interface IMessageDeliver {
3243
3247
  conversationType: ConversationType;
3244
3248
  targetId: string;
3245
3249
  }
3250
+ interface IGroupMessageDeliveredStatusInfo {
3251
+ MessageUId: string;
3252
+ deliveryCount: number;
3253
+ }
3254
+ interface IGroupMessageDeliverStatus {
3255
+ totalCount: number;
3256
+ list: IGroupMessageDeliveredStatusInfo[];
3257
+ }
3246
3258
 
3247
3259
  /**
3248
3260
  * engine 基本接口定义,用于约束 Electron 下主进程、渲染进程、JSEngine 的编码一致性
@@ -3252,8 +3264,9 @@ interface IEngine {
3252
3264
  * 建立连接
3253
3265
  * @param token
3254
3266
  * @param naviInfo
3267
+ * @param reconnectKickEnable
3255
3268
  */
3256
- connect(token: string, naviInfo: INaviInfo, versionInfo: string): Promise<ErrorCode>;
3269
+ connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean): Promise<ErrorCode>;
3257
3270
  /**
3258
3271
  * 上报版本信息
3259
3272
  * @param version
@@ -3589,6 +3602,8 @@ interface IEngine {
3589
3602
  * 获取当前 userId
3590
3603
  */
3591
3604
  getCurrentUserId(): string;
3605
+ getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
3606
+ getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
3592
3607
  /**
3593
3608
  * 设置用户在线状态监听器
3594
3609
  */
@@ -3658,16 +3673,33 @@ interface IEngine {
3658
3673
  */
3659
3674
  setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
3660
3675
  /**
3661
- * 通过关键字搜索会话
3662
- */
3676
+ * 通过关键字与 channelId 搜索所有会话
3677
+ */
3663
3678
  searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
3664
3679
  /**
3665
- * 按内容搜索会话内的消息
3666
- */
3680
+ * 通过关键字搜索所有会话
3681
+ */
3682
+ searchConversationByContentWithAllChannel(keyword: string, customMessageTypes: string[], conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
3683
+ /**
3684
+ * 按内容搜索指定会话内的消息
3685
+ */
3667
3686
  searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
3668
3687
  messages: IReceivedMessage[];
3669
3688
  count: number;
3670
3689
  }>;
3690
+ /**
3691
+ * 按内容搜索指定会话(不区分 channelId)的消息
3692
+ */
3693
+ searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number): IPromiseResult<{
3694
+ messages: IReceivedMessage[];
3695
+ count: number;
3696
+ }>;
3697
+ /**
3698
+ * 按内容搜索时间范围内指定会话(不区分 channelId)的消息
3699
+ */
3700
+ searchMessageByContentInTimeRangeWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, startTime: number, endTime: number, offset: number, limit: number): IPromiseResult<{
3701
+ messages: IReceivedMessage[];
3702
+ }>;
3671
3703
  /**
3672
3704
  * 获取会话下所有未读的 @ 消息
3673
3705
  */
@@ -3798,6 +3830,7 @@ declare type ITagListener = () => void;
3798
3830
  declare type IConversationTagListener = () => void;
3799
3831
  declare type ItypingStateListener = (data: ITypingMessage[]) => void;
3800
3832
  declare type IMessageDeliveredListener = (data: IMessageDeliver[]) => void;
3833
+ declare type IGroupMessageDeliveredStatusListener = (data: IGroupMessageDeliverStatus) => void;
3801
3834
  declare type IMessageBlockedListener = (data: IBlockedMessageInfo) => void;
3802
3835
  interface ISendExMsgOptions {
3803
3836
  channelId: string;
@@ -3862,6 +3895,10 @@ interface IWatcher {
3862
3895
  * 单聊消息送达通知
3863
3896
  */
3864
3897
  messageDelivered?: IMessageDeliveredListener;
3898
+ /**
3899
+ * 群聊消息送达状态通知
3900
+ */
3901
+ groupMessageDeliveredStatus?: IGroupMessageDeliveredStatusListener;
3865
3902
  messageBlocked?: IMessageBlockedListener;
3866
3903
  }
3867
3904
  interface IPluginGenerator<API, InitOption> {
@@ -4018,6 +4055,7 @@ declare class APIContext {
4018
4055
  private _typingStatusListener;
4019
4056
  private _pullFinishedListener;
4020
4057
  private _messageDeliveredListerer;
4058
+ private _groupMessageDeliveredStatusListerer;
4021
4059
  private _MessageBlockedListener;
4022
4060
  private _callInfoListener;
4023
4061
  /**
@@ -4054,14 +4092,22 @@ declare class APIContext {
4054
4092
  * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
4055
4093
  * @param token
4056
4094
  * @param refreshNavi 是否需要重新请求导航,当值为 `false` 时,优先使用有效缓存导航,若缓存失效则重新获取导航
4095
+ * @param reconnectKickEnable 设置断线重连时是否踢出当前正在重连的设备 (仅 Electron 环境有效)
4096
+ * 同一个账号在一台新设备上登录的时候,会把这个账号在之前登录的设备上踢出。
4097
+ 由于 SDK 有断线重连功能,存在下面情况。
4098
+ 用户在 A 设备登录,A 设备网络不稳定,没有连接成功,SDK 启动重连机制。
4099
+ 用户此时又在 B 设备登录,B 设备连接成功。
4100
+ A 设备网络稳定之后,用户在 A 设备连接成功,B 设备被踢出。
4101
+ 这个字段就是为这种情况加的。
4102
+ 设置 reconnectKickEnable 为 true 时,SDK 重连的时候发现此时已有别的设备连接成功,不再强行踢出已有设备,而是踢出重连设备。
4057
4103
  */
4058
- connect(token: string, refreshNavi?: boolean): Promise<IConnectResult>;
4104
+ connect(token: string, refreshNavi?: boolean, reconnectKickEnable?: boolean): Promise<IConnectResult>;
4059
4105
  /**
4060
4106
  * 拉取实时配置 web 端需更新 voipCall 字段
4061
4107
  */
4062
4108
  private _pullUserSettings;
4063
4109
  disconnect(): Promise<void>;
4064
- reconnect(): Promise<IConnectResult>;
4110
+ reconnect(reconnectKickEnable?: boolean): Promise<IConnectResult>;
4065
4111
  private _getTokenWithoutNavi;
4066
4112
  /**
4067
4113
  * 获取当前缓存的导航数据
@@ -4453,10 +4499,18 @@ declare class APIContext {
4453
4499
  status: string;
4454
4500
  }>>;
4455
4501
  searchConversationByContent(keyword: string, customMessageTypes?: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
4502
+ searchConversationByContentWithAllChannel(keyword: string, customMessageTypes?: string[], conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
4456
4503
  searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId?: string): Promise<IAsyncRes<{
4457
4504
  messages: IReceivedMessage[];
4458
4505
  count: number;
4459
4506
  }>>;
4507
+ searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number): Promise<IAsyncRes<{
4508
+ messages: IReceivedMessage[];
4509
+ count: number;
4510
+ }>>;
4511
+ searchMessageByContentInTimeRangeWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, startTime: number, endTime: number, offset: number, limit: number): Promise<IAsyncRes<{
4512
+ messages: IReceivedMessage[];
4513
+ }>>;
4460
4514
  getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId?: string): IReceivedMessage[];
4461
4515
  clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
4462
4516
  /**
@@ -4479,6 +4533,8 @@ declare class APIContext {
4479
4533
  key: string;
4480
4534
  value: string;
4481
4535
  }>;
4536
+ getConversationListWithAllChannel(): Promise<IAsyncRes<IReceivedConversation[]>>;
4537
+ getConversationListWithAllChannelByPage(index: number, limit: number): Promise<IAsyncRes<IReceivedConversation[]>>;
4482
4538
  /**
4483
4539
  * 加入房间
4484
4540
  * @param roomId
@@ -4675,6 +4731,7 @@ interface IEngineWatcher {
4675
4731
  onRTCDataChange: (data: IServerRTCRoomEntry[], roomId?: string) => void;
4676
4732
  pullFinished: () => void;
4677
4733
  messageDelivered: (data: IMessageDeliver[]) => void;
4734
+ groupMessageDeliveredStatus: (data: IGroupMessageDeliverStatus) => void;
4678
4735
  callInfo: (data: string) => void;
4679
4736
  }
4680
4737
  /**
@@ -4712,8 +4769,9 @@ declare abstract class AEngine implements IEngine {
4712
4769
  * 建立连接
4713
4770
  * @param token
4714
4771
  * @param naviInfo
4772
+ * @param reconnectKickEnable
4715
4773
  */
4716
- abstract connect(token: string, naviInfo: INaviInfo): Promise<ErrorCode>;
4774
+ abstract connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean): Promise<ErrorCode>;
4717
4775
  /**
4718
4776
  * 发送SDK版本
4719
4777
  * @param versionInfo
@@ -5063,6 +5121,8 @@ declare abstract class AEngine implements IEngine {
5063
5121
  * 获取当前 userId
5064
5122
  */
5065
5123
  abstract getCurrentUserId(): string;
5124
+ abstract getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
5125
+ abstract getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
5066
5126
  /**
5067
5127
  * 设置用户在线状态监听器
5068
5128
  */
@@ -5135,6 +5195,10 @@ declare abstract class AEngine implements IEngine {
5135
5195
  * 通过关键字搜索会话
5136
5196
  */
5137
5197
  abstract searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
5198
+ /**
5199
+ * 通过关键字搜索所有会话
5200
+ */
5201
+ abstract searchConversationByContentWithAllChannel(keyword: string, customMessageTypes: string[], conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
5138
5202
  /**
5139
5203
  * 按内容搜索会话内的消息
5140
5204
  */
@@ -5142,6 +5206,19 @@ declare abstract class AEngine implements IEngine {
5142
5206
  messages: IReceivedMessage[];
5143
5207
  count: number;
5144
5208
  }>;
5209
+ /**
5210
+ * 按内容搜索指定会话(不区分 channelId)的消息
5211
+ */
5212
+ abstract searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number): IPromiseResult<{
5213
+ messages: IReceivedMessage[];
5214
+ count: number;
5215
+ }>;
5216
+ /**
5217
+ * 按内容搜索时间范围内指定会话(不区分 channelId)的消息
5218
+ */
5219
+ abstract searchMessageByContentInTimeRangeWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, startTime: number, endTime: number, offset: number, limit: number): IPromiseResult<{
5220
+ messages: IReceivedMessage[];
5221
+ }>;
5145
5222
  /**
5146
5223
  * 获取会话下所有未读的 @ 消息
5147
5224
  */
@@ -5685,4 +5762,4 @@ declare enum CONNECTION_TYPE {
5685
5762
  */
5686
5763
  declare const version: string;
5687
5764
 
5688
- export { AEngine, ANavi, APIContext, AppStorage, AssertRules, CONNECTION_TYPE, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType as ChatroomMemberChangeType, CometChannel, ConnectResultCode, ConnectionStatus, ConversationType, DelayTimer, ErrorCode, EventEmitter, FileType, HttpMethod, IAPIContextOption, IAsyncRes, IBlockedMessageInfo, IChatroomEntries, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IDeliveredUser, IEngine, IEngineWatcher, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGroupMessageDeliverInfo, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageBlockedListener, IMessageDeliver, IMessageDeliveredListener, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntriesOption, IRemoveChatRoomEntryOption, IRequest, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, ItypingStateListener, KVString, LiveRole, LiveType, LogLevel, LogType, Logger, MAX_MESSAGE_CONTENT_BYTES, MINI_COMET_CONNECT_URIS, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NotificationStatus, PING_REQ_TIMEOUT, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UploadMethod, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, cloneByJSON, forEach, formatConnectResponseCode, getBrowser, getMimeKey, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidFileType, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, usingCppEngine, validate, version };
5765
+ export { AEngine, ANavi, APIContext, AppStorage, AssertRules, CONNECTION_TYPE, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType as ChatroomMemberChangeType, CometChannel, ConnectResultCode, ConnectionStatus, ConversationType, DelayTimer, ErrorCode, EventEmitter, FileType, HttpMethod, IAPIContextOption, IAsyncRes, IBlockedMessageInfo, IChatroomEntries, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IDeliveredUser, IEngine, IEngineWatcher, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IGroupMessageDeliveredStatusListener, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageBlockedListener, IMessageDeliver, IMessageDeliveredListener, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntriesOption, IRemoveChatRoomEntryOption, IRequest, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, ItypingStateListener, KVString, LiveRole, LiveType, LogLevel, LogType, Logger, MAX_MESSAGE_CONTENT_BYTES, MINI_COMET_CONNECT_URIS, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NotificationStatus, PING_REQ_TIMEOUT, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UploadMethod, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, cloneByJSON, forEach, formatConnectResponseCode, getBrowser, getMimeKey, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidFileType, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, usingCppEngine, validate, version };