@rongcloud/engine 5.5.4 → 5.5.5-beem-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  /**
2
2
  * 会话类型
3
+ * @category Enum
3
4
  */
4
5
  declare enum ConversationType {
5
6
  /**
@@ -53,6 +54,7 @@ declare enum ConversationType {
53
54
  */
54
55
  /**
55
56
  * 会话标签
57
+ * @category Interface
56
58
  */
57
59
  interface IConversationTag {
58
60
  tagId: string;
@@ -62,6 +64,7 @@ interface IConversationTag {
62
64
  }
63
65
  /**
64
66
  * 标签参数
67
+ * @category Interface
65
68
  */
66
69
  interface ITagParam {
67
70
  tagId: string;
@@ -69,22 +72,30 @@ interface ITagParam {
69
72
  }
70
73
  /**
71
74
  * 标签状态
75
+ * @category Interface
72
76
  */
73
77
  interface ITagStatus {
74
78
  isTop?: boolean;
75
79
  }
76
80
  /**
77
81
  * 本地存储会话的标签状态
82
+ * @category Interface
78
83
  */
79
84
  interface ILocalTagStatus {
80
85
  [tagId: string]: ITagStatus;
81
86
  }
87
+ /**
88
+ * @category Interface
89
+ */
82
90
  interface ITagInfo {
83
91
  tagId: string;
84
92
  tagName: string;
85
93
  conversationCount: number;
86
94
  createdTime?: number;
87
95
  }
96
+ /**
97
+ * @category Enum
98
+ */
88
99
  declare enum TagChangeType {
89
100
  add = 1,
90
101
  update = 2,
@@ -277,7 +288,6 @@ declare abstract class BaseWriter {
277
288
  getHeaderFlag(): number;
278
289
  getLengthSize(): number;
279
290
  getBufferData(): Int8Array;
280
- getCometData(): string;
281
291
  }
282
292
  declare class RetryableReader extends BaseReader {
283
293
  messageId: number;
@@ -356,6 +366,7 @@ declare enum OperateStatus {
356
366
 
357
367
  /**
358
368
  * 文件类型
369
+ * @category Enum
359
370
  */
360
371
  declare enum FileType {
361
372
  /**
@@ -384,6 +395,10 @@ declare enum FileType {
384
395
  COMBINE_HTML = 6
385
396
  }
386
397
 
398
+ /**
399
+ * 消息方向
400
+ * @category Enum
401
+ */
387
402
  declare enum MessageDirection {
388
403
  /**
389
404
  * 己方发送消息
@@ -402,6 +417,10 @@ declare enum MessageDirection {
402
417
  * 备注:iOS 与 Android 错误码一致。Web 与移动端一致的错误码,也用此片段,比如 34008 (消息不支持扩展)
403
418
  * 35001 ~ 39999 为 Web 端错误码 备注:由于 Web IM 历史版本 35xxx 36xxx 37xxx 38xxx 39xxxx 都占用过,所以错误码段范围较大
404
419
  */
420
+ /**
421
+ * 错误码
422
+ * @category Enum
423
+ */
405
424
  declare enum ErrorCode {
406
425
  /** 超时 */
407
426
  TIMEOUT = -1,
@@ -645,6 +664,15 @@ declare enum ErrorCode {
645
664
  * token平台验证失败
646
665
  */
647
666
  RC_PLATFORM_ERROR = 31028,
667
+ /**
668
+ * 用户账号已销户
669
+ * @desc 请检查您使用的 Token 是否正确,以及对应的 UserId 是否被销户
670
+ */
671
+ RC_CONN_USER_LOGOUT = 31029,
672
+ /**
673
+ * 证书过期,SDK不会重连
674
+ */
675
+ RC_LICENSE_EXPIRED = 31030,
648
676
  /**
649
677
  * 协议层内部错误。query,上传下载过程中数据错误。
650
678
  */
@@ -987,6 +1015,10 @@ declare enum ConnectionStatus {
987
1015
  * 重定向
988
1016
  */
989
1017
  REDIRECT = 14,
1018
+ /**
1019
+ * 用户账号已销户,不再进行连接
1020
+ */
1021
+ USER_LOGOUT = 19,
990
1022
  /**
991
1023
  * appkey 不正确
992
1024
  */
@@ -1014,9 +1046,17 @@ declare enum ConnectionStatus {
1014
1046
  /**
1015
1047
  * 请求导航超时
1016
1048
  */
1017
- RESPONSE_NAVI_TIMEOUT = 204
1049
+ RESPONSE_NAVI_TIMEOUT = 204,
1050
+ /**
1051
+ * 证书过期,SDK不会重连
1052
+ */
1053
+ RC_LICENSE_EXPIRED = 31030
1018
1054
  }
1019
1055
 
1056
+ /**
1057
+ * 消息接受状态
1058
+ * @category Enum
1059
+ */
1020
1060
  declare enum ReceivedStatus {
1021
1061
  /**
1022
1062
  * 已读
@@ -1120,6 +1160,10 @@ declare const ConnectResultCode: {
1120
1160
  * token平台验证失败
1121
1161
  */
1122
1162
  PLATFORM_ERROR: number;
1163
+ /**
1164
+ * 用户账号已销户,不再进行连接
1165
+ */
1166
+ USER_LOGOUT: number;
1123
1167
  };
1124
1168
 
1125
1169
  /**
@@ -1206,6 +1250,14 @@ declare enum MessageType {
1206
1250
  * 接受群已读回执更新消息(导航开关grpRRVer为1时使用)
1207
1251
  */
1208
1252
  GROUP_READ_RECEIPT_REQUEST = "RC:RRMsg",
1253
+ /**
1254
+ * 消息送达报告,仅单聊
1255
+ */
1256
+ DELIVERED = "RC:Delivered",
1257
+ /**
1258
+ * 消息送达状态报告,仅群聊
1259
+ */
1260
+ DELIVERED_MSG = "RC:DRMsg",
1209
1261
  /**
1210
1262
  * 用户加入聊天室
1211
1263
  */
@@ -1230,6 +1282,7 @@ declare enum MessageType {
1230
1282
 
1231
1283
  /**
1232
1284
  * @deprecated 已废弃,请使用 NotificationLevel
1285
+ * @category Enum
1233
1286
  */
1234
1287
  declare enum NotificationStatus {
1235
1288
  /**
@@ -1243,7 +1296,9 @@ declare enum NotificationStatus {
1243
1296
  }
1244
1297
 
1245
1298
  /**
1299
+ * 免打扰级别
1246
1300
  * @desc 原: NotificationStatus 已废弃
1301
+ * @category Enum
1247
1302
  */
1248
1303
  declare enum NotificationLevel {
1249
1304
  /**
@@ -1277,6 +1332,7 @@ declare enum NotificationLevel {
1277
1332
 
1278
1333
  /**
1279
1334
  * 群组 @ 类型
1335
+ * @category Enum
1280
1336
  */
1281
1337
  declare enum MentionedType {
1282
1338
  /**
@@ -1295,6 +1351,10 @@ interface IMetionedData {
1295
1351
  mentionedContent?: string;
1296
1352
  }
1297
1353
 
1354
+ /**
1355
+ * 上传方法
1356
+ * @category Enum
1357
+ */
1298
1358
  declare enum UploadMethod {
1299
1359
  /**
1300
1360
  * 七牛上传
@@ -1316,12 +1376,17 @@ declare enum UploadMethod {
1316
1376
 
1317
1377
  /**
1318
1378
  * 聊天室 kv 存储操作类型. 对方操作, 己方收到消息(RC:chrmKVNotiMsg)中会带入此值. 根据此值判断是删除还是更新
1379
+ * @category Enum
1319
1380
  */
1320
1381
  declare enum ChatroomEntryType {
1321
1382
  UPDATE = 1,
1322
1383
  DELETE = 2
1323
1384
  }
1324
1385
 
1386
+ /**
1387
+ * 日志级别
1388
+ * @category Enum
1389
+ */
1325
1390
  declare enum LogLevel {
1326
1391
  LOG = 0,
1327
1392
  DEBUG = 0,
@@ -1343,7 +1408,10 @@ declare enum LogSource {
1343
1408
  declare enum LogTagId {
1344
1409
  L_IMSDK_VER_O = "L-imsdk_ver-O",
1345
1410
  A_INIT_O = "A-init-O",
1411
+ A_INIT_REPEAT_O = "A_INIT_REPEAT_O",
1346
1412
  L_INIT_O = "L-init-O",
1413
+ A_DESTROY_O = "A_DESTROY_O",
1414
+ L_DESTROY_O = "L_DESTROY_O",
1347
1415
  P_INIT_O = "P-init-O",
1348
1416
  A_CONNECT_T = "A-connect-T",
1349
1417
  A_CONNECT_R = "A-connect-R",
@@ -1399,6 +1467,7 @@ declare enum LogTagId {
1399
1467
  L_MEDIA_UPLOAD_T = "L-media_upload-T",
1400
1468
  L_MEDIA_UPLOAD_R = "L-media_upload-R",
1401
1469
  G_UPLOAD_LOG_S = "G-upload_log-S",
1470
+ G_REPORT_LOG_S = "G-report_log-S",
1402
1471
  G_UPLOAD_LOG_E = "G-upload_log-E",
1403
1472
  G_GET_REAL_TIMELOG_COMMAND_S = "G-get_real_timelog_command-S",
1404
1473
  L_CHECK_ALIVE_IM_T = "L-check_alive_im-T",
@@ -1423,6 +1492,7 @@ declare enum LogTagId {
1423
1492
 
1424
1493
  /**
1425
1494
  * 聊天室成员进入和退出状态
1495
+ * @category Enum
1426
1496
  */
1427
1497
  declare enum ChatroomUserChangeType {
1428
1498
  QUIT = 0,
@@ -1431,6 +1501,7 @@ declare enum ChatroomUserChangeType {
1431
1501
 
1432
1502
  /**
1433
1503
  * 消息被拦截类型
1504
+ * @category Enum
1434
1505
  */
1435
1506
  declare enum MessageBlockType {
1436
1507
  /**
@@ -1496,6 +1567,18 @@ declare enum RTCMode {
1496
1567
  * 直播模式
1497
1568
  */
1498
1569
  LIVE = 2,
1570
+ /**
1571
+ *sip呼叫
1572
+ */
1573
+ SIP = 4,
1574
+ /**
1575
+ * 呼叫模式.包括单呼和群呼
1576
+ */
1577
+ CALL = 5,
1578
+ /**
1579
+ * 会议
1580
+ */
1581
+ MEETING = 6,
1499
1582
  /**
1500
1583
  * 跨应用多人房间
1501
1584
  */
@@ -1566,6 +1649,10 @@ declare enum RTCJoinType {
1566
1649
  COEXIST = 2
1567
1650
  }
1568
1651
 
1652
+ /**
1653
+ * 会话属性
1654
+ * @category Interface
1655
+ */
1569
1656
  interface IConversationOption {
1570
1657
  conversationType: ConversationType;
1571
1658
  targetId: string;
@@ -1658,6 +1745,9 @@ interface IClearMsgOption {
1658
1745
  timestamp?: number;
1659
1746
  }
1660
1747
 
1748
+ /**
1749
+ * @category Interface
1750
+ */
1661
1751
  interface IGooglePushConfig {
1662
1752
  /**
1663
1753
  * 分组ID
@@ -1672,6 +1762,9 @@ interface IGooglePushConfig {
1672
1762
  */
1673
1763
  priority?: 'high' | 'normal';
1674
1764
  }
1765
+ /**
1766
+ * @category Interface
1767
+ */
1675
1768
  interface IiOSPushConfig {
1676
1769
  /**
1677
1770
  * iOS 用于通知分组的 id
@@ -1690,6 +1783,9 @@ interface IiOSPushConfig {
1690
1783
  */
1691
1784
  richMediaUri?: string;
1692
1785
  }
1786
+ /**
1787
+ * @category Interface
1788
+ */
1693
1789
  interface IAndroidPushConfig {
1694
1790
  /**
1695
1791
  * Android 的通知 id
@@ -1716,6 +1812,10 @@ interface IAndroidPushConfig {
1716
1812
  */
1717
1813
  googleConfig?: IGooglePushConfig;
1718
1814
  }
1815
+ /**
1816
+ * 推送配置
1817
+ * @category Interface
1818
+ */
1719
1819
  interface IPushConfig {
1720
1820
  /**
1721
1821
  * 推送标题
@@ -1759,11 +1859,15 @@ interface IPushConfig {
1759
1859
 
1760
1860
  /**
1761
1861
  * 已读回执数据结构
1862
+ * @category Interface
1762
1863
  */
1763
1864
  interface IMessageReader {
1764
1865
  readTime: number;
1765
1866
  userId: string;
1766
1867
  }
1868
+ /**
1869
+ * @category Interface
1870
+ */
1767
1871
  interface IMessageReaderResponse {
1768
1872
  totalMemberCount: number;
1769
1873
  list: IMessageReader[];
@@ -1776,6 +1880,9 @@ interface ILocalReadReceiptInfo {
1776
1880
  readCount?: number;
1777
1881
  totalCount?: number;
1778
1882
  }
1883
+ /**
1884
+ * @category Interface
1885
+ */
1779
1886
  interface IReadReceiptInfo {
1780
1887
  /**
1781
1888
  * 是否已经发送已读回执
@@ -1796,6 +1903,7 @@ interface IReadReceiptInfo {
1796
1903
  }
1797
1904
  /**
1798
1905
  * 从服务端接收到的消息数据
1906
+ * @category Interface
1799
1907
  */
1800
1908
  interface IReceivedMessage {
1801
1909
  /**
@@ -1918,6 +2026,9 @@ interface IReceivedMessage {
1918
2026
  */
1919
2027
  channelType?: UltraGroupChannelType;
1920
2028
  }
2029
+ /**
2030
+ * @category Interface
2031
+ */
1921
2032
  interface IUserProfile {
1922
2033
  /**
1923
2034
  * 用户 ID
@@ -2241,6 +2352,7 @@ interface IUltraMsgQueryOptions {
2241
2352
  }
2242
2353
  /**
2243
2354
  * 被拦截的消息信息
2355
+ * @category Interface
2244
2356
  */
2245
2357
  interface IBlockedMessageInfo {
2246
2358
  blockedMessageUId: string;
@@ -2307,8 +2419,178 @@ declare const DelayTimer: {
2307
2419
  getTime: () => number;
2308
2420
  };
2309
2421
 
2422
+ declare enum HttpMethod {
2423
+ GET = "GET",
2424
+ POST = "POST"
2425
+ }
2426
+ interface IRequest {
2427
+ url: string;
2428
+ /**
2429
+ * @default `HttpMethod.GET`
2430
+ */
2431
+ method?: HttpMethod | 'GET' | 'POST';
2432
+ /**
2433
+ * 查询数据
2434
+ */
2435
+ query?: {
2436
+ [key: string]: string | number | null;
2437
+ };
2438
+ /**
2439
+ * Request Header 信息
2440
+ */
2441
+ headers?: {
2442
+ [key: string]: string;
2443
+ };
2444
+ /**
2445
+ * Request Body 数据
2446
+ */
2447
+ body?: Object | string;
2448
+ /**
2449
+ * 超时设置,默认 `60s`
2450
+ */
2451
+ timeout?: number;
2452
+ /**
2453
+ * 【Alipay-Only】
2454
+ * 期望返回的数据格式,如果为 json 则返回后会对返回的数据进行一次 JSON.parse
2455
+ */
2456
+ dataType?: 'json' | 'text' | 'base64' | 'arraybuffer';
2457
+ }
2458
+ interface IStorage {
2459
+ setItem(key: string, value: string): void;
2460
+ getItem(key: string): string | null;
2461
+ removeItem(key: string): void;
2462
+ clear(): void;
2463
+ }
2464
+ interface IResponse {
2465
+ status: number;
2466
+ data?: string;
2467
+ }
2468
+ /**
2469
+ * 网络状态枚举
2470
+ */
2471
+ declare enum NetworkType {
2472
+ WIFI = "wifi",
2473
+ FOUR_G = "4g",
2474
+ THREE_G = "3g",
2475
+ TWO_G = "2g",
2476
+ FIVE_G = "2g",
2477
+ THREE_GENT = "3gnet",
2478
+ UNKONWN = "unknown"
2479
+ }
2480
+ interface IWebSocket {
2481
+ /**
2482
+ * 监听连接建立事件,此时 WebSocket 实例已准备好收发数据
2483
+ * @param callback
2484
+ */
2485
+ onOpen(callback: () => void): void;
2486
+ /**
2487
+ * 监听连接关闭事件
2488
+ * @param callback
2489
+ */
2490
+ onClose(callback: (code?: number, reason?: string) => void): void;
2491
+ /**
2492
+ * 监听接收服务器消息事件
2493
+ * @param callback
2494
+ */
2495
+ onMessage(callback: (data: string | ArrayBuffer) => void): void;
2496
+ /**
2497
+ * 监听链接错误事件
2498
+ * @param callback
2499
+ */
2500
+ onError(callback: (error: unknown) => void): void;
2501
+ /**
2502
+ * 向服务器发送数据
2503
+ * @param data
2504
+ */
2505
+ send(data: ArrayBuffer | string): void;
2506
+ /**
2507
+ * 关闭连接
2508
+ * @param code
2509
+ * @param reason
2510
+ */
2511
+ close(code?: number, reason?: string): void;
2512
+ }
2513
+ /**
2514
+ * 平台运行时抽象
2515
+ */
2516
+ interface IRuntime {
2517
+ /**
2518
+ * 平台标识
2519
+ */
2520
+ tag: string;
2521
+ /**
2522
+ * 发送 http 请求
2523
+ * @param options
2524
+ */
2525
+ httpReq(options: IRequest): Promise<IResponse>;
2526
+ /**
2527
+ * 是否使用导航
2528
+ */
2529
+ useNavi: boolean;
2530
+ /**
2531
+ * websocket 地址上附加的平台字段
2532
+ */
2533
+ connectPlatform: string;
2534
+ /**
2535
+ * websocket 地址上 apiVer 字段,代表代码是否来源于 uniapp
2536
+ */
2537
+ isFromUniapp: boolean;
2538
+ /**
2539
+ * 创建长连接实例
2540
+ */
2541
+ createWebSocket?(url: string, protocols?: string[]): IWebSocket;
2542
+ /**
2543
+ * 存储模块
2544
+ */
2545
+ localStorage: IStorage;
2546
+ /**
2547
+ * 在某些非浏览器平台,其等同于 localStorage
2548
+ */
2549
+ sessionStorage: IStorage;
2550
+ /**
2551
+ * 获取网络状态
2552
+ * 2g 3g 4g wifi unkown
2553
+ */
2554
+ getNetworkType(): Promise<NetworkType>;
2555
+ }
2556
+
2557
+ /**
2558
+ * @category Interface
2559
+ */
2560
+ interface IAsyncRes<T = void> {
2561
+ /**
2562
+ * Promise 执行结果
2563
+ */
2564
+ code: ErrorCode;
2565
+ /**
2566
+ * 结果数据
2567
+ */
2568
+ data?: T;
2569
+ /**
2570
+ * 错误消息
2571
+ */
2572
+ msg?: string;
2573
+ }
2574
+ /**
2575
+ * 异步任务结果定义
2576
+ * @description
2577
+ * 通过 `Promise.resolve` 来处理预期内的异常,进而通过 Uncatch Promise Error 暴露预期外的异常
2578
+ */
2579
+ declare type IPromiseResult<T = void> = Promise<IAsyncRes<T>>;
2580
+ interface IConnectResult {
2581
+ /**
2582
+ * 连接错误码
2583
+ */
2584
+ code: ErrorCode;
2585
+ /**
2586
+ * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
2587
+ */
2588
+ userId?: string;
2589
+ }
2590
+
2310
2591
  /**
2311
2592
  * 从服务器拉取到的会话数据结构
2593
+ * @category Interface
2312
2594
  */
2313
2595
  interface IReceivedConversation {
2314
2596
  /**
@@ -2377,6 +2659,9 @@ interface IReceivedConversation {
2377
2659
  versionTime?: number;
2378
2660
  unreadMentionedCount?: number;
2379
2661
  }
2662
+ /**
2663
+ * @category Interface
2664
+ */
2380
2665
  interface IReceivedConversationByTag extends IReceivedConversation {
2381
2666
  isTopInTag: boolean;
2382
2667
  }
@@ -2435,20 +2720,32 @@ interface IUpdatedConversation {
2435
2720
  */
2436
2721
  unreadMentionedCount?: number;
2437
2722
  }
2723
+ /**
2724
+ * @category Interface
2725
+ */
2438
2726
  interface IBaseConversationInfo {
2439
2727
  conversationType: ConversationType;
2440
2728
  targetId: string;
2441
2729
  channelId: string;
2442
2730
  }
2731
+ /**
2732
+ * @category Interface
2733
+ */
2443
2734
  interface IConversationState extends IBaseConversationInfo {
2444
2735
  unreadCount: number;
2445
2736
  unreadMentionedCount: number;
2446
2737
  }
2447
- /** 指定超级群会话传参 */
2738
+ /**
2739
+ * 指定超级群会话传参
2740
+ * @category Interface
2741
+ */
2448
2742
  interface IUltraGroupOption {
2449
2743
  targetId: string;
2450
2744
  channelId?: string;
2451
2745
  }
2746
+ /**
2747
+ * @category Interface
2748
+ */
2452
2749
  interface IGetUltraGroupListOption {
2453
2750
  targetId?: string;
2454
2751
  channelType?: UltraGroupChannelType;
@@ -2712,6 +3009,9 @@ interface INaviInfo {
2712
3009
  jwt?: string;
2713
3010
  }
2714
3011
 
3012
+ /**
3013
+ * @category Interface
3014
+ */
2715
3015
  interface IChatroomEntryListenerData {
2716
3016
  /**
2717
3017
  * 更新的键
@@ -2734,6 +3034,9 @@ interface IChatroomEntryListenerData {
2734
3034
  */
2735
3035
  type: ChatroomEntryType;
2736
3036
  }
3037
+ /**
3038
+ * @category Interface
3039
+ */
2737
3040
  interface IChatroomRejoinedFailed {
2738
3041
  /**
2739
3042
  * 自动重新加入的聊天室 ID
@@ -2744,6 +3047,9 @@ interface IChatroomRejoinedFailed {
2744
3047
  */
2745
3048
  errorCode: number;
2746
3049
  }
3050
+ /**
3051
+ * @category Interface
3052
+ */
2747
3053
  interface IChatroomRejoinedSuccessed {
2748
3054
  /**
2749
3055
  * 自动重新加入的聊天室 ID
@@ -2754,6 +3060,9 @@ interface IChatroomRejoinedSuccessed {
2754
3060
  */
2755
3061
  count: number;
2756
3062
  }
3063
+ /**
3064
+ * @category Interface
3065
+ */
2757
3066
  interface IChatroomUserChangeInfo {
2758
3067
  users: {
2759
3068
  [userId: string]: ChatroomUserChangeType;
@@ -2763,6 +3072,7 @@ interface IChatroomUserChangeInfo {
2763
3072
  declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
2764
3073
  /**
2765
3074
  * 聊天室信息
3075
+ * @category Interface
2766
3076
  */
2767
3077
  interface IChatroomListenerData {
2768
3078
  /**
@@ -2782,6 +3092,9 @@ interface IChatroomListenerData {
2782
3092
  */
2783
3093
  chatroomDestroyed?: string;
2784
3094
  }
3095
+ /**
3096
+ * @category Interface
3097
+ */
2785
3098
  interface IChatroomEntry {
2786
3099
  /**
2787
3100
  * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
@@ -2804,6 +3117,9 @@ interface IChatroomEntry {
2804
3117
  */
2805
3118
  isAutoDelete?: boolean;
2806
3119
  }
3120
+ /**
3121
+ * @category Interface
3122
+ */
2807
3123
  interface IChatroomUser {
2808
3124
  /**
2809
3125
  * 用户 id
@@ -2814,6 +3130,9 @@ interface IChatroomUser {
2814
3130
  */
2815
3131
  time: number;
2816
3132
  }
3133
+ /**
3134
+ * @category Interface
3135
+ */
2817
3136
  interface IChatroomInfo {
2818
3137
  /**
2819
3138
  * 成员列表
@@ -2825,6 +3144,9 @@ interface IChatroomInfo {
2825
3144
  */
2826
3145
  userCount: number;
2827
3146
  }
3147
+ /**
3148
+ * @category Interface
3149
+ */
2828
3150
  interface IRemoveChatroomEntry {
2829
3151
  /**
2830
3152
  * 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
@@ -2839,6 +3161,9 @@ interface IRemoveChatroomEntry {
2839
3161
  */
2840
3162
  notificationExtra?: string;
2841
3163
  }
3164
+ /**
3165
+ * @category Interface
3166
+ */
2842
3167
  interface IRemoveChatroomEntries {
2843
3168
  /**
2844
3169
  * key 属性名称, 支持英文字母、数字、+、=、-、_ 的组合方式, 最大长度 128 字符
@@ -2854,6 +3179,9 @@ interface IRemoveChatroomEntries {
2854
3179
  */
2855
3180
  notificationExtra?: string;
2856
3181
  }
3182
+ /**
3183
+ * @category Interface
3184
+ */
2857
3185
  interface IChatroomEntries {
2858
3186
  /**
2859
3187
  * entries ,要设置的属性列表
@@ -2881,6 +3209,9 @@ interface IChatroomEntries {
2881
3209
  isForce?: boolean;
2882
3210
  }
2883
3211
 
3212
+ /**
3213
+ * @category Interface
3214
+ */
2884
3215
  interface IUploadAuth {
2885
3216
  /**
2886
3217
  * 七牛 token 有效期
@@ -2903,282 +3234,108 @@ interface IUploadAuth {
2903
3234
  */
2904
3235
  path: string;
2905
3236
  /**
2906
- * 上传文件名,阿里上传获取下载地址时,必须使用上传文件名,所以需抛出到业务端
2907
- */
2908
- fileName: string;
2909
- /**
2910
- * 阿里云 oss 的 AccessKeyId
2911
- */
2912
- osskeyId: string;
2913
- /**
2914
- * 阿里云 oss post 请求表单域中的字段 policy
2915
- */
2916
- ossPolicy: string;
2917
- /**
2918
- * 阿里云 oss 根据 policy 计算的签名信息
2919
- */
2920
- ossSign: string;
2921
- /**
2922
- * 阿里云 oss 存储空间名称
2923
- */
2924
- ossBucketName: string;
2925
- /**
2926
- * s3 认证凭证,对应 post上传 x-amz-credential 字段
2927
- */
2928
- s3Credential: string;
2929
- /**
2930
- * 加密算法,对应 post上传 x-amz-algorithm 字段
2931
- */
2932
- s3Algorithm: string;
2933
- /**
2934
- * s3 日期,对应 post上传 x-amz-date 字段
2935
- */
2936
- s3Date: string;
2937
- /**
2938
- * s3 policy,对应 post上传 policy 字段
2939
- */
2940
- s3Policy: string;
2941
- /**
2942
- * s3 签名信息,对应 post上传 x-amz-signature 字段
2943
- */
2944
- s3Signature: string;
2945
- /**
2946
- * s3 存储空间名称
2947
- */
2948
- s3BucketName: string;
2949
- /**
2950
- * stc Authorization 头
2951
- */
2952
- stcAuthorization: string;
2953
- /**
2954
- * stc xAmzContentSha256
2955
- */
2956
- stcContentSha256: string;
2957
- /**
2958
- * stc date
2959
- */
2960
- stcDate: string;
2961
- /**
2962
- * stc 存储空间名称
2963
- */
2964
- stcBucketName: string;
2965
- }
2966
-
2967
- interface IRTCRoomInfo {
2968
- roomId: string;
2969
- roomData: unknown[];
2970
- userCount: number;
2971
- list: unknown[];
2972
- }
2973
- interface IRtcTokenData {
2974
- rtcToken: string;
2975
- }
2976
- interface IRTCUsers {
2977
- users: {
2978
- [userId: string]: {
2979
- /**
2980
- * 发布的资源数据,是一个 JSON 字符串,解析后为发布的资源列表
2981
- */
2982
- uris?: string;
2983
- /**
2984
- * 加房间的身份标识,保存主房间 roomId
2985
- */
2986
- extra?: string;
2987
- };
2988
- };
2989
- }
2990
- interface IJoinRTCRoomData extends IRTCUsers {
2991
- token: string;
2992
- sessionId: string;
2993
- roomInfo: {
2994
- key: string;
2995
- value: string;
2996
- }[];
2997
- kvEntries: IServerRTCRoomEntry[];
2998
- offlineKickTime: number;
2999
- }
3000
- interface KVString {
3001
- [key: string]: string;
3002
- }
3003
- /**
3004
- * 设置 RTC 人员 inner、outer 数据
3005
- */
3006
- interface IRTCUserData {
3007
- [key: string]: string;
3008
- }
3009
-
3010
- interface IAsyncRes<T = any> {
3011
- /**
3012
- * Promise 执行结果
3013
- */
3014
- code: ErrorCode;
3015
- /**
3016
- * 结果数据
3017
- */
3018
- data?: T;
3019
- /**
3020
- * 错误消息
3021
- */
3022
- msg?: string;
3023
- }
3024
- /**
3025
- * 异步任务结果定义
3026
- * @description
3027
- * 通过 `Promise.resolve` 来处理预期内的异常,进而通过 Uncatch Promise Error 暴露预期外的异常
3028
- */
3029
- declare type IPromiseResult<T> = Promise<IAsyncRes<T>>;
3030
- interface IConnectResult {
3031
- /**
3032
- * 连接错误码
3033
- */
3034
- code: ErrorCode;
3035
- /**
3036
- * 导航获取成功后即可有相应的值,在导航数据获取完成之前该值为 undefined
3037
- */
3038
- userId?: string;
3039
- }
3040
-
3041
- declare enum HttpMethod {
3042
- GET = "GET",
3043
- POST = "POST"
3044
- }
3045
- interface IRequest {
3046
- url: string;
3047
- /**
3048
- * @default `HttpMethod.GET`
3049
- */
3050
- method?: HttpMethod | 'GET' | 'POST';
3051
- /**
3052
- * 查询数据
3053
- */
3054
- query?: {
3055
- [key: string]: string | number | null;
3056
- };
3057
- /**
3058
- * Request Header 信息
3059
- */
3060
- headers?: {
3061
- [key: string]: string;
3062
- };
3063
- /**
3064
- * Request Body 数据
3065
- */
3066
- body?: Object | string;
3067
- /**
3068
- * 超时设置
3069
- * @default 10 * 1000 毫秒
3070
- */
3071
- timeout?: number;
3072
- /**
3073
- * 期望返回的数据格式,如果为 json 则返回后会对返回的数据进行一次 JSON.parse, 在小程序平台需要
3074
- */
3075
- dataType?: 'json' | 'text' | 'base64' | 'arraybuffer';
3076
- }
3077
- interface IStorage {
3078
- setItem(key: string, value: string): void;
3079
- getItem(key: string): string | null;
3080
- removeItem(key: string): void;
3081
- clear(): void;
3082
- }
3083
- interface IResponse {
3084
- status: number;
3085
- data?: string;
3086
- }
3087
- /**
3088
- * 网络状态枚举
3089
- */
3090
- declare enum NetworkType {
3091
- WIFI = "wifi",
3092
- FOUR_G = "4g",
3093
- THREE_G = "3g",
3094
- TWO_G = "2g",
3095
- FIVE_G = "2g",
3096
- THREE_GENT = "3gnet",
3097
- UNKONWN = "unknown"
3098
- }
3099
- interface IWebSocket {
3100
- /**
3101
- * 监听连接建立事件,此时 WebSocket 实例已准备好收发数据
3102
- * @param callback
3103
- */
3104
- onOpen(callback: () => void): void;
3105
- /**
3106
- * 监听连接关闭事件
3107
- * @param callback
3108
- */
3109
- onClose(callback: (code?: number, reason?: string) => void): void;
3110
- /**
3111
- * 监听接收服务器消息事件
3112
- * @param callback
3237
+ * 上传文件名,阿里上传获取下载地址时,必须使用上传文件名,所以需抛出到业务端
3113
3238
  */
3114
- onMessage(callback: (data: string | ArrayBuffer) => void): void;
3239
+ fileName: string;
3115
3240
  /**
3116
- * 监听链接错误事件
3117
- * @param callback
3241
+ * 阿里云 oss 的 AccessKeyId
3118
3242
  */
3119
- onError(callback: (error: unknown) => void): void;
3243
+ osskeyId: string;
3120
3244
  /**
3121
- * 向服务器发送数据
3122
- * @param data
3245
+ * 阿里云 oss post 请求表单域中的字段 policy
3123
3246
  */
3124
- send(data: ArrayBuffer | string): void;
3247
+ ossPolicy: string;
3125
3248
  /**
3126
- * 关闭连接
3127
- * @param code
3128
- * @param reason
3249
+ * 阿里云 oss 根据 policy 计算的签名信息
3129
3250
  */
3130
- close(code?: number, reason?: string): void;
3131
- }
3132
- /**
3133
- * 平台运行时抽象
3134
- */
3135
- interface IRuntime {
3251
+ ossSign: string;
3136
3252
  /**
3137
- * 平台标识
3253
+ * 阿里云 oss 存储空间名称
3138
3254
  */
3139
- tag: string;
3255
+ ossBucketName: string;
3140
3256
  /**
3141
- * 发送 http 请求
3142
- * @param options
3257
+ * s3 认证凭证,对应 post上传 x-amz-credential 字段
3143
3258
  */
3144
- httpReq(options: IRequest): Promise<IResponse>;
3259
+ s3Credential: string;
3145
3260
  /**
3146
- * 检测是否支持长连接
3261
+ * 加密算法,对应 post上传 x-amz-algorithm 字段
3147
3262
  */
3148
- isSupportSocket(): boolean;
3263
+ s3Algorithm: string;
3149
3264
  /**
3150
- * 是否使用导航
3265
+ * s3 日期,对应 post上传 x-amz-date 字段
3151
3266
  */
3152
- useNavi: boolean;
3267
+ s3Date: string;
3153
3268
  /**
3154
- * websocket 地址上附加的平台字段
3269
+ * s3 policy,对应 post上传 policy 字段
3155
3270
  */
3156
- connectPlatform: string;
3271
+ s3Policy: string;
3157
3272
  /**
3158
- * websocket 地址上 apiVer 字段,代表代码是否来源于 uniapp
3273
+ * s3 签名信息,对应 post上传 x-amz-signature 字段
3159
3274
  */
3160
- isFromUniapp: boolean;
3275
+ s3Signature: string;
3161
3276
  /**
3162
- * 创建长连接实例
3277
+ * s3 存储空间名称
3163
3278
  */
3164
- createWebSocket?(url: string, protocols?: string[]): IWebSocket;
3279
+ s3BucketName: string;
3165
3280
  /**
3166
- * 创建数据通道
3281
+ * stc Authorization 头
3167
3282
  */
3168
- createDataChannel(watcher: IDataChannelWatcher, connectType?: 'websocket' | 'comet'): ADataChannel;
3283
+ stcAuthorization: string;
3169
3284
  /**
3170
- * 存储模块
3285
+ * stc xAmzContentSha256
3171
3286
  */
3172
- localStorage: IStorage;
3287
+ stcContentSha256: string;
3173
3288
  /**
3174
- * 在某些非浏览器平台,其等同于 localStorage
3289
+ * stc date
3175
3290
  */
3176
- sessionStorage: IStorage;
3291
+ stcDate: string;
3177
3292
  /**
3178
- * 获取网络状态
3179
- * 2g 3g 4g wifi unkown
3293
+ * stc 存储空间名称
3180
3294
  */
3181
- getNetworkType(): Promise<NetworkType>;
3295
+ stcBucketName: string;
3296
+ }
3297
+
3298
+ interface IRTCRoomInfo {
3299
+ roomId: string;
3300
+ roomData: unknown[];
3301
+ userCount: number;
3302
+ list: unknown[];
3303
+ }
3304
+ interface IRtcTokenData {
3305
+ rtcToken: string;
3306
+ }
3307
+ interface IRTCUsers {
3308
+ users: {
3309
+ [userId: string]: {
3310
+ /**
3311
+ * 发布的资源数据,是一个 JSON 字符串,解析后为发布的资源列表
3312
+ */
3313
+ uris?: string;
3314
+ /**
3315
+ * 加房间的身份标识,保存主房间 roomId
3316
+ */
3317
+ extra?: string;
3318
+ };
3319
+ };
3320
+ }
3321
+ interface IJoinRTCRoomData extends IRTCUsers {
3322
+ token: string;
3323
+ sessionId: string;
3324
+ roomInfo: {
3325
+ key: string;
3326
+ value: string;
3327
+ }[];
3328
+ kvEntries: IServerRTCRoomEntry[];
3329
+ offlineKickTime: number;
3330
+ }
3331
+ interface KVString {
3332
+ [key: string]: string;
3333
+ }
3334
+ /**
3335
+ * 设置 RTC 人员 inner、outer 数据
3336
+ */
3337
+ interface IRTCUserData {
3338
+ [key: string]: string;
3182
3339
  }
3183
3340
 
3184
3341
  /**
@@ -3567,17 +3724,17 @@ interface IEngine {
3567
3724
  * 创建标签
3568
3725
  * @param tag 标签
3569
3726
  */
3570
- createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
3727
+ createTag(tag: ITagParam): IPromiseResult;
3571
3728
  /**
3572
3729
  * 删除标签
3573
3730
  * @param tagId 标签id
3574
3731
  */
3575
- removeTag(tagId: string): IPromiseResult<IAsyncRes>;
3732
+ removeTag(tagId: string): IPromiseResult;
3576
3733
  /**
3577
3734
  * 编辑标签
3578
3735
  * @param tag 标签
3579
3736
  */
3580
- updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
3737
+ updateTag(tag: ITagParam): IPromiseResult;
3581
3738
  /**
3582
3739
  * 获取标签列表
3583
3740
  */
@@ -3587,20 +3744,20 @@ interface IEngine {
3587
3744
  * @param tagId 标签id
3588
3745
  * @param conversations 要添加的会话列表
3589
3746
  */
3590
- addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
3747
+ addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult;
3591
3748
  /**
3592
3749
  * 删除标签中的会话(从多个会话中批量删除指定标签)
3593
3750
  * @param tagId 标签id
3594
3751
  * @param conversations 要删除的会话列表
3595
3752
  */
3596
- removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
3753
+ removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult;
3597
3754
  /**
3598
3755
  * 删除会话中的标签(从单一会话中批量删除标签)
3599
3756
  * @param conversationType 会话类型
3600
3757
  * @param targetId 会话id
3601
3758
  * @param tagIds 要删除的标签列表
3602
3759
  */
3603
- removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
3760
+ removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult;
3604
3761
  /**
3605
3762
  * 获取标签下的会话列表
3606
3763
  * @param tagId 标签id
@@ -3616,7 +3773,7 @@ interface IEngine {
3616
3773
  * 设置标签中会话置顶
3617
3774
  * @param conversation 会话
3618
3775
  */
3619
- setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
3776
+ setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult;
3620
3777
  /**
3621
3778
  * 获取会话里的标签
3622
3779
  * @param config
@@ -3840,6 +3997,9 @@ interface IRTCJoinedInfo {
3840
3997
  joinTime: number;
3841
3998
  }
3842
3999
 
4000
+ /**
4001
+ * @category Interface
4002
+ */
3843
4003
  interface IRTCRoomBindOption {
3844
4004
  /**
3845
4005
  * 聊天室 ID
@@ -3851,6 +4011,10 @@ interface IRTCRoomBindOption {
3851
4011
  rtcRoomId: string;
3852
4012
  }
3853
4013
 
4014
+ /**
4015
+ * 扩展更新
4016
+ * @category Interface
4017
+ */
3854
4018
  interface IUpdatedExpansion {
3855
4019
  expansion: {
3856
4020
  [key: string]: any;
@@ -3858,11 +4022,19 @@ interface IUpdatedExpansion {
3858
4022
  messageUId: string;
3859
4023
  channelId?: string;
3860
4024
  }
4025
+ /**
4026
+ * 扩展删除
4027
+ * @category Interface
4028
+ */
3861
4029
  interface IDeletedExpansion {
3862
4030
  deletedKeys: string[];
3863
4031
  messageUId: string;
3864
4032
  channelId?: string;
3865
4033
  }
4034
+ /**
4035
+ * 扩展变更监听
4036
+ * @category Interface
4037
+ */
3866
4038
  interface IExpansionListenerData {
3867
4039
  updatedExpansion?: IUpdatedExpansion;
3868
4040
  deletedExpansion?: IDeletedExpansion;
@@ -4009,6 +4181,32 @@ interface IEndRoomPKOptions {
4009
4181
  keys: string[];
4010
4182
  }
4011
4183
 
4184
+ /**
4185
+ * 消息送达相关接口
4186
+ */
4187
+ interface IDeliveredUser {
4188
+ time: number;
4189
+ userId: string;
4190
+ }
4191
+ interface IGroupMessageDeliverInfo {
4192
+ totalCount: number;
4193
+ list: IDeliveredUser[];
4194
+ }
4195
+ interface IMessageDeliver {
4196
+ deliverTime: number;
4197
+ messageUId: string;
4198
+ objectName: string;
4199
+ targetId: string;
4200
+ }
4201
+ interface IGroupMessageDeliveredStatusInfo {
4202
+ MessageUId: string;
4203
+ deliveryCount: number;
4204
+ }
4205
+ interface IGroupMessageDeliverStatus {
4206
+ totalCount: number;
4207
+ list: IGroupMessageDeliveredStatusInfo[];
4208
+ }
4209
+
4012
4210
  /**
4013
4211
  * IndexDB中存储的log数据
4014
4212
  */
@@ -4034,6 +4232,16 @@ interface ILogInit {
4034
4232
  localLogLevel?: LogLevel;
4035
4233
  customLogPrint?: (logLevel: LogLevel, msg: string) => void;
4036
4234
  }
4235
+ interface IInitBigDataOption {
4236
+ runtime?: IRuntime;
4237
+ appkey?: string;
4238
+ version?: string;
4239
+ userId?: string;
4240
+ }
4241
+ interface IBigdataLogInit extends IInitBigDataOption {
4242
+ logUrl: string;
4243
+ sessionId: string;
4244
+ }
4037
4245
 
4038
4246
  /**
4039
4247
  * 定义已废弃,请使用 `IRemoveChatroomEntries` 替换
@@ -4061,8 +4269,7 @@ declare type IRemoveChatRoomEntry = IRemoveChatroomEntry;
4061
4269
  */
4062
4270
  declare class DataCodec {
4063
4271
  private _codec;
4064
- private _connectType;
4065
- constructor(connectType: 'websocket' | 'comet');
4272
+ private static createPBCodec;
4066
4273
  /**
4067
4274
  * PB 数据 转为 rmtp 数据 反序列化 通用数据
4068
4275
  * 根据解析的 PBName 分配解码方法. 如果没有单独的解码方法定义. 直接返回 pb 解析后的结果
@@ -4334,53 +4541,19 @@ interface IDataChannelWatcher {
4334
4541
  */
4335
4542
  signal: (signal: PublishReader, ack?: PubAckReader) => void;
4336
4543
  }
4337
- /**
4338
- * 数据通道接口,为 long-polling 与 websocket 提供公共抽象
4339
- */
4340
- declare abstract class ADataChannel {
4341
- protected _watcher: IDataChannelWatcher;
4342
- /**
4343
- * 通道所需的数据编解码器
4344
- */
4345
- readonly codec: DataCodec;
4346
- connectedTime: number;
4347
- userId: string;
4348
- sendConnectTime: number;
4349
- constructor(type: 'websocket' | 'comet', _watcher: IDataChannelWatcher);
4350
- /**
4351
- * 建立连接,连接成功则返回 Websocket 实例,否则返回连接错误码
4352
- * @param appkey
4353
- * @param token
4354
- * @param hosts 服务器地址,不包含协议头,`hostname:port`
4355
- * @param protocol 请求导航数据时使用的网络协议, /ping 与 websocket 需要继续遵循该协议
4356
- * @param apiVersion - apiVersion 需符合 `/\d+(\.\d+){2}/` 规则,对于预发布版本号如 `3.1.0-alpha.1` 需认定为 `3.1.0`
4357
- */
4358
- abstract connect(appkey: string, token: string, host: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
4359
- /**
4360
- * 只发送数据,无需响应
4361
- */
4362
- abstract sendOnly(writer: BaseWriter): void;
4363
- /**
4364
- *
4365
- * @param writer
4366
- * @param pbName 响应数据的 PB 定义
4367
- * @param timeout 超时配置,单位 ms
4368
- */
4369
- abstract send<T>(writer: QueryWriter | PublishWriter, pbName?: string, option?: any, timeout?: number): IPromiseResult<T>;
4370
- /**
4371
- * 关闭数据通道,同时清空监听
4372
- */
4373
- abstract close(): void;
4374
- }
4375
-
4376
4544
  /**
4377
4545
  * @todo 迁移中的 DataCodec 模块导致数据通道不够独立,与 xhr-polling 通信可能会有耦合,后续需解耦
4378
4546
  * @description
4379
4547
  * 1. 基于 WebSocket 协议建立数据通道,实现数据收发
4380
4548
  * 2. 基于 Protobuf 进行数据编解码
4381
4549
  */
4382
- declare class WebSocketChannel extends ADataChannel {
4550
+ declare class WebSocketChannel {
4383
4551
  private _runtime;
4552
+ private _watcher;
4553
+ readonly codec: DataCodec;
4554
+ connectedTime: number;
4555
+ userId: string;
4556
+ sendConnectTime: number;
4384
4557
  private _socket;
4385
4558
  private _pingResolve?;
4386
4559
  /**
@@ -4391,14 +4564,15 @@ declare class WebSocketChannel extends ADataChannel {
4391
4564
  * 接收多端同步消息时,等待 PubAck 的 Promise.resolve 函数
4392
4565
  */
4393
4566
  private _syncMessageIds;
4394
- constructor(_runtime: IRuntime, watcher: IDataChannelWatcher);
4567
+ constructor(_runtime: IRuntime, _watcher: IDataChannelWatcher);
4395
4568
  /**
4396
- * 建立 websocket 连接
4569
+ * 建立连接,连接成功则返回 Websocket 实例,否则返回连接错误码
4397
4570
  * @param appkey
4398
4571
  * @param token
4399
- * @param hosts
4400
- * @param protocol
4401
- * @param apiVersion - apiVersion 需符合 `/\d+(\.\d+){2}/` 规则
4572
+ * @param hosts 服务器地址,不包含协议头,`hostname:port`
4573
+ * @param protocol 请求导航数据时使用的网络协议, /ping 与 websocket 需要继续遵循该协议
4574
+ * @param apiVersion 需符合 `/\d+(\.\d+){2}/` 规则,对于预发布版本号如 `3.1.0-alpha.1` 需认定为 `3.1.0`
4575
+ * @param protocolVer
4402
4576
  */
4403
4577
  connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
4404
4578
  /**
@@ -4419,47 +4593,24 @@ declare class WebSocketChannel extends ADataChannel {
4419
4593
  private _timer;
4420
4594
  private _checkAlive;
4421
4595
  private _onReceiveSignal;
4596
+ /**
4597
+ * 只发送数据,无需响应
4598
+ */
4422
4599
  sendOnly(writer: BaseWriter): void;
4423
4600
  /**
4424
4601
  * 有效值 0 - 65535,超出 65535 位数超长溢出
4425
4602
  */
4426
4603
  private _idCount;
4427
4604
  private _generateMessageId;
4428
- send(writer: QueryWriter | PublishWriter, respPBName?: string, option?: any, timeout?: number): Promise<IAsyncRes>;
4429
- close(): void;
4430
- }
4431
-
4432
- declare class CometChannel extends ADataChannel {
4433
- private _runtime;
4434
- private _pid;
4435
- private _sessionid;
4436
- private _domain;
4437
- private _isDisconnected;
4438
- private _messageIds;
4439
- private _syncMessageIds;
4440
- private _protocol;
4441
- constructor(_runtime: IRuntime, watcher: IDataChannelWatcher);
4442
- /**
4443
- * 长轮询结果处理
4444
- * @param data
4445
- */
4446
- handleCometRes(res: IResponse): boolean;
4447
4605
  /**
4448
- * 长轮询心跳
4606
+ * @param writer
4607
+ * @param pbName 响应数据的 PB 定义
4608
+ * @param timeout 超时配置,单位 ms
4449
4609
  */
4450
- _startPullSignal(protocol: 'http' | 'https'): Promise<void>;
4610
+ send<T>(writer: QueryWriter | PublishWriter, respPBName?: string, option?: any, timeout?: number): Promise<IAsyncRes<T>>;
4451
4611
  /**
4452
- * 连接
4453
- * comet 连接暂时不走 protocolVer=v4 的协议
4454
- * @returns
4612
+ * 关闭数据通道,同时清空监听
4455
4613
  */
4456
- connect(appkey: string, token: string, hosts: string[], protocol: 'http' | 'https', apiVersion: string, protocolVer: ConnAckProtocolVer): Promise<ErrorCode>;
4457
- private _connect;
4458
- private _idCount;
4459
- private _generateMessageId;
4460
- sendCometData(writer: BaseWriter, timeout?: number): Promise<void>;
4461
- sendOnly(writer: BaseWriter): void;
4462
- send(writer: QueryWriter | PublishWriter, respPBName?: string, option?: any, timeout?: number): Promise<IAsyncRes>;
4463
4614
  close(): void;
4464
4615
  }
4465
4616
 
@@ -4477,6 +4628,8 @@ declare type ITagListener = () => void;
4477
4628
  declare type IConversationTagListener = () => void;
4478
4629
  declare type ItypingStateListener = (data: ITypingMessage[]) => void;
4479
4630
  declare type IMessageBlockedListener = (data: IBlockedMessageInfo) => void;
4631
+ declare type IMessageDeliveredListener = (data: IMessageDeliver[]) => void;
4632
+ declare type IGroupMessageDeliveredStatusListener = (data: IGroupMessageDeliverStatus) => void;
4480
4633
  interface IWatcher {
4481
4634
  message?: IMessageListnenr;
4482
4635
  batchMessage?: IMessagesListnenr;
@@ -4501,6 +4654,14 @@ interface IWatcher {
4501
4654
  */
4502
4655
  typingState?: ItypingStateListener;
4503
4656
  pullFinished?: ITagListener;
4657
+ /**
4658
+ * 单聊消息送达通知
4659
+ */
4660
+ messageDelivered?: IMessageDeliveredListener;
4661
+ /**
4662
+ * 群聊消息送达状态通知
4663
+ */
4664
+ groupMessageDeliveredStatus?: IGroupMessageDeliveredStatusListener;
4504
4665
  onConnecting?: () => void;
4505
4666
  onConnected?: () => void;
4506
4667
  onDisconnect?: (status: ConnectionStatus) => void;
@@ -4554,10 +4715,6 @@ interface IAPIContextOption {
4554
4715
  * 小程序的 CMP 代理地址
4555
4716
  */
4556
4717
  miniCMPProxy: string[];
4557
- /**
4558
- * 指定默认使用的连接类型
4559
- */
4560
- connectionType: 'websocket' | 'comet';
4561
4718
  /**
4562
4719
  * 修改 engine log 打印等级
4563
4720
  */
@@ -4583,6 +4740,32 @@ interface IAPIContextOption {
4583
4740
  * 是否校验证书,默认为 true
4584
4741
  */
4585
4742
  checkCA?: boolean;
4743
+ /**
4744
+ * TODO: 自定义策略覆盖服务策略有安全风险,等产品确认通用化逻辑,是否前后端共同建立双重开关
4745
+ * 目前仅 Beem Web-Meeting 使用
4746
+ * @deprecated
4747
+ * @hidden
4748
+ * 实时日志收集功能自定义上传策略
4749
+ * @param {number} logSwitch 日志收集功能开关,0 关闭;1 开启
4750
+ * @param {LogLevel} level 日志上传级别
4751
+ * @param {number} itv: interval 即日志上传间隔,单位秒,最小时间间隔 1 秒
4752
+ */
4753
+ logPolicy?: {
4754
+ logSwitch?: number;
4755
+ level?: LogLevel;
4756
+ itv?: number;
4757
+ };
4758
+ /**
4759
+ * 开启后,SDK 内的 HTTP 请求将由 Electron 主进程内发送。
4760
+ * @since 5.6.0
4761
+ * @description
4762
+ * 仅在 Electron 环境中搭配 `@rongcloud/electron-renderer` 与 `@rongcloud/electron` 包时有效。
4763
+ * * 当值为 `true` 时,HTTP 请求由 Electron 主进程内发送,不受浏览器安全沙箱策略限制。
4764
+ * * 当值为 `false` 时,保持使用 Chromium 的 XMLHttpRequest 发送 HTTP 协议请求,
4765
+ * 请求由渲染进程内发出,受浏览器安全沙箱策略限制。
4766
+ * @defautl `false`
4767
+ */
4768
+ httpInMainProcess: boolean;
4586
4769
  }
4587
4770
 
4588
4771
  interface IPluginGenerator<API, InitOption> {
@@ -4618,22 +4801,18 @@ declare type KeyType<T> = T[keyof T & number] & string;
4618
4801
  declare type ModuleType<T> = {
4619
4802
  [key in KeyType<T>]?: any;
4620
4803
  };
4621
- declare abstract class AbsCodec<T> {
4804
+ declare class Codec<T> {
4622
4805
  /**
4623
4806
  * Key 对应的 Value 结构映射表,用于不同 Key 数据的编解码
4624
4807
  */
4625
- protected pbmaps: T;
4808
+ private pbmaps;
4809
+ private readonly pbModules;
4626
4810
  constructor(
4627
4811
  /**
4628
4812
  * Key 对应的 Value 结构映射表,用于不同 Key 数据的编解码
4629
4813
  */
4630
- pbmaps: T);
4631
- /**
4632
- * 数据反序列化,反序列化的结果为未加工的原始数据,decode 函数本身不处理 format 过程
4633
- * @param pbname 待解码数据的 PB 名
4634
- * @param data 待解码数据
4635
- */
4636
- abstract decode(pbname: string, data: Uint8Array | string): any;
4814
+ pbmaps: T, pbDefined: string);
4815
+ getModule(pbname: string): any;
4637
4816
  /**
4638
4817
  * 数据序列化
4639
4818
  * @param pbname 待编码数据的 PB 名
@@ -4647,14 +4826,20 @@ declare abstract class AbsCodec<T> {
4647
4826
  * const data = codec.encode('pb2', { key: buffer })
4648
4827
  * ```
4649
4828
  */
4650
- abstract encode<K extends string & keyof T>(pbname: K, params?: ModuleType<T[K]>, returnSourceModule?: boolean): ArrayBuffer | ModuleType<T[K]>;
4829
+ encode<K extends string & keyof T>(pbname: K, params?: ModuleType<T[K]>, returnSourceModule?: boolean): ArrayBuffer;
4830
+ /**
4831
+ * 数据反序列化,反序列化的结果为未加工的原始数据,decode 函数本身不处理 format 过程
4832
+ * @param pbname 待解码数据的 PB 名
4833
+ * @param data 待解码数据
4834
+ */
4835
+ decode(pbname: string, uint8array: Uint8Array): any;
4651
4836
  }
4652
4837
 
4653
4838
  declare class APIContext {
4654
4839
  private _runtime;
4655
4840
  private static _context?;
4656
4841
  static init(runtime: IRuntime, options: IAPIContextOption): APIContext;
4657
- static destroy(): void;
4842
+ static destroy(): Promise<void>;
4658
4843
  private _token;
4659
4844
  /**
4660
4845
  * 插件队列,用于逐一派发消息与信令
@@ -4685,7 +4870,7 @@ declare class APIContext {
4685
4870
  */
4686
4871
  private readonly _rtcCodec;
4687
4872
  constructor(_runtime: IRuntime, options: IAPIContextOption);
4688
- createCodec<T extends CodecPBMaps>(keymaps: T, pbDesc: string): AbsCodec<T>;
4873
+ createCodec<T extends CodecPBMaps>(keymaps: T, pbDesc: string): Codec<T>;
4689
4874
  /**
4690
4875
  * 安装使用插件,并初始化插件实例
4691
4876
  * @param plugin
@@ -4732,6 +4917,9 @@ declare class APIContext {
4732
4917
  private _typingStatusListener;
4733
4918
  private _pullFinishedListener;
4734
4919
  private _MessageBlockedListener;
4920
+ private _messageDeliveredListerer;
4921
+ private _groupMessageDeliveredStatusListerer;
4922
+ private _callInfoListener;
4735
4923
  private _ultraGroupEnableListener;
4736
4924
  private _operateStatusListener;
4737
4925
  private _ultraGroupMessageExpansionUpdatedListener;
@@ -4757,7 +4945,7 @@ declare class APIContext {
4757
4945
  * @param options
4758
4946
  */
4759
4947
  assignWatcher(watcher: IWatcher): void;
4760
- resetWatcher(): void;
4948
+ private _resetWatcher;
4761
4949
  /**
4762
4950
  * 向内存中添加 typing 信息
4763
4951
  * 添加 typing 时不触发通知,只有在轮询时间点校验 _typingChangedList 的长度大于 0 时才通知
@@ -5126,20 +5314,20 @@ declare class APIContext {
5126
5314
  * @param tagId 标签id
5127
5315
  * @param conversations 要添加的会话列表
5128
5316
  */
5129
- addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
5317
+ addTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes>;
5130
5318
  /**
5131
5319
  * 删除标签中的会话(从多个会话中批量删除指定标签)
5132
5320
  * @param tagId 标签id
5133
5321
  * @param conversations 要删除的会话列表
5134
5322
  */
5135
- removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes<IAsyncRes>>;
5323
+ removeTagForConversations(tagId: string, conversations: IConversationOption[]): Promise<IAsyncRes>;
5136
5324
  /**
5137
5325
  * 删除会话中的标签(从单一会话中批量删除标签)
5138
5326
  * @param conversationType 会话类型
5139
5327
  * @param targetId 会话id
5140
5328
  * @param tagIds 要删除的标签列表
5141
5329
  */
5142
- removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes<IAsyncRes>>;
5330
+ removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): Promise<IAsyncRes>;
5143
5331
  /**
5144
5332
  * 获取标签下的会话列表
5145
5333
  * @param tagId 标签id
@@ -5157,7 +5345,7 @@ declare class APIContext {
5157
5345
  */
5158
5346
  setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: {
5159
5347
  isTop: boolean;
5160
- }): Promise<IAsyncRes<IAsyncRes>>;
5348
+ }): Promise<IAsyncRes>;
5161
5349
  /**
5162
5350
  * 获取会话里的标签
5163
5351
  * @param conversation
@@ -5185,7 +5373,9 @@ declare class APIContext {
5185
5373
  * 根据消息 ID 查询消息列表
5186
5374
  * @param options
5187
5375
  */
5188
- getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes>;
5376
+ getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes<{
5377
+ [messageUid: string]: IReceivedMessage | undefined;
5378
+ }>>;
5189
5379
  /**
5190
5380
  * 扩展已有的超级群消息
5191
5381
  * @param options 设置的扩展
@@ -5246,6 +5436,18 @@ declare class APIContext {
5246
5436
  * 获取应用主进程信息,仅限 Electron 平台可用
5247
5437
  */
5248
5438
  getMainProcessInfo(): IPromiseResult<IProcessInfo>;
5439
+ setCallInfo(targetId: string, key: string, value: string): Promise<IAsyncRes<{
5440
+ key: string;
5441
+ value: string;
5442
+ }>>;
5443
+ /**
5444
+ * 获取群组消息送达信息
5445
+ */
5446
+ getGroupMessageDeliverList(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IGroupMessageDeliverInfo>>;
5447
+ /**
5448
+ * 获取单聊消息送达信息
5449
+ */
5450
+ getPrivateMessageDeliverTime(messageUId: string, channelId?: string): Promise<IAsyncRes<number>>;
5249
5451
  /**
5250
5452
  * 删除所有会话
5251
5453
  */
@@ -5370,7 +5572,7 @@ declare class APIContext {
5370
5572
  clearData(): Promise<IAsyncRes<boolean>>;
5371
5573
  rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: any): Promise<{
5372
5574
  code: ErrorCode;
5373
- buffer?: Uint8Array | string;
5575
+ buffer?: Uint8Array;
5374
5576
  }>;
5375
5577
  /**
5376
5578
  * 加入房间
@@ -5457,7 +5659,7 @@ declare class PluginContext {
5457
5659
  * 获取 context
5458
5660
  */
5459
5661
  __getContext(): APIContext;
5460
- createCodec<T extends CodecPBMaps>(keymaps: T, pbDesc: string): AbsCodec<T>;
5662
+ createCodec<T extends CodecPBMaps>(keymaps: T, pbDesc: string): Codec<T>;
5461
5663
  /**
5462
5664
  * 获取当前的导航数据
5463
5665
  */
@@ -5483,6 +5685,10 @@ declare class PluginContext {
5483
5685
  * IM 客户端销毁通知
5484
5686
  */
5485
5687
  ondestroy?(): void;
5688
+ /**
5689
+ * beem 专有接口,做 groupCall 用到
5690
+ */
5691
+ onCallInfo?(data: string): void;
5486
5692
  /**
5487
5693
  * 获取 `@rongcloud/engine` 包版本
5488
5694
  */
@@ -5534,6 +5740,10 @@ declare class PluginContext {
5534
5740
  * 获取应用主进程信息,仅限 Electron 平台可用
5535
5741
  */
5536
5742
  getMainProcessInfo(): IPromiseResult<IProcessInfo>;
5743
+ setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
5744
+ key: string;
5745
+ value: string;
5746
+ }>;
5537
5747
  }
5538
5748
 
5539
5749
  declare class RTCPluginContext extends PluginContext {
@@ -5711,7 +5921,7 @@ declare class RTCPluginContext extends PluginContext {
5711
5921
  */
5712
5922
  rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: any): Promise<{
5713
5923
  code: ErrorCode;
5714
- buffer?: Uint8Array | string;
5924
+ buffer?: Uint8Array;
5715
5925
  }>;
5716
5926
  /**
5717
5927
  * RTC KV 数据通知
@@ -5729,33 +5939,10 @@ declare class RTCPluginContext extends PluginContext {
5729
5939
  getRTCJoinedUserInfo(userId: string): IPromiseResult<IRTCJoinedInfo[]>;
5730
5940
  }
5731
5941
 
5732
- declare const keymaps: {
5733
- readonly RtcInput: readonly ["roomType", "broadcastType", "extraInnerData", "needSysChatroom", "identityChangeType", "joinType", "innerDatas", "outerDatas"];
5734
- readonly RtcUserListOutput: readonly ["users", "token", "sessionId", "roomInfo"];
5735
- readonly SetUserStatusInput: readonly ["status"];
5736
- readonly RtcSetDataInput: readonly ["interior", "target", "key", "value", "objectName", "content"];
5737
- readonly RtcUserSetDataInput: readonly ["valueInfo", "objectName", "content"];
5738
- readonly RtcDataInput: readonly ["interior", "target", "key", "objectName", "content"];
5739
- readonly RtcSetOutDataInput: readonly ["target", "valueInfo", "objectName", "content"];
5740
- readonly MCFollowInput: readonly ["state"];
5741
- readonly RtcTokenOutput: readonly ["rtcToken"];
5742
- readonly RtcQryOutput: readonly ["outInfo"];
5743
- readonly RtcQryUserOutDataInput: readonly ["userId"];
5744
- readonly RtcUserOutDataOutput: readonly ["user"];
5745
- readonly RtcQueryListInput: readonly ["order"];
5746
- readonly RtcRoomInfoOutput: readonly ["roomId", "roomData", "userCount", "list"];
5747
- readonly RtcValueInfo: readonly ["key", "value"];
5748
- readonly RtcKeyDeleteInput: readonly ["key"];
5749
- readonly RtcNotifyMsg: readonly ["type", "time", "roomId"];
5750
- readonly RtcPullKV: readonly ["timestamp", "roomId"];
5751
- readonly RtcKVOutput: readonly ["entries", "bFullUpdate", "syncTime"];
5752
- readonly RtcQueryUserJoinedInput: readonly ["userId"];
5753
- readonly RtcQueryUserJoinedOutput: readonly ["info"];
5754
- readonly RtcInviteInput: readonly ["invitedUserId", "timeoutTime", "invitedRoomId", "inviteInfo", "inviteSessionId"];
5755
- readonly RtcCancelInviteInput: readonly ["invitedUserId", "invitedRoomId", "inviteInfo", "inviteSessionId"];
5756
- readonly RtcInviteAnswerInput: readonly ["inviteUserId", "answerCode", "inviteRoomId", "inviteSessionId", "content", "key", "value"];
5757
- readonly RtcEndInviteInput: readonly ["inviteRoomId", "inviteSessionId", "inviteContent", "inviteRoomKeys"];
5758
- };
5942
+ declare const keymaps: CodecPBMaps;
5943
+ /**
5944
+ * 仅限 IM 内部包使用,禁止 RTCLib 直接使用从而导致业务依赖
5945
+ */
5759
5946
  declare type RTCKeyMaps = typeof keymaps;
5760
5947
 
5761
5948
  interface IEngineWatcher {
@@ -5784,7 +5971,9 @@ interface IEngineWatcher {
5784
5971
  */
5785
5972
  onRTCDataChange: (data: IServerRTCRoomEntry[], roomId?: string) => void;
5786
5973
  pullFinished: () => void;
5787
- /** 导航数据变更 */
5974
+ messageDelivered: (data: IMessageDeliver[]) => void;
5975
+ groupMessageDeliveredStatus: (data: IGroupMessageDeliverStatus) => void;
5976
+ callInfo: (data: string) => void;
5788
5977
  onNaviDataChange: (naviInfo: INaviInfo) => void;
5789
5978
  }
5790
5979
  /**
@@ -5792,7 +5981,7 @@ interface IEngineWatcher {
5792
5981
  */
5793
5982
  declare abstract class AEngine implements IEngine {
5794
5983
  readonly runtime: IRuntime;
5795
- readonly rtcCodec: AbsCodec<RTCKeyMaps>;
5984
+ readonly rtcCodec: Codec<RTCKeyMaps>;
5796
5985
  protected readonly _watcher: IEngineWatcher;
5797
5986
  protected readonly _options: IAPIContextOption;
5798
5987
  /**
@@ -5807,7 +5996,7 @@ declare abstract class AEngine implements IEngine {
5807
5996
  * 引擎初始化
5808
5997
  * @param _appkey
5809
5998
  */
5810
- constructor(runtime: IRuntime, rtcCodec: AbsCodec<RTCKeyMaps>, _watcher: IEngineWatcher, _options: IAPIContextOption);
5999
+ constructor(runtime: IRuntime, rtcCodec: Codec<RTCKeyMaps>, _watcher: IEngineWatcher, _options: IAPIContextOption);
5811
6000
  protected _rtcSignalingListener?: (buffer: Uint8Array) => void;
5812
6001
  /**
5813
6002
  * 注册 RTC KV 变更监听器
@@ -6141,17 +6330,17 @@ declare abstract class AEngine implements IEngine {
6141
6330
  * 创建标签
6142
6331
  * @param tag 标签
6143
6332
  */
6144
- abstract createTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
6333
+ abstract createTag(tag: ITagParam): IPromiseResult;
6145
6334
  /**
6146
6335
  * 删除标签
6147
6336
  * @param tagId 标签id
6148
6337
  */
6149
- abstract removeTag(tagId: string): IPromiseResult<IAsyncRes>;
6338
+ abstract removeTag(tagId: string): IPromiseResult;
6150
6339
  /**
6151
6340
  * 编辑标签
6152
6341
  * @param tag 标签
6153
6342
  */
6154
- abstract updateTag(tag: ITagParam): IPromiseResult<IAsyncRes>;
6343
+ abstract updateTag(tag: ITagParam): IPromiseResult;
6155
6344
  /**
6156
6345
  * 获取标签列表
6157
6346
  */
@@ -6161,20 +6350,20 @@ declare abstract class AEngine implements IEngine {
6161
6350
  * @param tagId 标签id
6162
6351
  * @param conversations 要添加的会话列表
6163
6352
  */
6164
- abstract addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
6353
+ abstract addTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult;
6165
6354
  /**
6166
6355
  * 删除标签中的会话(从多个会话中批量删除指定标签)
6167
6356
  * @param tagId 标签id
6168
6357
  * @param conversations 要删除的会话列表
6169
6358
  */
6170
- abstract removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult<IAsyncRes>;
6359
+ abstract removeTagForConversations(tagId: string, conversations: IConversationOption[]): IPromiseResult;
6171
6360
  /**
6172
6361
  * 删除会话中的标签(从单一会话中批量删除标签)
6173
6362
  * @param conversationType 会话类型
6174
6363
  * @param targetId 会话id
6175
6364
  * @param tagIds 要删除的标签列表
6176
6365
  */
6177
- abstract removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult<IAsyncRes>;
6366
+ abstract removeTagsForConversation(conversation: IConversationOption, tagIds: string[]): IPromiseResult;
6178
6367
  /**
6179
6368
  * 获取标签下的会话列表
6180
6369
  * @param tagId 标签id
@@ -6190,7 +6379,7 @@ declare abstract class AEngine implements IEngine {
6190
6379
  * 设置标签中会话置顶
6191
6380
  * @param conversation 会话
6192
6381
  */
6193
- abstract setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult<IAsyncRes>;
6382
+ abstract setConversationStatusInTag(tagId: string, conversation: IConversationOption, status: ITagStatus): IPromiseResult;
6194
6383
  /**
6195
6384
  * 获取会话里的标签
6196
6385
  * @param config
@@ -6249,7 +6438,7 @@ declare abstract class AEngine implements IEngine {
6249
6438
  * @param targetId
6250
6439
  * @param options
6251
6440
  */
6252
- abstract sendUltraMessage(targetId: string, options: ISendMsgOptions, onSendBefore?: (messageId: number) => void, traceId?: string): Promise<IAsyncRes>;
6441
+ abstract sendUltraMessage(targetId: string, options: ISendMsgOptions, onSendBefore?: (messageId: number) => void, traceId?: string): Promise<IAsyncRes<IReceivedMessage>>;
6253
6442
  /**
6254
6443
  * 超级群消息正在输入中
6255
6444
  * @param options
@@ -6259,7 +6448,9 @@ declare abstract class AEngine implements IEngine {
6259
6448
  * 拉取超级群变更后的消息列表
6260
6449
  * @param time
6261
6450
  */
6262
- abstract getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes<Object>>;
6451
+ abstract getUltraGroupMessageListByMessageUId(options: IUltraMsgQueryOptions): Promise<IAsyncRes<{
6452
+ [messageUid: string]: IReceivedMessage | undefined;
6453
+ }>>;
6263
6454
  /**
6264
6455
  * 对已有的消息进行扩展
6265
6456
  * @param options
@@ -6275,7 +6466,11 @@ declare abstract class AEngine implements IEngine {
6275
6466
  * @param targetId
6276
6467
  * @param options
6277
6468
  */
6278
- abstract getUltraHistoryMsg(targetId: string, options: IGetMsgOption, traceId?: string): Promise<IAsyncRes>;
6469
+ abstract getUltraHistoryMsg(targetId: string, options: IGetMsgOption, traceId?: string): Promise<IAsyncRes<{
6470
+ list: IReceivedMessage[];
6471
+ syncTime: number;
6472
+ hasMore: boolean;
6473
+ }>>;
6279
6474
  abstract getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
6280
6475
  abstract getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
6281
6476
  /**
@@ -6423,6 +6618,18 @@ declare abstract class AEngine implements IEngine {
6423
6618
  list: IReceivedMessage[];
6424
6619
  hasMore: boolean;
6425
6620
  }>;
6621
+ /**
6622
+ * 获取群组消息送达列表
6623
+ */
6624
+ abstract getGroupMessageDeliverList(targetId: string, messageUId: string, channelId: string): IPromiseResult<IGroupMessageDeliverInfo>;
6625
+ /**
6626
+ * 获取单聊消息送达列表
6627
+ */
6628
+ abstract getPrivateMessageDeliverTime(messageUId: string, channelId: string): IPromiseResult<number>;
6629
+ abstract setCallInfo(targetId: string, key: string, value: string): IPromiseResult<{
6630
+ key: string;
6631
+ value: string;
6632
+ }>;
6426
6633
  /**
6427
6634
  * 无差别获取本地免打扰列表
6428
6635
  */
@@ -6472,9 +6679,9 @@ declare abstract class AEngine implements IEngine {
6472
6679
  * @param isQuery 使用 `qry` or `pub` 进行请求,按服务要求传递
6473
6680
  * @param sourceData PB 数据
6474
6681
  */
6475
- abstract rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: ArrayBuffer | object): Promise<{
6682
+ abstract rtcSignaling(roomId: string, method: string, isQuery: boolean, sourceData: ArrayBuffer): Promise<{
6476
6683
  code: ErrorCode;
6477
- buffer?: Uint8Array | string;
6684
+ buffer?: Uint8Array;
6478
6685
  }>;
6479
6686
  abstract rtcPing(roomId: string, mode: number, broadcastType?: number): Promise<ErrorCode>;
6480
6687
  joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData): IPromiseResult<IJoinRTCRoomData>;
@@ -6692,7 +6899,7 @@ declare const sessionId: string;
6692
6899
  * logLevelTransformer
6693
6900
  * @description 数据中心与前端日志规范LogLevel定义不统一
6694
6901
  * WebLogLevel(前端日志级别) -> ServerLogLevel(服务器日志级别)
6695
- * @param level { LogLevel }
6902
+ * @param level LogLevel
6696
6903
  * @returns serverLogLevel
6697
6904
  */
6698
6905
  declare function logLevelTransformer(level: LogLevel): number;
@@ -6761,7 +6968,7 @@ declare namespace base {
6761
6968
 
6762
6969
  /**
6763
6970
  * 缓存日志实时
6764
- * @param logLevel 日志等级
6971
+ * @param {LogLevel} logLevel 日志等级
6765
6972
  * @param tagId 日志标签
6766
6973
  * @param content 日志内容
6767
6974
  */
@@ -6826,7 +7033,6 @@ declare class Logger {
6826
7033
  }
6827
7034
  declare const _default: Logger;
6828
7035
 
6829
- declare const randomNum: (min: number, max: number) => number;
6830
7036
  declare const getUUID: () => string;
6831
7037
  declare const getUUID22: () => string;
6832
7038
 
@@ -6877,6 +7083,7 @@ declare class RCAssertError extends Error {
6877
7083
  }
6878
7084
  /**
6879
7085
  * 参数校验,该方法用于对业务层入参数据检查,及时抛出异常通知业务层进行修改
7086
+ * @deprecated 优先使用 `validate` 替代,禁止直接 throw error 阻断调用栈
6880
7087
  * @description
6881
7088
  * 1. 必填参数,value 需符合 validator 验证规,否则抛出异常
6882
7089
  * 2. 非必填参数,value 可为 undefined | null 或符合 validator 规则
@@ -6984,13 +7191,13 @@ declare const clone: (target: any) => any;
6984
7191
  */
6985
7192
  declare const NAVI_CACHE_DURATION: number;
6986
7193
  /**
6987
- * 单个 Navi 请求的超时时间,单位毫秒
7194
+ * 默认 HTTP 请求超时时间,单位毫秒
6988
7195
  */
6989
- declare const NAVI_REQ_TIMEOUT: number;
7196
+ declare const HTTP_TIMEOUT: number;
6990
7197
  /**
6991
- * /ping?r= 请求的超时时间,单位毫秒
7198
+ * 单个 Navi 请求的超时时间,单位毫秒
6992
7199
  */
6993
- declare const PING_REQ_TIMEOUT: number;
7200
+ declare const NAVI_REQ_TIMEOUT: number;
6994
7201
  /**
6995
7202
  * WebSocket 建立连接超时时间,单位毫秒
6996
7203
  */
@@ -7003,10 +7210,6 @@ declare const PUBLIC_CLOUD_NAVI_URIS: string[];
7003
7210
  * 小程序 websocket 连接地址
7004
7211
  */
7005
7212
  declare const MINI_SOCKET_CONNECT_URIS: string[];
7006
- /**
7007
- * 小程序 长轮询 连接地址
7008
- */
7009
- declare const MINI_COMET_CONNECT_URIS: string[];
7010
7213
  /**
7011
7214
  * IM 接口超时时间,单位毫秒
7012
7215
  */
@@ -7027,10 +7230,6 @@ declare const IM_PING_MIN_TIMEOUT: number;
7027
7230
  * 消息 content 内容尺寸限制:128 KB
7028
7231
  */
7029
7232
  declare const MAX_MESSAGE_CONTENT_BYTES: number;
7030
- /**
7031
- * IM Comet 发送 pullmsg(嗅探 + 等待信令) 超时时间 45s
7032
- */
7033
- declare const IM_COMET_PULLMSG_TIMEOUT = 45000;
7034
7233
  /**
7035
7234
  * IM 加入聊天室后定时拉取消息和 KV 时间间隔
7036
7235
  */
@@ -7067,21 +7266,22 @@ declare const CPP_PROTOCAL_MSGTYPE_OPTION: {
7067
7266
  * 状态消息(不存储,不计数,并且上线后不会拉取离线的状态消息)
7068
7267
  */
7069
7268
  declare const STATUS_MESSAGE: string[];
7070
- /**
7071
- * 连接类型
7072
- */
7073
- declare enum CONNECTION_TYPE {
7074
- WEBSOCKET = "websocket",
7075
- COMET = "comet"
7076
- }
7077
7269
  declare const REAT_TIME_LOG_SIZE = 500;
7078
7270
  declare const DB_LOG_MAX_SIZE = 100000;
7079
7271
  declare const DB_LOG_FLUSH_FREQUENCY = 3000;
7080
7272
  declare const ONE_LOG_SIZE_MAX = 1000;
7273
+ /** 日志上报域名 */
7274
+ declare const LOG_REPORT_URI = "logcollection.ronghub.com";
7275
+
7276
+ /**
7277
+ * 请使用 `Codec` 替代 `AbsCodec`
7278
+ * @deprecated
7279
+ */
7280
+ declare type AbsCodec<T> = Codec<T>;
7081
7281
 
7082
7282
  /**
7083
7283
  * engine 版本号
7084
7284
  */
7085
7285
  declare const version: string;
7086
7286
 
7087
- export { AEngine, APIContext, AbsCodec, AppStorage, AssertRules, CONNECTION_TYPE, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType, CometChannel, ConnectResultCode, ConnectionStatus, ConversationType, DB_LOG_FLUSH_FREQUENCY, DB_LOG_MAX_SIZE, DelayTimer, ErrorCode, EventEmitter, FileType, HttpMethod, IAPIContextOption, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBlockedMessageInfo, ICancelRoomPKOptions, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDataChannelWatcher, IDeletedExpansion, IEndRoomPKOptions, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGetMsgOption, IGetUltraGroupListOption, IGooglePushConfig, IInsertMsgOptions, IIsValidExpansion, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, ILogExtensions, ILogInfo, ILogInit, IM_CHATROOM_PULL_INTERVAL_TIME, IM_COMET_PULLMSG_TIMEOUT, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IOSInfo, IOperateStatusNotify, IPluginGenerator, IProcessInfo, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomBindOption, IRTCRoomInfo, IRTCUserData, IRTCUsers, IReadReceiptInfo, IRealTimeLog, IRecallMsgContent, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IReqRoomPKOptions, IRequest, IResRoomPKOptions, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraExMsgOptions, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadMentionedOption, IUltraModifyMsgOptions, IUltraMsgQueryOptions, IUltraUnreadConversation, IUltraUnreadMsg, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, IiOSPushConfig, ItypingStateListener, KVString, LiveRole, LiveType, LogLevel, LogSource, LogTagId, Logger, MAX_MESSAGE_CONTENT_BYTES, MAX_MESSAGE_EXPANSION_KEY_LENGTH, MAX_MESSAGE_EXPANSION_VAL_LENGTH, MINI_COMET_CONNECT_URIS, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NetworkType, NotificationLevel, NotificationStatus, ONE_LOG_SIZE_MAX, OperateStatus, PING_REQ_TIMEOUT, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, REAT_TIME_LOG_SIZE, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCKeyMaps, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UltraGroupChannelChangeType, UltraGroupChannelType, UltraMsgChangeType, UltraMsgSubChangeType, UploadMethod, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, clone, cloneByJSON, _default as engineLogger, forEach, formatConnectResponseCode, getBrowser, getClientMessageId, getMimeKey, getUUID, getUUID22, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChannelId, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidExpansion, isValidFileType, isValidNotificationLevel, base as logger, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, randomNum, todo, usingCppEngine, validate, version };
7287
+ export { AEngine, APIContext, AbsCodec, AppStorage, AssertRules, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType, Codec, CodecPBMaps, ConnectResultCode, ConnectionStatus, ConversationType, DB_LOG_FLUSH_FREQUENCY, DB_LOG_MAX_SIZE, DelayTimer, ErrorCode, EventEmitter, FileType, HTTP_TIMEOUT, HttpMethod, IAPIContextOption, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBigdataLogInit, IBlockedMessageInfo, ICancelRoomPKOptions, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionStatusListener, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDeletedExpansion, IDeliveredUser, IEndRoomPKOptions, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGetMsgOption, IGetUltraGroupListOption, IGooglePushConfig, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IInitBigDataOption, IInsertMsgOptions, IIsValidExpansion, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, ILogExtensions, ILogInfo, ILogInit, IM_CHATROOM_PULL_INTERVAL_TIME, IM_PING_INTERVAL_TIME, IM_PING_MIN_TIMEOUT, IM_PING_TIMEOUT, IM_SIGNAL_TIMEOUT, IMessageDeliver, IMessageDeliveredListener, IMessageListnenr, IMessageReader, IMessageReaderResponse, IMetionedData, INaviInfo, IOSInfo, IOperateStatusNotify, IPluginGenerator, IProcessInfo, IPromiseResult, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomBindOption, IRTCRoomInfo, IRTCUserData, IRTCUsers, IReadReceiptInfo, IRealTimeLog, IRecallMsgContent, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IReqRoomPKOptions, IRequest, IResRoomPKOptions, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraExMsgOptions, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadMentionedOption, IUltraModifyMsgOptions, IUltraMsgQueryOptions, IUltraUnreadConversation, IUltraUnreadMsg, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserProfile, IWatcher, IWebSocket, IiOSPushConfig, RTCKeyMaps as InnerRTCKeyMaps, ItypingStateListener, KVString, LOG_REPORT_URI, LiveRole, LiveType, LogLevel, LogSource, LogTagId, Logger, MAX_MESSAGE_CONTENT_BYTES, MAX_MESSAGE_EXPANSION_KEY_LENGTH, MAX_MESSAGE_EXPANSION_VAL_LENGTH, MINI_SOCKET_CONNECT_URIS, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NetworkType, NotificationLevel, NotificationStatus, ONE_LOG_SIZE_MAX, OperateStatus, PUBLIC_CLOUD_NAVI_URIS, PluginContext, RCAssertError, REAT_TIME_LOG_SIZE, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, TagChangeType, UltraGroupChannelChangeType, UltraGroupChannelType, UltraMsgChangeType, UltraMsgSubChangeType, UploadMethod, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketChannel, appendUrl, assert, clone, cloneByJSON, _default as engineLogger, forEach, formatConnectResponseCode, getBrowser, getClientMessageId, getMimeKey, getUUID, getUUID22, getUploadFileName, indexOf, isArray, isArrayBuffer, isBoolean, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isUndefined, isValidChannelId, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidExpansion, isValidFileType, isValidNotificationLevel, base as logger, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, reportLog, todo, usingCppEngine, validate, version };