@rongcloud/engine 4.5.5 → 4.6.0-beem.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 - v4.5.5
3
- * CommitId - 995181d9e191b32bf0910367a205e604999e026a
4
- * Wed Jan 26 2022 11:32:58 GMT+0800 (China Standard Time)
2
+ * RCEngine - v4.6.0-beem.3
3
+ * CommitId - 4d8902d56507c194e9555a4aadf89076191979c7
4
+ * Wed Mar 09 2022 16:28:00 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  /**
@@ -2638,6 +2638,7 @@ declare class PluginContext {
2638
2638
  * 目前仅通知:主播加入、退出房间的人员列表变更,发布、取消发布资源列表变更
2639
2639
  */
2640
2640
  onrtcdatachange?(data: IServerRTCRoomEntry[], roomdId?: string): void;
2641
+ onCallInfo?(data: string): void;
2641
2642
  /**
2642
2643
  * 获取 `@rongcloud/engine` 包版本
2643
2644
  */
@@ -2681,6 +2682,10 @@ declare class PluginContext {
2681
2682
  * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
2682
2683
  */
2683
2684
  getRTCJoinedUserInfo(userId: string): IPromiseResult<IRTCJoinedInfo[]>;
2685
+ setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
2686
+ key: string;
2687
+ value: string;
2688
+ }>;
2684
2689
  }
2685
2690
 
