@rongcloud/engine 5.0.0-alpha.4 → 5.0.0-alpha.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * RCEngine - v5.0.0-alpha.4
3
- * CommitId - 4005dd234e9fd648022465f3c714b6aa59db022c
4
- * Tue Sep 28 2021 20:56:56 GMT+0800 (China Standard Time)
2
+ * RCEngine - v5.0.0-alpha.5
3
+ * CommitId - fdd7669c36efb128309e9ef87a895076dff812bc
4
+ * Fri Oct 15 2021 13:45:07 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  /**
@@ -138,6 +138,42 @@ declare enum OperationType {
138
138
  DISCONNECT = 14,
139
139
  RESERVER2 = 15
140
140
  }
141
+ /**
142
+ * connect 版本号,用于区分 ConnAckMessage 的解析规则
143
+ */
144
+ declare enum ConnAckProtocolVer {
145
+ /**
146
+ * V4 说明:
147
+ * ```
148
+ * 增加 flag 来标识每个位置是否有内容,如果没有 messageId 说明此 APP 没有配置防重放,默认取0
149
+ * status | 4byte
150
+ * flag | 1byte 每一位标识是否有对应值,由低到高
151
+ * userId | 可变长
152
+ * sessionId | 可变长
153
+ * timestamp | 8byte
154
+ * messageId | 4byte
155
+ * onlineClientInfo | 可变长
156
+ * ===
157
+ * flag 描述:
158
+ * | | | | 4 | 3 | 2 | 1 | 0 |
159
+ * | | | | hasOnlineClientInfo | hasMessageId | hasTimeStamp | hasSessionId | hasUserId |
160
+ * ```
161
+ */
162
+ V4 = 4,
163
+ /**
164
+ * V3 说明:
165
+ * ```
166
+ * status | 4byte
167
+ * userId | 可变长
168
+ * sessionId | 可变长
169
+ * timestamp | 8byte
170
+ * descyptionType | 1byte
171
+ * secretKey | 可变长
172
+ * onlineClientInfo | 可变长
173
+ * ```
174
+ */
175
+ V3 = 3
176
+ }
141
177
 
142
178
  /**
143
179
  * @todo 注释补全
@@ -163,6 +199,10 @@ declare class RongStreamReader {
163
199
  private _poolLen;
164
200
  constructor(arr: Uint8Array);
165
201
  check(): boolean;
202
+ /**
203
+ * 读 2 位
204
+ */
205
+ read2Byte(): number;
166
206
  /**
167
207
  * 读 4 位
168
208
  */
