@rongcloud/engine 5.2.1-alpha.3 → 5.2.1-enterprise-alpha.1

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.2.1-alpha.3
3
- * CommitId - 39f5d0951d0770155a526688840b2a91e1f0786f
4
- * Tue Mar 08 2022 17:46:21 GMT+0800 (China Standard Time)
2
+ * RCEngine - v5.2.1-enterprise-alpha.1
3
+ * CommitId - 2db8186f9f3c4b502828f95f4f67dac6c8097869
4
+ * Wed Mar 30 2022 16:45:53 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  /**
@@ -365,7 +365,7 @@ declare class QueryWriter extends RetryableWriter {
365
365
  }
366
366
 
367
367
  /**
368
- * 聊天室 kv 存储操作类型. 对方操作, 己方收到消息(RC:chrmKVNotiMsg)中会带入此值. 根据此值判断是删除还是更新
368
+ * 输入状态类型
369
369
  */
370
370
  declare enum OperateStatus {
371
371
  typing = 0
@@ -394,11 +394,14 @@ interface IChrmKVEntry {
394
394
  userId?: string;
395
395
  type?: number;
396
396
  isDeleted?: boolean;
397
+ version?: number;
397
398
  }
398
399
  interface IChrmKVEntries {
399
400
  entries: {
400
401
  key: string;
401
402
  value?: string;
403
+ timestamp?: number;
404
+ version?: number;
402
405
  }[];
403
406
  notificationExtra?: string;
404
407
  isOverwrite?: boolean;
@@ -742,7 +745,7 @@ interface IReceivedMessage {
742
745
  */
743
746
  isInterrupt?: boolean;
744
747
  /**
745
- * 拉取历史消息时表示该消息是否修改过
748
+ * 拉取历史消息时表示该消息是否修改过(仅超级群有效)
746
749
  */
747
750
  isModifyMessage?: boolean;
748
751
  }
@@ -1158,6 +1161,11 @@ declare enum ErrorCode {
1158
1161
  * 聊天室Key不存在
1159
1162
  */
1160
1163
  CHATROOM_KEY_NOT_EXIST = 23427,
1164
+ /*!
1165
+ 聊天室设置 KV 失败,出现在两人或者多端同时操作一个 kv。
1166
+ 如果出现该错误,为避免和其他端同时操作,请延时一定时间再试
1167
+ */
1168
+ CHATROOM_KV_SET_ERROR = 23431,
1161
1169
  /**
1162
1170
  * 敏感词屏蔽
1163
1171
  */
@@ -2987,6 +2995,17 @@ interface IEndRoomPKOptions {
2987
2995
  keys: string[];
2988
2996
  }
2989
2997
 
2998
+ interface IRTCRoomBindOption {
2999
+ /**
3000
+ * 聊天室 ID
3001
+ */
3002
+ chatRoomId: string;
3003
+ /**
3004
+ * RTC房间 ID
3005
+ */
3006
+ rtcRoomId: string;
3007
+ }
3008
+
2990
3009
  /**
2991
3010
  * engine 基本接口定义,用于约束 Electron 下主进程、渲染进程、JSEngine 的编码一致性
2992
3011
  */
@@ -3405,16 +3424,27 @@ interface IEngine {
3405
3424
  */
3406
3425
  setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
3407
3426
  /**
3408
- * 通过关键字搜索会话
3427
+ * 通过关键字与 channelId 搜索所有会话
3409
3428
  */
3410
3429
  searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
3411
3430
  /**
3412
- * 按内容搜索会话内的消息
3431
+ * 通过关键字搜索所有会话
3432
+ */
3433
+ searchConversationByContentWithAllChannel(keyword: string, customMessageTypes: string[], conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
3434
+ /**
3435
+ * 按内容搜索指定会话内的消息
3413
3436
  */
3414
3437
  searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
3415
3438
  messages: IReceivedMessage[];
3416
3439
  count: number;
3417
3440
  }>;
3441
+ /**
3442
+ * 按内容搜索指定会话(不区分 channelId)的消息
3443
+ */
3444
+ searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number): IPromiseResult<{
3445
+ messages: IReceivedMessage[];
3446
+ count: number;
3447
+ }>;
3418
3448
  /**
3419
3449
  * 获取会话下所有未读的 @ 消息
3420
3450
  */
@@ -3496,6 +3526,7 @@ interface IEngine {
3496
3526
  cancelRoomPK(options: ICancelRoomPKOptions): Promise<ErrorCode>;
3497
3527
  responseRoomPK(options: IResRoomPKOptions): Promise<ErrorCode>;
3498
3528
  endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
3529
+ bindRTCRoomForChatroom(options: IRTCRoomBindOption): Promise<ErrorCode>;
3499
3530
  }
3500
3531
 
3501
3532
  interface IExpansionMsgContent {
@@ -3696,6 +3727,10 @@ declare class DataCodec {
3696
3727
  * 格式化 RTC 用户加入房间后通知拉取的数据(房间内主播全量列表、房间全量资源)
3697
3728
  */
3698
3729
  private _formatRTCRoomKVList;
3730
+ /**
3731
+ * 拉取聊天室 kv 存储时的最新时间戳
3732
+ */
3733
+ private _formatChrmKVVersion;
3699
3734
  /**
3700
3735
  * 格式化观众加房间后返回数据
3701
3736
  */
@@ -3944,6 +3979,10 @@ declare class DataCodec {
3944
3979
  * 结束连麦 PK
3945
3980
  */
3946
3981
  encodeEndRoomPK(options: IEndRoomPKOptions): any;
3982
+ /**
3983
+ * 设置聊天室关联的rtc房间
3984
+ */
3985
+ encodebindRTCRoomForChatroom(options: IRTCRoomBindOption): any;
3947
3986
  }
3948
3987
 
3949
3988
  interface IDataChannelWatcher {
@@ -4812,10 +4851,15 @@ declare class APIContext {
4812
4851
  status: string;
4813
4852
  }>>;
4814
4853
  searchConversationByContent(keyword: string, customMessageTypes?: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
4854
+ searchConversationByContentWithAllChannel(keyword: string, customMessageTypes?: string[], conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
4815
4855
  searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId?: string): Promise<IAsyncRes<{
4816
4856
  messages: IReceivedMessage[];
4817
4857
  count: number;
4818
4858
  }>>;
4859
+ searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number): Promise<IAsyncRes<{
4860
+ messages: IReceivedMessage[];
4861
+ count: number;
4862
+ }>>;
4819
4863
  getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId?: string): IReceivedMessage[];
4820
4864
  clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
4821
4865
  /**
@@ -4896,6 +4940,10 @@ declare class APIContext {
4896
4940
  * 结束连麦 PK
4897
4941
  */
4898
4942
  endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
4943
+ /**
4944
+ * SDK设置聊天室关联的rtc房间
4945
+ */
4946
+ bindRTCRoomForChatroom(option: IRTCRoomBindOption): Promise<ErrorCode>;
4899
4947
  }
4900
4948
 
4901
4949
  declare class PluginContext {
@@ -5663,6 +5711,10 @@ declare abstract class AEngine implements IEngine {
5663
5711
  * 通过关键字搜索会话
5664
5712
  */
5665
5713
  abstract searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
5714
+ /**
5715
+ * 通过关键字搜索所有会话
5716
+ */
5717
+ abstract searchConversationByContentWithAllChannel(keyword: string, customMessageTypes: string[], conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
5666
5718
  /**
5667
5719
  * 按内容搜索会话内的消息
5668
5720
  */
@@ -5670,6 +5722,13 @@ declare abstract class AEngine implements IEngine {
5670
5722
  messages: IReceivedMessage[];
5671
5723
  count: number;
5672
5724
  }>;
5725
+ /**
5726
+ * 按内容搜索指定会话(不区分 channelId)的消息
5727
+ */
5728
+ abstract searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number): IPromiseResult<{
5729
+ messages: IReceivedMessage[];
5730
+ count: number;
5731
+ }>;
5673
5732
  /**
5674
5733
  * 获取会话下所有未读的 @ 消息
5675
5734
  */
@@ -5762,6 +5821,7 @@ declare abstract class AEngine implements IEngine {
5762
5821
  abstract cancelRoomPK(options: ICancelRoomPKOptions): Promise<ErrorCode>;
5763
5822
  abstract responseRoomPK(options: IResRoomPKOptions): Promise<ErrorCode>;
5764
5823
  abstract endRoomPK(options: IEndRoomPKOptions): Promise<ErrorCode>;
5824
+ abstract bindRTCRoomForChatroom(options: IRTCRoomBindOption): Promise<ErrorCode>;
5765
5825
  }
5766
5826
 
5767
5827
  declare class AppStorage {
@@ -6234,4 +6294,4 @@ declare enum CONNECTION_TYPE {
6234
6294
  */
6235
6295
  declare const version: string;
6236
6296
 
6237
- 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, IBaseConversationInfo, IBlockedMessageInfo, ICancelRoomPKOptions, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IEndRoomPKOptions, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomInfo, IRTCUserData, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IReqRoomPKOptions, IRequest, IResRoomPKOptions, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUltraExMsgOptions, IUltraModifyMsgOptions, 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, clone, cloneByJSON, forEach, formatConnectResponseCode, getBrowser, getMimeKey, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidExpansion, isValidFileType, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, usingCppEngine, validate, version };
6297
+ 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, IBaseConversationInfo, IBlockedMessageInfo, ICancelRoomPKOptions, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IEndRoomPKOptions, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGetMsgOption, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomBindOption, IRTCRoomInfo, IRTCUserData, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IReqRoomPKOptions, IRequest, IResRoomPKOptions, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUltraExMsgOptions, IUltraModifyMsgOptions, IUltraMsgQueryOptions, 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, OperateStatus, 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, clone, cloneByJSON, forEach, formatConnectResponseCode, getBrowser, getMimeKey, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidExpansion, isValidFileType, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, todo, usingCppEngine, validate, version };