2686
2691
  declare enum ReceivedStatus {
@@ -2873,8 +2878,13 @@ declare enum MessageType {
2873
2878
  */
2874
2879
  GROUP_READ_RECEIPT_REQUEST = "RC:RRMsg",
2875
2880
  /**
2876
- * 用户加入聊天室
2881
+ * 消息送达报告,仅单聊
2882
+ */
2883
+ DELIVERED = "RC:Delivered",
2884
+ /**
2885
+ * 消息送达状态报告,仅群聊
2877
2886
  */
2887
+ DELIVERED_MSG = "RC:DRMsg",
2878
2888
  CHATROOM_JOIN = "RC:ChrmJoinNtf",
2879
2889
  /**
2880
2890
  * 用户退出聊天室
@@ -3220,1172 +3230,1225 @@ interface ITypingMessage {
3220
3230
  }
3221
3231
 
3222
3232
  /**
3223
- * 被拦截的消息信息
3233
+ * 消息送达相关接口
3224
3234
  */
3225
- interface IBlockedMessageInfo {
3226
- blockedMessageUId: string;
3227
- conversationType: number;
3235
+
3236
+ interface IDeliveredUser {
3237
+ time: number;
3238
+ userId: string;
3239
+ }
3240
+ interface IGroupMessageDeliverInfo {
3241
+ totalCount: number;
3242
+ list: IDeliveredUser[];
3243
+ }
3244
+ interface IMessageDeliver {
3245
+ deliverTime: number;
3246
+ messageUId: string;
3247
+ conversationType: ConversationType;
3228
3248
  targetId: string;
3229
- channelId: string;
3230
- blockType: MessageBlockType;
3249
+ }
3250
+ interface IGroupMessageDeliveredStatusInfo {
3251
+ MessageUId: string;
3252
+ deliveryCount: number;
3253
+ }
3254
+ interface IGroupMessageDeliverStatus {
3255
+ totalCount: number;
3256
+ list: IGroupMessageDeliveredStatusInfo[];
3231
3257
  }
3232
3258
 
3233
- interface IConnectResult {
3259
+ /**
3260
+ * engine 基本接口定义,用于约束 Electron 下主进程、渲染进程、JSEngine 的编码一致性
3261
+ */
3262
+ interface IEngine {
3234
3263
  /**
3235
- * 连接错误码
3264
+ * 建立连接
3265
+ * @param token
3266
+ * @param naviInfo
3267
+ * @param reconnectKickEnable
3236
3268
  */
3237
- code: ErrorCode;
3269
+ connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean): Promise<ErrorCode>;
3238
3270
  /**
3239
- * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
3271
+ * 上报版本信息
3272
+ * @param version
3240
3273
  */
3241
- userId?: string;
3242
- }
3243
- declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
3244
- declare type IConnectionStatusListener = (status: ConnectionStatus) => void;
3245
- declare type IConversationStateListener = (conversation: IUpdatedConversation[]) => void;
3246
- declare type IChatroomListener = (state: IChatroomListenerData) => void;
3247
- declare type IRTCInnerListener = {
3248
- message?: IMessageListnenr;
3249
- status?: IConnectionStatusListener;
3250
- };
3251
- declare type IExpansionListener = (data: IExpansionListenerData) => void;
3252
- declare type ITagListener = () => void;
3253
- declare type IConversationTagListener = () => void;
3254
- declare type ItypingStateListener = (data: ITypingMessage[]) => void;
3255
- declare type IMessageBlockedListener = (data: IBlockedMessageInfo) => void;
3256
- interface ISendExMsgOptions {
3257
- channelId: string;
3258
- conversationType: ConversationType;
3259
- targetId: string;
3274
+ reportSDKInfo(version: {
3275
+ [name: string]: string;
3276
+ }): void;
3260
3277
  /**
3261
- * 消息 ID
3278
+ * 连接时间
3279
+ */
3280
+ getConnectedTime(): number;
3281
+ /**
3282
+ * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
3283
+ * 对于未实现的方法,接口响应 Unsupport 错误码
3284
+ * @param method
3285
+ * @param args
3286
+ */
3287
+ callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
3288
+ /**
3289
+ * 获取历史消息
3290
+ * @param conversationType
3291
+ * @param targetId
3292
+ * @param timestamp
3293
+ * @param count
3294
+ * @param order
3295
+ */
3296
+ getHistoryMessage(conversationType: ConversationType, targetId: string,
3297
+ /**
3298
+ * 拉取时间戳,值为 `0` 表示从当前时间拉取
3299
+ */
3300
+ timestamp: number,
3301
+ /**
3302
+ * 获取条数, 有效值 `1` - `20`
3303
+ */
3304
+ count: number,
3305
+ /**
3306
+ * @description
3307
+ * 1. `0` 表示升序,获取消息发送时间比传入 `sentTime` 小 的消息
3308
+ * 2. `1` 表示降序,获取消息发送时间比传入 `sentTime` 大 的消息
3309
+ */
3310
+ order: 0 | 1,
3311
+ /**
3312
+ * 会话的业务标识
3262
3313
  */
3263
- messageUId: string;
3314
+ channelId: string,
3264
3315
  /**
3265
- * 原始消息是否支持扩展的字段
3316
+ * 消息类型
3317
+ */
3318
+ objectName: string): IPromiseResult<{
3319
+ list: IReceivedMessage[];
3320
+ hasMore: boolean;
3321
+ }>;
3322
+ /**
3323
+ * 删除历史消息 通过 messageUId
3266
3324
  */
3267
- canIncludeExpansion: boolean;
3325
+ deleteRemoteMessage(conversationType: ConversationType, targetId: string,
3268
3326
  /**
3269
- * 删除的 keys
3327
+ * @description
3328
+ * message 中 messageUId、setTime、messageDirection 为必须参数
3270
3329
  */
3271
- keys?: string[];
3330
+ messages: {
3331
+ messageUId: string;
3332
+ sentTime: number;
3333
+ messageDirection: MessageDirection;
3334
+ }[],
3272
3335
  /**
3273
- * 扩展对象
3336
+ * 会话的业务标识
3274
3337
  */
3275
- expansion?: {
3276
- [key: string]: string;
3277
- };
3338
+ channelId: string): Promise<ErrorCode>;
3339
+ recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
3278
3340
  /**
3279
- * 是否删除所有扩展
3341
+ * 删除历史消息 通过 时间戳
3342
+ * @param timestamp 小于等于传入时间戳的消息均删除
3280
3343
  */
3281
- removeAll?: boolean;
3344
+ deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number,
3282
3345
  /**
3283
- * 原始消息的扩展
3346
+ * 会话的业务标识
3284
3347
  */
3285
- originExpansion?: {
3286
- [key: string]: string;
3287
- } | null;
3288
- }
3289
- interface IWatcher {
3290
- message?: IMessageListnenr;
3291
- connectionState?: IConnectionStatusListener;
3292
- conversationState?: IConversationStateListener;
3293
- chatroomState?: IChatroomListener;
3294
- expansion?: IExpansionListener;
3348
+ channelId: string): Promise<ErrorCode>;
3295
3349
  /**
3296
- * 为兼容老版本 RTCLib 与 CallLib 接收消息的方式,新版本消息走插件机制
3350
+ * 获取会话列表
3351
+ * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
3297
3352
  */
3298
- rtcInnerWatcher?: IRTCInnerListener;
3353
+ getConversationList(
3299
3354
  /**
3300
- * 标签的增删改监听
3355
+ * 拉取数量, 有效值 0 - 1000, 默认 300
3301
3356
  */
3302
- tag?: ITagListener;
3357
+ count: number,
3303
3358
  /**
3304
- * 会话中标签状态变更监听
3359
+ * 会话类型
3360
+ * @todo 待确认是否生效
3305
3361
  */
3306
- conversationTagChanged?: IConversationTagListener;
3362
+ conversationType?: ConversationType,
3307
3363
  /**
3308
- * 输入状态变更监听
3309
- */
3310
- typingState?: ItypingStateListener;
3364
+ * 起始时间
3365
+ */
3366
+ startTime?: number,
3311
3367
  /**
3312
- * 是否拉取完毕添加通知
3313
- */
3314
- pullFinished?: ITagListener;
3368
+ * 获取顺序
3369
+ */
3370
+ order?: 0 | 1,
3315
3371
  /**
3316
- * 敏感词被拦截监听
3317
- */
3318
- messageBlocked?: IMessageBlockedListener;
3319
- }
3320
- interface IPluginGenerator<API, InitOption> {
3372
+ * 会话的业务标识
3373
+ */
3374
+ channelId?: string): IPromiseResult<IReceivedConversation[]>;
3321
3375
  /**
3322
- * 只读插件标识
3323
- */
3324
- readonly tag: string;
3376
+ * 获取指定会话
3377
+ */
3378
+ getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
3325
3379
  /**
3326
- * 版本号
3380
+ * 删除会话
3381
+ * @description 该删除操作会删除服务器端存储的会话数据
3382
+ * @param conversationType
3383
+ * @param targetId
3327
3384
  */
3328
- readonly version?: string;
3385
+ removeConversation(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3329
3386
  /**
3330
- * 插件名称
3387
+ * 获取所有会话未读数
3388
+ * @param channelId 多组织 Id
3389
+ * @param conversationTypes
3390
+ * @param includeMuted 包含已设置免打扰的会话
3331
3391
  */
3332
- readonly name?: string;
3392
+ getAllConversationUnreadCount(channelId: string, conversationTypes: ConversationType[], includeMuted: boolean): IPromiseResult<number>;
3333
3393
  /**
3334
- * 插件安装前的环境检测,通过返回 boolean 值确认插件是否可运行
3394
+ * 获取指定会话未读数
3335
3395
  */
3336
- verify(runtime: IRuntime): boolean;
3396
+ getConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<number>;
3337
3397
  /**
3338
- * 插件初始化
3339
- * @param context 插件调用上下文,用于实现插件的消息注册、消息首发等
3340
- * @param runtime 运行时实例,用于标识最终的运行时平台
3341
- * @param options 初始化参数
3398
+ * 清除指定会话未读数
3342
3399
  */
3343
- setup(context: PluginContext, runtime: IRuntime, options: InitOption): API;
3344
- }
3345
- interface IAPIContextOption {
3400
+ clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3346
3401
  /**
3347
- * 应用 appkey
3402
+ * 获取第一个未读消息
3348
3403
  */
3349
- appkey: string;
3404
+ getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
3350
3405
  /**
3351
- * IMLib 版本号
3406
+ * 设置/保存指定会话消息草稿
3407
+ * @draft 草稿内容
3352
3408
  */
3353
- apiVersion: string;
3409
+ saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
3354
3410
  /**
3355
- * 自定义导航地址:
3356
- * 1. 私有云环境下该值为必填项
3357
- * 2. 当存在自定义导航地址时,SDK 内部默认地址将无效
3358
- * 3. 当存在自定义导航地址时,地址 url 中需包含 http/https 协议头,否则视为无效值
3359
- * 4. 建立 ws/wss 连接前的 ping 接口使用的协议与导航 url 中的协议相同
3360
- * 5. 建立 websocket 建立连接时将根据 ping 接口使用的 http/https 协议来确定使用 ws/wss 协议
3361
- * 6. 动态导航使用的协议头将与自定义导航地址相同
3362
- * 7. 公有云默认使用 https 协议
3411
+ * 获取指定会话消息草稿
3363
3412
  */
3364
- navigators: string[];
3365
- /**
3366
- * (参数已废弃)~~c++ 协议栈数据库地址~~
3367
- * @deprecated
3368
- */
3369
- dbPath?: string;
3413
+ getConversationMessageDraft(conversationType: ConversationType, targetId: string): IPromiseResult<string>;
3370
3414
  /**
3371
- * 小程序的 CMP 代理地址
3415
+ * 清除指定会话消息草稿
3372
3416
  */
3373
- miniCMPProxy: string[];
3417
+ clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
3374
3418
  /**
3375
- * 指定默认使用的连接类型
3419
+ * 从服务端拉取会话状态
3376
3420
  */
3377
- connectionType: 'websocket' | 'comet';
3421
+ pullConversationStatus(timestamp: number): Promise<IAsyncRes<IServerConversationStatus[]>>;
3378
3422
  /**
3379
- * 修改 engine log 打印等级
3423
+ * 批量设置会话 置顶、免打扰
3380
3424
  */
3381
- logLevel?: LogLevel;
3425
+ batchSetConversationStatus(statusList: ISetConversationStatusOptions[]): Promise<ErrorCode>;
3426
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): IPromiseResult<IReceivedMessage>;
3382
3427
  /**
3383
- * 修改默认的 log 输出函数
3428
+ * 断开连接
3384
3429
  */
3385
- logStdout?: (logLevel: LogLevel, content: string) => void;
3430
+ disconnect(): void;
3386
3431
  /**
3387
- * (已废弃)私有云标识
3388
- * @deprecated
3432
+ * 拉取用户级配置数据
3389
3433
  */
3390
- isEnterPrise?: boolean;
3434
+ pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
3391
3435
  /**
3392
- * typing状态过期时间
3393
- */
3394
- typingExpireTime?: number;
3395
- /**
3396
- * 是否打开 IndexDB 存储,默认为 true
3436
+ * 消息注册
3437
+ * @description
3438
+ * 消息注册需在应用初始化完成前进行,否则在搭配 C++ 协议栈使用时,
3439
+ * 本端发出的消息将不默认作为未知消息处理,不存储、不计数
3440
+ * @param objectName 消息类型,如:RC:TxtMsg
3441
+ * @param isPersited 是否存储
3442
+ * @param isCounted 是否技术
3443
+ * @param searchProps 搜索字段,只在搭配协议栈使用时有效
3397
3444
  */
3398
- indexDBSwitch?: boolean;
3445
+ registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps: string[]): void;
3399
3446
  /**
3400
- * 是否校验证书,默认为 true
3401
- */
3402
- checkCA?: boolean;
3403
- }
3404
- declare class APIContext {
3405
- private _runtime;
3406
- private static _context?;
3407
- static init(runtime: IRuntime, options: IAPIContextOption): APIContext;
3408
- static destroy(): void;
3409
- private _token;
3447
+ * 加入聊天室
3448
+ * @param count 拉取消息数量
3449
+ */
3450
+ joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
3410
3451
  /**
3411
- * 插件队列,用于逐一派发消息与信令
3412
- */
3413
- private _pluginContextQueue;
3452
+ * 加入已存在的聊天室
3453
+ * @param count 拉取消息数量
3454
+ */
3455
+ joinExistChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
3414
3456
  /**
3415
- * 插件实例Map,用于重复初始化时返回实例
3416
- */
3417
- private _pluginInstanseMap;
3418
- private readonly _engine;
3457
+ * 退出聊天室
3458
+ */
3459
+ quitChatroom(chatroomId: string): Promise<ErrorCode>;
3419
3460
  /**
3420
- * 核心库版本号,后期与 4.0 IM SDK 版本号保持一致
3421
- */
3422
- readonly coreVersion: string;
3423
- readonly appkey: string;
3424
- readonly apiVersion: string;
3425
- private readonly _options;
3426
- private _versionInfo;
3427
- private _typingInfo;
3461
+ * 获取聊天室信息
3462
+ * @param count 获取人数, 范围 0 - 20
3463
+ * @param order 排序方式, 1 正序, 2 倒序
3464
+ */
3465
+ getChatroomInfo(chatroomId: string, count: number, order: number): IPromiseResult<IChatroomInfo>;
3428
3466
  /**
3429
- * 内部连接状态标识,为 ture 时不允许调用 reconnect 方法
3430
- */
3431
- private _isInternalConnected;
3432
- constructor(_runtime: IRuntime, options: IAPIContextOption);
3467
+ * 获取聊天室历史消息
3468
+ */
3469
+ getChatroomHistoryMessages(chatroomId: string, timestamp: number, count: number, order: number): IPromiseResult<{
3470
+ list: IReceivedMessage[];
3471
+ hasMore: boolean;
3472
+ }>;
3433
3473
  /**
3434
- * 安装使用插件,并初始化插件实例
3435
- * @param plugin
3436
- * @param options
3437
- */
3438
- install<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
3439
- private _connectionStatus;
3440
- private _canRedirectConnect;
3474
+ * 设置聊天室属性
3475
+ */
3476
+ setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3441
3477
  /**
3442
- * 重定向后,递归调用 connect
3478
+ * 批量设置聊天室属性
3443
3479
  */
3444
- private _handleRedirect;
3480
+ setChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<{
3481
+ code: ErrorCode;
3482
+ data?: any;
3483
+ }>;
3445
3484
  /**
3446
- * 连接状态变更回调
3447
- * @param message
3485
+ * 强制设置聊天室属性
3486
+ */
3487
+ forceSetChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3488
+ /**
3489
+ * 删除聊天室属性
3490
+ */
3491
+ removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3492
+ /**
3493
+ * 批量删除聊天室属性
3448
3494
  */
3449
- private _connectionStatusListener;
3450
- private _messageReceiver;
3495
+ removeChatroomEntries(chatroomId: string, entries: IChrmKVEntries): Promise<{
3496
+ code: ErrorCode;
3497
+ data?: any;
3498
+ }>;
3451
3499
  /**
3452
- * 聊天室相关信息监听
3500
+ * 强制删除聊天室属性
3453
3501
  */
3454
- private _chatroomInfoListener;
3502
+ forceRemoveChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3455
3503
  /**
3456
- * 会话监听相关
3504
+ * 获取聊天室 key 对应 value
3457
3505
  */
3458
- private _conversationInfoListener;
3506
+ getChatroomEntry(chatroomId: string, key: string): IPromiseResult<string | null>;
3459
3507
  /**
3460
- * 消息扩展监听相关
3508
+ * 获取聊天室所有 key value
3461
3509
  */
3462
- private _expansionInfoListener;
3510
+ getAllChatroomEntry(chatroomId: string): IPromiseResult<{
3511
+ [key: string]: string;
3512
+ }>;
3463
3513
  /**
3464
- * 标签增删改监听
3465
- */
3466
- private _tagListener;
3514
+ * 获取上传认证信息
3515
+ * @description
3516
+ * 若不传 fileName 百度上传认证字段(bosToken、bosDate、path)均返回 null
3517
+ */
3518
+ getFileToken(fileType: FileType, fileName?: string, httpMethod?: string, queryUriString?: string): Promise<IAsyncRes<IUploadAuth>>;
3467
3519
  /**
3468
- * 会话标签状态监听
3469
- */
3470
- private _conversationTagListener;
3471
- private _typingStatusListener;
3472
- private _pullFinishedListener;
3473
- private _MessageBlockedListener;
3520
+ * 获取文件上传后下载地址
3521
+ */
3522
+ getFileUrl(fileType: FileType, uploadMethod: UploadMethod, fileName?: string, originName?: string): IPromiseResult<{
3523
+ downloadUrl: string;
3524
+ }>;
3474
3525
  /**
3475
- * rtc 数据变更通知 pluginContext
3476
- */
3477
- private _rtcDataChange;
3526
+ * 创建标签
3527
+ * @param tag 标签
3528
+ */
3529
+ createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
3478
3530
  /**
3479
- * 业务层事件监听器挂载点
3480
- */
3481
- private _watcher;
3531
+ * 删除标签
3532
+ * @param tagId 标签id
3533
+ */
3534
+ removeTag(tagId: string): IPromiseResult<IAsyncRes>;
3482
3535
  /**
3483
- * 添加事件监听
3484
- * @param options
3485
- */
3486
- assignWatcher(watcher: IWatcher): void;
3536
+ * 编辑标签
3537
+ * @param tag 标签
3538
+ */
3539
+ updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
3487
3540
  /**
3488
- * 向内存中添加 typing 信息
3489
- * 添加 typing 时不触发通知,只有在轮询时间点校验 _typingChangedList 的长度大于 0 时才通知
3541
+ * 获取标签列表
3490
3542
  */
3491
- private _addTypingInfo;
3492
- private _typingInternalTimer;
3493
- private _typingExpireTime;
3494
- private _typingChangedList;
3543
+ getTagList(): IPromiseResult<Array<ITagInfo>>;
3495
3544
  /**
3496
- * 启动定时移除typing
3545
+ * 添加会话到标签(给多个会话增加标签)
3546
+ * @param tagId 标签id
3547
+ * @param conversations 要添加的会话列表
3497
3548
  */
3498
- private _startCheckTypingInfo;
3499
- getConnectedTime(): number;
3500
- getServerTime(): number;
3501
- getDeviceId(): string;
3502
- getCurrentUserId(): string;
3503
- getConnectionStatus(): ConnectionStatus;
3549
+ addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
3504
3550
  /**
3505
- * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
3506
- * @param token
3507
- * @param refreshNavi 是否需要重新请求导航,当值为 `false` 时,优先使用有效缓存导航,若缓存失效则重新获取导航
3508
- * @param reconnectKickEnable 设置断线重连时是否踢出当前正在重连的设备 (仅 Electron 环境有效)
3509
- * 同一个账号在一台新设备上登录的时候,会把这个账号在之前登录的设备上踢出。
3510
- 由于 SDK 有断线重连功能,存在下面情况。
3511
- 用户在 A 设备登录,A 设备网络不稳定,没有连接成功,SDK 启动重连机制。
3512
- 用户此时又在 B 设备登录,B 设备连接成功。
3513
- A 设备网络稳定之后,用户在 A 设备连接成功,B 设备被踢出。
3514
- 这个字段就是为这种情况加的。
3515
- 设置 reconnectKickEnable 为 true 时,SDK 重连的时候发现此时已有别的设备连接成功,不再强行踢出已有设备,而是踢出重连设备。
3551
+ * 删除标签中的会话(从多个会话中批量删除指定标签)
3552
+ * @param tagId 标签id
3553
+ * @param conversations 要删除的会话列表
3516
3554
  */
3517
- connect(token: string, refreshNavi?: boolean, reconnectKickEnable?: boolean): Promise<IConnectResult>;
3555
+ removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
3518
3556
  /**
3519
- * 拉取实时配置 web 端需更新 voipCall 字段
3557
+ * 删除会话中的标签(从单一会话中批量删除标签)
3558
+ * @param conversationType 会话类型
3559
+ * @param targetId 会话id
3560
+ * @param tagIds 要删除的标签列表
3520
3561
  */
3521
- private _pullUserSettings;
3522
- disconnect(): Promise<void>;
3523
- reconnect(reconnectKickEnable?: boolean): Promise<IConnectResult>;
3524
- private _getTokenWithoutNavi;
3562
+ removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
3525
3563
  /**
3526
- * 获取当前缓存的导航数据
3564
+ * 获取标签下的会话列表
3565
+ * @param tagId 标签id
3527
3566
  */
3528
- getInfoFromCache(): INaviInfo | null;
3567
+ getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): IPromiseResult<IReceivedConversationByTag[]>;
3529
3568
  /**
3530
- * 消息注册
3531
- * @description 消息注册需在应用初始化完成前进行
3532
- * @param objectName 消息类型,如:RC:TxtMsg
3533
- * @param isPersited 是否存储
3534
- * @param isCounted 是否技术
3535
- * @param searchProps 搜索字段,只在搭配协议栈使用时有效
3569
+ * 获取标签下的未读消息数
3570
+ * @param tagId 标签id
3571
+ * @param containMuted 是否包含免打扰会话
3536
3572
  */
3537
- registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
3573
+ getUnreadCountByTag(tagId: string, containMuted: boolean): IPromiseResult<number>;
3538
3574
  /**
3539
- * 发送消息
3540
- * @param conversationType
3541
- * @param targetId
3542
- * @param objectName
3543
- * @param content
3544
- * @param options
3575
+ * 设置标签中会话置顶
3576
+ * @param conversation 会话
3545
3577
  */
3546
- sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): Promise<IAsyncRes<IReceivedMessage>>;
3578
+ setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
3547
3579
  /**
3548
- * 发送扩展消息
3549
- * @param messageUId 消息 Id
3550
- * @param keys 需要删除的 key
3551
- * @param expansion 设置的扩展
3552
- */
3553
- sendExpansionMessage(options: ISendExMsgOptions): Promise<IAsyncRes<ErrorCode>>;
3580
+ * 获取会话里的标签
3581
+ * @param config
3582
+ */
3583
+ getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
3554
3584
  /**
3555
3585
  * 发送群组消息已读回执
3556
3586
  * 导航下发已读回执开关为 true 时调用
3557
- * @param targetId 群组会话id
3558
- * @param messageUIds 消息id
3559
3587
  */