@@ -219,8 +259,8 @@ declare class BaseReader {
219
259
  identifier: string;
220
260
  constructor(header: Header);
221
261
  getIdentifier(): string | number;
222
- read(stream: RongStreamReader, length: number): void;
223
- readMessage(stream: RongStreamReader, length?: number): {
262
+ read(stream: RongStreamReader, length: number, protocolVer: ConnAckProtocolVer): void;
263
+ readMessage(stream: RongStreamReader, length?: number, protocolVer?: ConnAckProtocolVer): {
224
264
  stream: RongStreamReader;
225
265
  length: number | undefined;
226
266
  };
@@ -408,6 +448,24 @@ declare enum ChatroomEntryType {
408
448
  DELETE = 2
409
449
  }
410
450
 
451
+ /**
452
+ * 消息被拦截类型
453
+ */
454
+ declare enum MessageBlockType {
455
+ /*!
456
+ 全局敏感词:命中了融云内置的全局敏感词
457
+ */
458
+ GLOBAL = 1,
459
+ /*!
460
+ 自定义敏感词拦截:命中了客户在融云自定义的敏感词
461
+ */
462
+ CUSTOM = 2,
463
+ /*!
464
+ 第三方审核拦截:命中了第三方(数美)或模板路由决定不下发的状态
465
+ */
466
+ THIRD_PARTY = 3
467
+ }
468
+
411
469
  declare enum MessageDirection {
412
470
  /**
413
471
  * 己方发送消息
@@ -866,6 +924,15 @@ interface ISendExMsgOptions {
866
924
  [key: string]: string;
867
925
  } | null;
868
926
  }
927
+ /**
928
+ * 被拦截的消息信息
929
+ */
930
+ interface IBlockedMessageInfo {
931
+ blockedMessageUId: string;
932
+ conversationType: number;
933
+ targetId: string;
934
+ blockType: MessageBlockType;
935
+ }
869
936
 
870
937
  /**
871
938
  * TODO: 确定对外暴露的必要性
@@ -1108,6 +1175,18 @@ declare enum ErrorCode {
1108
1175
  * Disconnect,由服务器返回,比如用户互踢。
1109
1176
  */
1110
1177
  RC_DISCONN_EXCEPTION = 31011,
1178
+ /**
1179
+ * app 验证Token 验证不通过。所有内部超时,访问失败,返回给客户端sdk都是验证不通过,由服务端日志去看具体是那种失败。
1180
+ */
1181
+ RC_APP_AUTH_NOT_PASS = 31026,
1182
+ /**
1183
+ * One Time Password 已经被使用过
1184
+ */
1185
+ RC_OTP_USED = 31027,
1186
+ /**
1187
+ * token平台验证失败
1188
+ */
1189
+ RC_PLATFORM_ERROR = 31028,
1111
1190
  /**
1112
1191
  * 协议层内部错误。query,上传下载过程中数据错误。
1113
1192
  */
@@ -1434,6 +1513,23 @@ declare enum RTCIdentityChangeType {
1434
1513
  AnchorToViewer = 1,
1435
1514
  ViewerToAnchor = 2
1436
1515
  }
1516
+ /**
1517
+ * RTC 房间加入类型
1518
+ */
1519
+ declare enum RTCJoinType {
1520
+ /**
1521
+ * 踢前一个设备
1522
+ */
1523
+ KICK = 0,
1524
+ /**
1525
+ * 当前加入拒绝
1526
+ */
1527
+ REFUSE = 1,
1528
+ /**
1529
+ * 两个设备共存
1530
+ */
1531
+ COEXIST = 2
1532
+ }
1437
1533
 
1438
1534
  /**
1439
1535
  * 序列化、反序列化数据通道
@@ -1516,7 +1612,14 @@ declare class DataCodec {
1516
1612
  * 格式化 RTC 用户加入房间后通知拉取的数据(房间内主播全量列表、房间全量资源)
1517
1613
  */
1518
1614
  private _formatRTCRoomKVList;
1615
+ /**
1616
+ * 格式化观众加房间后返回数据
1617
+ */
1519
1618
  private _formatRTCAuidenceJoinRoomData;
1619
+ /**
1620
+ * 格式化加入 RTC 房间的用户信息
1621
+ */
1622
+ private _formatRTCJoinedUserInfo;
1520
1623
  /**
1521
1624
  * ===== 以下为通用数据 序列化为 PB 数据 =====
1522
1625
  * Engine Index 调用处理数据
@@ -1646,7 +1749,7 @@ declare class DataCodec {
1646
1749
  /**
1647
1750
  * 加入 RTC 房间
1648
1751
  */
1649
- encodeJoinRTCRoom(mode: RTCMode, broadcastType?: number): any[];
1752
+ encodeJoinRTCRoom(mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType): any[];
1650
1753
  /**
1651
1754
  * 退出 RTC 房间
1652
1755
  */
@@ -1662,6 +1765,7 @@ declare class DataCodec {
1662
1765
  * 全量 URI
1663
1766
  */
1664
1767
  encodeUserSetRTCData(message: any, valueInfo: string, objectName: string, mcuValInfo: string): any;
1768
+ encodeUserSetRTCCDNUris(objectName: string, CDNUris: string): any;
1665
1769
  /**
1666
1770
  * 用户属性获取
1667
1771
  */
@@ -1704,6 +1808,10 @@ declare class DataCodec {
1704
1808
  * RTC 直播观众拉取房间内 KV
1705
1809
  */
1706
1810
  encodePullRTCRoomKV(roomId: string, timestamp: number): any;
1811
+ /**
1812
+ * RTC 查询在房间内用户的信息
1813
+ */
1814
+ encodeQueryUserJoinedInfo(userId: string): any;
1707
1815
  }
1708
1816
 
1709
1817
  /**
@@ -1844,7 +1952,7 @@ declare abstract class ADataChannel {
1844
1952
  * @param protocol 请求导航数据时使用的网络协议, /ping 与 websocket 需要继续遵循该协议
1845
1953
  * @param apiVersion - apiVersion 需符合 `/\d+(\.\d+){2}/` 规则,对于预发布版本号如 `3.1.0-alpha.1` 需认定为 `3.1.0`
1846
1954
  */
1847
- abstract connect(appkey: string, token: string, host: string[], protocol: 'http' | 'https', apiVersion: string): Promise<ErrorCode>;
1955
+ abstract connect(appkey: string, token: string, host: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
1848
1956
  /**
1849
1957
  * 只发送数据,无需响应
1850
1958
  */
@@ -2011,7 +2119,7 @@ declare class WebSocketChannel extends ADataChannel {
2011
2119
  * @param protocol
2012
2120
  * @param apiVersion - apiVersion 需符合 `/\d+(\.\d+){2}/` 规则
2013
2121
  */
2014
- connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string): Promise<ErrorCode>;
2122
+ connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
2015
2123
  /**
2016
2124
  * 当前累计心跳超时次数
2017
2125
  */
@@ -2055,7 +2163,12 @@ declare class CometChannel extends ADataChannel {
2055
2163
  * 长轮询心跳
2056
2164
  */
2057
2165
  _startPullSignal(protocol: 'http' | 'https'): Promise<void>;
2058
- connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string): Promise<ErrorCode>;
2166
+ /**
2167
+ * 连接
2168
+ * comet 连接暂时不走 protocolVer=v4 的协议
2169
+ * @returns
2170
+ */
2171
+ connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
2059
2172
  private _idCount;
2060
2173
  private _generateMessageId;
2061
2174
  sendCometData(writer: BaseWriter, timeout?: number): Promise<void>;
@@ -2262,7 +2375,7 @@ interface IChatroomListenerData {
2262
2375
  */
2263
2376
  chatroomDestroyed?: string;
2264
2377
  }
2265
- interface IChatroomEntry {
2378
+ interface IChatRoomEntry {
2266
2379
  /**
2267
2380
  * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2268
2381
  */
@@ -2305,7 +2418,7 @@ interface IChatroomInfo {
2305
2418
  */
2306
2419
  userCount: number;
2307
2420
  }
2308
- interface IRemoveChatRoomEntryOption {
2421
+ interface IRemoveChatRoomEntry {
2309
2422
  /**
2310
2423
  * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2311
2424
  */
@@ -2319,7 +2432,22 @@ interface IRemoveChatRoomEntryOption {
2319
2432
  */
2320
2433
  notificationExtra?: string;
2321
2434
  }
2322
- interface IChatroomEntries {
2435
+ interface IRemoveChatRoomEntries {
2436
+ /**
2437
+ * key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2438
+ */
2439
+ entries: {
2440
+ key: string;
2441
+ }[];
2442
+ /**
2443
+ * 删除成功后是否发送通知消息
2444
+ */
2445
+ /**
2446
+ * RC:chrmKVNotiMsg 消息中携带的附加信息
2447
+ */
2448
+ notificationExtra?: string;
2449
+ }
2450
+ interface IChatRoomEntries {
2323
2451
  /**
2324
2452
  * entries ,要设置的属性列表
2325
2453
  * key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
@@ -2464,6 +2592,10 @@ interface IRTCUsers {
2464
2592
  interface IJoinRTCRoomData extends IRTCUsers {
2465
2593
  token: string;
2466
2594
  sessionId: string;
2595
+ roomInfo: {
2596
+ key: string;
2597
+ value: string;
2598
+ }[];
2467
2599
  }
2468
2600
  interface KVString {
2469
2601
  [key: string]: string;
@@ -2723,6 +2855,10 @@ interface INaviInfo {
2723
2855
  * 群组回执开关, 1: 打开,0(或者没有): 关闭
2724
2856
  */
2725
2857
  grpRRVer?: number;
2858
+ /**
2859
+ * 防黑产开关, 1: 打开,0:关闭
2860
+ */
2861
+ openAnti?: number;
2726
2862
  }
2727
2863
 
2728
2864
  declare enum ReceivedStatus {
@@ -2812,6 +2948,22 @@ declare const ConnectResultCode: {
2812
2948
  * 开启`禁止把已在线客户端踢下线`开关后,该错误码标识已有同类型端在线,禁止链接
2813
2949
  */
2814
2950
  HASOHTERSAMECLIENTONLINE: number;
2951
+ /**
2952
+ * 客户端连错环境,引发连接拒绝
2953
+ */
2954
+ IN_OTHER_CLUSTER: number;
2955
+ /**
2956
+ * app 验证Token 验证不通过。所有内部超时,访问失败,返回给客户端sdk都是验证不通过,由服务端日志去看具体是那种失败。
2957
+ */
2958
+ APP_AUTH_NOT_PASS: number;
2959
+ /**
2960
+ * One Time Password 已经被使用过
2961
+ */
2962
+ OTP_USED: number;
2963
+ /**
2964
+ * token平台验证失败
2965
+ */
2966
+ PLATFORM_ERROR: number;
2815
2967
  };
2816
2968
 
2817
2969
  /**
@@ -2909,7 +3061,15 @@ declare enum MessageType {
2909
3061
  /**
2910
3062
  * 用户加入退出聊天室的集合
2911
3063
  */
2912
- CHATROOM_MERGE_CHANGE = "RC:ChrmMemChange"
3064
+ CHATROOM_MERGE_CHANGE = "RC:ChrmMemChange",
3065
+ /**
3066
+ * 输入状态消息
3067
+ */
3068
+ TYPING_STATUS = "RC:TypSts",
3069
+ /**
3070
+ * 拦截消息,(当发送的消息的敏感词时,服务会下发一个拦截消息,内容包含被拦截消息信息)
3071
+ */
3072
+ INTERCEPT = "RC:InterceptMsg"
2913
3073
  }
2914
3074
 
2915
3075
  /**
@@ -3315,6 +3475,10 @@ interface IEngine {
3315
3475
  * 获取设备ID
3316
3476
  */
3317
3477
  getDeviceId(): string;
3478
+ /**
3479
+ * 获取当前 userId
3480
+ */
3481
+ getCurrentUserId(): string;
3318
3482
  /**
3319
3483
  * 设置用户在线状态监听器
3320
3484
  */
@@ -3454,6 +3618,7 @@ interface IEngine {
3454
3618
  getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
3455
3619
  setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
3456
3620
  getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
3621
+ setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
3457
3622
  }
3458
3623
 
3459
3624
  interface IExpansionMsgContent {
@@ -3477,6 +3642,24 @@ interface IExpansionMsgContent {
3477
3642
  removeAll?: number;
3478
3643
  }
3479
3644
 
3645
+ /**
3646
+ * 加入 RTC 房间的用户信息
3647
+ */
3648
+ interface IRTCJoinedInfo {
3649
+ /**
3650
+ * 设备 ID
3651
+ */
3652
+ deviceId: string;
3653
+ /**
3654
+ * RTC 房间 ID
3655
+ */
3656
+ roomId: string;
3657
+ /**
3658
+ * 加入的时间戳
3659
+ */
3660
+ joinTime: number;
3661
+ }
3662
+
3480
3663
  /**
3481
3664
  * typing相关接口
3482
3665
  */
@@ -3542,10 +3725,9 @@ declare type IRTCInnerListener = {
3542
3725
  };
3543
3726
  declare type IExpansionListener = (data: IExpansionListenerData) => void;
3544
3727
  declare type ITagListener = () => void;
3545
- declare type IConversationTagListener = (conversationType: ConversationType, targetId: string, conversationTags: {
3546
- tags: ILocalTagStatus;
3547
- }) => void;
3728
+ declare type IConversationTagListener = () => void;
3548
3729
  declare type ItypingStateListener = (data: ITypingMessage[]) => void;
3730
+ declare type IMessageBlockedListener = (data: IBlockedMessageInfo) => void;
3549
3731
  interface IWatcher {
3550
3732
  message?: IMessageListnenr;
3551
3733
  batchMessage?: IMessagesListnenr;
@@ -3579,6 +3761,10 @@ interface IWatcher {
3579
3761
  messageReceiptResponse?: (conversation: IConversationOption, messageUId: string, sender: {
3580
3762
  [responseUserIdList: string]: number;
3581
3763
  }) => void;
3764
+ /**
3765
+ * 敏感词被拦截监听
3766
+ */
3767
+ messageBlocked?: IMessageBlockedListener;
3582
3768
  }
3583
3769
  interface IAPIContextOption {
3584
3770
  /**
@@ -3640,23 +3826,6 @@ interface IAPIContextOption {
3640
3826
  checkCA?: boolean;
3641
3827
  }
3642
3828
 
3643
- interface IRemoveChatRoomEntriesOption {
3644
- /**
3645
- * key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
3646
- */
3647
- entries: {
3648
- key: string;
3649
- }[];
3650
- /**
3651
- * 删除成功后是否发送通知消息
3652
- */
3653
- isSendNotification?: boolean;
3654
- /**
3655
- * RC:chrmKVNotiMsg 消息中携带的附加信息
3656
- */
3657
- notificationExtra?: string;
3658
- }
3659
-
3660
3829
  declare class APIContext {
3661
3830
  private _runtime;
3662
3831
  private static _context?;
@@ -3730,7 +3899,8 @@ declare class APIContext {
3730
3899
  */
3731
3900
  private _conversationTagListener;
3732
3901
  private _typingStatusListener;
3733
- private _pullFinishedLister;
3902
+ private _pullFinishedListener;
3903
+ private _MessageBlockedListener;
3734
3904
  /**
3735
3905
  * rtc 数据变更通知 pluginContext
3736
3906
  */
@@ -3924,36 +4094,36 @@ declare class APIContext {
3924
4094
  * @param roomId 聊天室房间 id
3925
4095
  * @param entry 属性信息
3926
4096
  */
3927
- setChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3928
- setChatroomEntries(roomId: string, entryOptions: IChatroomEntries): Promise<ErrorCode>;
4097
+ setChatroomEntry(roomId: string, entry: IChatRoomEntry): Promise<ErrorCode>;
4098
+ setChatroomEntries(roomId: string, entryOptions: IChatRoomEntries): Promise<ErrorCode>;
3929
4099
  /**
3930
4100
  * 在指定聊天室中强制增加 / 修改任意聊天室属性
3931
4101
  * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
3932
4102
  * @param roomId 聊天室房间 id
3933
4103
  * @param entry 属性信息
3934
4104
  */
3935
- forceSetChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
4105
+ forceSetChatroomEntry(roomId: string, entry: IChatRoomEntry): Promise<ErrorCode>;
3936
4106
  /**
3937
4107
  * 删除聊天室属性
3938
4108
  * @description 该方法仅限于删除自己设置的聊天室属性
3939
4109
  * @param roomId 聊天室房间 id
3940
4110
  * @param entry 要移除的属性信息
3941
4111
  */
3942
- removeChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
4112
+ removeChatroomEntry(roomId: string, entry: IRemoveChatRoomEntry): Promise<ErrorCode>;
3943
4113
  /**
3944
4114
  * 批量删除聊天室属性
3945
4115
  * @description 该方法仅限于删除自己设置的聊天室属性
3946
4116
  * @param roomId 聊天室房间 id
3947
4117
  * @param entry 要移除的属性信息
3948
4118
  */
3949
- removeChatroomEntries(roomId: string, entryOptions: IRemoveChatRoomEntriesOption): Promise<ErrorCode>;
4119
+ removeChatroomEntries(roomId: string, entryOptions: IRemoveChatRoomEntries): Promise<ErrorCode>;
3950
4120
  /**
3951
4121
  * 强制删除任意聊天室属性
3952
4122
  * @description 该方法仅限于删除自己设置的聊天室属性
3953
4123
  * @param roomId 聊天室房间 id
3954
4124
  * @param entry 要移除的属性信息
3955
4125
  */
3956
- forceRemoveChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
4126
+ forceRemoveChatroomEntry(roomId: string, entry: IRemoveChatRoomEntry): Promise<ErrorCode>;
3957
4127
  /**
3958
4128
  * 获取聊天室中的指定属性
3959
4129
  * @param roomId 聊天室房间 id
@@ -4176,7 +4346,7 @@ declare class APIContext {
4176
4346
  * @param mode 房间模式:直播 or 会议
4177
4347
  * @param mediaType 直播房间模式下的媒体资源类型
4178
4348
  */
4179
- joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4349
+ joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number, joinType?: RTCJoinType): Promise<IAsyncRes<IJoinRTCRoomData>>;
4180
4350
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
4181
4351
  rtcPing(roomId: string, mode: number, mediaType?: number): Promise<ErrorCode>;
4182
4352
  getRTCRoomInfo(roomId: string): Promise<IAsyncRes<IRTCRoomInfo>>;
@@ -4192,6 +4362,7 @@ declare class APIContext {
4192
4362
  name: string;
4193
4363
  content: string;
4194
4364
  }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
4365
+ setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4195
4366
  getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): Promise<IAsyncRes<KVString>>;
4196
4367
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
4197
4368
  name: string;
@@ -4207,6 +4378,7 @@ declare class APIContext {
4207
4378
  */
4208
4379
  joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
4209
4380
  token: string;
4381
+ kvEntries: IServerRTCRoomEntry[];
4210
4382
  }>>;
4211
4383
  /**
4212
4384
  * 直播观众退出房间
@@ -4216,6 +4388,10 @@ declare class APIContext {
4216
4388
  * 直播身份切换
4217
4389
  */
4218
4390
  rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4391
+ /**
4392
+ * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
4393
+ */
4394
+ getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
4219
4395
  }
4220
4396
 
4221
4397
  declare class PluginContext {
@@ -4287,6 +4463,10 @@ declare class PluginContext {
4287
4463
  * 获取服务时间
4288
4464
  */
4289
4465
  getServerTime(): number;
4466
+ /**
4467
+ * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
4468
+ */
4469
+ getRTCJoinedUserInfo(userId: string): IPromiseResult<IRTCJoinedInfo[]>;
4290
4470
  }
4291
4471
 
4292
4472
  declare class RTCPluginContext extends PluginContext {
@@ -4301,7 +4481,7 @@ declare class RTCPluginContext extends PluginContext {
4301
4481
  * @param mode 房间模式:直播 or 会议
4302
4482
  * @param broadcastType
4303
4483
  */
4304
- joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
4484
+ joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType): IPromiseResult<IJoinRTCRoomData>;
4305
4485
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
4306
4486
  rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
4307
4487
  getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
@@ -4341,6 +4521,22 @@ declare class RTCPluginContext extends PluginContext {
4341
4521
  * mcu 合流发布内容,是一个 JSON 字符串,解析类型为 {mediaType: number, msid: string, uri: string}[]
4342
4522
  */
4343
4523
  mcuValInfo?: string): Promise<ErrorCode>;
4524
+ /**
4525
+ * 设置 cdn_uris 扩散
4526
+ * @param objectName 全量 URI 消息名,即 `RCRTC:TotalContentResources`
4527
+ * @param CDNUris cdn_uris 扩散字段
4528
+ * {
4529
+ "broadcast":0,
4530
+ "fps":25,
4531
+ "h":640,
4532
+ "pull_safe":true,
4533
+ "push_mode":1,
4534
+ "url":"https://rtc-media-api-service-ucbj2-01.rongcloud.net/api/rtc/cdn/player",
4535
+ "w":360,
4536
+ "enableInnerCDN":true
4537
+ }[]
4538
+ */
4539
+ setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4344
4540
  getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
4345
4541
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
4346
4542
  name: string;
@@ -4356,6 +4552,7 @@ declare class RTCPluginContext extends PluginContext {
4356
4552
  */
4357
4553
  joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<{
4358
4554
  token: string;
4555
+ kvEntries: IServerRTCRoomEntry[];
4359
4556
  }>;
4360
4557
  /**
4361
4558
  * 直播观众退出房间
@@ -4407,9 +4604,7 @@ interface IEngineWatcher {
4407
4604
  conversation: (event: any) => void;
4408
4605
  expansion: (event: IExpansionListenerData) => void;
4409
4606
  tag: () => void;
4410
- conversationTag: (conversationType: ConversationType, targetId: string, conversationTags: {
4411
- tags: ILocalTagStatus;
4412
- }) => void;
4607
+ conversationTag: () => void;
4413
4608
  /**
4414
4609
  * RTC 数据变更
4415
4610
  */
@@ -4788,6 +4983,10 @@ declare abstract class AEngine implements IEngine {
4788
4983
  * 获取设备ID
4789
4984
  */
4790
4985
  abstract getDeviceId(): string;
4986
+ /**
4987
+ * 获取当前 userId
4988
+ */
4989
+ abstract getCurrentUserId(): string;
4791
4990
  /**
4792
4991
  * 设置用户在线状态监听器
4793
4992
  */
@@ -4894,7 +5093,7 @@ declare abstract class AEngine implements IEngine {
4894
5093
  list: IReceivedMessage[];
4895
5094
  hasMore: boolean;
4896
5095
  }>;
4897
- abstract joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
5096
+ abstract joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType): IPromiseResult<IJoinRTCRoomData>;
4898
5097
  abstract quitRTCRoom(roomId: string): Promise<ErrorCode>;
4899
5098
  abstract rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
4900
5099
  abstract getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
@@ -4929,9 +5128,12 @@ declare abstract class AEngine implements IEngine {
4929
5128
  abstract getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
4930
5129
  abstract joinLivingRoomAsAudience(roomId: string, mode: RTCMode, broadcastType?: number): Promise<IAsyncRes<{
4931
5130
  token: string;
5131
+ kvEntries: IServerRTCRoomEntry[];
4932
5132
  }>>;
4933
5133
  abstract quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
4934
5134
  abstract rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
5135
+ abstract getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
5136
+ abstract setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4935
5137
  }
4936
5138
 
4937
5139
  declare class AppStorage {
@@ -5382,4 +5584,4 @@ declare enum CONNECTION_TYPE {
5382
5584
  */
5383
5585
  declare const version: string;
5384
5586
 
5385
- 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, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, 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, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UploadMethod, 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 };
5587
+ 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, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IInsertMsgOptions, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomInfo, IRTCUsers, IReadReceiptInfo, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, 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, 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 };