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