3560
3588
  sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
3561
3589
  /**
3562
3590
  * 获取群组消息已读列表
3563
- * @param targetId
3564
- * @param messageUIds
3565
3591
  */
3566
- getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
3592
+ getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
3567
3593
  /**
3568
- * 反初始化,清空所有监听及计时器
3594
+ * 获取服务器时间
3569
3595
  */
3570
- private _destroy;
3596
+ getServerTime(): number;
3571
3597
  /**
3572
- * @param conversationType
3573
- * @param targetId 会话 Id
3574
- * @param timestamp 拉取时间戳
3575
- * @param count 拉取条数
3576
- * @param order 1 正序拉取,0 为倒序拉取
3577
- * @param channelId
3578
- * @param objectName
3598
+ * 获取设备ID
3579
3599
  */
3580
- getHistoryMessage(conversationType: ConversationType, targetId: string, timestamp?: number, count?: number, order?: 0 | 1, channelId?: string, objectName?: string): Promise<IAsyncRes<{
3581
- list: IReceivedMessage[];
3582
- hasMore: boolean;
3583
- }>>;
3600
+ getDeviceId(): string;
3584
3601
  /**
3585
- * 获取会话列表
3586
- * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
3602
+ * 获取当前 userId
3587
3603
  */
3588
- getConversationList(count?: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
3604
+ getCurrentUserId(): string;
3589
3605
  /**
3590
- * 获取单一会话数据
3591
- * @param conversationType
3592
- * @param targetId
3593
- * @param channelId
3594
- */
3595
- getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
3606
+ * 设置用户在线状态监听器
3607
+ */
3608
+ setUserStatusListener(config: {
3609
+ userIds: string[];
3610
+ }, listener: Function): void;
3596
3611
  /**
3597
- * 删除会话
3598
- */
3599
- removeConversation(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3612
+ * 设置当前用户在线状态
3613
+ */
3614
+ setUserStatus(status: number): Promise<ErrorCode>;
3600
3615
  /**
3601
- * 清除会话消息未读数
3602
- */
3603
- clearUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3616
+ * 订阅用户在线状态
3617
+ */
3618
+ subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
3604
3619
  /**
3605
- * 清除全部会话消息未读数
3606
- */
3607
- clearAllUnreadCount(): Promise<ErrorCode>;
3620
+ * 获取用户状态
3621
+ */
3622
+ getUserStatus(userId: string): IPromiseResult<{
3623
+ status: string;
3624
+ }>;
3608
3625
  /**
3609
- * 获取指定会话消息未读数
3610
- */
3611
- getUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<number>>;
3626
+ * 清空所有会话
3627
+ */
3628
+ clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
3612
3629
  /**
3613
- * 获取所有会话未读数
3614
- * @param channelId 多组织 Id
3615
- * @param conversationTypes
3616
- * @param includeMuted 包含已设置免打扰的会话
3617
- */
3618
- getTotalUnreadCount(channelId: string, conversationTypes?: ConversationType[], includeMuted?: boolean): Promise<IAsyncRes<number>>;
3630
+ * 加入黑名单
3631
+ */
3632
+ addToBlacklist(userId: string): Promise<ErrorCode>;
3619
3633
  /**
3620
- * 获取第一个未读消息
3621
- */
3622
- getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<IReceivedMessage | null>>;
3623
- setConversationStatus(conversationType: ConversationType, targetId: string, isTop?: boolean, notificationStatus?: 1 | 2, channelId?: string): Promise<ErrorCode>;
3624
- saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
3625
- getConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<IAsyncRes<string>>;
3626
- clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
3627
- recallMessage(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
3634
+ * 将指定用户移除黑名单
3635
+ */
3636
+ removeFromBlacklist(userId: string): Promise<ErrorCode>;
3628
3637
  /**
3629
- * 删除远端消息
3630
- * @param conversationType
3631
- * @param targetId
3632
- * @param list
3633
- */
3634
- deleteRemoteMessage(conversationType: ConversationType, targetId: string, list: {
3635
- messageUId: string;
3636
- sentTime: number;
3637
- messageDirection: MessageDirection;
3638
- }[], channelId?: string): Promise<ErrorCode>;
3638
+ * 获取黑名单列表
3639
+ */
3640
+ getBlacklist(): IPromiseResult<string[]>;
3639
3641
  /**
3640
- * 根据时间戳删除指定时间之前的
3641
- * @param conversationType
3642
- * @param targetId
3643
- * @param timestamp
3644
- */
3645
- deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
3642
+ * 获取指定人员在黑名单中的状态
3643
+ */
3644
+ getBlacklistStatus(userId: string): IPromiseResult<string>;
3646
3645
  /**
3647
- * 加入聊天室,若聊天室不存在则创建聊天室
3648
- * @param roomId 聊天室房间 Id
3649
- * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
3650
- */
3651
- joinChatroom(roomId: string, count?: number): Promise<ErrorCode>;
3646
+ * 向本地插入一条消息,不发送到服务器
3647
+ */
3648
+ insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
3652
3649
  /**
3653
- * 加入聊天室,若聊天室不存在则抛出异常
3654
- * @param roomId 聊天室房间 Id
3655
- * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
3656
- */
3657
- joinExistChatroom(roomId: string, count?: number): Promise<ErrorCode>;
3650
+ * 删除本地消息
3651
+ */
3652
+ deleteMessages(timestamps: number[]): Promise<ErrorCode>;
3658
3653
  /**
3659
- * 退出聊天室
3660
- * @param roomId
3661
- */
3662
- quitChatroom(roomId: string): Promise<ErrorCode>;
3654
+ * 通过时间戳删除本地消息
3655
+ */
3656
+ deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
3663
3657
  /**
3664
- * 获取聊天室房间数据
3665
- * @description count 或 order 有一个为 0 时,只返回成员总数,不返回成员列表信息
3666
- * @param roomId 聊天室 Id
3667
- * @param count 获取房间人员列表数量,最大有效值 `20`,最小值未 `0`,默认为 0
3668
- * @param order 人员排序方式,`1` 为正序,`2` 为倒序,默认为 0
3669
- */
3670
- getChatroomInfo(roomId: string, count?: number, order?: 0 | 1 | 2): Promise<IAsyncRes<IChatroomInfo>>;
3658
+ * 清空会话下历史消息
3659
+ */
3660
+ clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
3671
3661
  /**
3672
- * 在指定聊天室中设置自定义属性
3673
- * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
3674
- * @param roomId 聊天室房间 id
3675
- * @param entry 属性信息
3676
- */
3677
- setChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3678
- setChatroomEntries(roomId: string, entryOptions: IChatroomEntries): Promise<{
3679
- code: ErrorCode;
3680
- data?: any;
3681
- }>;
3662
+ * 获取消息
3663
+ */
3664
+ getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
3682
3665
  /**
3683
- * 在指定聊天室中强制增加 / 修改任意聊天室属性
3684
- * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
3685
- * @param roomId 聊天室房间 id
3686
- * @param entry 属性信息
3687
- */
3688
- forceSetChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3666
+ * 设置消息内容
3667
+ */
3668
+ setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
3689
3669
  /**
3690
- * 删除聊天室属性
3691
- * @description 该方法仅限于删除自己设置的聊天室属性
3692
- * @param roomId 聊天室房间 id
3693
- * @param entry 要移除的属性信息
3694
- */
3695
- removeChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
3670
+ * 设置消息搜索字段
3671
+ */
3672
+ setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
3696
3673
  /**
3697
- * 批量删除聊天室属性
3698
- * @description 该方法仅限于删除自己设置的聊天室属性
3699
- * @param roomId 聊天室房间 id
3700
- * @param entry 要移除的属性信息
3701
- */
3702
- removeChatroomEntries(roomId: string, entryOptions: IRemoveChatRoomEntriesOption): Promise<{
3703
- code: ErrorCode;
3704
- data?: any;
3674
+ * 通过关键字搜索会话
3675
+ */
3676
+ searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
3677
+ /**
3678
+ * 按内容搜索会话内的消息
3679
+ */
3680
+ searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
3681
+ messages: IReceivedMessage[];
3682
+ count: number;
3705
3683
  }>;
3706
3684
  /**
3707
- * 强制删除任意聊天室属性
3708
- * @description 该方法仅限于删除自己设置的聊天室属性
3709
- * @param roomId 聊天室房间 id
3710
- * @param entry 要移除的属性信息
3711
- */
3712
- forceRemoveChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
3685
+ * 获取会话下所有未读的 @ 消息
3686
+ */
3687
+ getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
3713
3688
  /**
3714
- * 获取聊天室中的指定属性
3715
- * @param roomId 聊天室房间 id
3716
- * @param key 属性键名
3717
- */
3718
- getChatroomEntry(roomId: string, key: string): Promise<IAsyncRes<string | null>>;
3689
+ * 设置消息发送状态
3690
+ */
3691
+ setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
3719
3692
  /**
3720
- * 获取聊天室内的所有属性
3721
- * @param roomId 聊天室房间 id
3722
- */
3723
- getAllChatroomEntries(roomId: string): Promise<IAsyncRes<{
3724
- [key: string]: string;
3725
- }>>;
3693
+ * 设置消息接收状态
3694
+ */
3695
+ setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
3726
3696
  /**
3727
- * 拉取聊天室内的历史消息
3728
- * @param roomId
3729
- * @param count 拉取消息条数, 有效值范围 `1 - 20`
3730
- * @param order 获取顺序,默认值为 0。
3731
- * * 0:降序,用于获取早于指定时间戳发送的消息
3732
- * * 1:升序,用于获取晚于指定时间戳发送的消息
3733
- * @param timestamp 指定拉取消息用到的时间戳。默认值为 `0`,表示按当前时间拉取
3734
- */
3735
- getChatRoomHistoryMessages(roomId: string, count?: number, order?: 0 | 1, timestamp?: number): Promise<IAsyncRes<{
3736
- list: IReceivedMessage[];
3737
- hasMore: boolean;
3738
- }>>;
3697
+ * 删除时间戳前的未读数
3698
+ */
3699
+ clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
3739
3700
  /**
3740
- * 获取存储服务鉴权信息
3741
- * @param fileType 文件类型
3742
- * @param fileName 文件名称
3743
- * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
3744
- * @param queryString STC 分段上传时的查询字符串
3745
- * @description
3746
- * `httpMethod` 与 `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
3747
- * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`
3748
- * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`
3749
- * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`
3750
- * @returns
3751
- */
3752
- getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<IUploadAuth & {
3753
- bos: string;
3754
- qiniu: string;
3755
- }>;
3701
+ * 获取会话免打扰状态
3702
+ */
3703
+ getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
3756
3704
  /**
3757
- * 获取 七牛、百度、阿里云 上传成功可下载的 URL
3758
- * @param fileType 文件类型
3759
- * @param fileName 文件名
3760
- * @param saveName 下载后的存储文件名
3761
- * @param uploadRes 插件上传返回的结果。降级百度上传后,用户传入返回结果,再把结果里的下载地址返回给用户,保证兼容之前结果获取
3762
- * @param serverType 使用的存储服务标识
3705
+ * 协议栈获取远端历史消息
3763
3706
  */
3764
- getFileUrl(fileType: FileType, fileName?: string, saveName?: string, uploadRes?: {
3765
- isBosRes: boolean;
3766
- downloadUrl: string;
3767
- }, serverType?: UploadMethod): Promise<{
3768
- downloadUrl: string;
3707
+ getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
3708
+ list: IReceivedMessage[];
3709
+ hasMore: boolean;
3769
3710
  }>;
3770
3711
  /**
3771
- * 创建标签
3772
- * @param tag 标签
3773
- */
3774
- createTag(tag: ITagParam): Promise<IAsyncRes>;
3775
- /**
3776
- * 删除标签
3777
- * @param tagId 标签id
3778
- */
3779
- removeTag(tagId: string): Promise<IAsyncRes>;
3780
- /**
3781
- * 更新标签
3782
- * @param tag 标签
3783
- */
3784
- updateTag(tag: ITagParam): Promise<IAsyncRes>;
3785
- /**
3786
- * 获取标签列表
3712
+ * 获取群组消息送达列表
3787
3713
  */
3788
- getTagList(): Promise<IAsyncRes<Array<ITagInfo>>>;
3714
+ getGroupMessageDeliverList(targetId: string, messageUId: string, channelId: string): IPromiseResult<IGroupMessageDeliverInfo>;
3789
3715
  /**
3790
- * 添加会话到标签(给多个会话增加标签)
3791
- * @param tagId 标签id
3792
- * @param conversations 要添加的会话列表
3716
+ * 获取单聊消息送达详情
3793
3717
  */
3794
- addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
3718
+ getPrivateMessageDeliverTime(messageUId: string, channelId: string): IPromiseResult<number>;
3719
+ setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
3720
+ key: string;
3721
+ value: string;
3722
+ }>;
3723
+ joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
3724
+ quitRTCRoom(roomId: string): Promise<ErrorCode>;
3725
+ rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
3726
+ getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
3727
+ getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
3728
+ getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
3729
+ setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
3730
+ removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
3731
+ setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
3732
+ name: string;
3733
+ content: string;
3734
+ }): Promise<ErrorCode>;
3795
3735
  /**
3796
- * 删除标签中的会话(从多个会话中批量删除指定标签)
3797
- * @param tagId 标签id
3798
- * @param conversations 要删除的会话列表
3736
+ * 全量订阅资源修改
3737
+ * @param roomId 房间 Id
3738
+ * @param message 向前兼容的消息内容
3739
+ * @param valueInfo 全量资源数据
3740
+ * @param objectName 全量 URI 消息名
3799
3741
  */
