@rongcloud/engine 4.5.0-alpha.2 → 5.0.0-alpha.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  /*
2
- * RCEngine - v4.5.0-alpha.2
3
- * CommitId - 2dbdf34ce94b97b99b64591f1ad1736dd594730a
4
- * Tue Sep 28 2021 11:52:00 GMT+0800 (China Standard Time)
2
+ * RCEngine - v5.0.0-alpha.4
3
+ * CommitId - 4005dd234e9fd648022465f3c714b6aa59db022c
4
+ * Tue Sep 28 2021 20:56:56 GMT+0800 (China Standard Time)
5
5
  * ©2020 RongCloud, Inc. All rights reserved.
6
6
  */
7
7
  /**
@@ -337,10 +337,18 @@ interface IChrmKVEntry {
337
337
  type?: number;
338
338
  isDeleted?: boolean;
339
339
  }
340
- interface IChrmKVPullData {
341
- kvEntries: IChrmKVEntry[];
342
- isFullUpdate?: boolean;
343
- syncTime?: number;
340
+ interface IChrmKVEntries {
341
+ entries: {
342
+ key: string;
343
+ value?: string;
344
+ }[];
345
+ notificationExtra?: string;
346
+ isOverwrite?: boolean;
347
+ isAutoDelete?: boolean;
348
+ timestamp?: number;
349
+ userId?: string;
350
+ type?: number;
351
+ isDeleted?: boolean;
344
352
  }
345
353
  interface IServerConversationStatus {
346
354
  conversationType: number;
@@ -400,6 +408,17 @@ declare enum ChatroomEntryType {
400
408
  DELETE = 2
401
409
  }
402
410
 
411
+ declare enum MessageDirection {
412
+ /**
413
+ * 己方发送消息
414
+ */
415
+ SEND = 1,
416
+ /**
417
+ * 己方接收消息
418
+ */
419
+ RECEIVE = 2
420
+ }
421
+
403
422
  interface IGooglePushConfig {
404
423
  /**
405
424
  * 分组ID
@@ -499,6 +518,155 @@ interface IPushConfig {
499
518
  templateId: string;
500
519
  }
501
520
 
521
+ /**
522
+ * 已读回执数据结构
523
+ */
524
+ interface IMessageReader {
525
+ readTime: number;
526
+ userId: string;
527
+ }
528
+ interface IMessageReaderResponse {
529
+ totalMemberCount: number;
530
+ list: IMessageReader[];
531
+ }
532
+ interface ILocalReadReceiptInfo {
533
+ hasRespond?: boolean;
534
+ readerInfo?: {
535
+ [userId: string]: number;
536
+ };
537
+ readCount?: number;
538
+ totalCount?: number;
539
+ }
540
+ interface IReadReceiptInfo {
541
+ /**
542
+ * 是否已经发送已读回执
543
+ */
544
+ hasRespond?: boolean;
545
+ /**
546
+ * 已阅读用户列表(不准确)
547
+ */
548
+ readerList?: IMessageReader[];
549
+ /**
550
+ * 阅读人数(不准确)
551
+ */
552
+ readCount?: number;
553
+ /**
554
+ * 群组总人数(不准确)
555
+ */
556
+ totalCount?: number;
557
+ }
558
+ /**
559
+ * 从服务端接收到的消息数据
560
+ */
561
+ interface IReceivedMessage {
562
+ /**
563
+ * 会话的业务标识
564
+ */
565
+ channelId?: string;
566
+ /**
567
+ * 会话类型
568
+ * * 1: 单聊
569
+ * * 3: 群聊
570
+ * * 4: 聊天室
571
+ * * 5: 客服会话
572
+ * * 6: 系统消息
573
+ * * 7: 默认关注的公众号
574
+ * * 8: 手动关注的公众号
575
+ * * 9: RTCLib 房间
576
+ */
577
+ conversationType: ConversationType;
578
+ /**
579
+ * 会话 targetId
580
+ */
581
+ targetId: string;
582
+ /**
583
+ * 消息发送者的用户 Id
584
+ */
585
+ senderUserId: string;
586
+ /**
587
+ * 消息内容
588
+ */
589
+ content: any;
590
+ /**
591
+ * 消息结构名称,即消息类型
592
+ * @example RC:TxtMsg
593
+ */
594
+ messageType: string;
595
+ /**
596
+ * 服务端存储的消息 Id
597
+ */
598
+ messageUId: string;
599
+ /**
600
+ * 消息方向是发出 or 收取
601
+ */
602
+ messageDirection: MessageDirection;
603
+ /**
604
+ * 是否为离线消息
605
+ */
606
+ isOffLineMessage: boolean;
607
+ /**
608
+ * 消息在服务器端的发送时间
609
+ */
610
+ sentTime: number;
611
+ /**
612
+ * 消息接收时间,该时间通过消息的 `sentTime` 值在本地进行计算得出,不推荐使用
613
+ * @description 当 isOffLineMessage 为 true 时,该值无效
614
+ */
615
+ receivedTime: number;
616
+ /**
617
+ * 是否存储
618
+ * @default true
619
+ */
620
+ isPersited: boolean;
621
+ /**
622
+ * 是否计数
623
+ * @default true
624
+ */
625
+ isCounted: boolean;
626
+ /**
627
+ * 是否为 @ 消息
628
+ */
629
+ isMentioned: boolean;
630
+ /**
631
+ * 消息是否静默
632
+ * @description 静默消息不会发送 Push 信息和本地通知提醒
633
+ */
634
+ disableNotification: boolean;
635
+ /**
636
+ * 是否是状态消息
637
+ */
638
+ isStatusMessage: boolean;
639
+ /**
640
+ * 是否支持消息扩展存储
641
+ */
642
+ canIncludeExpansion: boolean;
643
+ /**
644
+ * 消息携带的扩展存储
645
+ */
646
+ expansion: {
647
+ [key: string]: any;
648
+ } | null;
649
+ /**
650
+ * 消息接收状态
651
+ */
652
+ receivedStatus: number;
653
+ /**
654
+ * CPP 独有字段 消息本地 ID
655
+ */
656
+ messageId?: number;
657
+ /**
658
+ * CPP 独有字段 消息发送状态
659
+ */
660
+ sentStatus?: number;
661
+ /**
662
+ * 已读回执信息(导航配置grpRRVer=1时群组类型消息内存在, 其他情况为undefined)
663
+ */
664
+ readReceiptInfo?: IReadReceiptInfo;
665
+ /**
666
+ * 推送扩展
667
+ */
668
+ pushConfig?: IPushConfig;
669
+ }
502
670
  interface IUserProfile {
503
671
  /**
504
672
  * 用户 ID
@@ -517,6 +685,35 @@ interface IUserProfile {
517
685
  */
518
686
  extra?: string;
519
687
  }
688
+ interface IRecallMsgOptions {
689
+ /**
690
+ * 会话组织机构标识
691
+ * 默认值未 空字符串
692
+ */
693
+ channelId: string;
694
+ /**
695
+ * 发送消息携带的用户信息
696
+ */
697
+ user?: IUserProfile;
698
+ /**
699
+ * Push 信息
700
+ */
701
+ pushContent?: string;
702
+ /**
703
+ * 原消息体
704
+ */
705
+ oriContent?: any;
706
+ /**
707
+ * 是否发送静默消息
708
+ * @description
709
+ * 当值为 `true` 时,服务器将不会发送 Push 信息,移动端也不会弹出本地通知提醒
710
+ */
711
+ disableNotification?: boolean;
712
+ /**
713
+ * 移动端推送配置
714
+ */
715
+ pushConfig?: IPushConfig;
716
+ }
520
717
  /**
521
718
  * 发送消息时的可选项信息
522
719
  */
@@ -620,6 +817,55 @@ interface ISendMsgOptions {
620
817
  */
621
818
  channelId?: string;
622
819
  }
820
+ interface IInsertMsgOptions {
821
+ senderUserId: string;
822
+ messageType: string;
823
+ content: string;
824
+ messageDirection: number;
825
+ readStatus?: number;
826
+ sentStatus?: number;
827
+ sentTime?: number;
828
+ searchContent?: string;
829
+ isUnread?: boolean;
830
+ messageUId?: string;
831
+ disableNotification?: boolean;
832
+ canIncludeExpansion?: boolean;
833
+ expansionMsg?: string;
834
+ channelId: string;
835
+ }
836
+ interface ISendExMsgOptions {
837
+ channelId: string;
838
+ conversationType: ConversationType;
839
+ targetId: string;
840
+ /**
841
+ * 消息 ID
842
+ */
843
+ messageUId: string;
844
+ /**
845
+ * 原始消息是否支持扩展的字段
846
+ */
847
+ canIncludeExpansion: boolean;
848
+ /**
849
+ * 删除的 keys
850
+ */
851
+ keys?: string[];
852
+ /**
853
+ * 扩展对象
854
+ */
855
+ expansion?: {
856
+ [key: string]: string;
857
+ };
858
+ /**
859
+ * 是否删除所有扩展
860
+ */
861
+ removeAll?: boolean;
862
+ /**
863
+ * 原始消息的扩展
864
+ */
865
+ originExpansion?: {
866
+ [key: string]: string;
867
+ } | null;
868
+ }
623
869
 
624
870
  /**
625
871
  * TODO: 确定对外暴露的必要性
@@ -900,10 +1146,14 @@ declare enum ErrorCode {
900
1146
  MSG_ROAMING_SERVICE_UNAVAILABLE = 33007,
901
1147
  MSG_INSERT_ERROR = 33008,
902
1148
  MSG_DEL_ERROR = 33009,
1149
+ /**
1150
+ * 标签已存在
1151
+ */
1152
+ TAG_EXISTS = 33101,
903
1153
  /**
904
1154
  * 标签不存在
905
1155
  */
906
- TAG_NOT_EXIST = 33101,
1156
+ TAG_NOT_EXIST = 33100,
907
1157
  /**
908
1158
  * 会话中不存在此标签
909
1159
  */
@@ -979,6 +1229,10 @@ declare enum ErrorCode {
979
1229
  * 开启`禁止把已在线客户端踢下线`开关后,该错误码标识已有同类型端在线,禁止链接
980
1230
  */
981
1231
  HAS_OHTER_SAME_CLIENT_ON_LINE = 35010,
1232
+ /**
1233
+ * 上传文件失败
1234
+ */
1235
+ UPLOAD_FILE_FAILED = 35020,
982
1236
  /**
983
1237
  * 加入聊天室Id为空
984
1238
  */
@@ -1117,7 +1371,11 @@ declare enum ErrorCode {
1117
1371
  /**
1118
1372
  * VoIP 不可用
1119
1373
  */
1120
- VOIP_NOT_AVALIABLE = 18
1374
+ VOIP_NOT_AVALIABLE = 18,
1375
+ /**
1376
+ * 聊天室批量设置kv部分不成功
1377
+ */
1378
+ CHATROOM_KV_STORE_NOT_ALL_SUCCESS = 23428
1121
1379
  }
1122
1380
 
1123
1381
  /**
@@ -1176,35 +1434,7 @@ declare enum RTCIdentityChangeType {
1176
1434
  AnchorToViewer = 1,
1177
1435
  ViewerToAnchor = 2
1178
1436
  }
1179
- /**
1180
- * RTC 房间加入类型
1181
- */
1182
- declare enum RTCJoinType {
1183
- /**
1184
- * 踢前一个设备
1185
- */
1186
- KICK = 0,
1187
- /**
1188
- * 当前加入拒绝
1189
- */
1190
- REFUSE = 1,
1191
- /**
1192
- * 两个设备共存
1193
- */
1194
- COEXIST = 2
1195
- }
1196
-
1197
- declare enum MessageDirection {
1198
- /**
1199
- * 己方发送消息
1200
- */
1201
- SEND = 1,
1202
- /**
1203
- * 己方接收消息
1204
- */
1205
- RECEIVE = 2
1206
- }
1207
-
1437
+
1208
1438
  /**
1209
1439
  * 序列化、反序列化数据通道
1210
1440
  */
@@ -1286,14 +1516,7 @@ declare class DataCodec {
1286
1516
  * 格式化 RTC 用户加入房间后通知拉取的数据(房间内主播全量列表、房间全量资源)
1287
1517
  */
1288
1518
  private _formatRTCRoomKVList;
1289
- /**
1290
- * 格式化观众加房间后返回数据
1291
- */
1292
1519
  private _formatRTCAuidenceJoinRoomData;
1293
- /**
1294
- * 格式化加入 RTC 房间的用户信息
1295
- */
1296
- private _formatRTCJoinedUserInfo;
1297
1520
  /**
1298
1521
  * ===== 以下为通用数据 序列化为 PB 数据 =====
1299
1522
  * Engine Index 调用处理数据
@@ -1372,6 +1595,7 @@ declare class DataCodec {
1372
1595
  * 聊天室 KV 存储
1373
1596
  */
1374
1597
  encodeModifyChatRoomKV(chrmId: string, entry: IChrmKVEntry, currentUserId: string): any;
1598
+ encodeModifyChatRoomKVS(chrmId: string, entryOptions: IChrmKVEntries, currentUserId: string): any;
1375
1599
  /**
1376
1600
  * KV 存储拉取
1377
1601
  */
@@ -1422,7 +1646,7 @@ declare class DataCodec {
1422
1646
  /**
1423
1647
  * 加入 RTC 房间
1424
1648
  */
1425
- encodeJoinRTCRoom(mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType): any[];
1649
+ encodeJoinRTCRoom(mode: RTCMode, broadcastType?: number): any[];
1426
1650
  /**
1427
1651
  * 退出 RTC 房间
1428
1652
  */
@@ -1438,7 +1662,6 @@ declare class DataCodec {
1438
1662
  * 全量 URI
1439
1663
  */
1440
1664
  encodeUserSetRTCData(message: any, valueInfo: string, objectName: string, mcuValInfo: string): any;
1441
- encodeUserSetRTCCDNUris(objectName: string, CDNUris: string): any;
1442
1665
  /**
1443
1666
  * 用户属性获取
1444
1667
  */
@@ -1481,10 +1704,6 @@ declare class DataCodec {
1481
1704
  * RTC 直播观众拉取房间内 KV
1482
1705
  */
1483
1706
  encodePullRTCRoomKV(roomId: string, timestamp: number): any;
1484
- /**
1485
- * RTC 查询在房间内用户的信息
1486
- */
1487
- encodeQueryUserJoinedInfo(userId: string): any;
1488
1707
  }
1489
1708
 
1490
1709
  /**
@@ -1581,6 +1800,16 @@ interface IAsyncRes<T = any> {
1581
1800
  * 通过 `Promise.resolve` 来处理预期内的异常,进而通过 Uncatch Promise Error 暴露预期外的异常
1582
1801
  */
1583
1802
  declare type IPromiseResult<T> = Promise<IAsyncRes<T>>;
1803
+ interface IConnectResult {
1804
+ /**
1805
+ * 连接错误码
1806
+ */
1807
+ code: ErrorCode;
1808
+ /**
1809
+ * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
1810
+ */
1811
+ userId?: string;
1812
+ }
1584
1813
 
1585
1814
  interface IDataChannelWatcher {
1586
1815
  /**
@@ -1846,157 +2075,6 @@ declare enum NotificationStatus {
1846
2075
  CLOSE = 2
1847
2076
  }
1848
2077
 
1849
- /**
1850
- * 已读回执数据结构
1851
- */
1852
- interface IMessageReader {
1853
- readTime: number;
1854
- userId: string;
1855
- }
1856
- interface IMessageReaderResponse {
1857
- totalMemberCount: number;
1858
- list: IMessageReader[];
1859
- }
1860
- interface ILocalReadReceiptInfo {
1861
- hasRespond?: boolean;
1862
- readerInfo?: {
1863
- [userId: string]: number;
1864
- };
1865
- readCount?: number;
1866
- totalCount?: number;
1867
- }
1868
- interface IReadReceiptInfo {
1869
- /**
1870
- * 是否已经发送已读回执
1871
- */
1872
- hasRespond?: boolean;
1873
- /**
1874
- * 已阅读用户列表(不准确)
1875
- */
1876
- readerList?: IMessageReader[];
1877
- /**
1878
- * 阅读人数(不准确)
1879
- */
1880
- readCount?: number;
1881
- /**
1882
- * 群组总人数(不准确)
1883
- */
1884
- totalCount?: number;
1885
- }
1886
-
1887
- /**
1888
- * 从服务端接收到的消息数据
1889
- */
1890
- interface IReceivedMessage {
1891
- /**
1892
- * 会话的业务标识
1893
- */
1894
- channelId?: string;
1895
- /**
1896
- * 会话类型
1897
- * * 1: 单聊
1898
- * * 3: 群聊
1899
- * * 4: 聊天室
1900
- * * 5: 客服会话
1901
- * * 6: 系统消息
1902
- * * 7: 默认关注的公众号
1903
- * * 8: 手动关注的公众号
1904
- * * 9: RTCLib 房间
1905
- */
1906
- conversationType: ConversationType;
1907
- /**
1908
- * 会话 targetId
1909
- */
1910
- targetId: string;
1911
- /**
1912
- * 消息发送者的用户 Id
1913
- */
1914
- senderUserId: string;
1915
- /**
1916
- * 消息内容
1917
- */
1918
- content: any;
1919
- /**
1920
- * 消息结构名称,即消息类型
1921
- * @example RC:TxtMsg
1922
- */
1923
- messageType: string;
1924
- /**
1925
- * 服务端存储的消息 Id
1926
- */
1927
- messageUId: string;
1928
- /**
1929
- * 消息方向是发出 or 收取
1930
- */
1931
- messageDirection: MessageDirection;
1932
- /**
1933
- * 是否为离线消息
1934
- */
1935
- isOffLineMessage: boolean;
1936
- /**
1937
- * 消息在服务器端的发送时间
1938
- */
1939
- sentTime: number;
1940
- /**
1941
- * 消息接收时间,该时间通过消息的 `sentTime` 值在本地进行计算得出,不推荐使用
1942
- * @description 当 isOffLineMessage 为 true 时,该值无效
1943
- */
1944
- receivedTime: number;
1945
- /**
1946
- * 是否存储
1947
- * @default true
1948
- */
1949
- isPersited: boolean;
1950
- /**
1951
- * 是否计数
1952
- * @default true
1953
- */
1954
- isCounted: boolean;
1955
- /**
1956
- * 是否为 @ 消息
1957
- */
1958
- isMentioned: boolean;
1959
- /**
1960
- * 消息是否静默
1961
- * @description 静默消息不会发送 Push 信息和本地通知提醒
1962
- */
1963
- disableNotification: boolean;
1964
- /**
1965
- * 是否是状态消息
1966
- */
1967
- isStatusMessage: boolean;
1968
- /**
1969
- * 是否支持消息扩展存储
1970
- */
1971
- canIncludeExpansion: boolean;
1972
- /**
1973
- * 消息携带的扩展存储
1974
- */
1975
- expansion: {
1976
- [key: string]: any;
1977
- } | null;
1978
- /**
1979
- * 消息接收状态
1980
- */
1981
- receivedStatus: number;
1982
- /**
1983
- * CPP 独有字段 消息本地 ID
1984
- */
1985
- messageId?: number;
1986
- /**
1987
- * CPP 独有字段 消息发送状态
1988
- */
1989
- sentStatus?: number;
1990
- /**
1991
- * 已读回执信息(导航配置grpRRVer=1时群组类型消息内存在, 其他情况为undefined)
1992
- */
1993
- readReceiptInfo?: IReadReceiptInfo;
1994
- /**
1995
- * 推送扩展
1996
- */
1997
- pushConfig?: IPushConfig;
1998
- }
1999
-
2000
2078
  /**
2001
2079
  * 从服务器拉取到的会话数据结构
2002
2080
  */
@@ -2064,7 +2142,6 @@ interface IReceivedConversation {
2064
2142
  interface IReceivedConversationByTag extends IReceivedConversation {
2065
2143
  isTopInTag: boolean;
2066
2144
  }
2067
-
2068
2145
  /**
2069
2146
  * 设置会话状态 参数 信息
2070
2147
  */
@@ -2075,49 +2152,215 @@ interface ISetConversationStatusOptions {
2075
2152
  notificationStatus?: number;
2076
2153
  channelId?: string;
2077
2154
  }
2078
-
2079
- interface IChatroomUser {
2080
- /**
2081
- * 用户 id
2082
- */
2083
- id: string;
2155
+ interface IUpdatedConversation {
2156
+ updatedItems: {
2157
+ [key: string]: {
2158
+ time: number;
2159
+ val: any;
2160
+ };
2161
+ };
2162
+ conversationType: number;
2163
+ targetId: string;
2164
+ latestMessage?: IReceivedMessage;
2165
+ unreadMessageCount?: number;
2166
+ hasMentioned?: boolean;
2167
+ mentionedInfo?: {
2168
+ /**
2169
+ * `@ 类型,其中 1 为 @ 所有人,2 为 @ 部分人`
2170
+ */
2171
+ type: 1 | 2;
2172
+ /**
2173
+ * 被 @ 的用户 Id 列表,仅在 `type` 为 `2` 时有效
2174
+ */
2175
+ userIdList: string[];
2176
+ };
2177
+ lastUnreadTime?: number;
2178
+ notificationStatus?: number;
2179
+ isTop?: boolean;
2084
2180
  /**
2085
- * 加入聊天室的时间
2086
- */
2087
- time: number;
2181
+ * 会话标识
2182
+ */
2183
+ channelId?: string;
2184
+ tags?: IUpdatedConversation[];
2088
2185
  }
2089
2186
 
2090
- interface IChatroomInfo {
2091
- /**
2092
- * 成员列表
2093
- * @todo 需确认数组元素的数据结构
2094
- */
2095
- userInfos: IChatroomUser[];
2096
- /**
2097
- * 房间内总人数
2098
- */
2099
- userCount: number;
2187
+ /**
2188
+ * 聊天室成员进入和退出状态
2189
+ */
2190
+ declare enum ChatroomUserChangeType {
2191
+ QUIT = 0,
2192
+ JOIN = 1
2100
2193
  }
2101
2194
 
2102
- interface IUploadAuth {
2195
+ interface IChatroomEntryListenerData {
2103
2196
  /**
2104
- * 七牛 token 有效期
2197
+ * 更新的键
2105
2198
  */
2106
- deadline: number;
2199
+ key: string;
2107
2200
  /**
2108
- * 七牛上传 token
2201
+ * 更新的值
2109
2202
  */
2110
- token: string;
2203
+ value: string;
2111
2204
  /**
2112
- * 百度上传 token
2205
+ * 更新的时间
2113
2206
  */
2114
- bosToken: string;
2207
+ timestamp: number;
2115
2208
  /**
2116
- * 百度上传 header Date
2209
+ * 更新的聊天室 ID
2117
2210
  */
2118
- bosDate: string;
2211
+ chatroomId: string;
2119
2212
  /**
2120
- * 百度上传路径
2213
+ * 更新类型
2214
+ */
2215
+ type: ChatroomEntryType;
2216
+ }
2217
+ interface IChatroomRejoinedFailed {
2218
+ /**
2219
+ * 自动重新加入的聊天室 ID
2220
+ */
2221
+ chatroomId: string;
2222
+ /**
2223
+ * 自动重新加入失败的 code
2224
+ */
2225
+ errorCode: number;
2226
+ }
2227
+ interface IChatroomRejoinedSuccessed {
2228
+ /**
2229
+ * 自动重新加入的聊天室 ID
2230
+ */
2231
+ chatroomId: string;
2232
+ /**
2233
+ * 自动重新加入的聊天室拉取消息的数量
2234
+ */
2235
+ count: number;
2236
+ }
2237
+ interface IChatroomUserChangeInfo {
2238
+ users: {
2239
+ [userId: string]: ChatroomUserChangeType;
2240
+ };
2241
+ chatroomId: string;
2242
+ }
2243
+ declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
2244
+ /**
2245
+ * 聊天室信息
2246
+ */
2247
+ interface IChatroomListenerData {
2248
+ /**
2249
+ * SDK 内部重连聊天室信息
2250
+ */
2251
+ rejoinedRoom?: IChatroomRejoinedInfo;
2252
+ /**
2253
+ * 监听到的聊天室 KV 更新
2254
+ */
2255
+ updatedEntries?: IChatroomEntryListenerData[];
2256
+ /**
2257
+ * 登录退出的用户通知
2258
+ */
2259
+ userChange?: IChatroomUserChangeInfo;
2260
+ /**
2261
+ * 聊天室销毁
2262
+ */
2263
+ chatroomDestroyed?: string;
2264
+ }
2265
+ interface IChatroomEntry {
2266
+ /**
2267
+ * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2268
+ */
2269
+ key: string;
2270
+ /**
2271
+ * 属性对应的值, 最大长度 4096 字符
2272
+ */
2273
+ value: string;
2274
+ /**
2275
+ * 设置成功后是否发送通知消息
2276
+ */
2277
+ isSendNotification?: boolean;
2278
+ /**
2279
+ * RC:chrmKVNotiMsg 消息中携带的附加信息
2280
+ */
2281
+ notificationExtra?: string;
2282
+ /**
2283
+ * 用户退出聊天室时是否清除此属性
2284
+ */
2285
+ isAutoDelete?: boolean;
2286
+ }
2287
+ interface IChatroomUser {
2288
+ /**
2289
+ * 用户 id
2290
+ */
2291
+ id: string;
2292
+ /**
2293
+ * 加入聊天室的时间
2294
+ */
2295
+ time: number;
2296
+ }
2297
+ interface IChatroomInfo {
2298
+ /**
2299
+ * 成员列表
2300
+ * @todo 需确认数组元素的数据结构
2301
+ */
2302
+ userInfos: IChatroomUser[];
2303
+ /**
2304
+ * 房间内总人数
2305
+ */
2306
+ userCount: number;
2307
+ }
2308
+ interface IRemoveChatRoomEntryOption {
2309
+ /**
2310
+ * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2311
+ */
2312
+ key: string;
2313
+ /**
2314
+ * 删除成功后是否发送通知消息
2315
+ */
2316
+ isSendNotification?: boolean;
2317
+ /**
2318
+ * RC:chrmKVNotiMsg 消息中携带的附加信息
2319
+ */
2320
+ notificationExtra?: string;
2321
+ }
2322
+ interface IChatroomEntries {
2323
+ /**
2324
+ * entries ,要设置的属性列表
2325
+ * key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2326
+ * value 属性对应的值, 最大长度 4096 字符
2327
+ */
2328
+ entries: {
2329
+ key: string;
2330
+ value: string;
2331
+ }[];
2332
+ /**
2333
+ * 设置成功后是否发送通知消息
2334
+ */
2335
+ /**
2336
+ * RC:chrmKVNotiMsg 消息中携带的附加信息
2337
+ */
2338
+ notificationExtra?: string;
2339
+ /**
2340
+ * 用户退出聊天室时是否清除此属性
2341
+ */
2342
+ isAutoDelete?: boolean;
2343
+ }
2344
+
2345
+ interface IUploadAuth {
2346
+ /**
2347
+ * 七牛 token 有效期
2348
+ */
2349
+ deadline: number;
2350
+ /**
2351
+ * 七牛上传 token
2352
+ */
2353
+ token: string;
2354
+ /**
2355
+ * 百度上传 token
2356
+ */
2357
+ bosToken: string;
2358
+ /**
2359
+ * 百度上传 header Date
2360
+ */
2361
+ bosDate: string;
2362
+ /**
2363
+ * 百度上传路径
2121
2364
  */
2122
2365
  path: string;
2123
2366
  /**
@@ -2199,6 +2442,15 @@ interface IExpansionListenerData {
2199
2442
  deletedExpansion?: IDeletedExpansion;
2200
2443
  }
2201
2444
 
2445
+ interface IRTCRoomInfo {
2446
+ roomId: string;
2447
+ roomData: unknown[];
2448
+ userCount: number;
2449
+ list: unknown[];
2450
+ }
2451
+ interface IRtcTokenData {
2452
+ rtcToken: string;
2453
+ }
2202
2454
  interface IRTCUsers {
2203
2455
  users: {
2204
2456
  [userId: string]: {
@@ -2209,29 +2461,12 @@ interface IRTCUsers {
2209
2461
  };
2210
2462
  };
2211
2463
  }
2212
-
2213
- interface IRtcTokenData {
2214
- rtcToken: string;
2215
- }
2216
-
2217
- interface KVString {
2218
- [key: string]: string;
2219
- }
2220
-
2221
- interface IRTCRoomInfo {
2222
- roomId: string;
2223
- roomData: unknown[];
2224
- userCount: number;
2225
- list: unknown[];
2226
- }
2227
-
2228
2464
  interface IJoinRTCRoomData extends IRTCUsers {
2229
2465
  token: string;
2230
2466
  sessionId: string;
2231
- roomInfo: {
2232
- key: string;
2233
- value: string;
2234
- }[];
2467
+ }
2468
+ interface KVString {
2469
+ [key: string]: string;
2235
2470
  }
2236
2471
 
2237
2472
  /**
@@ -2283,271 +2518,211 @@ declare enum UploadMethod {
2283
2518
  STC = 4
2284
2519
  }
2285
2520
 
2286
- interface IRecallMsgOptions {
2287
- /**
2288
- * 会话组织机构标识
2289
- * 默认值未 空字符串
2290
- */
2291
- channelId: string;
2292
- /**
2293
- * 发送消息携带的用户信息
2294
- */
2295
- user?: IUserProfile;
2296
- /**
2297
- * Push 信息
2298
- */
2299
- pushContent?: string;
2521
+ /**
2522
+ * 导航信息数据就结构
2523
+ */
2524
+ interface INaviInfo {
2300
2525
  /**
2301
- * 原消息体
2302
- */
2303
- oriContent?: any;
2526
+ * Navi 数据请求响应码,200 为成功请求
2527
+ */
2528
+ code: number;
2304
2529
  /**
2305
- * 是否发送静默消息
2306
- * @description
2307
- * 当值为 `true` 时,服务器将不会发送 Push 信息,移动端也不会弹出本地通知提醒
2308
- */
2309
- disableNotification?: boolean;
2530
+ * 获取 Navi 数据失败时的提示信息
2531
+ */
2532
+ errorMessage?: string;
2310
2533
  /**
2311
- * 移动端推送配置
2312
- */
2313
- pushConfig?: IPushConfig;
2314
- }
2315
-
2316
- interface IInsertMsgOptions {
2317
- senderUserId: string;
2318
- messageType: string;
2319
- content: string;
2320
- messageDirection: number;
2321
- readStatus?: number;
2322
- sentStatus?: number;
2323
- sentTime?: number;
2324
- searchContent?: string;
2325
- isUnread?: boolean;
2326
- messageUId?: string;
2327
- disableNotification?: boolean;
2328
- canIncludeExpansion?: boolean;
2329
- expansionMsg?: string;
2330
- channelId: string;
2331
- }
2332
-
2333
- interface IChatroomEntry {
2534
+ * 获取 Navi 数据失败时的请求 url 信息
2535
+ */
2536
+ url?: string;
2334
2537
  /**
2335
- * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2538
+ * 请求导航数据时使用的协议:http / https
2539
+ * @description 该字段为 SDK 内增加的字段,导航接口数据中不存在
2336
2540
  */
2337
- key: string;
2541
+ protocol: 'http' | 'https';
2338
2542
  /**
2339
- * 属性对应的值, 最大长度 4096 字符
2543
+ * 获取导航时使用的 userId,小程序不走导航,故拿不到 userId
2340
2544
  */
2341
- value: string;
2545
+ userId?: string;
2342
2546
  /**
2343
- * 设置成功后是否发送通知消息
2547
+ * CMP 服务 Websocket 连接地址,包含域名与端口,不含 ws 或 wss 协议头
2548
+ * @example a.domain.com:443
2344
2549
  */
2345
- isSendNotification?: boolean;
2550
+ server: string;
2346
2551
  /**
2347
- * RC:chrmKVNotiMsg 消息中携带的附加信息
2552
+ * 备用 CMP 服务地址,包含域名与端口,不含 ws 或 wss 协议头,多个备用地址以 ',' 分割
2553
+ * @example a.domain.com:443,b.domain.com:443
2348
2554
  */
2349
- notificationExtra?: string;
2555
+ backupServer?: string;
2350
2556
  /**
2351
- * 用户退出聊天室时是否清除此属性
2557
+ * 备用 CMP 服务地址,POST 请求 TCP 连接返回的是 bs 字段,非 backupServer 字段
2352
2558
  */
2353
- isAutoDelete?: boolean;
2354
- }
2355
-
2356
- interface IRemoveChatRoomEntryOption {
2559
+ bs?: string;
2357
2560
  /**
2358
- * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
2561
+ * RTC 服务配置,其值可能为 null、无效字符串、有效 JSON 字符串
2562
+ * 1. 公有云未开通音视频时,值为 null
2563
+ * 2. 私有云无配置时为 `{ "strategy": 0 }`
2359
2564
  */
2360
- key: string;
2565
+ voipCallInfo: string | null;
2361
2566
  /**
2362
- * 删除成功后是否发送通知消息
2567
+ * 聊天室 kv 存储开关
2568
+ * @todo 需确认详细有效值
2569
+ * @description 公有云独有配置
2363
2570
  */
2364
- isSendNotification?: boolean;
2571
+ kvStorage: number;
2365
2572
  /**
2366
- * RC:chrmKVNotiMsg 消息中携带的附加信息
2573
+ * HttpDNS 功能开关,在 web 端无效
2574
+ * @description 公有云独有配置
2367
2575
  */
2368
- notificationExtra?: string;
2369
- }
2370
-
2371
- interface IChatroomEntryListenerData {
2576
+ openHttpDNS: boolean;
2372
2577
  /**
2373
- * 更新的键
2374
- */
2375
- key: string;
2578
+ * 历史消息云存储功能开关
2579
+ * @description
2580
+ * 1. 公有云通过 `developer.rongcloud.cn` 管理后台 `单群聊消息云端存储` 功能开关进行配置
2581
+ * 2. 私有云默认为 `true`
2582
+ */
2583
+ historyMsg: boolean;
2376
2584
  /**
2377
- * 更新的值
2378
- */
2379
- value: string;
2585
+ * 聊天室历史消息开关
2586
+ * @description
2587
+ * 1. 私有云对聊天室功能支持有限,默认为 `false`
2588
+ * 2. TODO: 公有云配置待确认
2589
+ */
2590
+ chatroomMsg: boolean;
2380
2591
  /**
2381
- * 更新的时间
2382
- */
2383
- timestamp: number;
2592
+ * 文件服务器地址
2593
+ * @description
2594
+ * 1. 公有云下,该地址为七牛云服务器地址
2595
+ * 2. 私有云下,该地址为私有云自研文件服务器地址
2596
+ */
2597
+ uploadServer: string;
2384
2598
  /**
2385
- * 更新的聊天室 ID
2386
- */
2387
- chatroomId: string;
2599
+ * 实时位置共享配置,web 端无需处理
2600
+ */
2601
+ location: null | string;
2388
2602
  /**
2389
- * 更新类型
2390
- */
2391
- type: ChatroomEntryType;
2392
- }
2393
- interface IChatroomRejoinedFailed {
2603
+ * 实时日志上传开关
2604
+ * @todo 需确认有效值及作用
2605
+ */
2606
+ monitor: number;
2394
2607
  /**
2395
- * 自动重新加入的聊天室 ID
2396
- */
2397
- chatroomId: string;
2608
+ * 是否允许加入多聊天室开关
2609
+ */
2610
+ joinMChrm: boolean;
2398
2611
  /**
2399
- * 自动重新加入失败的 code
2400
- */
2401
- errorCode: number;
2402
- }
2403
- interface IChatroomRejoinedSuccessed {
2612
+ * 是否开启公众号功能:`0` 为未开启,`1` 为已开启
2613
+ */
2614
+ openMp: 0 | 1;
2404
2615
  /**
2405
- * 自动重新加入的聊天室 ID
2406
- */
2407
- chatroomId: string;
2616
+ * 是否开启用户级配置,若开启,需连接成功后立即拉取实时配置,0 | 1
2617
+ * @description
2618
+ * 配置来源:
2619
+ * 1. 导航
2620
+ * 2. 服务端实时下发
2621
+ * 已有配置字段:
2622
+ * 1. Lan. 推送使用的语言设置,用户端可自定义修改. Web 端未做设置, 只做接收
2623
+ * 2. ShPushSwit. 推送是否显示详情设置,用户端可自定义修改. Web 端未做设置, 只做接收
2624
+ * 3. MobPushSwit: Web/PC 在线,移动端不在线是否发送推送开关,用户端可自定义修改. Web 端未做设置, 只做接收
2625
+ * 4. OffMsgDur: 离线消息保存天数,设置天数不可大于App级对应配置,用户端可自定义修改. Web 端未做设置, 只做接收
2626
+ * 5. VoipInfo: 音视频相关配置,用户端不可自定义修改. 由服务端决定,与导航下发格式一致
2627
+ * @todo 需确认公有云与私有云区别
2628
+ */
2629
+ openUS: 0 | 1;
2408
2630
  /**
2409
- * 自动重新加入的聊天室拉取消息的数量
2410
- */
2411
- count: number;
2412
- }
2413
- declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
2414
- /**
2415
- * 聊天室信息
2416
- */
2417
- interface IChatroomListenerData {
2631
+ * 群离线消息最大下发条数,`0` 为关闭
2632
+ * @description 公有云独有配合
2633
+ */
2634
+ grpMsgLimit: number;
2418
2635
  /**
2419
- * SDK 内部重连聊天室信息
2420
- */
2421
- rejoinedRoom?: IChatroomRejoinedInfo;
2636
+ * 消息加密开关,0 为关闭
2637
+ * @todo
2638
+ * 1. 确定其控制的功能
2639
+ * 2. 确定 web 相关性
2640
+ */
2641
+ isFormatted: number;
2422
2642
  /**
2423
- * 监听到的聊天室 KV 更新
2424
- */
2425
- updatedEntries?: IChatroomEntryListenerData[];
2426
- }
2427
-
2428
- interface IUpdatedConversation {
2429
- updatedItems: {
2430
- [key: string]: {
2431
- time: number;
2432
- val: any;
2433
- };
2434
- };
2435
- conversationType: number;
2436
- targetId: string;
2437
- latestMessage?: IReceivedMessage;
2438
- unreadMessageCount?: number;
2439
- hasMentioned?: boolean;
2440
- mentionedInfo?: {
2441
- /**
2442
- * `@ 类型,其中 1 为 @ 所有人,2 为 @ 部分人`
2443
- */
2444
- type: 1 | 2;
2445
- /**
2446
- * 被 @ 的用户 Id 列表,仅在 `type` 为 `2` 时有效
2447
- */
2448
- userIdList: string[];
2449
- };
2450
- lastUnreadTime?: number;
2451
- notificationStatus?: number;
2452
- isTop?: boolean;
2643
+ * GIF 动图大小限制,默认 2048 KB
2644
+ */
2645
+ gifSize: number;
2453
2646
  /**
2454
- * 会话标识
2455
- */
2456
- channelId?: string;
2457
- tags?: IUpdatedConversation[];
2458
- }
2459
-
2460
- /**
2461
- * 加入 RTC 房间的用户信息
2462
- */
2463
- interface IRTCJoinedInfo {
2647
+ * 上传小视频时长限制,单位:秒
2648
+ * @description 公有云字段,即私有云配置中的 `uploadVideoTimeLimit`
2649
+ */
2650
+ videoTimes?: number;
2464
2651
  /**
2465
- * 设备 ID
2652
+ * 上传小视频时长限制,单位:秒
2653
+ * @description 私有云字段,即公有云配置中的 `videoTimes`
2466
2654
  */
2467
- deviceId: string;
2655
+ uploadVideoTimeLimit?: number;
2468
2656
  /**
2469
- * RTC 房间 ID
2657
+ * 实时日志上传开关:`0` 为关闭,`1` 为开启
2470
2658
  */
2471
- roomId: string;
2659
+ logSwitch: number;
2472
2660
  /**
2473
- * 加入的时间戳
2661
+ * 实时日志上传策略
2662
+ * @example `'{ "url": "logcollection.ronghub.com", "level": 1,"itv": 6, "times": 5 }'`
2474
2663
  */
2475
- joinTime: number;
2476
- }
2477
-
2478
- declare class PluginContext {
2479
- protected readonly _context: APIContext;
2480
- constructor(_context: APIContext);
2664
+ logPolicy: string;
2481
2665
  /**
2482
- * 接收 IM 服务推送的消息,并通过返回 boolean 值决定此消息是否拦截
2483
- * @param message
2484
- * @returns 当返回值为 true,接收的消息将终止继续传递
2666
+ * 百度 BOS 存储服务地址
2667
+ * @description 公有云独有配置
2668
+ * @example `gz.bcebos.com`
2485
2669
  */
2486
- onmessage?(message: IReceivedMessage): boolean;
2670
+ bosAddr?: string;
2487
2671
  /**
2488
- * 用户主动断开连接的事件通知
2672
+ * 阿里上传配置,字符串数组,数组顺序代表 七牛、百度、阿里云 上传权重
2673
+ * @example "[{"qiniu":"upload.qiniup.com","p":"1"},{"baidu":"gz.bcebos.com","p":"2"},{"aliyun":"oss-cn-beijing.aliyuncs.com","p":"3"}]"
2489
2674
  */
2490
- ondisconnect?(): void;
2675
+ ossConfig?: string;
2491
2676
  /**
2492
- * 接收 IM 连接状态变更通知
2493
- * @param status
2677
+ * 私有云专有属性,可用来判断当前环境是公有云还是私有云,私有云环境下该值为 `1`
2494
2678
  */
2495
- onconnectionstatechange?(status: ConnectionStatus): void;
2679
+ type?: number;
2496
2680
  /**
2497
- * IM 客户端销毁通知
2681
+ * @deprecated 已废弃
2498
2682
  */
2499
- ondestroy?(): void;
2683
+ compDays: number;
2500
2684
  /**
2501
- * RTC 数据通知
2502
- * @param roomdId 数据对应的房间 Id
2503
- * @param data 通知数据为 key:value 方式
2504
- * @description
2505
- * 目前仅通知:主播加入、退出房间的人员列表变更,发布、取消发布资源列表变更
2506
- */
2507
- onrtcdatachange?(data: IServerRTCRoomEntry[], roomdId?: string): void;
2685
+ * @deprecated 已废弃
2686
+ */
2687
+ msgAck: unknown;
2508
2688
  /**
2509
- * 获取 `@rongcloud/engine` 包版本
2689
+ * @deprecated 已废弃
2510
2690
  */
2511
- getCoreVersion(): string;
2691
+ activeServer: string;
2512
2692
  /**
2513
- * 获取当前运行中的 IMLib 版本号
2693
+ * @deprecated 已废弃
2514
2694
  */
2515
- getAPIVersion(): string;
2695
+ qnAddr: string;
2516
2696
  /**
2517
- * 获取当前应用的 appkey
2697
+ * @deprecated 已废弃
2518
2698
  */
2519
- getAppkey(): string;
2699
+ extkitSwitch: number;
2520
2700
  /**
2521
- * 获取当前已连接用户的 userId
2522
- * 用户连接建立之前及 disconnect 之后,该方法返回 '' 值
2701
+ * @deprecated 已废弃
2523
2702
  */
2524
- getCurrentId(): string;
2703
+ alone: boolean;
2525
2704
  /**
2526
- * 获取当前连接状态
2705
+ * @deprecated 已废弃
2527
2706
  */
2528
- getConnectionStatus(): ConnectionStatus;
2529
- getDeviceId(): string;
2707
+ voipServer: string;
2530
2708
  /**
2531
- * 发送消息
2709
+ * 离线日志上报地址
2710
+ * @deprecated 已废弃
2532
2711
  */
2533
- sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
2712
+ offlinelogserver: string;
2534
2713
  /**
2535
- * 消息注册
2536
- * @description 消息注册需在应用初始化完成前进行
2537
- * @param objectName 消息类型,如:RC:TxtMsg
2538
- * @param isPersited 是否存储
2539
- * @param isCounted 是否技术
2540
- * @param searchProps 搜索字段,只在搭配协议栈使用时有效
2714
+ * 在线日志上报地址
2715
+ * @deprecated 已废弃
2541
2716
  */
2542
- registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
2717
+ onlinelogserver?: string;
2543
2718
  /**
2544
- * 获取服务时间
2719
+ * 链路加密字段,内容为 JSON 字符串,仅限 C++ 可用
2545
2720
  */
2546
- getServerTime(): number;
2721
+ crypto?: string;
2547
2722
  /**
2548
- * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
2723
+ * 群组回执开关, 1: 打开,0(或者没有): 关闭
2549
2724
  */
2550
- getRTCJoinedUserInfo(userId: string): IPromiseResult<IRTCJoinedInfo[]>;
2725
+ grpRRVer?: number;
2551
2726
  }
2552
2727
 
2553
2728
  declare enum ReceivedStatus {
@@ -2724,9 +2899,17 @@ declare enum MessageType {
2724
2899
  */
2725
2900
  GROUP_READ_RECEIPT_REQUEST = "RC:RRMsg",
2726
2901
  /**
2727
- * 消息送达报告,仅单聊
2902
+ * 用户加入聊天室
2903
+ */
2904
+ CHATROOM_JOIN = "RC:ChrmJoinNtf",
2905
+ /**
2906
+ * 用户退出聊天室
2907
+ */
2908
+ CHATROOM_LEFT = "RC:ChrmQuitNtf",
2909
+ /**
2910
+ * 用户加入退出聊天室的集合
2728
2911
  */
2729
- DELIVERED = "RC:Delivered"
2912
+ CHATROOM_MERGE_CHANGE = "RC:ChrmMemChange"
2730
2913
  }
2731
2914
 
2732
2915
  /**
@@ -2774,278 +2957,27 @@ declare enum LogLevel {
2774
2957
  * 4
2775
2958
  */
2776
2959
  FATAL = 4,
2777
- /**
2778
- * 不展示任何日志
2779
- */
2780
- NONE = 1000
2781
- }
2782
-
2783
- declare enum LogType {
2784
- IM = "IM",
2785
- RTC = "RTC"
2786
- }
2787
-
2788
- /**
2789
- * 导航信息数据就结构
2790
- */
2791
- interface INaviInfo {
2792
- /**
2793
- * Navi 数据请求响应码,200 为成功请求
2794
- */
2795
- code: number;
2796
- /**
2797
- * 获取 Navi 数据失败时的提示信息
2798
- */
2799
- errorMessage?: string;
2800
- /**
2801
- * 获取 Navi 数据失败时的请求 url 信息
2802
- */
2803
- url?: string;
2804
- /**
2805
- * 请求导航数据时使用的协议:http / https
2806
- * @description 该字段为 SDK 内增加的字段,导航接口数据中不存在
2807
- */
2808
- protocol: 'http' | 'https';
2809
- /**
2810
- * 获取导航时使用的 userId,小程序不走导航,故拿不到 userId
2811
- */
2812
- userId?: string;
2813
- /**
2814
- * CMP 服务 Websocket 连接地址,包含域名与端口,不含 ws 或 wss 协议头
2815
- * @example a.domain.com:443
2816
- */
2817
- server: string;
2818
- /**
2819
- * 备用 CMP 服务地址,包含域名与端口,不含 ws 或 wss 协议头,多个备用地址以 ',' 分割
2820
- * @example a.domain.com:443,b.domain.com:443
2821
- */
2822
- backupServer?: string;
2823
- /**
2824
- * 备用 CMP 服务地址,POST 请求 TCP 连接返回的是 bs 字段,非 backupServer 字段
2825
- */
2826
- bs?: string;
2827
- /**
2828
- * RTC 服务配置,其值可能为 null、无效字符串、有效 JSON 字符串
2829
- * 1. 公有云未开通音视频时,值为 null
2830
- * 2. 私有云无配置时为 `{ "strategy": 0 }`
2831
- */
2832
- voipCallInfo: string | null;
2833
- /**
2834
- * 聊天室 kv 存储开关
2835
- * @todo 需确认详细有效值
2836
- * @description 公有云独有配置
2837
- */
2838
- kvStorage: number;
2839
- /**
2840
- * HttpDNS 功能开关,在 web 端无效
2841
- * @description 公有云独有配置
2842
- */
2843
- openHttpDNS: boolean;
2844
- /**
2845
- * 历史消息云存储功能开关
2846
- * @description
2847
- * 1. 公有云通过 `developer.rongcloud.cn` 管理后台 `单群聊消息云端存储` 功能开关进行配置
2848
- * 2. 私有云默认为 `true`
2849
- */
2850
- historyMsg: boolean;
2851
- /**
2852
- * 聊天室历史消息开关
2853
- * @description
2854
- * 1. 私有云对聊天室功能支持有限,默认为 `false`
2855
- * 2. TODO: 公有云配置待确认
2856
- */
2857
- chatroomMsg: boolean;
2858
- /**
2859
- * 文件服务器地址
2860
- * @description
2861
- * 1. 公有云下,该地址为七牛云服务器地址
2862
- * 2. 私有云下,该地址为私有云自研文件服务器地址
2863
- */
2864
- uploadServer: string;
2865
- /**
2866
- * 实时位置共享配置,web 端无需处理
2867
- */
2868
- location: null | string;
2869
- /**
2870
- * 实时日志上传开关
2871
- * @todo 需确认有效值及作用
2872
- */
2873
- monitor: number;
2874
- /**
2875
- * 是否允许加入多聊天室开关
2876
- */
2877
- joinMChrm: boolean;
2878
- /**
2879
- * 是否开启公众号功能:`0` 为未开启,`1` 为已开启
2880
- */
2881
- openMp: 0 | 1;
2882
- /**
2883
- * 是否开启用户级配置,若开启,需连接成功后立即拉取实时配置,0 | 1
2884
- * @description
2885
- * 配置来源:
2886
- * 1. 导航
2887
- * 2. 服务端实时下发
2888
- * 已有配置字段:
2889
- * 1. Lan. 推送使用的语言设置,用户端可自定义修改. Web 端未做设置, 只做接收
2890
- * 2. ShPushSwit. 推送是否显示详情设置,用户端可自定义修改. Web 端未做设置, 只做接收
2891
- * 3. MobPushSwit: Web/PC 在线,移动端不在线是否发送推送开关,用户端可自定义修改. Web 端未做设置, 只做接收
2892
- * 4. OffMsgDur: 离线消息保存天数,设置天数不可大于App级对应配置,用户端可自定义修改. Web 端未做设置, 只做接收
2893
- * 5. VoipInfo: 音视频相关配置,用户端不可自定义修改. 由服务端决定,与导航下发格式一致
2894
- * @todo 需确认公有云与私有云区别
2895
- */
2896
- openUS: 0 | 1;
2897
- /**
2898
- * 群离线消息最大下发条数,`0` 为关闭
2899
- * @description 公有云独有配合
2900
- */
2901
- grpMsgLimit: number;
2902
- /**
2903
- * 消息加密开关,0 为关闭
2904
- * @todo
2905
- * 1. 确定其控制的功能
2906
- * 2. 确定 web 相关性
2907
- */
2908
- isFormatted: number;
2909
- /**
2910
- * GIF 动图大小限制,默认 2048 KB
2911
- */
2912
- gifSize: number;
2913
- /**
2914
- * 上传小视频时长限制,单位:秒
2915
- * @description 公有云字段,即私有云配置中的 `uploadVideoTimeLimit`
2916
- */
2917
- videoTimes?: number;
2918
- /**
2919
- * 上传小视频时长限制,单位:秒
2920
- * @description 私有云字段,即公有云配置中的 `videoTimes`
2921
- */
2922
- uploadVideoTimeLimit?: number;
2923
- /**
2924
- * 实时日志上传开关:`0` 为关闭,`1` 为开启
2925
- */
2926
- logSwitch: number;
2927
- /**
2928
- * 实时日志上传策略
2929
- * @example `'{ "url": "logcollection.ronghub.com", "level": 1,"itv": 6, "times": 5 }'`
2930
- */
2931
- logPolicy: string;
2932
- /**
2933
- * 百度 BOS 存储服务地址
2934
- * @description 公有云独有配置
2935
- * @example `gz.bcebos.com`
2936
- */
2937
- bosAddr?: string;
2938
- /**
2939
- * 阿里上传配置,字符串数组,数组顺序代表 七牛、百度、阿里云 上传权重
2940
- * @example "[{"qiniu":"upload.qiniup.com","p":"1"},{"baidu":"gz.bcebos.com","p":"2"},{"aliyun":"oss-cn-beijing.aliyuncs.com","p":"3"}]"
2941
- */
2942
- ossConfig?: string;
2943
- /**
2944
- * 私有云专有属性,可用来判断当前环境是公有云还是私有云,私有云环境下该值为 `1`
2945
- */
2946
- type?: number;
2947
- /**
2948
- * @deprecated 已废弃
2949
- */
2950
- compDays: number;
2951
- /**
2952
- * @deprecated 已废弃
2953
- */
2954
- msgAck: unknown;
2955
- /**
2956
- * @deprecated 已废弃
2957
- */
2958
- activeServer: string;
2959
- /**
2960
- * @deprecated 已废弃
2961
- */
2962
- qnAddr: string;
2963
- /**
2964
- * @deprecated 已废弃
2965
- */
2966
- extkitSwitch: number;
2967
- /**
2968
- * @deprecated 已废弃
2969
- */
2970
- alone: boolean;
2971
- /**
2972
- * @deprecated 已废弃
2973
- */
2974
- voipServer: string;
2975
- /**
2976
- * 离线日志上报地址
2977
- * @deprecated 已废弃
2978
- */
2979
- offlinelogserver: string;
2980
- /**
2981
- * 在线日志上报地址
2982
- * @deprecated 已废弃
2983
- */
2984
- onlinelogserver?: string;
2985
- /**
2986
- * 链路加密字段,内容为 JSON 字符串,仅限 C++ 可用
2987
- */
2988
- crypto?: string;
2989
- /**
2990
- * 群组回执开关, 1: 打开,0(或者没有): 关闭
2991
- */
2992
- grpRRVer?: number;
2993
- }
2994
-
2995
- /**
2996
- * 拓展方法定义,便于 electron-solution 实现时保持接口类型推导可用
2997
- */
2998
- interface IExtraMethod {
2999
- getConversationsByPage(conversationTypes: ConversationType[], sentTime: number, count: number, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
3000
- getHistoryMessagesByObjectNames(conversationType: ConversationType, targetId: string, sentTime: number, count: number, objectNames: string[], desc: 0 | 1, tag: string): Promise<IAsyncRes<{
3001
- list: IReceivedMessage[];
3002
- hasMore: boolean;
3003
- }>>;
3004
- updateMessageReceiptStatus(conersationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<boolean>>;
3005
- }
3006
-
3007
- /**
3008
- * typing相关接口
3009
- */
3010
-
3011
- /**
3012
- * typing信息
3013
- */
3014
- interface ITypingUser {
3015
- userId: string;
3016
- timestamp: number;
3017
- messageType: string;
3018
- }
3019
- /**
3020
- * 内存存储typing,key为conversationType_targetId
3021
- */
3022
- interface ITypingInfo {
3023
- [key: string]: Array<ITypingUser>;
2960
+ /**
2961
+ * 不展示任何日志
2962
+ */
2963
+ NONE = 1000
3024
2964
  }
3025
- /**
3026
- * typing通知消息接口
3027
- */
3028
- interface ITypingMessage {
3029
- targetId: string;
3030
- conversationType: ConversationType;
3031
- channelId?: string;
3032
- list: Array<ITypingUser>;
2965
+
2966
+ declare enum LogType {
2967
+ IM = "IM",
2968
+ RTC = "RTC"
3033
2969
  }
3034
2970
 
3035
2971
  /**
3036
- * 消息送达相关接口
2972
+ * 拓展方法定义,便于 electron-solution 实现时保持接口类型推导可用
3037
2973
  */
3038
- interface IDeliveredUser {
3039
- time: number;
3040
- userId: string;
3041
- }
3042
- interface IGroupMessageDeliverInfo {
3043
- totalCount: number;
3044
- list: IDeliveredUser[];
3045
- }
3046
- interface IMessageDeliver {
3047
- deliverTime: number;
3048
- messageUId: string;
2974
+ interface IExtraMethod {
2975
+ getConversationsByPage(conversationTypes: ConversationType[], sentTime: number, count: number, channelId?: string): Promise<IAsyncRes<IReceivedConversation[]>>;
2976
+ getHistoryMessagesByObjectNames(conversationType: ConversationType, targetId: string, sentTime: number, count: number, objectNames: string[], desc: 0 | 1, tag: string): Promise<IAsyncRes<{
2977
+ list: IReceivedMessage[];
2978
+ hasMore: boolean;
2979
+ }>>;
2980
+ updateMessageReceiptStatus(conersationType: ConversationType, targetId: string, timestamp: number, channelId?: string): Promise<IAsyncRes<boolean>>;
3049
2981
  }
3050
2982
 
3051
2983
  /**
@@ -3265,6 +3197,10 @@ interface IEngine {
3265
3197
  * 设置聊天室属性
3266
3198
  */
3267
3199
  setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3200
+ /**
3201
+ * 批量设置聊天室属性
3202
+ */
3203
+ setChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<ErrorCode>;
3268
3204
  /**
3269
3205
  * 强制设置聊天室属性
3270
3206
  */
@@ -3273,6 +3209,10 @@ interface IEngine {
3273
3209
  * 删除聊天室属性
3274
3210
  */
3275
3211
  removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
3212
+ /**
3213
+ * 批量删除聊天室属性
3214
+ */
3215
+ removeChatroomEntries(chatroomId: string, entries: IChrmKVEntries): Promise<ErrorCode>;
3276
3216
  /**
3277
3217
  * 强制删除聊天室属性
3278
3218
  */
@@ -3481,14 +3421,6 @@ interface IEngine {
3481
3421
  list: IReceivedMessage[];
3482
3422
  hasMore: boolean;
3483
3423
  }>;
3484
- /**
3485
- * 获取群组消息送达列表
3486
- */
3487
- getGroupMessageDeliverList(targetId: string, messageUId: string, channelId: string): IPromiseResult<IGroupMessageDeliverInfo>;
3488
- /**
3489
- * 获取单聊消息送达详情
3490
- */
3491
- getPrivateMessageDeliverTime(messageUId: string, channelId: string): IPromiseResult<IDeliveredUser | null>;
3492
3424
  joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
3493
3425
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
3494
3426
  rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
@@ -3522,7 +3454,6 @@ interface IEngine {
3522
3454
  getRTCToken(roomId: string, mode: number, broadcastType?: number): IPromiseResult<IRtcTokenData>;
3523
3455
  setRTCState(roomId: string, reportId: string): Promise<ErrorCode>;
3524
3456
  getRTCUserList(roomId: string): IPromiseResult<IRTCUsers>;
3525
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
3526
3457
  }
3527
3458
 
3528
3459
  interface IExpansionMsgContent {
@@ -3546,17 +3477,62 @@ interface IExpansionMsgContent {
3546
3477
  removeAll?: number;
3547
3478
  }
3548
3479
 
3549
- interface IConnectResult {
3480
+ /**
3481
+ * typing相关接口
3482
+ */
3483
+
3484
+ /**
3485
+ * typing信息
3486
+ */
3487
+ interface ITypingUser {
3488
+ userId: string;
3489
+ timestamp: number;
3490
+ messageType: string;
3491
+ }
3492
+ /**
3493
+ * 内存存储typing,key为conversationType_targetId
3494
+ */
3495
+ interface ITypingInfo {
3496
+ [key: string]: Array<ITypingUser>;
3497
+ }
3498
+ /**
3499
+ * typing通知消息接口
3500
+ */
3501
+ interface ITypingMessage {
3502
+ targetId: string;
3503
+ conversationType: ConversationType;
3504
+ channelId?: string;
3505
+ list: Array<ITypingUser>;
3506
+ }
3507
+
3508
+ interface IPluginGenerator<API, InitOption> {
3550
3509
  /**
3551
- * 连接错误码
3510
+ * 只读插件标识
3552
3511
  */
3553
- code: ErrorCode;
3512
+ readonly tag: string;
3554
3513
  /**
3555
- * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
3514
+ * 版本号
3556
3515
  */
3557
- userId?: string;
3516
+ readonly version?: string;
3517
+ /**
3518
+ * 插件名称
3519
+ */
3520
+ readonly name?: string;
3521
+ /**
3522
+ * 插件安装前的环境检测,通过返回 boolean 值确认插件是否可运行
3523
+ */
3524
+ verify(runtime: IRuntime): boolean;
3525
+ /**
3526
+ * 插件初始化
3527
+ * @param context 插件调用上下文,用于实现插件的消息注册、消息首发等
3528
+ * @param runtime 运行时实例,用于标识最终的运行时平台
3529
+ * @param options 初始化参数
3530
+ */
3531
+ setup(context: PluginContext, runtime: IRuntime, options: InitOption): API;
3558
3532
  }
3533
+
3559
3534
  declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
3535
+ declare type IMessagesListnenr = (messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean) => void;
3560
3536
  declare type IConnectionStatusListener = (status: ConnectionStatus) => void;
3561
3537
  declare type IConversationStateListener = (conversation: IUpdatedConversation[]) => void;
3562
3538
  declare type IChatroomListener = (state: IChatroomListenerData) => void;
@@ -3566,44 +3542,13 @@ declare type IRTCInnerListener = {
3566
3542
  };
3567
3543
  declare type IExpansionListener = (data: IExpansionListenerData) => void;
3568
3544
  declare type ITagListener = () => void;
3569
- declare type IConversationTagListener = () => void;
3545
+ declare type IConversationTagListener = (conversationType: ConversationType, targetId: string, conversationTags: {
3546
+ tags: ILocalTagStatus;
3547
+ }) => void;
3570
3548
  declare type ItypingStateListener = (data: ITypingMessage[]) => void;
3571
- declare type IMessageDeliveredListener = (data: IMessageDeliver[]) => void;
3572
- interface ISendExMsgOptions {
3573
- channelId: string;
3574
- conversationType: ConversationType;
3575
- targetId: string;
3576
- /**
3577
- * 消息 ID
3578
- */
3579
- messageUId: string;
3580
- /**
3581
- * 原始消息是否支持扩展的字段
3582
- */
3583
- canIncludeExpansion: boolean;
3584
- /**
3585
- * 删除的 keys
3586
- */
3587
- keys?: string[];
3588
- /**
3589
- * 扩展对象
3590
- */
3591
- expansion?: {
3592
- [key: string]: string;
3593
- };
3594
- /**
3595
- * 是否删除所有扩展
3596
- */
3597
- removeAll?: boolean;
3598
- /**
3599
- * 原始消息的扩展
3600
- */
3601
- originExpansion?: {
3602
- [key: string]: string;
3603
- } | null;
3604
- }
3605
3549
  interface IWatcher {
3606
3550
  message?: IMessageListnenr;
3551
+ batchMessage?: IMessagesListnenr;
3607
3552
  connectionState?: IConnectionStatusListener;
3608
3553
  conversationState?: IConversationStateListener;
3609
3554
  chatroomState?: IChatroomListener;
@@ -3624,39 +3569,16 @@ interface IWatcher {
3624
3569
  * 输入状态变更监听
3625
3570
  */
3626
3571
  typingState?: ItypingStateListener;
3627
- /**
3628
- * 是否拉取完毕添加通知
3629
- */
3630
3572
  pullFinished?: ITagListener;
3631
- /**
3632
- * 单聊消息送达通知
3633
- */
3634
- messageDelivered?: IMessageDeliveredListener;
3635
- }
3636
- interface IPluginGenerator<API, InitOption> {
3637
- /**
3638
- * 只读插件标识
3639
- */
3640
- readonly tag: string;
3641
- /**
3642
- * 版本号
3643
- */
3644
- readonly version?: string;
3645
- /**
3646
- * 插件名称
3647
- */
3648
- readonly name?: string;
3649
- /**
3650
- * 插件安装前的环境检测,通过返回 boolean 值确认插件是否可运行
3651
- */
3652
- verify(runtime: IRuntime): boolean;
3653
- /**
3654
- * 插件初始化
3655
- * @param context 插件调用上下文,用于实现插件的消息注册、消息首发等
3656
- * @param runtime 运行时实例,用于标识最终的运行时平台
3657
- * @param options 初始化参数
3658
- */
3659
- setup(context: PluginContext, runtime: IRuntime, options: InitOption): API;
3573
+ onConnecting?: () => void;
3574
+ onConnected?: () => void;
3575
+ onDisconnect?: () => void;
3576
+ onSuspend?: () => void;
3577
+ readReceiptReceived?: (conversation: IConversationOption, messageUId: string, sentTime: number) => void;
3578
+ messageReceiptRequest?: (conversation: IConversationOption, messageUId: string) => void;
3579
+ messageReceiptResponse?: (conversation: IConversationOption, messageUId: string, sender: {
3580
+ [responseUserIdList: string]: number;
3581
+ }) => void;
3660
3582
  }
3661
3583
  interface IAPIContextOption {
3662
3584
  /**
@@ -3717,6 +3639,24 @@ interface IAPIContextOption {
3717
3639
  */
3718
3640
  checkCA?: boolean;
3719
3641
  }
3642
+
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
+
3720
3660
  declare class APIContext {
3721
3661
  private _runtime;
3722
3662
  private static _context?;
@@ -3763,7 +3703,12 @@ declare class APIContext {
3763
3703
  * @param message
3764
3704
  */
3765
3705
  private _connectionStatusListener;
3706
+ _handleConnecting(): void;
3707
+ _handleConnected(): void;
3708
+ _handleDisconnect(): void;
3709
+ _handleSuspend(): void;
3766
3710
  private _messageReceiver;
3711
+ _batchMessageReceiver(messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean): void;
3767
3712
  /**
3768
3713
  * 聊天室相关信息监听
3769
3714
  */
@@ -3785,8 +3730,7 @@ declare class APIContext {
3785
3730
  */
3786
3731
  private _conversationTagListener;
3787
3732
  private _typingStatusListener;
3788
- private _pullFinishedListener;
3789
- private _messageDeliveredListerer;
3733
+ private _pullFinishedLister;
3790
3734
  /**
3791
3735
  * rtc 数据变更通知 pluginContext
3792
3736
  */
@@ -3800,6 +3744,7 @@ declare class APIContext {
3800
3744
  * @param options
3801
3745
  */
3802
3746
  assignWatcher(watcher: IWatcher): void;
3747
+ resetWatcher(): void;
3803
3748
  /**
3804
3749
  * 向内存中添加 typing 信息
3805
3750
  * 添加 typing 时不触发通知,只有在轮询时间点校验 _typingChangedList 的长度大于 0 时才通知
@@ -3817,6 +3762,7 @@ declare class APIContext {
3817
3762
  getDeviceId(): string;
3818
3763
  getCurrentUserId(): string;
3819
3764
  getConnectionStatus(): ConnectionStatus;
3765
+ get token(): string;
3820
3766
  /**
3821
3767
  * 建立连接,连接失败则抛出异常,连接成功后返回用户 userId,否则返回相应的错误码
3822
3768
  * @param token
@@ -3979,6 +3925,7 @@ declare class APIContext {
3979
3925
  * @param entry 属性信息
3980
3926
  */
3981
3927
  setChatroomEntry(roomId: string, entry: IChatroomEntry): Promise<ErrorCode>;
3928
+ setChatroomEntries(roomId: string, entryOptions: IChatroomEntries): Promise<ErrorCode>;
3982
3929
  /**
3983
3930
  * 在指定聊天室中强制增加 / 修改任意聊天室属性
3984
3931
  * @description 仅聊天室中不存在此属性或属性设置者为己方时可设置成功
@@ -3993,6 +3940,13 @@ declare class APIContext {
3993
3940
  * @param entry 要移除的属性信息
3994
3941
  */
3995
3942
  removeChatroomEntry(roomId: string, entry: IRemoveChatRoomEntryOption): Promise<ErrorCode>;
3943
+ /**
3944
+ * 批量删除聊天室属性
3945
+ * @description 该方法仅限于删除自己设置的聊天室属性
3946
+ * @param roomId 聊天室房间 id
3947
+ * @param entry 要移除的属性信息
3948
+ */
3949
+ removeChatroomEntries(roomId: string, entryOptions: IRemoveChatRoomEntriesOption): Promise<ErrorCode>;
3996
3950
  /**
3997
3951
  * 强制删除任意聊天室属性
3998
3952
  * @description 该方法仅限于删除自己设置的聊天室属性
@@ -4216,21 +4170,13 @@ declare class APIContext {
4216
4170
  list: IReceivedMessage[];
4217
4171
  hasMore: boolean;
4218
4172
  }>>;
4219
- /**
4220
- * 获取群组消息送达信息
4221
- */
4222
- getGroupMessageDeliverList(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IGroupMessageDeliverInfo>;
4223
- /**
4224
- * 获取单聊消息送达信息
4225
- */
4226
- getPrivateMessageDeliverTime(messageUId: string, channelId?: string): IPromiseResult<IDeliveredUser | null>;
4227
4173
  /**
4228
4174
  * 加入房间
4229
4175
  * @param roomId
4230
4176
  * @param mode 房间模式:直播 or 会议
4231
4177
  * @param mediaType 直播房间模式下的媒体资源类型
4232
4178
  */
4233
- joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number, joinType?: RTCJoinType): Promise<IAsyncRes<IJoinRTCRoomData>>;
4179
+ joinRTCRoom(roomId: string, mode: RTCMode, mediaType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4234
4180
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
4235
4181
  rtcPing(roomId: string, mode: number, mediaType?: number): Promise<ErrorCode>;
4236
4182
  getRTCRoomInfo(roomId: string): Promise<IAsyncRes<IRTCRoomInfo>>;
@@ -4246,7 +4192,6 @@ declare class APIContext {
4246
4192
  name: string;
4247
4193
  content: string;
4248
4194
  }, valueInfo: string, objectName: string, mcuValInfo?: string): Promise<ErrorCode>;
4249
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4250
4195
  getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): Promise<IAsyncRes<KVString>>;
4251
4196
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
4252
4197
  name: string;
@@ -4271,14 +4216,77 @@ declare class APIContext {
4271
4216
  * 直播身份切换
4272
4217
  */
4273
4218
  rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4219
+ }
4220
+
4221
+ declare class PluginContext {
4222
+ protected readonly _context: APIContext;
4223
+ constructor(_context: APIContext);
4224
+ /**
4225
+ * 接收 IM 服务推送的消息,并通过返回 boolean 值决定此消息是否拦截
4226
+ * @param message
4227
+ * @returns 当返回值为 true,接收的消息将终止继续传递
4228
+ */
4229
+ onmessage?(message: IReceivedMessage): boolean;
4230
+ /**
4231
+ * 用户主动断开连接的事件通知
4232
+ */
4233
+ ondisconnect?(): void;
4274
4234
  /**
4275
- * 获取加入 RTC 房间的用户信息(当前仅能查自己的)
4235
+ * 接收 IM 连接状态变更通知
4236
+ * @param status
4237
+ */
4238
+ onconnectionstatechange?(status: ConnectionStatus): void;
4239
+ /**
4240
+ * IM 客户端销毁通知
4241
+ */
4242
+ ondestroy?(): void;
4243
+ /**
4244
+ * RTC 数据通知
4245
+ * @param roomdId 数据对应的房间 Id
4246
+ * @param data 通知数据为 key:value 方式
4247
+ * @description
4248
+ * 目前仅通知:主播加入、退出房间的人员列表变更,发布、取消发布资源列表变更
4249
+ */
4250
+ onrtcdatachange?(data: IServerRTCRoomEntry[], roomdId?: string): void;
4251
+ /**
4252
+ * 获取 `@rongcloud/engine` 包版本
4253
+ */
4254
+ getCoreVersion(): string;
4255
+ /**
4256
+ * 获取当前运行中的 IMLib 版本号
4257
+ */
4258
+ getAPIVersion(): string;
4259
+ /**
4260
+ * 获取当前应用的 appkey
4261
+ */
4262
+ getAppkey(): string;
4263
+ /**
4264
+ * 获取当前已连接用户的 userId
4265
+ * 用户连接建立之前及 disconnect 之后,该方法返回 '' 值
4266
+ */
4267
+ getCurrentId(): string;
4268
+ /**
4269
+ * 获取当前连接状态
4270
+ */
4271
+ getConnectionStatus(): ConnectionStatus;
4272
+ getDeviceId(): string;
4273
+ /**
4274
+ * 发送消息
4275
+ */
4276
+ sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
4277
+ /**
4278
+ * 消息注册
4279
+ * @description 消息注册需在应用初始化完成前进行
4280
+ * @param objectName 消息类型,如:RC:TxtMsg
4281
+ * @param isPersited 是否存储
4282
+ * @param isCounted 是否技术
4283
+ * @param searchProps 搜索字段,只在搭配协议栈使用时有效
4276
4284
  */
4277
- getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
4285
+ registerMessageType(objectName: string, isPersited: boolean, isCounted: boolean, searchProps?: string[]): void;
4278
4286
  /**
4279
- * 拉取 RTC 全量 KV
4287
+ * 获取服务时间
4280
4288
  */
4281
- pullRTCRoomEntry(roomId: string, timestamp: number): Promise<IAsyncRes<IChrmKVPullData>>;
4289
+ getServerTime(): number;
4282
4290
  }
4283
4291
 
4284
4292
  declare class RTCPluginContext extends PluginContext {
@@ -4293,7 +4301,7 @@ declare class RTCPluginContext extends PluginContext {
4293
4301
  * @param mode 房间模式:直播 or 会议
4294
4302
  * @param broadcastType
4295
4303
  */
4296
- joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType): IPromiseResult<IJoinRTCRoomData>;
4304
+ joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
4297
4305
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
4298
4306
  rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
4299
4307
  getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
@@ -4333,22 +4341,6 @@ declare class RTCPluginContext extends PluginContext {
4333
4341
  * mcu 合流发布内容,是一个 JSON 字符串,解析类型为 {mediaType: number, msid: string, uri: string}[]
4334
4342
  */
4335
4343
  mcuValInfo?: string): Promise<ErrorCode>;
4336
- /**
4337
- * 设置 cdn_uris 扩散
4338
- * @param objectName 全量 URI 消息名,即 `RCRTC:TotalContentResources`
4339
- * @param CDNUris cdn_uris 扩散字段
4340
- * {
4341
- "broadcast":0,
4342
- "fps":25,
4343
- "h":640,
4344
- "pull_safe":true,
4345
- "push_mode":1,
4346
- "url":"https://rtc-media-api-service-ucbj2-01.rongcloud.net/api/rtc/cdn/player",
4347
- "w":360,
4348
- "enableInnerCDN":true
4349
- }[]
4350
- */
4351
- setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4352
4344
  getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
4353
4345
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
4354
4346
  name: string;
@@ -4373,10 +4365,6 @@ declare class RTCPluginContext extends PluginContext {
4373
4365
  * 直播身份切换
4374
4366
  */
4375
4367
  rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
4376
- /**
4377
- * 拉取 RTC 全量 KV
4378
- */
4379
- pullRTCRoomEntry(roomId: string, timestamp: number): IPromiseResult<IChrmKVPullData>;
4380
4368
  }
4381
4369
 
4382
4370
  declare abstract class ANavi {
@@ -4413,19 +4401,20 @@ interface IEngineWatcher {
4413
4401
  * @param leftCount 参数废弃,值始终为 undefined
4414
4402
  * @param hasMore 消息是否收取结束,需与协议栈配合使用
4415
4403
  */
4416
- message: (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
4404
+ batchMessage: (messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean) => void;
4417
4405
  status: (status: ConnectionStatus) => void;
4418
4406
  chatroom: (event: IChatroomListenerData) => void;
4419
4407
  conversation: (event: any) => void;
4420
4408
  expansion: (event: IExpansionListenerData) => void;
4421
4409
  tag: () => void;
4422
- conversationTag: () => void;
4410
+ conversationTag: (conversationType: ConversationType, targetId: string, conversationTags: {
4411
+ tags: ILocalTagStatus;
4412
+ }) => void;
4423
4413
  /**
4424
4414
  * RTC 数据变更
4425
4415
  */
4426
4416
  onRTCDataChange: (data: IServerRTCRoomEntry[], roomId?: string) => void;
4427
4417
  pullFinished: () => void;
4428
- messageDelivered: (data: IMessageDeliver[]) => void;
4429
4418
  }
4430
4419
  /**
4431
4420
  * 引擎定义
@@ -4677,6 +4666,10 @@ declare abstract class AEngine implements IEngine {
4677
4666
  * 设置聊天室属性
4678
4667
  */
4679
4668
  abstract setChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4669
+ /**
4670
+ * 批量设置聊天室属性
4671
+ */
4672
+ abstract setChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<ErrorCode>;
4680
4673
  /**
4681
4674
  * 强制设置聊天室属性
4682
4675
  */
@@ -4685,6 +4678,10 @@ declare abstract class AEngine implements IEngine {
4685
4678
  * 删除聊天室属性
4686
4679
  */
4687
4680
  abstract removeChatroomEntry(chatroomId: string, entry: IChrmKVEntry): Promise<ErrorCode>;
4681
+ /**
4682
+ * 批量删除聊天室属性
4683
+ */
4684
+ abstract removeChatroomEntries(chatroomId: string, entry: IChrmKVEntries): Promise<ErrorCode>;
4688
4685
  /**
4689
4686
  * 强制删除聊天室属性
4690
4687
  */
@@ -4897,15 +4894,7 @@ declare abstract class AEngine implements IEngine {
4897
4894
  list: IReceivedMessage[];
4898
4895
  hasMore: boolean;
4899
4896
  }>;
4900
- /**
4901
- * 获取群组消息送达列表
4902
- */
4903
- abstract getGroupMessageDeliverList(targetId: string, messageUId: string, channelId: string): IPromiseResult<IGroupMessageDeliverInfo>;
4904
- /**
4905
- * 获取单聊消息送达列表
4906
- */
4907
- abstract getPrivateMessageDeliverTime(messageUId: string, channelId: string): IPromiseResult<IDeliveredUser | null>;
4908
- abstract joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType): IPromiseResult<IJoinRTCRoomData>;
4897
+ abstract joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number): IPromiseResult<IJoinRTCRoomData>;
4909
4898
  abstract quitRTCRoom(roomId: string): Promise<ErrorCode>;
4910
4899
  abstract rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
4911
4900
  abstract getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
@@ -4943,9 +4932,6 @@ declare abstract class AEngine implements IEngine {
4943
4932
  }>>;
4944
4933
  abstract quitLivingRoomAsAudience(roomId: string): Promise<ErrorCode>;
4945
4934
  abstract rtcIdentityChange(roomId: string, changeType: RTCIdentityChangeType, broadcastType?: number): Promise<IAsyncRes<IJoinRTCRoomData>>;
4946
- abstract getRTCJoinedUserInfo(userId: string): Promise<IAsyncRes<IRTCJoinedInfo[]>>;
4947
- abstract setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
4948
- abstract pullRTCRoomEntry(roomId: string, timestamp: number): Promise<IAsyncRes<IChrmKVPullData>>;
4949
4935
  }
4950
4936
 
4951
4937
  declare class AppStorage {
@@ -5396,4 +5382,4 @@ declare enum CONNECTION_TYPE {
5396
5382
  */
5397
5383
  declare const version: string;
5398
5384
 
5399
- export { AEngine, ANavi, APIContext, AppStorage, AssertRules, CONNECTION_TYPE, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, CometChannel, ConnectResultCode, ConnectionStatus, ConversationType, DelayTimer, ErrorCode, EventEmitter, FileType, HttpMethod, IAPIContextOption, IAsyncRes, IChatroomEntry, IChatroomInfo, IChatroomListener, IChatroomListenerData, 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, IMessageDeliver, IMessageDeliveredListener, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IPluginGenerator, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, 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, 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 };
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 };