3800
- removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
3742
+ setRTCTotalRes(roomId: string, message: {
3743
+ name: string;
3744
+ content: string;
3745
+ }, valueInfo: string, objectName: string, mcuValInfo: string): Promise<ErrorCode>;
3746
+ getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
3747
+ removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
3748
+ name: string;
3749
+ content: string;
3750
+ }): Promise<ErrorCode>;
3751
+ setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
3752
+ getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
3753
+ getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
3754
+ setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
3755
+ getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
3756
+ setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
3757
+ }
3758
+
3759
+ interface IExpansionMsgContent {
3801
3760
  /**
3802
- * 删除会话中的标签(从单一会话中批量删除标签)
3803
- * @param conversationType 会话类型
3804
- * @param targetId 会话id
3805
- * @param tagIds 要删除的标签列表
3806
- */
3807
- removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<IAsyncRes>>;
3761
+ * 消息扩展的对象
3762
+ */
3763
+ put?: {
3764
+ [key: string]: string;
3765
+ };
3808
3766
  /**
3809
- * 获取标签下的会话列表
3810
- * @param tagId 标签id
3811
- */
3812
- getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): Promise<IAsyncRes<IReceivedConversationByTag[]>>;
3767
+ * 删除的 keys
3768
+ */
3769
+ del?: string[];
3813
3770
  /**
3814
- * 获取标签下的未读消息数
3815
- * @param tagId 标签id
3816
- * @param containMuted 是否包含免打扰会话
3817
- */
3818
- getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<IAsyncRes<number>>;
3771
+ * messageUId
3772
+ */
3773
+ mid: string;
3819
3774
  /**
3820
- * 设置标签中会话置顶
3821
- * @param conversation 会话
3822
- */
3823
- setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: {
3824
- isTop: boolean;
3825
- }): Promise<IAsyncRes<IAsyncRes>>;
3775
+ * 是否删除所有, 有效值:0、1 . ( 后续如有需要, API Layer 层可使用)
3776
+ */
3777
+ removeAll?: number;
3778
+ }
3779
+
3780
+ /**
3781
+ * 被拦截的消息信息
3782
+ */
3783
+ interface IBlockedMessageInfo {
3784
+ blockedMessageUId: string;
3785
+ conversationType: number;
3786
+ targetId: string;
3787
+ channelId: string;
3788
+ blockType: MessageBlockType;
3789
+ }
3790
+
3791
+ interface IConnectResult {
3826
3792
  /**
3827
- * 获取会话里的标签
3828
- * @param conversation
3793
+ * 连接错误码
3829
3794
  */
3830
- getTagsForConversation(conversation: IConversationOption): Promise<IAsyncRes<IConversationTag[]>>;
3795
+ code: ErrorCode;
3831
3796
  /**
3832
- * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
3833
- * 对于未实现的方法,接口响应 Unsupport 错误码
3834
- * @param method 方法名
3835
- * @param args
3797
+ * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
3836
3798
  */
3837
- callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
3799
+ userId?: string;
3800
+ }
3801
+ declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
3802
+ declare type IConnectionStatusListener = (status: ConnectionStatus) => void;
3803
+ declare type IConversationStateListener = (conversation: IUpdatedConversation[]) => void;
3804
+ declare type IChatroomListener = (state: IChatroomListenerData) => void;
3805
+ declare type IRTCInnerListener = {
3806
+ message?: IMessageListnenr;
3807
+ status?: IConnectionStatusListener;
3808
+ };
3809
+ declare type IExpansionListener = (data: IExpansionListenerData) => void;
3810
+ declare type ITagListener = () => void;
3811
+ declare type IConversationTagListener = () => void;
3812
+ declare type ItypingStateListener = (data: ITypingMessage[]) => void;
3813
+ declare type IMessageDeliveredListener = (data: IMessageDeliver[]) => void;
3814
+ declare type IGroupMessageDeliveredStatusListener = (data: IGroupMessageDeliverStatus) => void;
3815
+ declare type IMessageBlockedListener = (data: IBlockedMessageInfo) => void;
3816
+ interface ISendExMsgOptions {
3817
+ channelId: string;
3818
+ conversationType: ConversationType;
3819
+ targetId: string;
3838
3820
  /**
3839
- * 删除所有会话
3821
+ * 消息 ID
3840
3822
  */
3841
- clearConversations(conversationTypes?: ConversationType[], tag?: string): Promise<ErrorCode>;
3823
+ messageUId: string;
3842
3824
  /**
3843
- * 设置用户连接状态监听器
3825
+ * 原始消息是否支持扩展的字段
3844
3826
  */
3845
- setUserStatusListener(config: {
3846
- userIds: string[];
3847
- }, listener: Function): void;
3827
+ canIncludeExpansion: boolean;
3848
3828
  /**
3849
- * 添加用户黑名单
3829
+ * 删除的 keys
3850
3830
  */
3851
- addToBlacklist(userId: string): Promise<ErrorCode>;
3831
+ keys?: string[];
3852
3832
  /**
3853
- * 将指定用户移除黑名单
3833
+ * 扩展对象
3854
3834
  */
3855
- removeFromBlacklist(userId: string): Promise<ErrorCode>;
3835
+ expansion?: {
3836
+ [key: string]: string;
3837
+ };
3856
3838
  /**
3857
- * 获取黑名单列表
3839
+ * 是否删除所有扩展
3858
3840
  */
3859
- getBlacklist(): Promise<IAsyncRes<string[]>>;
3841
+ removeAll?: boolean;
3860
3842
  /**
3861
- * 获取指定人员在黑名单中的状态
3843
+ * 原始消息的扩展
3862
3844
  */
3863
- getBlacklistStatus(userId: string): Promise<IAsyncRes<string>>;
3845
+ originExpansion?: {
3846
+ [key: string]: string;
3847
+ } | null;
3848
+ }
3849
+ interface IWatcher {
3850
+ message?: IMessageListnenr;
3851
+ connectionState?: IConnectionStatusListener;
3852
+ conversationState?: IConversationStateListener;
3853
+ chatroomState?: IChatroomListener;
3854
+ expansion?: IExpansionListener;
3864
3855
  /**
3865
- * 向本地插入一条消息,不发送到服务器
3866
- */
3867
- insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
3856
+ * 为兼容老版本 RTCLib 与 CallLib 接收消息的方式,新版本消息走插件机制
3857
+ */
3858
+ rtcInnerWatcher?: IRTCInnerListener;
3868
3859
  /**
3869
- * 删除本地消息
3870
- */
3871
- deleteMessages(timestamp: number[]): Promise<ErrorCode>;
3860
+ * 标签的增删改监听
3861
+ */
3862
+ tag?: ITagListener;
3872
3863
  /**
3873
- * 从本地消息数据库中删除某一会话指定时间之前的消息数据
3874
- */
3875
- deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId?: string): Promise<ErrorCode>;
3864
+ * 会话中标签状态变更监听
3865
+ */
3866
+ conversationTagChanged?: IConversationTagListener;
3876
3867
  /**
3877
- * 清空会话下历史消息
3878
- */
3879
- clearMessages(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
3868
+ * 输入状态变更监听
3869
+ */
3870
+ typingState?: ItypingStateListener;
3880
3871
  /**
3881
- * 获取本地消息
3882
- */
3883
- getMessage(messageId: number): Promise<IAsyncRes<IReceivedMessage>>;
3872
+ * 是否拉取完毕添加通知
3873
+ */
3874
+ pullFinished?: ITagListener;
3884
3875
  /**
3885
- * 设置消息内容
3886
- */
3887
- setMessageContent(messageId: number, content: any, messageType: string): Promise<ErrorCode>;
3876
+ * 单聊消息送达通知
3877
+ */
3878
+ messageDelivered?: IMessageDeliveredListener;
3888
3879
  /**
3889
- * 设置消息搜索字段
3890
- */
3891
- setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
3880
+ * 群聊消息送达状态通知
3881
+ */
3882
+ groupMessageDeliveredStatus?: IGroupMessageDeliveredStatusListener;
3883
+ messageBlocked?: IMessageBlockedListener;
3884
+ }
3885
+ interface IPluginGenerator<API, InitOption> {
3892
3886
  /**
3893
- * 设置消息发送状态
3894
- */
3895
- setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
3887
+ * 只读插件标识
3888
+ */
3889
+ readonly tag: string;
3896
3890
  /**
3897
- * 设置消息接收状态
3898
- */
3899
- setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
3891
+ * 版本号
3892
+ */
3893
+ readonly version?: string;
3894
+ /**
3895
+ * 插件名称
3896
+ */
3897
+ readonly name?: string;
3898
+ /**
3899
+ * 插件安装前的环境检测,通过返回 boolean 值确认插件是否可运行
3900
+ */
3901
+ verify(runtime: IRuntime): boolean;
3902
+ /**
3903
+ * 插件初始化
3904
+ * @param context 插件调用上下文,用于实现插件的消息注册、消息首发等
3905
+ * @param runtime 运行时实例,用于标识最终的运行时平台
3906
+ * @param options 初始化参数
3907
+ */
3908
+ setup(context: PluginContext, runtime: IRuntime, options: InitOption): API;
3909
+ }
3910
+ interface IAPIContextOption {
3911
+ /**
3912
+ * 应用 appkey
3913
+ */
3914
+ appkey: string;
3915
+ /**
3916
+ * IMLib 版本号
3917
+ */
3918
+ apiVersion: string;
3919
+ /**
3920
+ * 自定义导航地址:
3921
+ * 1. 私有云环境下该值为必填项
3922
+ * 2. 当存在自定义导航地址时,SDK 内部默认地址将无效
3923
+ * 3. 当存在自定义导航地址时,地址 url 中需包含 http/https 协议头,否则视为无效值
3924
+ * 4. 建立 ws/wss 连接前的 ping 接口使用的协议与导航 url 中的协议相同
3925
+ * 5. 建立 websocket 建立连接时将根据 ping 接口使用的 http/https 协议来确定使用 ws/wss 协议
3926
+ * 6. 动态导航使用的协议头将与自定义导航地址相同
3927
+ * 7. 公有云默认使用 https 协议
3928
+ */
3929
+ navigators: string[];
3900
3930
  /**
3901
- * 设置当前用户在线状态
3931
+ * (参数已废弃)~~c++ 协议栈数据库地址~~
3932
+ * @deprecated
3902
3933
  */
3903
- setUserStatus(status: number): Promise<ErrorCode>;
3934
+ dbPath?: string;
3904
3935
  /**
3905
- * 订阅用户在线状态
3906
- */
3907
- subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
3936
+ * 小程序的 CMP 代理地址
3937
+ */
3938
+ miniCMPProxy: string[];
3908
3939
  /**
3909
- * 获取用户在线状态
3910
- */
3911
- getUserStatus(userId: string): Promise<IAsyncRes<{
3912
- status: string;
3913
- }>>;
3914
- searchConversationByContent(keyword: string, customMessageTypes?: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
3915
- searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId?: string): Promise<IAsyncRes<{
3916
- messages: IReceivedMessage[];
3917
- count: number;
3918
- }>>;
3919
- getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId?: string): IReceivedMessage[];
3920
- clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
3940
+ * 指定默认使用的连接类型
3941
+ */
3942
+ connectionType: 'websocket' | 'comet';
3921
3943
  /**
3922
- * 获取会话免打扰状态
3923
- */
3924
- getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<NotificationStatus>>;
3925
- getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): Promise<IAsyncRes<{
3926
- list: IReceivedMessage[];
3927
- hasMore: boolean;
3928
- }>>;
3944
+ * 修改 engine log 打印等级
3945
+ */
3946
+ logLevel?: LogLevel;
3929
3947
  /**
3930
- * 加入房间
3931
- * @param roomId
3932
- * @param mode 房间模式:直播 or 会议
3933
- * @param mediaType 直播房间模式下的媒体资源类型
3948
+ * 修改默认的 log 输出函数
3934
3949
  */
3935
- joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number, joinType?: RTCJoinType): Promise<IAsyncRes<IJoinRTCRoomData>>;
3936
- quitRTCRoom(roomId: string): Promise<ErrorCode>;
3937
- rtcPing(roomId: string, mode: number, mediaType?: number): Promise<ErrorCode>;
3938
- getRTCRoomInfo(roomId: string): Promise<IAsyncRes<IRTCRoomInfo>>;
3939
- getRTCUserInfoList(roomId: string): Promise<IAsyncRes<IRTCUsers>>;
3940
- getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
3941
- setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
3942
- removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
3943
- setRTCData(roomId: string, key: string, value: string, isInner: boolean, apiType: RTCApiType, message?: {
3944
- name: string;
3945
- content: string;
3946
- }): Promise<ErrorCode>;
3947
- setRTCTotalRes(roomId: string, message: {
3948
- name: string;
3949
- content: string;
3950
- }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
3951
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
3952
- getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): Promise<IAsyncRes<KVString>>;
3953
- removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
3954
- name: string;
3955
- content: string;
3956
- }): Promise<ErrorCode>;
3957
- setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
3958
- getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
3959
- getRTCToken(roomId: string, mode: number, broadcastType?: number): Promise<IAsyncRes<IRtcTokenData>>;
3960
- setRTCState(roomId: string, report: string): Promise<ErrorCode>;
3961
- getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
3950
+ logStdout?: (logLevel: LogLevel, content: string) => void;
3962
3951
  /**
3963
- * 直播观众加房间
3952
+ * (已废弃)私有云标识
3953
+ * @deprecated
3964
3954
  */
3965
- joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
3966
- token: string;
3967
- kvEntries: IServerRTCRoomEntry[];
3968
- }>>;
3955
+ isEnterPrise?: boolean;
3969
3956
  /**
3970
- * 直播观众退出房间
3957
+ * typing状态过期时间
3971
3958
  */
3972
- quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
3959
+ typingExpireTime?: number;
3973
3960
  /**
3974
- * 直播身份切换
3961
+ * 是否打开 IndexDB 存储,默认为 true
3975
3962
  */
3976
- rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
3963
+ indexDBSwitch?: boolean;
3977
3964
  /**
3978
- * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
3965
+ * 是否校验证书,默认为 true
3979
3966
  */
3980
- getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
3967
+ checkCA?: boolean;
3981
3968
  }
3982
-
3983
- /**
3984
- * engine 基本接口定义,用于约束 Electron 下主进程、渲染进程、JSEngine 的编码一致性
3985
- */
3986
- interface IEngine {
3969
+ declare class APIContext {
3970
+ private _runtime;
3971
+ private static _context?;
3972
+ static init(runtime: IRuntime, options: IAPIContextOption): APIContext;
3973
+ static destroy(): void;
3974
+ private _token;
3987
3975
  /**
3988
- * 建立连接
3989
- * @param token
3990
- * @param naviInfo
3991
- * @param reconnectKickEnable
3976
+ * 插件队列,用于逐一派发消息与信令
3992
3977
  */
3993
- connect(token: string, naviInfo: INaviInfo, reconnectKickEnable?: boolean): Promise<ErrorCode>;
3978
+ private _pluginContextQueue;
3994
3979
  /**
3995
- * 上报版本信息
3996
- * @param version
3980
+ * 插件实例Map,用于重复初始化时返回实例
3997
3981
  */
3998
- reportSDKInfo(version: {
3999
- [name: string]: string;
4000
- }): void;
3982
+ private _pluginInstanseMap;
3983
+ private readonly _engine;
4001
3984
  /**
4002
- * 连接时间
3985
+ * 核心库版本号,后期与 4.0 IM SDK 版本号保持一致
4003
3986
  */
4004
- getConnectedTime(): number;
3987
+ readonly coreVersion: string;
3988
+ readonly appkey: string;
3989
+ readonly apiVersion: string;
3990
+ private readonly _options;
3991
+ private _versionInfo;
3992
+ private _typingInfo;
4005
3993
  /**
4006
- * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
4007
- * 对于未实现的方法,接口响应 Unsupport 错误码
4008
- * @param method
4009
- * @param args
3994
+ * 内部连接状态标识,为 ture 时不允许调用 reconnect 方法
4010
3995
  */
4011
- callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
3996
+ private _isInternalConnected;
3997
+ constructor(_runtime: IRuntime, options: IAPIContextOption);
4012
3998
  /**
4013
- * 获取历史消息
4014
- * @param conversationType
4015
- * @param targetId
4016
- * @param timestamp
4017
- * @param count
4018
- * @param order
3999
+ * 安装使用插件,并初始化插件实例
4000
+ * @param plugin
4001
+ * @param options
4019
4002
  */
4020
- getHistoryMessage(conversationType: ConversationType, targetId: string,
4003
+ install<T, O>(plugin: IPluginGenerator<T, O>, options: O): T | null;
4004
+ private _connectionStatus;
4005
+ private _canRedirectConnect;
4021
4006
  /**
4022
- * 拉取时间戳,值为 `0` 表示从当前时间拉取
4007
+ * 重定向后,递归调用 connect
4023
4008
  */
4024
- timestamp: number,
4009
+ private _handleRedirect;
4025
4010
  /**
4026
- * 获取条数, 有效值 `1` - `20`
4011
+ * 连接状态变更回调
4012
+ * @param message
4027
4013
  */
4028
- count: number,
4014
+ private _connectionStatusListener;
4015
+ private _messageReceiver;
4029
4016
  /**
4030
- * @description
4031
- * 1. `0` 表示升序,获取消息发送时间比传入 `sentTime` 小 的消息
4032
- * 2. `1` 表示降序,获取消息发送时间比传入 `sentTime` 大 的消息
4033
- */
4034
- order: 0 | 1,
4017
+ * 聊天室相关信息监听
4018
+ */
4019
+ private _chatroomInfoListener;
4035
4020
  /**
4036
- * 会话的业务标识
4021
+ * 会话监听相关
4037
4022
  */
4038
- channelId: string,
4023
+ private _conversationInfoListener;
4039
4024
  /**
4040
- * 消息类型
4025
+ * 消息扩展监听相关
4026
+ */
4027
+ private _expansionInfoListener;
4028
+ /**
4029
+ * 标签增删改监听
4041
4030
  */
4042
- objectName: string): IPromiseResult<{
4043
- list: IReceivedMessage[];
4044
- hasMore: boolean;
4045
- }>;
4031
+ private _tagListener;
4046
4032
  /**
4047
- * 删除历史消息 通过 messageUId
4048
- */
4049
- deleteRemoteMessage(conversationType: ConversationType, targetId: string,
4033
+ * 会话标签状态监听
4034
+ */
4035
+ private _conversationTagListener;
4036
+ private _typingStatusListener;
4037
+ private _pullFinishedListener;
4038
+ private _messageDeliveredListerer;
4039
+ private _groupMessageDeliveredStatusListerer;
4040
+ private _MessageBlockedListener;
4041
+ private _callInfoListener;
4050
4042
  /**
4051
- * @description
4052
- * message 中 messageUId、setTime、messageDirection 为必须参数
4053
- */
4054
- messages: {
4055
- messageUId: string;
4056
- sentTime: number;
4057
- messageDirection: MessageDirection;
4058
- }[],
4043
+ * rtc 数据变更通知 pluginContext
4044
+ */
4045
+ private _rtcDataChange;
4059
4046
  /**
4060
- * 会话的业务标识
4061
- */
4062
- channelId: string): Promise<ErrorCode>;
4063
- recallMsg(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): IPromiseResult<IReceivedMessage>;
4047
+ * 业务层事件监听器挂载点
4048
+ */
4049
+ private _watcher;
4064
4050
  /**
4065
- * 删除历史消息 通过 时间戳
4066
- * @param timestamp 小于等于传入时间戳的消息均删除
4067
- */
4068
- deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number,
4051
+ * 添加事件监听
4052
+ * @param options
4053
+ */
4054
+ assignWatcher(watcher: IWatcher): void;
4069
4055
  /**
4070
- * 会话的业务标识
4071
- */
4072
- channelId: string): Promise<ErrorCode>;
4056
+ * 向内存中添加 typing 信息
4057
+ * 添加 typing 时不触发通知,只有在轮询时间点校验 _typingChangedList 的长度大于 0 时才通知
4058
+ */
4059
+ private _addTypingInfo;
4060
+ private _typingInternalTimer;
4061
+ private _typingExpireTime;
4062
+ private _typingChangedList;
4073
4063
  /**
4074
- * 获取会话列表
4075
- * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
4064
+ * 启动定时移除typing
4076
4065
  */
4077
- getConversationList(
4066
+ private _startCheckTypingInfo;
4067
+ getConnectedTime(): number;
4068
+ getServerTime(): number;
4069
+ getDeviceId(): string;
4070
+ getCurrentUserId(): string;
4071
+ getConnectionStatus(): ConnectionStatus;
4078
4072
  /**
4079
- * 拉取数量, 有效值 0 - 1000, 默认 300
4073
+ * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
4074
+ * @param token
4075
+ * @param refreshNavi 是否需要重新请求导航,当值为 `false` 时,优先使用有效缓存导航,若缓存失效则重新获取导航
4076
+ * @param reconnectKickEnable 设置断线重连时是否踢出当前正在重连的设备 (仅 Electron 环境有效)
4077
+ * 同一个账号在一台新设备上登录的时候,会把这个账号在之前登录的设备上踢出。
4078
+ 由于 SDK 有断线重连功能,存在下面情况。
4079
+ 用户在 A 设备登录,A 设备网络不稳定,没有连接成功,SDK 启动重连机制。
4080
+ 用户此时又在 B 设备登录,B 设备连接成功。
4081
+ A 设备网络稳定之后,用户在 A 设备连接成功,B 设备被踢出。
4082
+ 这个字段就是为这种情况加的。
4083
+ 设置 reconnectKickEnable 为 true 时,SDK 重连的时候发现此时已有别的设备连接成功,不再强行踢出已有设备,而是踢出重连设备。
4080
4084
  */
4081
- count: number,
4085
+ connect(token: string, refreshNavi?: boolean, reconnectKickEnable?: boolean): Promise<IConnectResult>;
4086
+ /**
4087
+ * 拉取实时配置 web 端需更新 voipCall 字段
4088
+ */
4089
+ private _pullUserSettings;
4090
+ disconnect(): Promise<void>;
4091
+ reconnect(reconnectKickEnable?: boolean): Promise<IConnectResult>;
4092
+ private _getTokenWithoutNavi;
4082
4093
  /**
4083
- * 会话类型
4084
- * @todo 待确认是否生效
4094
+ * 获取当前缓存的导航数据
4085
4095
  */
4086
- conversationType?: ConversationType,
4096
+ getInfoFromCache(): INaviInfo | null;
4087
4097
  /**
4088
- * 起始时间
4089
- */
4090
- startTime?: number,
4098
+ * 消息注册
4099
+ * @description 消息注册需在应用初始化完成前进行
4100
+ * @param objectName 消息类型,如:RC:TxtMsg
4101
+ * @param isPersited 是否存储
4102
+ * @param isCounted 是否技术
4103
+ * @param searchProps 搜索字段,只在搭配协议栈使用时有效
4104
+ */
4105
+ registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
4091
4106
  /**
4092
- * 获取顺序
4093
- */
4094
- order?: 0 | 1,
4107
+ * 发送消息
4108
+ * @param conversationType
4109
+ * @param targetId
4110
+ * @param objectName
4111
+ * @param content
4112
+ * @param options
4113
+ */
4114
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): Promise<IAsyncRes<IReceivedMessage>>;
4095
4115
  /**
4096
- * 会话的业务标识
4116
+ * 发送扩展消息
4117
+ * @param messageUId 消息 Id
4118
+ * @param keys 需要删除的 key
4119
+ * @param expansion 设置的扩展
4097
4120
  */
4098
- channelId?: string): IPromiseResult<IReceivedConversation[]>;
4121
+ sendExpansionMessage(options: ISendExMsgOptions): Promise<IAsyncRes<ErrorCode>>;
4099
4122
  /**
4100
- * 获取指定会话
4101
- */
4102
- getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
4123
+ * 发送群组消息已读回执
4124
+ * 导航下发已读回执开关为 true 时调用
4125
+ * @param targetId 群组会话id
4126
+ * @param messageUIds 消息id
4127
+ */
4128
+ sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
4103
4129
  /**
4104
- * 删除会话
4105
- * @description 该删除操作会删除服务器端存储的会话数据
4106
- * @param conversationType
4130
+ * 获取群组消息已读列表
4107
4131
  * @param targetId
4132
+ * @param messageUIds
4108
4133
  */
4109
- removeConversation(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
4134
+ getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
4110
4135
  /**
4111
- * 获取所有会话未读数
4112
- * @param channelId 多组织 Id
4113
- * @param conversationTypes
4114
- * @param includeMuted 包含已设置免打扰的会话
4136
+ * 反初始化,清空所有监听及计时器
4115
4137
  */
4116
- getAllConversationUnreadCount(channelId: string, conversationTypes: ConversationType[], includeMuted: boolean): IPromiseResult<number>;
4138
+ private _destroy;
4117
4139
  /**
4118
- * 获取指定会话未读数
4140
+ * @param conversationType
4141
+ * @param targetId 会话 Id
4142
+ * @param timestamp 拉取时间戳
4143
+ * @param count 拉取条数
4144
+ * @param order 1 正序拉取,0 为倒序拉取
4145
+ * @param channelId
4146
+ * @param objectName
4119
4147
  */
4120
- getConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<number>;
4148
+ getHistoryMessage(conversationType: ConversationType, targetId: string, timestamp?: number, count?: number, order?: 0 | 1, channelId?: string, objectName?: string): Promise<IAsyncRes<{
4149
+ list: IReceivedMessage[];
4150
+ hasMore: boolean;
4151
+ }>>;
4121
4152
  /**
4122
- * 清除指定会话未读数
4153
+ * 获取会话列表
4154
+ * @param count 指定获取数量, 不传则获取全部会话列表,默认 `300`
4123
4155
  */
4124
- clearConversationUnreadCount(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
4156
+ getConversationList(count?: number, conversationType?: ConversationType, startTime?: number, order?: 0 | 1, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
4125
4157
  /**
4126
- * 获取第一个未读消息
4158
+ * 获取单一会话数据
4159
+ * @param conversationType
4160
+ * @param targetId
4161
+ * @param channelId
4127
4162
  */
4128
- getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedMessage | null>;
4163
+ getConversation(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<IReceivedConversation | null>;
4129
4164
  /**
4130
- * 设置/保存指定会话消息草稿
4131
- * @draft 草稿内容
4165
+ * 删除会话
4132
4166
  */
4133
- saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
4167
+ removeConversation(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
4134
4168
  /**
4135
- * 获取指定会话消息草稿
4169
+ * 清除会话消息未读数
4136
4170
  */
4137
- getConversationMessageDraft(conversationType: ConversationType, targetId: string): IPromiseResult<string>;
4171
+ clearUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
4138
4172
  /**
4139
- * 清除指定会话消息草稿
4173
+ * 清除全部会话消息未读数
4140
4174
  */
4141
- clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
4175
+ clearAllUnreadCount(): Promise<ErrorCode>;
4142
4176
  /**
4143
- * 从服务端拉取会话状态
4177
+ * 获取指定会话消息未读数
4144
4178
  */
4145
- pullConversationStatus(timestamp: number): Promise<IAsyncRes<IServerConversationStatus[]>>;
4179
+ getUnreadCount(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<number>>;
4146
4180
  /**
4147
- * 批量设置会话 置顶、免打扰
4181
+ * 获取所有会话未读数
4182
+ * @param channelId 多组织 Id
4183
+ * @param conversationTypes
4184
+ * @param includeMuted 包含已设置免打扰的会话
4148
4185
  */
4149
- batchSetConversationStatus(statusList: ISetConversationStatusOptions[]): Promise<ErrorCode>;
4150
- sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions, onBefore?: (messageId: number) => void): IPromiseResult<IReceivedMessage>;
4186
+ getTotalUnreadCount(channelId: string, conversationTypes?: ConversationType[], includeMuted?: boolean): Promise<IAsyncRes<number>>;
4151
4187
  /**
4152
- * 断开连接
4188
+ * 获取第一个未读消息
4153
4189
  */
4154
- disconnect(): void;
4190
+ getFirstUnreadMessage(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<IReceivedMessage | null>>;
4191
+ setConversationStatus(conversationType: ConversationType, targetId: string, isTop?: boolean, notificationStatus?: 1 | 2, channelId?: string): Promise<ErrorCode>;
4192
+ saveConversationMessageDraft(conversationType: ConversationType, targetId: string, draft: string): Promise<ErrorCode>;
4193
+ getConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<IAsyncRes<string>>;
4194
+ clearConversationMessageDraft(conversationType: ConversationType, targetId: string): Promise<ErrorCode>;
4195
+ recallMessage(conversationType: ConversationType, targetId: string, messageUId: string, sentTime: number, recallMsgOptions: IRecallMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
4155
4196
  /**
4156
- * 拉取用户级配置数据
4197
+ * 删除远端消息
4198
+ * @param conversationType
4199
+ * @param targetId
4200
+ * @param list
4157
4201
  */
4158
- pullUserSettings(version: number): IPromiseResult<IServerUserSetting>;
4202
+ deleteRemoteMessage(conversationType: ConversationType, targetId: string, list: {
4203
+ messageUId: string;
4204
+ sentTime: number;
4205
+ messageDirection: MessageDirection;
4206
+ }[], channelId?: string): Promise<ErrorCode>;
4159
4207
  /**
4160
- * 消息注册
4161
- * @description
4162
- * 消息注册需在应用初始化完成前进行,否则在搭配 C++ 协议栈使用时,
4163
- * 本端发出的消息将不默认作为未知消息处理,不存储、不计数
4164
- * @param objectName 消息类型,如:RC:TxtMsg
4165
- * @param isPersited 是否存储
4166
- * @param isCounted 是否技术
4167
- * @param searchProps 搜索字段,只在搭配协议栈使用时有效
4208
+ * 根据时间戳删除指定时间之前的
4209
+ * @param conversationType
4210
+ * @param targetId
4211
+ * @param timestamp
4168
4212
  */
4169
- registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps: string[]): void;
4213
+ deleteRemoteMessageByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
4170
4214
  /**
4171
- * 加入聊天室
4172
- * @param count 拉取消息数量
4173
- */
4174
- joinChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
4215
+ * 加入聊天室,若聊天室不存在则创建聊天室
4216
+ * @param roomId 聊天室房间 Id
4217
+ * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
4218
+ */
4219
+ joinChatroom(roomId: string, count?: number): Promise<ErrorCode>;
4175
4220
  /**
4176
- * 加入已存在的聊天室
4177
- * @param count 拉取消息数量
4178
- */
4179
- joinExistChatroom(chatroomId: string, count: number): Promise<ErrorCode>;
4221
+ * 加入聊天室,若聊天室不存在则抛出异常
4222
+ * @param roomId 聊天室房间 Id
4223
+ * @param count 进入聊天室成功后,自动拉取的历史消息数量,默认值为 `10`,最大有效值为 `50`,`-1` 为不拉取
4224
+ */
4225
+ joinExistChatroom(roomId: string, count?: number): Promise<ErrorCode>;
4180
4226
  /**
4181
4227
  * 退出聊天室
4182
- */
4183
- quitChatroom(chatroomId: string): Promise<ErrorCode>;
4184
- /**
4185
- * 获取聊天室信息
4186
- * @param count 获取人数, 范围 0 - 20
4187
- * @param order 排序方式, 1 正序, 2 倒序
4188
- */
4189
- getChatroomInfo(chatroomId: string, count: number, order: number): IPromiseResult<IChatroomInfo>;
4190
- /**
4191
- * 获取聊天室历史消息
4192
- */
4193
- getChatroomHistoryMessages(chatroomId: string, timestamp: number, count: number, order: number): IPromiseResult<{
4194
- list: IReceivedMessage[];
4195
- hasMore: boolean;
4196
- }>;
4228
+ * @param roomId
4229
+ */
4230
+ quitChatroom(roomId: string): Promise<ErrorCode>;
4197
4231
  /**
4198
- * 设置聊天室属性
4199
- */
4200
- setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4232
+ * 获取聊天室房间数据
4233
+ * @description count 或 order 有一个为 0 时,只返回成员总数,不返回成员列表信息
4234
+ * @param roomId 聊天室 Id
4235
+ * @param count 获取房间人员列表数量,最大有效值 `20`,最小值未 `0`,默认为 0
4236
+ * @param order 人员排序方式,`1` 为正序,`2` 为倒序,默认为 0
4237
+ */
4238
+ getChatroomInfo(roomId: string, count?: number, order?: 0 | 1 | 2): Promise<IAsyncRes<IChatroomInfo>>;
4201
4239
  /**
4202
- * 批量设置聊天室属性
4240
+ * 在指定聊天室中设置自定义属性
4241
+ * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
4242
+ * @param roomId 聊天室房间 id
4243
+ * @param entry 属性信息
4203
4244
  */
4204
- setChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<{
4245
+ setChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
4246
+ setChatroomEntries(roomId: string, entryOptions: IChatroomEntries): Promise<{
4205
4247
  code: ErrorCode;
4206
4248
  data?: any;
4207
4249
  }>;
4208
4250
  /**
4209
- * 强制设置聊天室属性
4210
- */
4211
- forceSetChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4251
+ * 在指定聊天室中强制增加 / 修改任意聊天室属性
4252
+ * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
4253
+ * @param roomId 聊天室房间 id
4254
+ * @param entry 属性信息
4255
+ */
4256
+ forceSetChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
4212
4257
  /**
4213
4258
  * 删除聊天室属性
4214
- */
4215
- removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4259
+ * @description 该方法仅限于删除自己设置的聊天室属性
4260
+ * @param roomId 聊天室房间 id
4261
+ * @param entry 要移除的属性信息
4262
+ */
4263
+ removeChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
4216
4264
  /**
4217
4265
  * 批量删除聊天室属性
4266
+ * @description 该方法仅限于删除自己设置的聊天室属性
4267
+ * @param roomId 聊天室房间 id
4268
+ * @param entry 要移除的属性信息
4218
4269
  */
4219
- removeChatroomEntries(chatroomId: string, entries: IChrmKVEntries): Promise<{
4270
+ removeChatroomEntries(roomId: string, entryOptions: IRemoveChatRoomEntriesOption): Promise<{
4220
4271
  code: ErrorCode;
4221
4272
  data?: any;
4222
4273
  }>;
4223
4274
  /**
4224
- * 强制删除聊天室属性
4225
- */
4226
- forceRemoveChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4275
+ * 强制删除任意聊天室属性
4276
+ * @description 该方法仅限于删除自己设置的聊天室属性
4277
+ * @param roomId 聊天室房间 id
4278
+ * @param entry 要移除的属性信息
4279
+ */
4280
+ forceRemoveChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
4227
4281
  /**
4228
- * 获取聊天室 key 对应 value
4229
- */
4230
- getChatroomEntry(chatroomId: string, key: string): IPromiseResult<string | null>;
4282
+ * 获取聊天室中的指定属性
4283
+ * @param roomId 聊天室房间 id
4284
+ * @param key 属性键名
4285
+ */
4286
+ getChatroomEntry(roomId: string, key: string): Promise<IAsyncRes<string | null>>;
4231
4287
  /**
4232
- * 获取聊天室所有 key value
4233
- */
4234
- getAllChatroomEntry(chatroomId: string): IPromiseResult<{
4288
+ * 获取聊天室内的所有属性
4289
+ * @param roomId 聊天室房间 id
4290
+ */
4291
+ getAllChatroomEntries(roomId: string): Promise<IAsyncRes<{
4235
4292
  [key: string]: string;
4236
- }>;
4293
+ }>>;
4237
4294
  /**
4238
- * 获取上传认证信息
4295
+ * 拉取聊天室内的历史消息
4296
+ * @param roomId
4297
+ * @param count 拉取消息条数, 有效值范围 `1 - 20`
4298
+ * @param order 获取顺序,默认值为 0。
4299
+ * * 0:降序,用于获取早于指定时间戳发送的消息
4300
+ * * 1:升序,用于获取晚于指定时间戳发送的消息
4301
+ * @param timestamp 指定拉取消息用到的时间戳。默认值为 `0`,表示按当前时间拉取
4302
+ */
4303
+ getChatRoomHistoryMessages(roomId: string, count?: number, order?: 0 | 1, timestamp?: number): Promise<IAsyncRes<{
4304
+ list: IReceivedMessage[];
4305
+ hasMore: boolean;
4306
+ }>>;
4307
+ /**
4308
+ * 获取存储服务鉴权信息
4309
+ * @param fileType 文件类型
4310
+ * @param fileName 文件名称
4311
+ * @param httpMethod STC 分段上传时的必填参数,有效值为 PUT | POST
4312
+ * @param queryString STC 分段上传时的查询字符串
4239
4313
  * @description
4240
- * 若不传 fileName 百度上传认证字段(bosToken、bosDate、path)均返回 null
4241
- */
4242
- getFileToken(fileType: FileType, fileName?: string, httpMethod?: string, queryUriString?: string): Promise<IAsyncRes<IUploadAuth>>;
4314
+ * `httpMethod` `queryString` 为 STC S3 分段上传时的专属参数,STC 分段上传包含三个过程:
4315
+ * 1. 开始分段前调用,此时 `httpMethod` 值应为 `POST`, `queryString` 值为 `uploads`
4316
+ * 2. 上传请求前调用,此时 `httpMethod` 值应为 `PUT`,`queryString` 值为 `partNumber={partamNumer}&uploadId={uploadId}`
4317
+ * 3. 上传结束前调用,此时 `httpMethod` 值应为 `POST`,`queryString` 值为 `uploadId={uploadId}`
4318
+ * @returns
4319
+ */
4320
+ getFileToken(fileType: FileType, fileName?: string, httpMethod?: 'POST' | 'PUT', queryString?: string): Promise<IUploadAuth & {
4321
+ bos: string;
4322
+ qiniu: string;
4323
+ }>;
4243
4324
  /**
4244
- * 获取文件上传后下载地址
4325
+ * 获取 七牛、百度、阿里云 上传成功可下载的 URL
4326
+ * @param fileType 文件类型
4327
+ * @param fileName 文件名
4328
+ * @param saveName 下载后的存储文件名
4329
+ * @param uploadRes 插件上传返回的结果。降级百度上传后,用户传入返回结果,再把结果里的下载地址返回给用户,保证兼容之前结果获取
4330
+ * @param serverType 使用的存储服务标识
4245
4331
  */
4246
- getFileUrl(fileType: FileType, uploadMethod: UploadMethod, fileName?: string, originName?: string): IPromiseResult<{
4332
+ getFileUrl(fileType: FileType, fileName?: string, saveName?: string, uploadRes?: {
4333
+ isBosRes: boolean;
4334
+ downloadUrl: string;
4335
+ }, serverType?: UploadMethod): Promise<{
4247
4336
  downloadUrl: string;
4248
4337
  }>;
4249
4338
  /**
4250
4339
  * 创建标签
4251
4340
  * @param tag 标签
4252
- */
4253
- createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
4341
+ */
4342
+ createTag(tag: ITagParam): Promise<IAsyncRes>;
4254
4343
  /**
4255
4344
  * 删除标签
4256
4345
  * @param tagId 标签id
4257
- */
4258
- removeTag(tagId: string): IPromiseResult<IAsyncRes>;
4346
+ */
4347
+ removeTag(tagId: string): Promise<IAsyncRes>;
4259
4348
  /**
4260
- * 编辑标签
4349
+ * 更新标签
4261
4350
  * @param tag 标签
4262
- */
4263
- updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
4351
+ */
4352
+ updateTag(tag: ITagParam): Promise<IAsyncRes>;
4264
4353
  /**
4265
4354
  * 获取标签列表
4266
4355
  */
4267
- getTagList(): IPromiseResult<Array<ITagInfo>>;
4356
+ getTagList(): Promise<IAsyncRes<Array<ITagInfo>>>;
4268
4357
  /**
4269
4358
  * 添加会话到标签(给多个会话增加标签)
4270
4359
  * @param tagId 标签id
4271
4360
  * @param conversations 要添加的会话列表
4272
4361
  */
4273
- addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
4362
+ addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
4274
4363
  /**
4275
4364
  * 删除标签中的会话(从多个会话中批量删除指定标签)
4276
4365
  * @param tagId 标签id
4277
4366
  * @param conversations 要删除的会话列表
4278
4367
  */
4279
- removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
4368
+ removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
4280
4369
  /**
4281
4370
  * 删除会话中的标签(从单一会话中批量删除标签)
4282
4371
  * @param conversationType 会话类型
4283
4372
  * @param targetId 会话id
4284
4373
  * @param tagIds 要删除的标签列表
4285
4374
  */
4286
- removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
4375
+ removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<IAsyncRes>>;
4287
4376
  /**
4288
4377
  * 获取标签下的会话列表
4289
4378
  * @param tagId 标签id
4290
4379
  */
4291
- getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): IPromiseResult<IReceivedConversationByTag[]>;
4380
+ getConversationListByTag(tagId: string, startTime: number, count?: number, channelId?: string): Promise<IAsyncRes<IReceivedConversationByTag[]>>;
4292
4381
  /**
4293
4382
  * 获取标签下的未读消息数
4294
4383
  * @param tagId 标签id
4295
4384
  * @param containMuted 是否包含免打扰会话
4296
4385
  */
4297
- getUnreadCountByTag(tagId: string, containMuted: boolean): IPromiseResult<number>;
4386
+ getUnreadCountByTag(tagId: string, containMuted: boolean): Promise<IAsyncRes<number>>;
4298
4387
  /**
4299
4388
  * 设置标签中会话置顶
4300
4389
  * @param conversation 会话
4301
4390
  */
4302
- setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
4391
+ setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: {
4392
+ isTop: boolean;
4393
+ }): Promise<IAsyncRes<IAsyncRes>>;
4303
4394
  /**
4304
4395
  * 获取会话里的标签
4305
- * @param config
4306
- */
4307
- getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
4308
- /**
4309
- * 发送群组消息已读回执
4310
- * 导航下发已读回执开关为 true 时调用
4311
- */
4312
- sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
4313
- /**
4314
- * 获取群组消息已读列表
4315
- */
4316
- getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
4317
- /**
4318
- * 获取服务器时间
4396
+ * @param conversation
4319
4397
  */
4320
- getServerTime(): number;
4398
+ getTagsForConversation(conversation: IConversationOption): Promise<IAsyncRes<IConversationTag[]>>;
4321
4399
  /**
4322
- * 获取设备ID
4400
+ * 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
4401
+ * 对于未实现的方法,接口响应 Unsupport 错误码
4402
+ * @param method 方法名
4403
+ * @param args
4323
4404
  */
4324
- getDeviceId(): string;
4405
+ callExtra(method: string | keyof IExtraMethod, ...args: any[]): Promise<IAsyncRes<unknown>>;
4325
4406
  /**
4326
- * 获取当前 userId
4327
- */
4328
- getCurrentUserId(): string;
4407
+ * 删除所有会话
4408
+ */
4409
+ clearConversations(conversationTypes?: ConversationType[], tag?: string): Promise<ErrorCode>;
4329
4410
  /**
4330
- * 设置用户在线状态监听器
4411
+ * 设置用户连接状态监听器
4331
4412
  */
4332
4413
  setUserStatusListener(config: {
4333
4414
  userIds: string[];
4334
4415
  }, listener: Function): void;
4335
4416
  /**
4336
- * 设置当前用户在线状态
4337
- */
4338
- setUserStatus(status: number): Promise<ErrorCode>;
4339
- /**
4340
- * 订阅用户在线状态
4341
- */
4342
- subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
4343
- /**
4344
- * 获取用户状态
4345
- */
4346
- getUserStatus(userId: string): IPromiseResult<{
4347
- status: string;
4348
- }>;
4349
- /**
4350
- * 清空所有会话
4351
- */
4352
- clearConversations(conversationTypes?: ConversationType[], channelId?: string): Promise<ErrorCode>;
4353
- /**
4354
- * 加入黑名单
4417
+ * 添加用户黑名单
4355
4418
  */
4356
4419
  addToBlacklist(userId: string): Promise<ErrorCode>;
4357
4420
  /**
4358
- * 将指定用户移除黑名单
4421
+ * 将指定用户移除黑名单
4359
4422
  */
4360
4423
  removeFromBlacklist(userId: string): Promise<ErrorCode>;
4361
4424
  /**
4362
- * 获取黑名单列表
4425
+ * 获取黑名单列表
4363
4426
  */
4364
- getBlacklist(): IPromiseResult<string[]>;
4427
+ getBlacklist(): Promise<IAsyncRes<string[]>>;
4365
4428
  /**
4366
- * 获取指定人员在黑名单中的状态
4429
+ * 获取指定人员在黑名单中的状态
4367
4430
  */
4368
- getBlacklistStatus(userId: string): IPromiseResult<string>;
4431
+ getBlacklistStatus(userId: string): Promise<IAsyncRes<string>>;
4369
4432
  /**
4370
4433
  * 向本地插入一条消息,不发送到服务器
4371
4434
  */
4372
- insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): IPromiseResult<IReceivedMessage>;
4435
+ insertMessage(conversationType: ConversationType, targetId: string, insertOptions: IInsertMsgOptions): Promise<IAsyncRes<IReceivedMessage>>;
4373
4436
  /**
4374
4437
  * 删除本地消息
4375
4438
  */
4376
- deleteMessages(timestamps: number[]): Promise<ErrorCode>;
4439
+ deleteMessages(timestamp: number[]): Promise<ErrorCode>;
4377
4440
  /**
4378
- * 通过时间戳删除本地消息
4441
+ * 从本地消息数据库中删除某一会话指定时间之前的消息数据
4379
4442
  */
4380
- deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId: string): Promise<ErrorCode>;
4443
+ deleteMessagesByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, cleanSpace: boolean, channelId?: string): Promise<ErrorCode>;
4381
4444
  /**
4382
4445
  * 清空会话下历史消息
4383
4446
  */
4384
- clearMessages(conversationType: ConversationType, targetId: string, channelId: string): Promise<ErrorCode>;
4447
+ clearMessages(conversationType: ConversationType, targetId: string, channelId?: string): Promise<ErrorCode>;
4385
4448
  /**
4386
- * 获取消息
4449
+ * 获取本地消息
4387
4450
  */
4388
- getMessage(messageId: number): IPromiseResult<IReceivedMessage>;
4451
+ getMessage(messageId: number): Promise<IAsyncRes<IReceivedMessage>>;
4389
4452
  /**
4390
4453
  * 设置消息内容
4391
4454
  */
@@ -4394,49 +4457,66 @@ interface IEngine {
4394
4457
  * 设置消息搜索字段
4395
4458
  */
4396
4459
  setMessageSearchField(messageId: number, content: any, searchFiles: string): Promise<ErrorCode>;
4397
- /**
4398
- * 通过关键字搜索会话
4399
- */
4400
- searchConversationByContent(keyword: string, customMessageTypes: string[], channelId: string, conversationTypes?: ConversationType[]): IPromiseResult<IReceivedConversation[]>;
4401
- /**
4402
- * 按内容搜索会话内的消息
4403
- */
4404
- searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId: string): IPromiseResult<{
4405
- messages: IReceivedMessage[];
4406
- count: number;
4407
- }>;
4408
- /**
4409
- * 获取会话下所有未读的 @ 消息
4410
- */
4411
- getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId: string): IReceivedMessage[];
4412
4460
  /**
4413
4461
  * 设置消息发送状态
4414
4462
  */
4415
4463
  setMessageSentStatus(messageId: number, sentStatus: number): Promise<ErrorCode>;
4416
4464
  /**
4417
- * 设置消息接收状态
4465
+ * 设置消息接收状态
4418
4466
  */
4419
4467
  setMessageReceivedStatus(messageId: number, receivedStatus: number): Promise<ErrorCode>;
4420
4468
  /**
4421
- * 删除时间戳前的未读数
4469
+ * 设置当前用户在线状态
4422
4470
  */
4423
- clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId: string): Promise<ErrorCode>;
4471
+ setUserStatus(status: number): Promise<ErrorCode>;
4424
4472
  /**
4425
- * 获取会话免打扰状态
4473
+ * 订阅用户在线状态
4426
4474
  */
4427
- getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId: string): IPromiseResult<NotificationStatus>;
4475
+ subscribeUserStatus(userIds: string[]): Promise<ErrorCode>;
4428
4476
  /**
4429
- * 协议栈获取远端历史消息
4477
+ * 获取用户在线状态
4430
4478
  */
4431
- getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): IPromiseResult<{
4479
+ getUserStatus(userId: string): Promise<IAsyncRes<{
4480
+ status: string;
4481
+ }>>;
4482
+ searchConversationByContent(keyword: string, customMessageTypes?: string[], channelId?: string, conversationTypes?: ConversationType[]): Promise<IAsyncRes<IReceivedConversation[]>>;
4483
+ searchMessageByContent(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number, total: number, channelId?: string): Promise<IAsyncRes<{
4484
+ messages: IReceivedMessage[];
4485
+ count: number;
4486
+ }>>;
4487
+ getUnreadMentionedMessages(conversationType: ConversationType, targetId: string, channelId?: string): IReceivedMessage[];
4488
+ clearUnreadCountByTimestamp(conversationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<ErrorCode>;
4489
+ /**
4490
+ * 获取会话免打扰状态
4491
+ */
4492
+ getConversationNotificationStatus(conversationType: ConversationType, targetId: string, channelId?: string): Promise<IAsyncRes<NotificationStatus>>;
4493
+ getRemoteHistoryMessages(conversationType: ConversationType, targetId: string, timestamp: number, count: number, order: 0 | 1, channelId: string): Promise<IAsyncRes<{
4432
4494
  list: IReceivedMessage[];
4433
4495
  hasMore: boolean;
4496
+ }>>;
4497
+ /**
4498
+ * 获取群组消息送达信息
4499
+ */
4500
+ getGroupMessageDeliverList(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IGroupMessageDeliverInfo>;
4501
+ /**
4502
+ * 获取单聊消息送达信息
4503
+ */
4504
+ getPrivateMessageDeliverTime(messageUId: string, channelId?: string): IPromiseResult<number>;
4505
+ setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
4506
+ key: string;
4507
+ value: string;
4434
4508
  }>;
4435
- joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
4509
+ /**
4510
+ * 加入房间
4511
+ * @param roomId
4512
+ * @param mode 房间模式:直播 or 会议
4513
+ * @param mediaType 直播房间模式下的媒体资源类型
4514
+ */
4515
+ joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number, joinType?: RTCJoinType): Promise<IAsyncRes<IJoinRTCRoomData>>;
4436
4516
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
4437
- rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
4438
- getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
4439
- getRTCUserInfoList(roomId: string): IPromiseResult<IRTCUsers>;
4517
+ rtcPing(roomId: string, mode: number, mediaType?: number): Promise<ErrorCode>;
4518
+ getRTCRoomInfo(roomId: string): Promise<IAsyncRes<IRTCRoomInfo>>;
4519
+ getRTCUserInfoList(roomId: string): Promise<IAsyncRes<IRTCUsers>>;
4440
4520
  getRTCUserInfo(roomId: string): IPromiseResult<unknown>;
4441
4521
  setRTCUserInfo(roomId: string, key: string, value: string): Promise<ErrorCode>;
4442
4522
  removeRTCUserInfo(roomId: string, keys: string[]): Promise<ErrorCode>;
@@ -4444,49 +4524,40 @@ interface IEngine {
4444
4524
  name: string;
4445
4525
  content: string;
4446
4526
  }): Promise<ErrorCode>;
4447
- /**
4448
- * 全量订阅资源修改
4449
- * @param roomId 房间 Id
4450
- * @param message 向前兼容的消息内容
4451
- * @param valueInfo 全量资源数据
4452
- * @param objectName 全量 URI 消息名
4453
- */
4454
4527
  setRTCTotalRes(roomId: string, message: {
4455
4528
  name: string;
4456
4529
  content: string;
4457
- }, valueInfo: string, objectName: string, mcuValInfo: string): Promise<ErrorCode>;
4458
- getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
4530
+ }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
4531
+ setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4532
+ getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): Promise<IAsyncRes<KVString>>;
4459
4533
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
4460
4534
  name: string;
4461
4535
  content: string;
4462
4536
  }): Promise<ErrorCode>;
4463
4537
  setRTCOutData(roomId: string, rtcData: unknown, type: number, message: unknown): Promise<ErrorCode>;
4464
4538
  getRTCOutData(roomId: string, userIds: string[]): IPromiseResult<unknown>;
4465
- getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
4466
- setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
4539
+ getRTCToken(roomId: string, mode: number, broadcastType?: number): Promise<IAsyncRes<IRtcTokenData>>;
4540
+ setRTCState(roomId: string, report: string): Promise<ErrorCode>;
4467
4541
  getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
4468
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4469
- }
4470
-
4471
- interface IExpansionMsgContent {
4472
4542
  /**
4473
- * 消息扩展的对象
4474
- */
4475
- put?: {
4476
- [key: string]: string;
4477
- };
4543
+ * 直播观众加房间
4544
+ */
4545
+ joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
4546
+ token: string;
4547
+ kvEntries: IServerRTCRoomEntry[];
4548
+ }>>;
4478
4549
  /**
4479
- * 删除的 keys
4480
- */
4481
- del?: string[];
4550
+ * 直播观众退出房间
4551
+ */
4552
+ quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
4482
4553
  /**
4483
- * messageUId
4484
- */
4485
- mid: string;
4554
+ * 直播身份切换
4555
+ */
4556
+ rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4486
4557
  /**
4487
- * 是否删除所有, 有效值:0、1 . ( 后续如有需要, API Layer 层可使用)
4488
- */
4489
- removeAll?: number;
4558
+ * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
4559
+ */
4560
+ getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
4490
4561
  }
4491
4562
 
4492
4563
  declare class RTCPluginContext extends PluginContext {
@@ -4630,6 +4701,9 @@ interface IEngineWatcher {
4630
4701
  */
4631
4702
  onRTCDataChange: (data: IServerRTCRoomEntry[], roomId?: string) => void;
4632
4703
  pullFinished: () => void;
4704
+ messageDelivered: (data: IMessageDeliver[]) => void;
4705
+ groupMessageDeliveredStatus: (data: IGroupMessageDeliverStatus) => void;
4706
+ callInfo: (data: string) => void;
4633
4707
  }
4634
4708
  /**
4635
4709
  * 引擎定义
@@ -5124,6 +5198,18 @@ declare abstract class AEngine implements IEngine {
5124
5198
  list: IReceivedMessage[];
5125
5199
  hasMore: boolean;
5126
5200
  }>;
5201
+ /**
5202
+ * 获取群组消息送达列表
5203
+ */
5204
+ abstract getGroupMessageDeliverList(targetId: string, messageUId: string, channelId: string): IPromiseResult<IGroupMessageDeliverInfo>;
5205
+ /**
5206
+ * 获取单聊消息送达列表
5207
+ */
5208
+ abstract getPrivateMessageDeliverTime(messageUId: string, channelId: string): IPromiseResult<number>;
5209
+ abstract setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
5210
+ key: string;
5211
+ value: string;
5212
+ }>;
5127
5213
  abstract joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType): IPromiseResult<IJoinRTCRoomData>;
5128
5214
  abstract quitRTCRoom(roomId: string): Promise<ErrorCode>;
5129
5215
  abstract rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
@@ -5628,4 +5714,4 @@ declare enum CONNECTION_TYPE {
5628
5714
  */
5629
5715
  declare const version: string;
5630
5716
 
5631
- 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, IEngine, IEngineWatcher, 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, IMessageBlockedListener, 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 };
5717
+ 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 };