@rongcloud/engine 5.7.8 → 5.7.10
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 +969 -121
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/package.json +1 -1
package/index.d.ts
CHANGED
|
@@ -546,6 +546,14 @@ declare enum ErrorCode {
|
|
|
546
546
|
* JSON 后的消息体超限, 目前最大 128kb
|
|
547
547
|
*/
|
|
548
548
|
RC_MSG_CONTENT_EXCEED_LIMIT = 30016,
|
|
549
|
+
/**
|
|
550
|
+
* 网络不可用,未连接。
|
|
551
|
+
*/
|
|
552
|
+
RC_NETWORK_DOWN = 30019,
|
|
553
|
+
/**
|
|
554
|
+
* TCP 连上后,rmtp 还未连上时, TCP 连接断开。
|
|
555
|
+
*/
|
|
556
|
+
RC_TCP_DISCONNECTED_NO_RMTP = 30021,
|
|
549
557
|
/**
|
|
550
558
|
* TCP 连接中,CMP 应答超时。
|
|
551
559
|
*/
|
|
@@ -730,6 +738,10 @@ declare enum ErrorCode {
|
|
|
730
738
|
* 消息不支持扩展,原消息 canIncludeExpansion 值为 false (错误码与移动端对齐)
|
|
731
739
|
*/
|
|
732
740
|
MESSAGE_KV_NOT_SUPPORT = 34008,
|
|
741
|
+
/**
|
|
742
|
+
* 上传失败
|
|
743
|
+
*/
|
|
744
|
+
UPLOAD_FAIL = 34011,
|
|
733
745
|
/**
|
|
734
746
|
* 会话数量超出上限
|
|
735
747
|
*/
|
|
@@ -786,10 +798,6 @@ declare enum ErrorCode {
|
|
|
786
798
|
* 该功能仅支持超级群
|
|
787
799
|
*/
|
|
788
800
|
METHOD_ONLY_SUPPORT_ULTRA_GROUP = 35014,
|
|
789
|
-
/**
|
|
790
|
-
* 上传文件失败
|
|
791
|
-
*/
|
|
792
|
-
UPLOAD_FILE_FAILED = 35020,
|
|
793
801
|
/**
|
|
794
802
|
* 加入聊天室Id为空
|
|
795
803
|
*/
|
|
@@ -1188,6 +1196,18 @@ declare enum MessageType {
|
|
|
1188
1196
|
* 用户加入退出聊天室的集合
|
|
1189
1197
|
*/
|
|
1190
1198
|
CHATROOM_MERGE_CHANGE = "RC:ChrmMemChange",
|
|
1199
|
+
/**
|
|
1200
|
+
* 聊天室用户加入退出多端同步消息
|
|
1201
|
+
*/
|
|
1202
|
+
CHATROOM_SYNC_MSG = "RC:ChrmSyncMsg",
|
|
1203
|
+
/**
|
|
1204
|
+
* 聊天室用户封禁消息
|
|
1205
|
+
*/
|
|
1206
|
+
CHATROOM_MERGE_BLOCK = "RC:ChrmBlockMsg",
|
|
1207
|
+
/**
|
|
1208
|
+
* 聊天室用户禁言消息
|
|
1209
|
+
*/
|
|
1210
|
+
CHATROOM_MERGE_BAN = "RC:ChrmBanMsg",
|
|
1191
1211
|
/**
|
|
1192
1212
|
* 输入状态消息
|
|
1193
1213
|
*/
|
|
@@ -1467,7 +1487,21 @@ declare enum LogTagId {
|
|
|
1467
1487
|
A_REMOVE_PROXY_O = "A-remove_proxy-O",
|
|
1468
1488
|
A_SET_PROXY_O = "A-set_proxy-O",
|
|
1469
1489
|
A_TEST_PROXY_O = "A-test_proxy-O",
|
|
1470
|
-
L_WEBSOCKET_DISACCORD_E = "L-websocket_disaccord-e"
|
|
1490
|
+
L_WEBSOCKET_DISACCORD_E = "L-websocket_disaccord-e",
|
|
1491
|
+
/** electronExtension 相关 */
|
|
1492
|
+
A_SEARCH_MESSAGE_BY_USER_T = "A-search_messages_by_user-T",
|
|
1493
|
+
A_SEARCH_MESSAGE_BY_USER_R = "A-search_messages_by_user-R"
|
|
1494
|
+
}
|
|
1495
|
+
|
|
1496
|
+
/** 统计数据标签 */
|
|
1497
|
+
declare enum StatisticsTag {
|
|
1498
|
+
IM_NAVI = "IM-stats_navi-S",
|
|
1499
|
+
IM_WEBSOCKET = "IM-stats_websocket-S",
|
|
1500
|
+
IM_CONNECTION_DURATION = "IM-stats_con_dur-S",
|
|
1501
|
+
IM_CMP = "IM-stats_cmp-S",
|
|
1502
|
+
IM_CMP_RMTP = "IM-stats_cmp_rmtp-S",
|
|
1503
|
+
IM_STATS_CS = "IM-stats_cs-S",
|
|
1504
|
+
IM_NETWORK_CHANGE = "IM-stats_network_change-S"
|
|
1471
1505
|
}
|
|
1472
1506
|
|
|
1473
1507
|
/**
|
|
@@ -1510,6 +1544,94 @@ declare enum SentStatus {
|
|
|
1510
1544
|
DESTROYED = 60
|
|
1511
1545
|
}
|
|
1512
1546
|
|
|
1547
|
+
/**
|
|
1548
|
+
* 聊天室多端同步时,消息中的状态:加入/离开
|
|
1549
|
+
* @category Enum
|
|
1550
|
+
* @since 5.7.9
|
|
1551
|
+
*/
|
|
1552
|
+
declare enum ChrmSyncStatus {
|
|
1553
|
+
/**
|
|
1554
|
+
* 离开
|
|
1555
|
+
*/
|
|
1556
|
+
QUIT = 0,
|
|
1557
|
+
/**
|
|
1558
|
+
* 加入
|
|
1559
|
+
*/
|
|
1560
|
+
JOIN = 1
|
|
1561
|
+
}
|
|
1562
|
+
|
|
1563
|
+
/**
|
|
1564
|
+
* 聊天室解封/封禁用户消息,操作类型枚举
|
|
1565
|
+
* @category Enum
|
|
1566
|
+
* @since 5.7.9
|
|
1567
|
+
*/
|
|
1568
|
+
declare enum ChrmMemOperateType {
|
|
1569
|
+
/**
|
|
1570
|
+
* 解封
|
|
1571
|
+
*/
|
|
1572
|
+
Deblock = 0,
|
|
1573
|
+
/**
|
|
1574
|
+
* 封禁
|
|
1575
|
+
*/
|
|
1576
|
+
Blocked = 1
|
|
1577
|
+
}
|
|
1578
|
+
|
|
1579
|
+
/**
|
|
1580
|
+
* 聊天室禁言/解除禁言操作类型枚举
|
|
1581
|
+
* @category Enum
|
|
1582
|
+
* @since 5.7.9
|
|
1583
|
+
*/
|
|
1584
|
+
declare enum ChrmMemBanType {
|
|
1585
|
+
/**
|
|
1586
|
+
* 解除指定聊天室中用户禁言
|
|
1587
|
+
*/
|
|
1588
|
+
UnmuteUsers = 0,
|
|
1589
|
+
/**
|
|
1590
|
+
* 禁言指定聊天室中用户
|
|
1591
|
+
*/
|
|
1592
|
+
MuteUsers = 1,
|
|
1593
|
+
/**
|
|
1594
|
+
* 解除聊天室全体禁言
|
|
1595
|
+
*/
|
|
1596
|
+
UnmuteAll = 2,
|
|
1597
|
+
/**
|
|
1598
|
+
* 聊天室全体禁言
|
|
1599
|
+
*/
|
|
1600
|
+
MuteAll = 3,
|
|
1601
|
+
/**
|
|
1602
|
+
* 移出禁言用户白名单
|
|
1603
|
+
*/
|
|
1604
|
+
RemoveWhitelist = 4,
|
|
1605
|
+
/**
|
|
1606
|
+
* 添加禁言用户白名单
|
|
1607
|
+
*/
|
|
1608
|
+
AddWhitelist = 5,
|
|
1609
|
+
/**
|
|
1610
|
+
* 解除用户聊天室全局禁言
|
|
1611
|
+
*/
|
|
1612
|
+
UnmuteGloble = 6,
|
|
1613
|
+
/**
|
|
1614
|
+
* 用户聊天室全局禁言
|
|
1615
|
+
*/
|
|
1616
|
+
MuteGloble = 7
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
/**
|
|
1620
|
+
* 聊天室多端同步时,离开聊天室的原因
|
|
1621
|
+
* @category Enum
|
|
1622
|
+
* @since 5.7.9
|
|
1623
|
+
*/
|
|
1624
|
+
declare enum ChatroomSyncStatusReason {
|
|
1625
|
+
/**
|
|
1626
|
+
* 自己主动离开
|
|
1627
|
+
*/
|
|
1628
|
+
LeaveOnMyOwn = 0,
|
|
1629
|
+
/**
|
|
1630
|
+
* 多端加入互踢导致离开
|
|
1631
|
+
*/
|
|
1632
|
+
OtherDeviceLogin = 1
|
|
1633
|
+
}
|
|
1634
|
+
|
|
1513
1635
|
declare enum StoreKeys {
|
|
1514
1636
|
/**
|
|
1515
1637
|
* Navi 数据缓存,暂未使用
|
|
@@ -1554,6 +1676,55 @@ declare enum UserGroupChangeType {
|
|
|
1554
1676
|
CHANNEL_BIND_USER_GROUP = 4,
|
|
1555
1677
|
CHANNEL_UNBIND_USER_GROUP = 5
|
|
1556
1678
|
}
|
|
1679
|
+
declare enum UltraMentionedType {
|
|
1680
|
+
/**
|
|
1681
|
+
* 非 @ 消息
|
|
1682
|
+
*/
|
|
1683
|
+
NOT_MENTIONED = 0,
|
|
1684
|
+
/**
|
|
1685
|
+
* 所有人
|
|
1686
|
+
*/
|
|
1687
|
+
ALL = 1,
|
|
1688
|
+
/**
|
|
1689
|
+
* 部分人
|
|
1690
|
+
*/
|
|
1691
|
+
ME = 2
|
|
1692
|
+
}
|
|
1693
|
+
|
|
1694
|
+
/**
|
|
1695
|
+
* 私有云、公有云枚举
|
|
1696
|
+
* 1 私有云
|
|
1697
|
+
* 0 公有云
|
|
1698
|
+
*/
|
|
1699
|
+
declare enum EnterpriseType {
|
|
1700
|
+
PRIVATE = 1,
|
|
1701
|
+
OPEN = 0
|
|
1702
|
+
}
|
|
1703
|
+
/**
|
|
1704
|
+
* 协议表示枚举
|
|
1705
|
+
*/
|
|
1706
|
+
declare enum ProtocalType {
|
|
1707
|
+
NAVI = 1,
|
|
1708
|
+
TCP = 2,
|
|
1709
|
+
WS = 3
|
|
1710
|
+
}
|
|
1711
|
+
declare enum NaviCacheType {
|
|
1712
|
+
REQUEST = 0,
|
|
1713
|
+
LOCAL = 1
|
|
1714
|
+
}
|
|
1715
|
+
declare enum StatisticsVersion {
|
|
1716
|
+
CURRENT = 2
|
|
1717
|
+
}
|
|
1718
|
+
declare enum ConnectType {
|
|
1719
|
+
CONNECT = 0,
|
|
1720
|
+
RECONNECT = 1
|
|
1721
|
+
}
|
|
1722
|
+
declare enum ConnectReason {
|
|
1723
|
+
CONNECT = 0,
|
|
1724
|
+
RECONNECT = 1,
|
|
1725
|
+
REDIRECTED = 3,
|
|
1726
|
+
TIMEOUT = 4
|
|
1727
|
+
}
|
|
1557
1728
|
|
|
1558
1729
|
/**
|
|
1559
1730
|
* 音视频模式
|
|
@@ -2443,6 +2614,11 @@ interface IReceivedConversation {
|
|
|
2443
2614
|
*/
|
|
2444
2615
|
versionTime?: number;
|
|
2445
2616
|
unreadMentionedCount?: number;
|
|
2617
|
+
/**
|
|
2618
|
+
* @ 我的未读消息数
|
|
2619
|
+
* @since 5.7.9
|
|
2620
|
+
*/
|
|
2621
|
+
unreadMentionedMeCount?: number;
|
|
2446
2622
|
}
|
|
2447
2623
|
/**
|
|
2448
2624
|
* @category Interface
|
|
@@ -2504,6 +2680,11 @@ interface IUpdatedConversation {
|
|
|
2504
2680
|
* @ 消息未读数
|
|
2505
2681
|
*/
|
|
2506
2682
|
unreadMentionedCount?: number;
|
|
2683
|
+
/**
|
|
2684
|
+
* @ 我的未读消息数
|
|
2685
|
+
* @since 5.7.9
|
|
2686
|
+
*/
|
|
2687
|
+
unreadMentionedMeCount?: number;
|
|
2507
2688
|
}
|
|
2508
2689
|
/**
|
|
2509
2690
|
* @category Interface
|
|
@@ -2569,6 +2750,15 @@ interface IUltraUnreadConversation {
|
|
|
2569
2750
|
targetId: string;
|
|
2570
2751
|
channelId?: string;
|
|
2571
2752
|
}
|
|
2753
|
+
interface IUltraGroupUnreadInfo {
|
|
2754
|
+
type: ConversationType;
|
|
2755
|
+
targetId: string;
|
|
2756
|
+
channelId: string;
|
|
2757
|
+
unreadMessageCount: number;
|
|
2758
|
+
mentionedCount: number;
|
|
2759
|
+
mentionedMeCount: number;
|
|
2760
|
+
notificationLevel: NotificationLevel;
|
|
2761
|
+
}
|
|
2572
2762
|
|
|
2573
2763
|
/**
|
|
2574
2764
|
* @category Interface
|
|
@@ -2630,6 +2820,92 @@ interface IChatroomUserChangeInfo {
|
|
|
2630
2820
|
};
|
|
2631
2821
|
chatroomId: string;
|
|
2632
2822
|
}
|
|
2823
|
+
/**
|
|
2824
|
+
* @category Interface
|
|
2825
|
+
* @since 5.7.9
|
|
2826
|
+
*/
|
|
2827
|
+
interface IChatroomNotifyMultiLoginSync {
|
|
2828
|
+
/**
|
|
2829
|
+
* 聊天室ID
|
|
2830
|
+
*/
|
|
2831
|
+
chatroomId: string;
|
|
2832
|
+
/**
|
|
2833
|
+
* 变更的状态,0:离开, 1:加入
|
|
2834
|
+
*/
|
|
2835
|
+
status: ChrmSyncStatus;
|
|
2836
|
+
/**
|
|
2837
|
+
* 如果status是0的情况,区分离开类型,0:主动离开, 1:多端加入被踢
|
|
2838
|
+
*/
|
|
2839
|
+
reason: ChatroomSyncStatusReason;
|
|
2840
|
+
/**
|
|
2841
|
+
* 用户加入/退出/被踢的时间(毫秒时间戳)
|
|
2842
|
+
*/
|
|
2843
|
+
time: number;
|
|
2844
|
+
/**
|
|
2845
|
+
* 附加信息
|
|
2846
|
+
*/
|
|
2847
|
+
extra: string;
|
|
2848
|
+
}
|
|
2849
|
+
/**
|
|
2850
|
+
* @category Interface
|
|
2851
|
+
* @since 5.7.9
|
|
2852
|
+
*/
|
|
2853
|
+
interface IChatroomNotifyBlock {
|
|
2854
|
+
/**
|
|
2855
|
+
* 聊天室ID
|
|
2856
|
+
*/
|
|
2857
|
+
chatroomId: string;
|
|
2858
|
+
/**
|
|
2859
|
+
* 封禁类型,0是解封,1是封禁
|
|
2860
|
+
*/
|
|
2861
|
+
operateType: ChrmMemOperateType;
|
|
2862
|
+
/**
|
|
2863
|
+
* 封禁时长(毫秒),封禁时有此字段,封禁时长最大值为43200分钟(1个月), 最小值1分钟
|
|
2864
|
+
*/
|
|
2865
|
+
durationTime: number;
|
|
2866
|
+
/**
|
|
2867
|
+
* 操作时间(毫秒时间戳)
|
|
2868
|
+
*/
|
|
2869
|
+
operateTime: number;
|
|
2870
|
+
/**
|
|
2871
|
+
* 被封禁/解封的用户 ID 列表
|
|
2872
|
+
*/
|
|
2873
|
+
userIdList: string[];
|
|
2874
|
+
/**
|
|
2875
|
+
* 附加信息
|
|
2876
|
+
*/
|
|
2877
|
+
extra: string;
|
|
2878
|
+
}
|
|
2879
|
+
/**
|
|
2880
|
+
* @category Interface
|
|
2881
|
+
* @since 5.7.9
|
|
2882
|
+
*/
|
|
2883
|
+
interface IChatroomNotifyBan {
|
|
2884
|
+
/**
|
|
2885
|
+
* 聊天室ID
|
|
2886
|
+
*/
|
|
2887
|
+
chatroomId: string;
|
|
2888
|
+
/**
|
|
2889
|
+
* 禁言类型
|
|
2890
|
+
*/
|
|
2891
|
+
banType: ChrmMemBanType;
|
|
2892
|
+
/**
|
|
2893
|
+
* 禁言时长(毫秒),禁言时有此字段,禁言时长最大值为43200分钟(1个月), 最小值1分钟
|
|
2894
|
+
*/
|
|
2895
|
+
durationTime: number;
|
|
2896
|
+
/**
|
|
2897
|
+
* 操作时间(毫秒时间戳)
|
|
2898
|
+
*/
|
|
2899
|
+
operateTime: number;
|
|
2900
|
+
/**
|
|
2901
|
+
* 禁言/解禁言用户 ID 列表
|
|
2902
|
+
*/
|
|
2903
|
+
userIdList: string[];
|
|
2904
|
+
/**
|
|
2905
|
+
* 附加信息
|
|
2906
|
+
*/
|
|
2907
|
+
extra: string;
|
|
2908
|
+
}
|
|
2633
2909
|
declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
|
|
2634
2910
|
/**
|
|
2635
2911
|
* 聊天室信息
|
|
@@ -2652,6 +2928,18 @@ interface IChatroomListenerData {
|
|
|
2652
2928
|
* 聊天室销毁
|
|
2653
2929
|
*/
|
|
2654
2930
|
chatroomDestroyed?: string;
|
|
2931
|
+
/**
|
|
2932
|
+
* 加入退出多端同步通知
|
|
2933
|
+
*/
|
|
2934
|
+
chatroomNotifyMultiLoginSync?: IChatroomNotifyMultiLoginSync;
|
|
2935
|
+
/**
|
|
2936
|
+
* 聊天室用户封禁通知
|
|
2937
|
+
*/
|
|
2938
|
+
chatroomNotifyBlock?: IChatroomNotifyBlock;
|
|
2939
|
+
/**
|
|
2940
|
+
* 聊天室用户禁言通知
|
|
2941
|
+
*/
|
|
2942
|
+
chatroomNotifyBan?: IChatroomNotifyBan;
|
|
2655
2943
|
}
|
|
2656
2944
|
/**
|
|
2657
2945
|
* @category Interface
|
|
@@ -2961,14 +3249,15 @@ interface IProxy {
|
|
|
2961
3249
|
|
|
2962
3250
|
declare enum HttpMethod {
|
|
2963
3251
|
GET = "GET",
|
|
2964
|
-
POST = "POST"
|
|
3252
|
+
POST = "POST",
|
|
3253
|
+
PUT = "PUT"
|
|
2965
3254
|
}
|
|
2966
3255
|
interface IRequest {
|
|
2967
3256
|
url: string;
|
|
2968
3257
|
/**
|
|
2969
3258
|
* @default `HttpMethod.GET`
|
|
2970
3259
|
*/
|
|
2971
|
-
method?: HttpMethod | 'GET' | 'POST';
|
|
3260
|
+
method?: HttpMethod | 'GET' | 'POST' | 'PUT';
|
|
2972
3261
|
/**
|
|
2973
3262
|
* 查询数据
|
|
2974
3263
|
*/
|
|
@@ -2998,6 +3287,10 @@ interface IRequest {
|
|
|
2998
3287
|
* socks5 代理参数,仅 Electron 平台有效,web 平台默认为 null
|
|
2999
3288
|
*/
|
|
3000
3289
|
proxy?: IProxy | null;
|
|
3290
|
+
/**
|
|
3291
|
+
* 进度回调
|
|
3292
|
+
*/
|
|
3293
|
+
onProgress?: (progress: ProgressEvent) => void;
|
|
3001
3294
|
}
|
|
3002
3295
|
interface IStorage {
|
|
3003
3296
|
setItem(key: string, value: string): void;
|
|
@@ -3008,6 +3301,7 @@ interface IStorage {
|
|
|
3008
3301
|
interface IResponse {
|
|
3009
3302
|
status: number;
|
|
3010
3303
|
data?: string;
|
|
3304
|
+
xhr?: XMLHttpRequest;
|
|
3011
3305
|
}
|
|
3012
3306
|
/**
|
|
3013
3307
|
* 网络状态枚举
|
|
@@ -3055,6 +3349,10 @@ interface IWebSocket {
|
|
|
3055
3349
|
*/
|
|
3056
3350
|
close(code?: number, reason?: string): void;
|
|
3057
3351
|
}
|
|
3352
|
+
interface INetwork {
|
|
3353
|
+
status: boolean;
|
|
3354
|
+
type: NetworkType;
|
|
3355
|
+
}
|
|
3058
3356
|
/**
|
|
3059
3357
|
* 平台运行时抽象
|
|
3060
3358
|
*/
|
|
@@ -3097,6 +3395,16 @@ interface IRuntime {
|
|
|
3097
3395
|
* 2g 3g 4g wifi unkown
|
|
3098
3396
|
*/
|
|
3099
3397
|
getNetworkType(): Promise<NetworkType>;
|
|
3398
|
+
/**
|
|
3399
|
+
* 网络状态变更监听
|
|
3400
|
+
* @since 5.7.9
|
|
3401
|
+
*/
|
|
3402
|
+
setNetworkStatusListener: (callback: any) => void;
|
|
3403
|
+
/**
|
|
3404
|
+
* 去除网络状态变更监听
|
|
3405
|
+
* @since 5.7.9
|
|
3406
|
+
*/
|
|
3407
|
+
removeNetworkStatusListener: () => void;
|
|
3100
3408
|
}
|
|
3101
3409
|
|
|
3102
3410
|
/**
|
|
@@ -3112,7 +3420,32 @@ interface IExtraMethod {
|
|
|
3112
3420
|
}
|
|
3113
3421
|
|
|
3114
3422
|
/**
|
|
3115
|
-
*
|
|
3423
|
+
* 连接协议
|
|
3424
|
+
* 截止 5.7.4 版本,暂不支持 rpp 和 quic
|
|
3425
|
+
* v2 版本文档: https://a5bq662kv5.feishu.cn/wiki/wikcnfo3lEo2CPbonDxuXFvU0Kb#K7nbeN
|
|
3426
|
+
*/
|
|
3427
|
+
declare enum EConnectProtocol {
|
|
3428
|
+
RMTP = 1,
|
|
3429
|
+
TLS = 2,
|
|
3430
|
+
RPP = 3,
|
|
3431
|
+
QUIC = 4,
|
|
3432
|
+
WS = 5,
|
|
3433
|
+
WSS = 6
|
|
3434
|
+
}
|
|
3435
|
+
interface INaviRequestOption {
|
|
3436
|
+
appkey: string;
|
|
3437
|
+
uri: string;
|
|
3438
|
+
token: string;
|
|
3439
|
+
platform: string;
|
|
3440
|
+
isTcp?: boolean;
|
|
3441
|
+
}
|
|
3442
|
+
interface ICmpData {
|
|
3443
|
+
addr: string;
|
|
3444
|
+
protocol: EConnectProtocol;
|
|
3445
|
+
weight: number;
|
|
3446
|
+
}
|
|
3447
|
+
/**
|
|
3448
|
+
* 导航信息数据结构
|
|
3116
3449
|
*/
|
|
3117
3450
|
interface INaviInfo {
|
|
3118
3451
|
/**
|
|
@@ -3139,15 +3472,18 @@ interface INaviInfo {
|
|
|
3139
3472
|
/**
|
|
3140
3473
|
* CMP 服务 Websocket 连接地址,包含域名与端口,不含 ws 或 wss 协议头
|
|
3141
3474
|
* @example a.domain.com:443
|
|
3475
|
+
* @note 在 V2 版本废弃
|
|
3142
3476
|
*/
|
|
3143
3477
|
server: string;
|
|
3144
3478
|
/**
|
|
3145
3479
|
* 备用 CMP 服务地址,包含域名与端口,不含 ws 或 wss 协议头,多个备用地址以 ',' 分割
|
|
3146
3480
|
* @example a.domain.com:443,b.domain.com:443
|
|
3481
|
+
* @note 在 V2 版本废弃
|
|
3147
3482
|
*/
|
|
3148
3483
|
backupServer?: string;
|
|
3149
3484
|
/**
|
|
3150
3485
|
* 备用 CMP 服务地址,POST 请求 TCP 连接返回的是 bs 字段,非 backupServer 字段
|
|
3486
|
+
* @note 在 V2 版本废弃
|
|
3151
3487
|
*/
|
|
3152
3488
|
bs?: string;
|
|
3153
3489
|
/**
|
|
@@ -3186,8 +3522,9 @@ interface INaviInfo {
|
|
|
3186
3522
|
* @description
|
|
3187
3523
|
* 1. 公有云下,该地址为七牛云服务器地址
|
|
3188
3524
|
* 2. 私有云下,该地址为私有云自研文件服务器地址
|
|
3525
|
+
* @note 在 V2 版本废弃
|
|
3189
3526
|
*/
|
|
3190
|
-
uploadServer
|
|
3527
|
+
uploadServer?: string;
|
|
3191
3528
|
/**
|
|
3192
3529
|
* 实时位置共享配置,web 端无需处理
|
|
3193
3530
|
*/
|
|
@@ -3230,114 +3567,406 @@ interface INaviInfo {
|
|
|
3230
3567
|
*/
|
|
3231
3568
|
grpMsgLimit: number;
|
|
3232
3569
|
/**
|
|
3233
|
-
* 消息加密开关,0 为关闭
|
|
3234
|
-
* @todo
|
|
3235
|
-
* 1. 确定其控制的功能
|
|
3236
|
-
* 2. 确定 web 相关性
|
|
3570
|
+
* 消息加密开关,0 为关闭
|
|
3571
|
+
* @todo
|
|
3572
|
+
* 1. 确定其控制的功能
|
|
3573
|
+
* 2. 确定 web 相关性
|
|
3574
|
+
* @note 在 V2 版本废弃
|
|
3575
|
+
*/
|
|
3576
|
+
isFormatted: number;
|
|
3577
|
+
/**
|
|
3578
|
+
* GIF 动图大小限制,默认 2048 KB
|
|
3579
|
+
*/
|
|
3580
|
+
gifSize: number;
|
|
3581
|
+
/**
|
|
3582
|
+
* 上传小视频时长限制,单位:秒
|
|
3583
|
+
* @description 公有云字段,即私有云配置中的 `uploadVideoTimeLimit`
|
|
3584
|
+
*/
|
|
3585
|
+
videoTimes?: number;
|
|
3586
|
+
/**
|
|
3587
|
+
* 上传小视频时长限制,单位:秒
|
|
3588
|
+
* @description 私有云字段,即公有云配置中的 `videoTimes`
|
|
3589
|
+
*/
|
|
3590
|
+
uploadVideoTimeLimit?: number;
|
|
3591
|
+
/**
|
|
3592
|
+
* 实时日志上传开关:`0` 为关闭,`1` 为开启
|
|
3593
|
+
*/
|
|
3594
|
+
logSwitch: number;
|
|
3595
|
+
/**
|
|
3596
|
+
* 实时日志上传策略,值为 JSON 字符串
|
|
3597
|
+
* @example `'{
|
|
3598
|
+
* "url": "logcollection.ronghub.com", // 上传地址
|
|
3599
|
+
* "level": 1, // 日志等级
|
|
3600
|
+
* "itv": 6, // 上传频率,即时间间隔,单位 s
|
|
3601
|
+
* "times": 5 // 重试次数?
|
|
3602
|
+
* }'`
|
|
3603
|
+
*/
|
|
3604
|
+
logPolicy: string;
|
|
3605
|
+
/**
|
|
3606
|
+
* 百度 BOS 存储服务地址
|
|
3607
|
+
* @description 公有云独有配置
|
|
3608
|
+
* @example `gz.bcebos.com`
|
|
3609
|
+
* @deprecated 已废弃
|
|
3610
|
+
*/
|
|
3611
|
+
bosAddr?: string;
|
|
3612
|
+
/**
|
|
3613
|
+
* 阿里上传配置,字符串数组,数组顺序代表 七牛、百度、阿里云 上传权重
|
|
3614
|
+
* @example
|
|
3615
|
+
* ```
|
|
3616
|
+
* `[{"qiniu":"upload.qiniup.com","p":"1"},
|
|
3617
|
+
* {"baidu":"gz.bcebos.com","p":"2"},
|
|
3618
|
+
* {"aliyun":"oss-cn-beijing.aliyuncs.com","p":"3"}]`
|
|
3619
|
+
* ```
|
|
3620
|
+
*/
|
|
3621
|
+
ossConfig?: string;
|
|
3622
|
+
/**
|
|
3623
|
+
* 私有云专有属性,可用来判断当前环境是公有云还是私有云,私有云环境下该值为 `1`
|
|
3624
|
+
*/
|
|
3625
|
+
type?: number;
|
|
3626
|
+
/**
|
|
3627
|
+
* @deprecated 已废弃
|
|
3628
|
+
*/
|
|
3629
|
+
compDays: number;
|
|
3630
|
+
/**
|
|
3631
|
+
* @deprecated 已废弃
|
|
3632
|
+
*/
|
|
3633
|
+
msgAck: unknown;
|
|
3634
|
+
/**
|
|
3635
|
+
* @deprecated 已废弃
|
|
3636
|
+
*/
|
|
3637
|
+
activeServer: string;
|
|
3638
|
+
/**
|
|
3639
|
+
* @deprecated 已废弃
|
|
3640
|
+
*/
|
|
3641
|
+
qnAddr: string;
|
|
3642
|
+
/**
|
|
3643
|
+
* @deprecated 已废弃
|
|
3644
|
+
*/
|
|
3645
|
+
extkitSwitch: number;
|
|
3646
|
+
/**
|
|
3647
|
+
* @deprecated 已废弃
|
|
3648
|
+
*/
|
|
3649
|
+
alone: boolean;
|
|
3650
|
+
/**
|
|
3651
|
+
* @deprecated 已废弃
|
|
3652
|
+
*/
|
|
3653
|
+
voipServer: string;
|
|
3654
|
+
/**
|
|
3655
|
+
* 离线日志上报地址
|
|
3656
|
+
* @deprecated 已废弃
|
|
3657
|
+
*/
|
|
3658
|
+
offlinelogserver: string;
|
|
3659
|
+
/**
|
|
3660
|
+
* 在线日志上报地址
|
|
3661
|
+
* @deprecated 已废弃
|
|
3662
|
+
*/
|
|
3663
|
+
onlinelogserver?: string;
|
|
3664
|
+
/**
|
|
3665
|
+
* 链路加密字段,内容为 JSON 字符串,仅限 C++ 可用
|
|
3666
|
+
* @note 在 V2 版本废弃
|
|
3667
|
+
*/
|
|
3668
|
+
crypto?: string;
|
|
3669
|
+
/**
|
|
3670
|
+
* 群组回执开关, 1: 打开,0(或者没有): 关闭
|
|
3671
|
+
*/
|
|
3672
|
+
grpRRVer?: number;
|
|
3673
|
+
/**
|
|
3674
|
+
* 防黑产开关, 1: 打开,0:关闭
|
|
3675
|
+
*/
|
|
3676
|
+
openAnti?: number;
|
|
3677
|
+
/**
|
|
3678
|
+
* 鉴权认证
|
|
3679
|
+
*/
|
|
3680
|
+
jwt?: string;
|
|
3681
|
+
/**
|
|
3682
|
+
* 数据中心
|
|
3683
|
+
*/
|
|
3684
|
+
dc?: string;
|
|
3685
|
+
/**
|
|
3686
|
+
* 是否开启 tls
|
|
3687
|
+
*/
|
|
3688
|
+
openTLS?: number;
|
|
3689
|
+
/**
|
|
3690
|
+
* V2 版本中新增字段
|
|
3691
|
+
* 服务地址列表
|
|
3692
|
+
*/
|
|
3693
|
+
serverAddr?: ICmpData[];
|
|
3694
|
+
/**
|
|
3695
|
+
* V2 版本中新增字段
|
|
3696
|
+
* 新版本控制tag
|
|
3697
|
+
*/
|
|
3698
|
+
excludeLogTag?: string;
|
|
3699
|
+
}
|
|
3700
|
+
|
|
3701
|
+
declare type Content = string | number | boolean | null;
|
|
3702
|
+
declare type Type = 'IM' | 'RTC';
|
|
3703
|
+
/**
|
|
3704
|
+
* 对外暴露的 Logger 工具接口定义,以隐藏 BasicLogger 其他实现
|
|
3705
|
+
*/
|
|
3706
|
+
interface IStatistic {
|
|
3707
|
+
/**
|
|
3708
|
+
* 设置日志打印等级,默认为 `LogL.WARN`
|
|
3709
|
+
* @param level
|
|
3710
|
+
*/
|
|
3711
|
+
/**
|
|
3712
|
+
* 创建事务追踪 ID,全局唯一,便于跨进程、异步事务追踪,需要考虑多进程
|
|
3713
|
+
*/
|
|
3714
|
+
createTraceId(): string;
|
|
3715
|
+
}
|
|
3716
|
+
|
|
3717
|
+
/**
|
|
3718
|
+
* LogLevel 等级定义,与大数据服务器日志等级保持一致
|
|
3719
|
+
*/
|
|
3720
|
+
declare enum StatisticL {
|
|
3721
|
+
/**
|
|
3722
|
+
* IM 质量数据日志,控制台不打印
|
|
3723
|
+
*/
|
|
3724
|
+
STATISTICS = -2,
|
|
3725
|
+
/**
|
|
3726
|
+
* 接口调用日志等级【一期日志埋点标识】
|
|
3727
|
+
*/
|
|
3728
|
+
RECORD = -1
|
|
3729
|
+
}
|
|
3730
|
+
|
|
3731
|
+
interface IStatisticData {
|
|
3732
|
+
/**
|
|
3733
|
+
* 日志原始内容
|
|
3734
|
+
*/
|
|
3735
|
+
content?: Content;
|
|
3736
|
+
/**
|
|
3737
|
+
* 日志标签,如 `L-INIT-O`
|
|
3738
|
+
*/
|
|
3739
|
+
tag: string;
|
|
3740
|
+
/**
|
|
3741
|
+
* logger 实例 Id,用于确定日志由谁埋点,如 `RCEngien` 为 engine 包埋点日志
|
|
3742
|
+
*/
|
|
3743
|
+
loggerId: string;
|
|
3744
|
+
/**
|
|
3745
|
+
* 日志生成时间
|
|
3746
|
+
*/
|
|
3747
|
+
time: number;
|
|
3748
|
+
/**
|
|
3749
|
+
* 应用的声明周期 sessionId
|
|
3750
|
+
* @description
|
|
3751
|
+
* Electron 环境下,以主进程 sessionId 入库,渲染进程 sessionId 存储于 content 内。
|
|
3752
|
+
* 日志上报时,通过 `${mainSessionId}:${renderSessionId}` 形式作为 sessionId 上报
|
|
3753
|
+
* @TODO 需确认服务是否允许 `${mainSessionId}:${renderSessionId}` 的方式,以及 sessionId 是否超出长度。
|
|
3754
|
+
*/
|
|
3755
|
+
sessionId: string;
|
|
3756
|
+
/**
|
|
3757
|
+
* 日志类型,仅用于大数据后台查阅统计
|
|
3758
|
+
*/
|
|
3759
|
+
type: 'IM' | 'RTC';
|
|
3760
|
+
/**
|
|
3761
|
+
* 日志等级,该等级与服务器统计等级保持一致,为入库等级
|
|
3762
|
+
*/
|
|
3763
|
+
level: StatisticL;
|
|
3764
|
+
/**
|
|
3765
|
+
* 事务跟踪 ID
|
|
3766
|
+
*/
|
|
3767
|
+
traceId?: string;
|
|
3768
|
+
}
|
|
3769
|
+
|
|
3770
|
+
/**
|
|
3771
|
+
* 日志数据库接口
|
|
3772
|
+
*/
|
|
3773
|
+
interface IStatisticDB {
|
|
3774
|
+
/**
|
|
3775
|
+
* 获取实时日志上报的时间戳记录。
|
|
3776
|
+
* 时间戳不以人为维度记录,避免换账户登录时,一次拉取巨量的历史日志。
|
|
3777
|
+
*/
|
|
3778
|
+
getTimestamp4RealtimeLog(): number;
|
|
3779
|
+
/**
|
|
3780
|
+
* 设置实时日志上报的时间戳记录
|
|
3781
|
+
* @param timestamp
|
|
3782
|
+
*/
|
|
3783
|
+
setTimestamp4RealtimeLog(timestamp: number): void;
|
|
3784
|
+
/**
|
|
3785
|
+
* 根据时间戳和日志等级获取全量日志
|
|
3786
|
+
* @param startTime
|
|
3787
|
+
* @param endTime
|
|
3788
|
+
* @param level
|
|
3789
|
+
* @param realtimeReport 是否实时上报。实时上报时,需要取质量数据日志
|
|
3790
|
+
*/
|
|
3791
|
+
getStatistics(startTime: number, endTime: number, level: StatisticL, realtimeReport: boolean): Promise<{
|
|
3792
|
+
logs: IStatisticData[];
|
|
3793
|
+
dbReady: boolean;
|
|
3794
|
+
}>;
|
|
3795
|
+
}
|
|
3796
|
+
|
|
3797
|
+
/**
|
|
3798
|
+
* 初始化 DB 模块,按 APPKEY 分库,后续需要将日志与业务数据库也分开
|
|
3799
|
+
* @param appkey
|
|
3800
|
+
* @param logger
|
|
3801
|
+
* @param expireTime 日志有效期,单位 `h`,默认为 `168h`
|
|
3802
|
+
*/
|
|
3803
|
+
declare const initStatisticDB: (appkey: string, logger: ILogger, expireTime?: number) => void;
|
|
3804
|
+
/**
|
|
3805
|
+
* IndexDB 日志数据库反初始化,在切换 APPKEY 时调用
|
|
3806
|
+
* @returns
|
|
3807
|
+
*/
|
|
3808
|
+
declare const unInitStatisticDB: () => Promise<void>;
|
|
3809
|
+
|
|
3810
|
+
/**
|
|
3811
|
+
* 日志数据转为 csv 结构数据
|
|
3812
|
+
* @param log
|
|
3813
|
+
* @returns
|
|
3814
|
+
*/
|
|
3815
|
+
declare const statisticTranscsv: (log: IStatisticData) => string;
|
|
3816
|
+
|
|
3817
|
+
/**
|
|
3818
|
+
* Statistic 抽象基类,定义埋点采集接口,
|
|
3819
|
+
* 由子类继承实现入库逻辑
|
|
3820
|
+
*/
|
|
3821
|
+
declare abstract class BasicStatistic {
|
|
3822
|
+
protected readonly _appkey: string;
|
|
3823
|
+
protected readonly _id: string;
|
|
3824
|
+
protected readonly _type: Type;
|
|
3825
|
+
constructor(_appkey: string, _id: string, _type: Type);
|
|
3826
|
+
/**
|
|
3827
|
+
* 由子类继承实现日志入库
|
|
3828
|
+
* @override
|
|
3237
3829
|
*/
|
|
3238
|
-
|
|
3830
|
+
protected abstract flush(data: IStatisticData): void;
|
|
3831
|
+
private _writer;
|
|
3239
3832
|
/**
|
|
3240
|
-
*
|
|
3833
|
+
* 内部质量数据统计接口,仅限 IMLib 与 RTCLib 内部使用
|
|
3241
3834
|
*/
|
|
3242
|
-
|
|
3835
|
+
__statistics: (tag: string, content?: Content | undefined, traceId?: string | undefined) => void;
|
|
3243
3836
|
/**
|
|
3244
|
-
*
|
|
3245
|
-
* @description 公有云字段,即私有云配置中的 `uploadVideoTimeLimit`
|
|
3837
|
+
* 创建事务追踪 ID,全局唯一,便于跨进程、异步事务追踪,需要考虑多进程
|
|
3246
3838
|
*/
|
|
3247
|
-
|
|
3839
|
+
createTraceId(): string;
|
|
3248
3840
|
/**
|
|
3249
|
-
*
|
|
3250
|
-
* @
|
|
3841
|
+
* 获取当前进程的 sessionId,全局唯一
|
|
3842
|
+
* @returns
|
|
3251
3843
|
*/
|
|
3252
|
-
|
|
3844
|
+
getSessionId(): string;
|
|
3845
|
+
}
|
|
3846
|
+
|
|
3847
|
+
/**
|
|
3848
|
+
* 日志上报工具,负责处理实时日志上报和下消息拉日志业务。
|
|
3849
|
+
* 通过 DB 和 Logger 两个抽象接口组合使用,
|
|
3850
|
+
* 避免业务与不同平台不同的 DB 数据库耦合,从而最大限度代码复用,
|
|
3851
|
+
* 上报工具仅处理业务,无需关心 DB 和 Logger 的实际类型
|
|
3852
|
+
*/
|
|
3853
|
+
declare abstract class BasicStatisticReporter {
|
|
3854
|
+
private appkey;
|
|
3855
|
+
private deviceId;
|
|
3253
3856
|
/**
|
|
3254
|
-
*
|
|
3857
|
+
* 设备描述信息
|
|
3255
3858
|
*/
|
|
3256
|
-
|
|
3859
|
+
private deviceInfo;
|
|
3257
3860
|
/**
|
|
3258
|
-
*
|
|
3259
|
-
* @example `'{
|
|
3260
|
-
* "url": "logcollection.ronghub.com", // 上传地址
|
|
3261
|
-
* "level": 1, // 日志等级
|
|
3262
|
-
* "itv": 6, // 上传频率,即时间间隔,单位 s
|
|
3263
|
-
* "times": 5 // 重试次数?
|
|
3264
|
-
* }'`
|
|
3861
|
+
* statistic 数据库实例,有日志数据库的读写方法,使上报与数据库解耦
|
|
3265
3862
|
*/
|
|
3266
|
-
|
|
3863
|
+
protected readonly statisticDB: IStatisticDB;
|
|
3267
3864
|
/**
|
|
3268
|
-
*
|
|
3269
|
-
* @description 公有云独有配置
|
|
3270
|
-
* @example `gz.bcebos.com`
|
|
3865
|
+
* logger 实例
|
|
3271
3866
|
*/
|
|
3272
|
-
|
|
3867
|
+
protected readonly logger: BasicLogger;
|
|
3273
3868
|
/**
|
|
3274
|
-
*
|
|
3275
|
-
* @example
|
|
3276
|
-
* ```
|
|
3277
|
-
* `[{"qiniu":"upload.qiniup.com","p":"1"},
|
|
3278
|
-
* {"baidu":"gz.bcebos.com","p":"2"},
|
|
3279
|
-
* {"aliyun":"oss-cn-beijing.aliyuncs.com","p":"3"}]`
|
|
3280
|
-
* ```
|
|
3869
|
+
* 上报主体类实例
|
|
3281
3870
|
*/
|
|
3282
|
-
|
|
3871
|
+
protected readonly reportClass: BasicLogger | BasicStatistic;
|
|
3283
3872
|
/**
|
|
3284
|
-
*
|
|
3873
|
+
* 当前用户 id
|
|
3285
3874
|
*/
|
|
3286
|
-
|
|
3875
|
+
protected userId: string;
|
|
3876
|
+
constructor(appkey: string, deviceId: string,
|
|
3287
3877
|
/**
|
|
3288
|
-
*
|
|
3878
|
+
* 设备描述信息
|
|
3289
3879
|
*/
|
|
3290
|
-
|
|
3880
|
+
deviceInfo: string,
|
|
3291
3881
|
/**
|
|
3292
|
-
*
|
|
3882
|
+
* statistic 数据库实例,有日志数据库的读写方法,使上报与数据库解耦
|
|
3293
3883
|
*/
|
|
3294
|
-
|
|
3884
|
+
statisticDB: IStatisticDB,
|
|
3295
3885
|
/**
|
|
3296
|
-
*
|
|
3886
|
+
* logger 实例
|
|
3297
3887
|
*/
|
|
3298
|
-
|
|
3888
|
+
logger: BasicLogger,
|
|
3299
3889
|
/**
|
|
3300
|
-
*
|
|
3890
|
+
* 上报主体类实例
|
|
3301
3891
|
*/
|
|
3302
|
-
|
|
3892
|
+
reportClass?: BasicLogger | BasicStatistic);
|
|
3893
|
+
private timer;
|
|
3894
|
+
protected started: boolean;
|
|
3303
3895
|
/**
|
|
3304
|
-
*
|
|
3896
|
+
* 根据配置启动实时日志上报,在导航获取完成后启动,导航中包含 userId 信息
|
|
3897
|
+
* 实时日志仅获取当前时间 - 10s 以前的日志上报,避免多页面并行写库造成数据遗漏
|
|
3305
3898
|
*/
|
|
3306
|
-
|
|
3899
|
+
checkStart(navi: INaviInfo): Promise<void>;
|
|
3307
3900
|
/**
|
|
3308
|
-
*
|
|
3901
|
+
* 实时日志上报
|
|
3902
|
+
* @override IndexDBReporter 重载此方法,增加同设备多页面多端时进程竞争检测
|
|
3309
3903
|
*/
|
|
3310
|
-
|
|
3904
|
+
protected realtimeReport(uri: string, level: StatisticL, itv: number): Promise<void>;
|
|
3905
|
+
protected abstract compressStatistics(logs: IStatisticData[]): Promise<{
|
|
3906
|
+
success: boolean;
|
|
3907
|
+
data: string;
|
|
3908
|
+
}>;
|
|
3311
3909
|
/**
|
|
3312
|
-
*
|
|
3910
|
+
* 处理下消息拉日志,以拉取包含 `LogL.DEBUG` 级别的全量日志
|
|
3911
|
+
* @param startTime 拉取起始时间
|
|
3912
|
+
* @param endTime 拉取结束时间
|
|
3913
|
+
* @param platform 平台
|
|
3914
|
+
* @param uri 本次拉取的上传地址,若无值,使用导航配置下发地址
|
|
3915
|
+
* @param logId 拉取事务 Id,用于上传日志时的 Http 请求
|
|
3916
|
+
* @param messageUId 消息 messageUId
|
|
3313
3917
|
*/
|
|
3314
|
-
|
|
3918
|
+
report(startTime: number, endTime: number, platform: string, uri: string, logId: string, messageUId: string): Promise<void>;
|
|
3315
3919
|
/**
|
|
3316
|
-
*
|
|
3317
|
-
* @
|
|
3920
|
+
* 以 `POST` 方法向服务发送日志数据
|
|
3921
|
+
* @param url
|
|
3922
|
+
* @param content
|
|
3318
3923
|
*/
|
|
3319
|
-
|
|
3924
|
+
protected abstract send(req: IRequest): Promise<IResponse>;
|
|
3320
3925
|
/**
|
|
3321
|
-
*
|
|
3322
|
-
* @deprecated 已废弃
|
|
3926
|
+
* 清理计时器,停止定时任务
|
|
3323
3927
|
*/
|
|
3324
|
-
|
|
3928
|
+
stop(): void;
|
|
3929
|
+
}
|
|
3930
|
+
|
|
3931
|
+
/**
|
|
3932
|
+
* 实现基于 IndexDB 存储的日志类
|
|
3933
|
+
*/
|
|
3934
|
+
declare class IndexDBStatistic extends BasicStatistic {
|
|
3935
|
+
protected flush(data: IStatisticData): void;
|
|
3936
|
+
}
|
|
3937
|
+
|
|
3938
|
+
declare class IndexDBStatisticReporter extends BasicStatisticReporter {
|
|
3939
|
+
private runtime;
|
|
3940
|
+
constructor(appkey: string, runtime: IRuntime, logger: BasicLogger,
|
|
3325
3941
|
/**
|
|
3326
|
-
*
|
|
3942
|
+
* 客户端配置的上报等级,仅限 Beem IndexDB 日志版本可用,不设置时,以服务器 navi 下发配置为准
|
|
3327
3943
|
*/
|
|
3328
|
-
|
|
3944
|
+
statisticLog: BasicStatistic);
|
|
3945
|
+
protected send(req: IRequest): Promise<IResponse>;
|
|
3329
3946
|
/**
|
|
3330
|
-
*
|
|
3947
|
+
* @override 重写实现
|
|
3331
3948
|
*/
|
|
3332
|
-
|
|
3949
|
+
checkStart(navi: INaviInfo): Promise<void>;
|
|
3950
|
+
protected compressStatistics(logs: IStatisticData[]): Promise<{
|
|
3951
|
+
success: boolean;
|
|
3952
|
+
data: string;
|
|
3953
|
+
}>;
|
|
3333
3954
|
/**
|
|
3334
|
-
*
|
|
3955
|
+
* 进程竞争检测,检查是否为执行上报的进程
|
|
3956
|
+
* @param callback
|
|
3957
|
+
* @returns
|
|
3335
3958
|
*/
|
|
3336
|
-
|
|
3959
|
+
private isReporter;
|
|
3337
3960
|
/**
|
|
3338
|
-
*
|
|
3961
|
+
* @param startTime
|
|
3962
|
+
* @param endTime
|
|
3963
|
+
* @param platform
|
|
3964
|
+
* @param uri
|
|
3965
|
+
* @param logId
|
|
3966
|
+
* @param messageUId
|
|
3339
3967
|
*/
|
|
3340
|
-
|
|
3968
|
+
report(startTime: number, endTime: number, platform: string, uri: string, logId: string, messageUId: string): Promise<void>;
|
|
3969
|
+
protected realtimeReport(url: string, level: StatisticL, itv: number): Promise<void>;
|
|
3341
3970
|
}
|
|
3342
3971
|
|
|
3343
3972
|
declare type INaviCache = {
|
|
@@ -3351,15 +3980,8 @@ declare type INaviCache = {
|
|
|
3351
3980
|
declare abstract class BasicNavi {
|
|
3352
3981
|
protected readonly appkey: string;
|
|
3353
3982
|
protected readonly logger: BasicLogger;
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
*/
|
|
3357
|
-
protected readonly navigators: string[];
|
|
3358
|
-
constructor(appkey: string, logger: BasicLogger,
|
|
3359
|
-
/**
|
|
3360
|
-
* 业务层的自定义导航配置
|
|
3361
|
-
*/
|
|
3362
|
-
navigators: string[]);
|
|
3983
|
+
protected readonly statisticLog: BasicStatistic;
|
|
3984
|
+
constructor(appkey: string, logger: BasicLogger, statisticLog: BasicStatistic);
|
|
3363
3985
|
/**
|
|
3364
3986
|
* 当前进行中的导航请求
|
|
3365
3987
|
*/
|
|
@@ -3371,7 +3993,7 @@ declare abstract class BasicNavi {
|
|
|
3371
3993
|
* @param ignoreExpire 是否忽略有效期检查。理论上只需要在建立连接时需要检测 navi 有效期,其他场景无需检测
|
|
3372
3994
|
* @param traceId 事务日志跟踪 ID
|
|
3373
3995
|
*/
|
|
3374
|
-
request(token: string, ignoreCache: boolean, ignoreExpire: boolean, traceId: string): IPromiseResult<INaviInfo>;
|
|
3996
|
+
request(token: string, ignoreCache: boolean, ignoreExpire: boolean, traceId: string, contextInfo?: INaviContextInfo): IPromiseResult<INaviInfo>;
|
|
3375
3997
|
private sendRequest;
|
|
3376
3998
|
/**
|
|
3377
3999
|
* 从指定服务列表中顺序尝试获取导航
|
|
@@ -3389,7 +4011,17 @@ declare abstract class BasicNavi {
|
|
|
3389
4011
|
* @param timeout 请求超时时间
|
|
3390
4012
|
* @param traceId
|
|
3391
4013
|
*/
|
|
3392
|
-
protected abstract httpRequest(uri: string, appkey: string, token: string,
|
|
4014
|
+
protected abstract httpRequest(uri: string, appkey: string, token: string, traceId: string, finished: boolean): IPromiseResult<INaviInfo>;
|
|
4015
|
+
/**
|
|
4016
|
+
* 向目标导航服务发送请求
|
|
4017
|
+
* @param uri 导航服务地址
|
|
4018
|
+
* @param appkey
|
|
4019
|
+
* @param token
|
|
4020
|
+
* @param version
|
|
4021
|
+
* @param timeout 请求超时时间
|
|
4022
|
+
* @param traceId
|
|
4023
|
+
*/
|
|
4024
|
+
protected abstract httpRequestV2(uri: string, appkey: string, token: string, traceId: string, finished: boolean): IPromiseResult<INaviInfo>;
|
|
3393
4025
|
/**
|
|
3394
4026
|
* 转换 Navi 接口 HTTP 请求状态码为 ErrorCode 定义
|
|
3395
4027
|
* @param code
|
|
@@ -3418,6 +4050,12 @@ declare abstract class BasicNavi {
|
|
|
3418
4050
|
* @param voipCallInfo
|
|
3419
4051
|
*/
|
|
3420
4052
|
updateVoipCallInfo(token: string, voipCallInfo: string): void;
|
|
4053
|
+
protected getNaviV2RequestOption(option: INaviRequestOption): IRequest;
|
|
4054
|
+
/**
|
|
4055
|
+
* 是否使用 v2 版本导航
|
|
4056
|
+
* 仅私有云 rcx 使用 v1 版本
|
|
4057
|
+
*/
|
|
4058
|
+
useV2Navi(): boolean;
|
|
3421
4059
|
}
|
|
3422
4060
|
|
|
3423
4061
|
/**
|
|
@@ -3425,16 +4063,9 @@ declare abstract class BasicNavi {
|
|
|
3425
4063
|
*/
|
|
3426
4064
|
declare class WebSocketNavi extends BasicNavi {
|
|
3427
4065
|
private runtime;
|
|
3428
|
-
|
|
3429
|
-
|
|
3430
|
-
|
|
3431
|
-
private readonly miniCmpUris;
|
|
3432
|
-
constructor(appkey: string, logger: BasicLogger, runtime: IRuntime,
|
|
3433
|
-
/**
|
|
3434
|
-
* 小程序平台服务地址,多个地址以 ',' 分割
|
|
3435
|
-
*/
|
|
3436
|
-
miniCmpUris: string, navigators?: string[]);
|
|
3437
|
-
protected httpRequest(uri: string, appkey: string, token: string, version: string, timeout: number, traceId: string, finished: boolean): IPromiseResult<INaviInfo>;
|
|
4066
|
+
constructor(appkey: string, logger: BasicLogger, statisticLog: BasicStatistic, runtime: IRuntime);
|
|
4067
|
+
protected httpRequest(uri: string, appkey: string, token: string, traceId: string, finished: boolean): IPromiseResult<INaviInfo>;
|
|
4068
|
+
protected httpRequestV2(uri: string, appkey: string, token: string, traceId: string): IPromiseResult<INaviInfo>;
|
|
3438
4069
|
protected getNaviCache(formatedToken: string): INaviCache | null;
|
|
3439
4070
|
protected setNaviCache(formatedToken: string, naviInfo: INaviInfo): void;
|
|
3440
4071
|
}
|
|
@@ -3577,18 +4208,32 @@ declare abstract class AConnectionMgr {
|
|
|
3577
4208
|
protected readonly appkey: string;
|
|
3578
4209
|
private navi;
|
|
3579
4210
|
protected logger: BasicLogger;
|
|
4211
|
+
protected statisticLog: BasicStatistic;
|
|
3580
4212
|
private listener;
|
|
3581
|
-
constructor(appkey: string, navi: BasicNavi, logger: BasicLogger, listener: IConnectionListener);
|
|
4213
|
+
constructor(appkey: string, navi: BasicNavi, logger: BasicLogger, statisticLog: BasicStatistic, listener: IConnectionListener);
|
|
3582
4214
|
/**
|
|
3583
4215
|
* 当前连接所用 token
|
|
3584
4216
|
*/
|
|
3585
4217
|
private token;
|
|
4218
|
+
protected curCmpUrl: string;
|
|
3586
4219
|
/**
|
|
3587
4220
|
* 获取当前连接中使用的 token
|
|
3588
4221
|
* @returns
|
|
3589
4222
|
*/
|
|
3590
4223
|
getToken(): string;
|
|
3591
4224
|
private reconnectKick;
|
|
4225
|
+
/**
|
|
4226
|
+
* 控制连接时长埋点开关
|
|
4227
|
+
*/
|
|
4228
|
+
private _connectDurSwitch;
|
|
4229
|
+
/**
|
|
4230
|
+
* 重连次数
|
|
4231
|
+
*/
|
|
4232
|
+
retryCount: number;
|
|
4233
|
+
uuid: string;
|
|
4234
|
+
reason: number;
|
|
4235
|
+
private connectedTime;
|
|
4236
|
+
private _network;
|
|
3592
4237
|
/**
|
|
3593
4238
|
* 当前连接状态
|
|
3594
4239
|
*/
|
|
@@ -3602,6 +4247,11 @@ declare abstract class AConnectionMgr {
|
|
|
3602
4247
|
* @returns
|
|
3603
4248
|
*/
|
|
3604
4249
|
getCurrentUserId(): string;
|
|
4250
|
+
/**
|
|
4251
|
+
* 缓存的 cmp 权重
|
|
4252
|
+
* disconnect 时重置
|
|
4253
|
+
*/
|
|
4254
|
+
protected cmpWeightCache?: ICmpData[];
|
|
3605
4255
|
/**
|
|
3606
4256
|
* 修改连接状态
|
|
3607
4257
|
* @param status
|
|
@@ -3613,6 +4263,16 @@ declare abstract class AConnectionMgr {
|
|
|
3613
4263
|
* @returns
|
|
3614
4264
|
*/
|
|
3615
4265
|
getConnectionStatus(): RCConnectionStatus;
|
|
4266
|
+
/**
|
|
4267
|
+
* 设置网络状态
|
|
4268
|
+
* @returns
|
|
4269
|
+
*/
|
|
4270
|
+
setNetwork(data: INetwork, isUnPrintLog?: boolean): void;
|
|
4271
|
+
/**
|
|
4272
|
+
* 获取网络连接状态
|
|
4273
|
+
* @returns
|
|
4274
|
+
*/
|
|
4275
|
+
getNetwork(): INetwork;
|
|
3616
4276
|
/**
|
|
3617
4277
|
* 建立连接
|
|
3618
4278
|
* @param token
|
|
@@ -3649,6 +4309,7 @@ declare abstract class AConnectionMgr {
|
|
|
3649
4309
|
*/
|
|
3650
4310
|
private createConnectionTask;
|
|
3651
4311
|
private reconnectTimer;
|
|
4312
|
+
private setReconnectReason;
|
|
3652
4313
|
/**
|
|
3653
4314
|
* 尝试重连
|
|
3654
4315
|
* @param ignoreNaviCache 是否忽略 navi 缓存以重新请求 navi
|
|
@@ -3701,6 +4362,15 @@ declare abstract class AConnectionMgr {
|
|
|
3701
4362
|
* 清理重连计时器
|
|
3702
4363
|
*/
|
|
3703
4364
|
private stopReconnectTimer;
|
|
4365
|
+
/**
|
|
4366
|
+
* 获取 CMP 列表
|
|
4367
|
+
*/
|
|
4368
|
+
protected getCmpList(navi: INaviInfo, isTcp?: boolean): ICmpData[];
|
|
4369
|
+
/**
|
|
4370
|
+
* 修改 CMP 权重
|
|
4371
|
+
*/
|
|
4372
|
+
protected updateCmpWeight(cmpUrl: string, isRise?: boolean): void;
|
|
4373
|
+
private clearCmpWeightCache;
|
|
3704
4374
|
}
|
|
3705
4375
|
|
|
3706
4376
|
/**
|
|
@@ -4551,6 +5221,93 @@ interface IUserGroupStatusInfo {
|
|
|
4551
5221
|
userGroupUnBindChannel?: IChannelAndUserGroupChangeData[];
|
|
4552
5222
|
}
|
|
4553
5223
|
|
|
5224
|
+
/**
|
|
5225
|
+
* IM-stats_cs-S 埋点数据
|
|
5226
|
+
*/
|
|
5227
|
+
interface IStatisticsCSData {
|
|
5228
|
+
cid: string;
|
|
5229
|
+
reason: ConnectReason;
|
|
5230
|
+
net: NetworkType;
|
|
5231
|
+
spr: EnterpriseType;
|
|
5232
|
+
}
|
|
5233
|
+
/**
|
|
5234
|
+
* 统计日志公共数据
|
|
5235
|
+
*/
|
|
5236
|
+
interface IBaseStatisticsData {
|
|
5237
|
+
bid: string;
|
|
5238
|
+
ptc: ProtocalType;
|
|
5239
|
+
net: NetworkType;
|
|
5240
|
+
cod: number;
|
|
5241
|
+
dur: number;
|
|
5242
|
+
pr: EnterpriseType;
|
|
5243
|
+
spr: EnterpriseType;
|
|
5244
|
+
hos: string;
|
|
5245
|
+
rsn: ConnectReason;
|
|
5246
|
+
v: number;
|
|
5247
|
+
cid: string;
|
|
5248
|
+
count: number;
|
|
5249
|
+
}
|
|
5250
|
+
/**
|
|
5251
|
+
* IM-stats_navi-S 埋点数据
|
|
5252
|
+
*/
|
|
5253
|
+
interface IStatisticsNaviData extends IBaseStatisticsData {
|
|
5254
|
+
cache: NaviCacheType;
|
|
5255
|
+
}
|
|
5256
|
+
/**
|
|
5257
|
+
* IM-stats_websocket-S 埋点数据
|
|
5258
|
+
*/
|
|
5259
|
+
interface IStatisticsWebsocketData extends IBaseStatisticsData {
|
|
5260
|
+
idx: number;
|
|
5261
|
+
rct: number;
|
|
5262
|
+
weight: number;
|
|
5263
|
+
}
|
|
5264
|
+
/**
|
|
5265
|
+
* IM-stats_websocket-S 埋点数据
|
|
5266
|
+
*/
|
|
5267
|
+
interface IStatisticsCMPData extends IBaseStatisticsData {
|
|
5268
|
+
ddu: number;
|
|
5269
|
+
idx: number;
|
|
5270
|
+
rct: number;
|
|
5271
|
+
weight: number;
|
|
5272
|
+
}
|
|
5273
|
+
/**
|
|
5274
|
+
* IM-stats_cmp_rmtp-S 质量埋点
|
|
5275
|
+
*/
|
|
5276
|
+
interface IStatisticsRMTPData {
|
|
5277
|
+
bid: string;
|
|
5278
|
+
net: NetworkType;
|
|
5279
|
+
spr: EnterpriseType;
|
|
5280
|
+
cod: number;
|
|
5281
|
+
dur: number;
|
|
5282
|
+
v: number;
|
|
5283
|
+
cid: string;
|
|
5284
|
+
count: number;
|
|
5285
|
+
}
|
|
5286
|
+
/**
|
|
5287
|
+
* IM-stats_cmp_rmtp-S 质量埋点
|
|
5288
|
+
*/
|
|
5289
|
+
interface IStatisticsDurData {
|
|
5290
|
+
bid: string;
|
|
5291
|
+
net: NetworkType;
|
|
5292
|
+
cod: number;
|
|
5293
|
+
dur: number;
|
|
5294
|
+
cid: string;
|
|
5295
|
+
}
|
|
5296
|
+
/**
|
|
5297
|
+
* IM-stats_cmp_rmtp-S 质量埋点
|
|
5298
|
+
*/
|
|
5299
|
+
interface IStatisticsNetworkData {
|
|
5300
|
+
cid: string;
|
|
5301
|
+
cn: NetworkType;
|
|
5302
|
+
on: NetworkType;
|
|
5303
|
+
}
|
|
5304
|
+
interface INaviContextInfo {
|
|
5305
|
+
retryCount: number;
|
|
5306
|
+
uuid: string;
|
|
5307
|
+
type: NetworkType;
|
|
5308
|
+
reason: ConnectReason;
|
|
5309
|
+
}
|
|
5310
|
+
|
|
4554
5311
|
/**
|
|
4555
5312
|
* 定义已废弃,请使用 `IRemoveChatroomEntries` 替换
|
|
4556
5313
|
* @deprecated
|
|
@@ -4810,6 +5567,12 @@ declare const DelayTimer: {
|
|
|
4810
5567
|
getTime: () => number;
|
|
4811
5568
|
};
|
|
4812
5569
|
|
|
5570
|
+
declare enum AreaCode {
|
|
5571
|
+
BJ = 1,
|
|
5572
|
+
SG = 2,
|
|
5573
|
+
NA = 3
|
|
5574
|
+
}
|
|
5575
|
+
|
|
4813
5576
|
declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
|
|
4814
5577
|
declare type IMessagesListnenr = (messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean) => void;
|
|
4815
5578
|
declare type IConnectionStatusListener = (status: RCConnectionStatus | ErrorCode | ConnectionStatus) => void;
|
|
@@ -4925,6 +5688,14 @@ interface IAPIContextOption {
|
|
|
4925
5688
|
* IndexDB 数据库内的日志有效期,单位为小时,有效值为 `24` - `168`,默认 IndexDB 内日志数据有效期 168 小时
|
|
4926
5689
|
*/
|
|
4927
5690
|
logExpireTime?: number;
|
|
5691
|
+
/**
|
|
5692
|
+
* 区域码
|
|
5693
|
+
*/
|
|
5694
|
+
areaCode?: AreaCode;
|
|
5695
|
+
/**
|
|
5696
|
+
* 日志服务地址
|
|
5697
|
+
*/
|
|
5698
|
+
logServerUrl?: string;
|
|
4928
5699
|
}
|
|
4929
5700
|
|
|
4930
5701
|
interface IPluginGenerator<API, InitOption> {
|
|
@@ -5066,6 +5837,52 @@ declare class APIContext {
|
|
|
5066
5837
|
private _processChrmMemChangeMessage;
|
|
5067
5838
|
private _processTypingStatusMessage;
|
|
5068
5839
|
private _processInterceptMessage;
|
|
5840
|
+
/**
|
|
5841
|
+
* 聊天室用户加入退出多端同步消息
|
|
5842
|
+
* @since 5.7.9
|
|
5843
|
+
* 多端登录相关事件通知回调,包含三种通知 case
|
|
5844
|
+
* 1. 多端登录情况, 一端加入聊天室, 需要通知另一终端, 指定聊天室中所有成员,包括当前加入用户
|
|
5845
|
+
* 2. 多端登录情况, 一端退出聊天室, 需要通知另一终端, 指定聊天室中所有成员,包括当前退出用户
|
|
5846
|
+
* 3. 用户多端加入聊天室场景: 用户在 Android 端加入聊天室, 在 Web 端登录后又加入一个新的聊天室,
|
|
5847
|
+
* 自动将用户从上一个聊天室踢出, 被踢出聊天室中的所有成员,包括被踢出用户
|
|
5848
|
+
* 注:case 3 如果开通了一个用户可加入多个聊天室的情况不会进行通知
|
|
5849
|
+
*/
|
|
5850
|
+
private _processChrmSyncMessage;
|
|
5851
|
+
/**
|
|
5852
|
+
* @since 5.7.9
|
|
5853
|
+
* 封禁用户相关事件通知回调, 包含两种通知 case
|
|
5854
|
+
* 1. 封禁用户,聊天室中所有成员,包括被封禁用户
|
|
5855
|
+
* 注:
|
|
5856
|
+
* 封禁后用户被自动踢出聊天室
|
|
5857
|
+
* 封禁后用户不会再收到被踢出的通知
|
|
5858
|
+
*
|
|
5859
|
+
* 2. 解除封禁,被解除封禁的成员
|
|
5860
|
+
* 注:
|
|
5861
|
+
* 用户未在线时,再登录时不会收到通知
|
|
5862
|
+
* 服务端仅对主动解除封禁做通知,封禁时间到了,自动解除的不通知, 此刻调用加入聊天室接口可成功
|
|
5863
|
+
*/
|
|
5864
|
+
private _processChrmMemBlockMessage;
|
|
5865
|
+
/**
|
|
5866
|
+
* @since 5.7.9
|
|
5867
|
+
* 禁言相关事件通知回调,包含以下 case
|
|
5868
|
+
* 注:禁言,受到白名单保护,即白名单中用户不会被禁言
|
|
5869
|
+
* 1. 禁言指定聊天室中用户,指定聊天室中任何成员
|
|
5870
|
+
* 2. 解除指定聊天室中用户禁言,指定聊天室中任何成员
|
|
5871
|
+
*
|
|
5872
|
+
* 注:全体禁言,也受到白名单保护,即白名单中用户不会被禁言
|
|
5873
|
+
* 3. 聊天室全体禁言,针对聊天室中所有成员
|
|
5874
|
+
* 4. 解除聊天室全体禁言,针对聊天室中所有成员
|
|
5875
|
+
*
|
|
5876
|
+
* 注:白名单是聊天室维度,添加后,用户在此聊天室内无法被设置禁言,即被保护
|
|
5877
|
+
* 生命周期跟随聊天室,销毁后,清空白名单,重建聊天室时,需要再次调用接口添加
|
|
5878
|
+
* 5. 添加禁言用户白名单,对应聊天室中所有成员
|
|
5879
|
+
* 6. 移出禁言用户白名单,对应聊天室中所有成员
|
|
5880
|
+
*
|
|
5881
|
+
* 注:全局禁言是最高优先级,全局禁言后,禁言用户在所有聊天室内都无法发言,即便配置白名单也不行
|
|
5882
|
+
* 7. 用户聊天室全局禁言,指定全局禁言用户
|
|
5883
|
+
* 8. 解除用户聊天室全局禁言,指定解除全局禁言用户
|
|
5884
|
+
*/
|
|
5885
|
+
private _processChrmMemBanMessage;
|
|
5069
5886
|
/**
|
|
5070
5887
|
* 消息处理器(v2/v4/next 版本中兼容)
|
|
5071
5888
|
* 返回 false | undefined:消息继续向上抛出,true:内部处理或转为事件回调,无需向上抛出
|
|
@@ -5602,6 +6419,10 @@ declare class APIContext {
|
|
|
5602
6419
|
* @returns 指定会话第一条未读消息时间戳
|
|
5603
6420
|
*/
|
|
5604
6421
|
getUltraGroupFirstUnreadMessageTimestamp(options: IUltraGroupOption): Promise<IAsyncRes<IUltraUnreadMsg>>;
|
|
6422
|
+
/**
|
|
6423
|
+
* 根据超级群的 targetId 数组,获取每个超级群下所有频道会话信息
|
|
6424
|
+
*/
|
|
6425
|
+
getUltraGroupUnreadInfoList(targetIds: string[]): Promise<IAsyncRes<IUltraGroupUnreadInfo[]>>;
|
|
5605
6426
|
/**
|
|
5606
6427
|
* 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
|
|
5607
6428
|
* 对于未实现的方法,接口响应 Unsupport 错误码
|
|
@@ -5724,6 +6545,9 @@ declare class APIContext {
|
|
|
5724
6545
|
messages: IReceivedMessage[];
|
|
5725
6546
|
count: number;
|
|
5726
6547
|
}>>;
|
|
6548
|
+
searchMessagesByUser(conversationType: ConversationType, targetId: string, userId: string, timestamp: number, count?: number, channelId?: string): Promise<IAsyncRes<{
|
|
6549
|
+
messages: IReceivedMessage[];
|
|
6550
|
+
}>>;
|
|
5727
6551
|
searchMessageByContentWithAllChannel(conversationType: ConversationType, targetId: string, keyword: string, timestamp: number, count: number): Promise<IAsyncRes<{
|
|
5728
6552
|
messages: IReceivedMessage[];
|
|
5729
6553
|
count: number;
|
|
@@ -6132,6 +6956,7 @@ declare abstract class AEngine {
|
|
|
6132
6956
|
protected readonly _watcher: IEngineWatcher;
|
|
6133
6957
|
protected readonly _options: IAPIContextOption;
|
|
6134
6958
|
protected readonly logger: BasicLogger;
|
|
6959
|
+
protected readonly statisticLog: BasicStatistic;
|
|
6135
6960
|
/**
|
|
6136
6961
|
* 连接时间
|
|
6137
6962
|
*/
|
|
@@ -6142,7 +6967,7 @@ declare abstract class AEngine {
|
|
|
6142
6967
|
* 引擎初始化
|
|
6143
6968
|
* @param _appkey
|
|
6144
6969
|
*/
|
|
6145
|
-
constructor(runtime: IRuntime, rtcCodec: Codec<RTCKeyMaps>, _watcher: IEngineWatcher, _options: IAPIContextOption, logger: BasicLogger);
|
|
6970
|
+
constructor(runtime: IRuntime, rtcCodec: Codec<RTCKeyMaps>, _watcher: IEngineWatcher, _options: IAPIContextOption, logger: BasicLogger, statisticLog: BasicStatistic);
|
|
6146
6971
|
protected _rtcSignalingListener?: (buffer: Uint8Array) => void;
|
|
6147
6972
|
/**
|
|
6148
6973
|
* 注册 RTC KV 变更监听器
|
|
@@ -6165,6 +6990,10 @@ declare abstract class AEngine {
|
|
|
6165
6990
|
* 获取 engine 包内部 logger 工具
|
|
6166
6991
|
*/
|
|
6167
6992
|
getInnerLogger(): BasicLogger;
|
|
6993
|
+
/**
|
|
6994
|
+
* 获取 engine 包内部 logger 工具
|
|
6995
|
+
*/
|
|
6996
|
+
getInnerStatisticLog(): BasicStatistic;
|
|
6168
6997
|
/**
|
|
6169
6998
|
* 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
|
|
6170
6999
|
* 对于未实现的方法,接口响应 Unsupport 错误码
|
|
@@ -6627,6 +7456,11 @@ declare abstract class AEngine {
|
|
|
6627
7456
|
syncTime: number;
|
|
6628
7457
|
hasMore: boolean;
|
|
6629
7458
|
}>>;
|
|
7459
|
+
/**
|
|
7460
|
+
* 根据超级群的 targetId 数组,获取每个超级群下所有频道会话信息
|
|
7461
|
+
* @param targetIds
|
|
7462
|
+
*/
|
|
7463
|
+
abstract getUltraGroupUnreadInfoList(targetIds: string[]): Promise<IAsyncRes<IUltraGroupUnreadInfo[]>>;
|
|
6630
7464
|
abstract getConversationListWithAllChannel(): IPromiseResult<IReceivedConversation[]>;
|
|
6631
7465
|
abstract getConversationListWithAllChannelByPage(index: number, limit: number): IPromiseResult<IReceivedConversation[]>;
|
|
6632
7466
|
/**
|
|
@@ -6722,6 +7556,12 @@ declare abstract class AEngine {
|
|
|
6722
7556
|
messages: IReceivedMessage[];
|
|
6723
7557
|
count: number;
|
|
6724
7558
|
}>;
|
|
7559
|
+
/**
|
|
7560
|
+
* 按用户ID搜索会话内的消息
|
|
7561
|
+
*/
|
|
7562
|
+
abstract searchMessagesByUser(conversationType: ConversationType, targetId: string, userId: string, timestamp: number, count: number, channelId: string): IPromiseResult<{
|
|
7563
|
+
messages: IReceivedMessage[];
|
|
7564
|
+
}>;
|
|
6725
7565
|
/**
|
|
6726
7566
|
* 按内容搜索指定会话(不区分 channelId)的消息
|
|
6727
7567
|
*/
|
|
@@ -6879,7 +7719,35 @@ declare abstract class AEngine {
|
|
|
6879
7719
|
* 测试代理
|
|
6880
7720
|
*/
|
|
6881
7721
|
abstract testProxy(proxy: IProxy, testHost: string): Promise<IResponse>;
|
|
7722
|
+
/**
|
|
7723
|
+
* 设置当前网络
|
|
7724
|
+
*/
|
|
7725
|
+
abstract setNetwork(data: INetwork, isUnPrintLog?: boolean): void;
|
|
7726
|
+
}
|
|
7727
|
+
|
|
7728
|
+
interface IUrlCenterInitOption {
|
|
7729
|
+
areaCode?: AreaCode;
|
|
7730
|
+
navigators?: string[];
|
|
7731
|
+
logServerUrl?: string;
|
|
7732
|
+
miniCMPProxy?: string[];
|
|
7733
|
+
}
|
|
7734
|
+
declare class UrlCenter {
|
|
7735
|
+
private initOption;
|
|
7736
|
+
init(initOption: IUrlCenterInitOption): void;
|
|
7737
|
+
/**
|
|
7738
|
+
* 获取导航 URL 列表
|
|
7739
|
+
*/
|
|
7740
|
+
getNaviUrlList(token: string): string[];
|
|
7741
|
+
/**
|
|
7742
|
+
* 获取日志上传
|
|
7743
|
+
*/
|
|
7744
|
+
getLogUrlPolicyList(naviLogUrl?: string): string[];
|
|
7745
|
+
/**
|
|
7746
|
+
* 获取小程序平台 CMP 地址
|
|
7747
|
+
*/
|
|
7748
|
+
getMiniCmpUrlList(): string[];
|
|
6882
7749
|
}
|
|
7750
|
+
declare const urlCenter: UrlCenter;
|
|
6883
7751
|
|
|
6884
7752
|
declare class AppStorage {
|
|
6885
7753
|
private _cache;
|
|
@@ -7194,6 +8062,7 @@ declare const isValidChrmEntryValue: (value: string) => Boolean;
|
|
|
7194
8062
|
* 注意: 这里的 messageId 与 websocketChannel 中的 messageId 不是同一个。
|
|
7195
8063
|
*/
|
|
7196
8064
|
declare const getClientMessageId: () => number;
|
|
8065
|
+
declare const getbundleId: () => string;
|
|
7197
8066
|
|
|
7198
8067
|
/**
|
|
7199
8068
|
* @todo 后期禁用此方法,容易滥用,且会丢失上下文的数据类型跟踪
|
|
@@ -7245,22 +8114,6 @@ declare const NAVI_REQ_TIMEOUT: number;
|
|
|
7245
8114
|
* WebSocket 建立连接超时时间,单位毫秒
|
|
7246
8115
|
*/
|
|
7247
8116
|
declare const WEB_SOCKET_TIMEOUT: number;
|
|
7248
|
-
/**
|
|
7249
|
-
* 公有云 Navi 请求地址
|
|
7250
|
-
*/
|
|
7251
|
-
declare const PUBLIC_CLOUD_NAVI_URIS: string[];
|
|
7252
|
-
/**
|
|
7253
|
-
* 小程序 websocket 连接地址
|
|
7254
|
-
*/
|
|
7255
|
-
declare const MINI_SOCKET_CONNECT_URIS: string[];
|
|
7256
|
-
/**
|
|
7257
|
-
* 七牛存储服务地址
|
|
7258
|
-
*/
|
|
7259
|
-
declare const QINIU_STORAGE_SERVER_URI: string;
|
|
7260
|
-
/**
|
|
7261
|
-
* 百度存储服务地址
|
|
7262
|
-
*/
|
|
7263
|
-
declare const BAIDU_STORAGE_SERVER_URI: string;
|
|
7264
8117
|
/**
|
|
7265
8118
|
* IM 接口超时时间,单位毫秒
|
|
7266
8119
|
*/
|
|
@@ -7322,19 +8175,14 @@ declare const REAT_TIME_LOG_SIZE: number;
|
|
|
7322
8175
|
declare const DB_LOG_MAX_SIZE = 100000;
|
|
7323
8176
|
declare const DB_LOG_FLUSH_FREQUENCY = 3000;
|
|
7324
8177
|
declare const ONE_LOG_SIZE_MAX = 1000;
|
|
7325
|
-
/** 日志上报默认策略 */
|
|
7326
|
-
declare const DEFAULT_LOG_POLICY: {
|
|
7327
|
-
url: string;
|
|
7328
|
-
level: number;
|
|
7329
|
-
itv: number;
|
|
7330
|
-
times: number;
|
|
7331
|
-
};
|
|
7332
8178
|
/** SDK 版本号 */
|
|
7333
8179
|
declare const VERSION: string;
|
|
7334
8180
|
/**
|
|
7335
8181
|
* 祛除标签的标准版本号,如愿版本号为 `3.1.0-alpha.1`,则该值为 `3.1.0`
|
|
7336
8182
|
*/
|
|
7337
8183
|
declare const FORMATED_VERSION: string;
|
|
8184
|
+
declare const MAX_UPLOAD_FILE_SIZE: number;
|
|
8185
|
+
declare const UPLOAD_FILE_CHUNK_SIZE: number;
|
|
7338
8186
|
|
|
7339
8187
|
/**
|
|
7340
8188
|
* 请使用 `Codec` 替代 `AbsCodec`
|
|
@@ -7348,4 +8196,4 @@ declare type AbsCodec<T> = Codec<T>;
|
|
|
7348
8196
|
*/
|
|
7349
8197
|
declare const version: string;
|
|
7350
8198
|
|
|
7351
|
-
export { AConnectionMgr, AEngine, APIContext, AbsCodec, AppStorage,
|
|
8199
|
+
export { AConnectionMgr, AEngine, APIContext, AbsCodec, AppStorage, AreaCode, AssertRules, BasicLogger, BasicNavi, BasicReporter, BasicStatistic, BasicStatisticReporter, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomSyncStatusReason, ChatroomUserChangeType, ChrmMemBanType, ChrmMemOperateType, ChrmSyncStatus, Codec, CodecPBMaps, ConnectReason, ConnectType, ConnectionStatus, Content, ConversationType, DB_LOG_FLUSH_FREQUENCY, DB_LOG_MAX_SIZE, DelayTimer, EnableLogL, EnterpriseType, ErrorCode, EventEmitter, FORMATED_VERSION, FileType, HTTP_TIMEOUT, HttpMethod, IAPIContextOption, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBaseStatisticsData, IBlockedMessageInfo, ICancelRoomPKOptions, IChannelAndUserGroupChangeData, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListener, IChatroomListenerData, IChatroomNotifyBan, IChatroomNotifyBlock, IChatroomNotifyMultiLoginSync, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionListener, IConnectionStatusListener, IConversationIdentifier, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDeletedExpansion, IDeliveredUser, IEndRoomPKOptions, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGetMsgOption, IGetUltraGroupListOption, IGooglePushConfig, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IGroupMessageDeliveredStatusInfo, IInsertMessage, IInsertMsgOptions, IIsValidExpansion, IJoinRTCRoomData, ILocalReadReceiptInfo, ILocalTagStatus, ILogDB, ILogData, ILogger, 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, INaviCache, INaviContextInfo, INaviInfo, INetwork, IOSInfo, IOperateInfo, IOperateStatusNotify, IOperateSummary, IPluginGenerator, IProcessCache, IProcessInfo, IPromiseResult, IProxy, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomBindOption, IRTCRoomInfo, IRTCUserData, IRTCUsers, IReadReceiptInfo, IRecallMsgContent, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IReqRoomPKOptions, IRequest, IResRoomPKOptions, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStatistic, IStatisticDB, IStatisticData, IStatisticsCMPData, IStatisticsCSData, IStatisticsDurData, IStatisticsNaviData, IStatisticsNetworkData, IStatisticsRMTPData, IStatisticsWebsocketData, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraExMsgOptions, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadInfo, IUltraGroupUnreadMentionedOption, IUltraModifyMsgOptions, IUltraMsgQueryOptions, IUltraUnreadConversation, IUltraUnreadMsg, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserGroupChangeData, IUserGroupStatusInfo, IUserProfile, IWatcher, IWebSocket, IiOSPushConfig, IndexDBLogger, IndexDBReporter, IndexDBStatistic, IndexDBStatisticReporter, RTCKeyMaps as InnerRTCKeyMaps, ItypingStateListener, KVString, LiveRole, LiveType, LogContent, LogL, LogLevel, LogSource, LogTagId, LogType, MAX_MESSAGE_CONTENT_BYTES, MAX_MESSAGE_EXPANSION_KEY_LENGTH, MAX_MESSAGE_EXPANSION_VAL_LENGTH, MAX_UPLOAD_FILE_SIZE, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NaviCacheType, NetworkType, NotificationLevel, NotificationStatus, ONE_LOG_SIZE_MAX, OperateStatus, PluginContext, ProtocalType, RCAssertError, RCConnectionStatus, REAT_TIME_LOG_SIZE, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATUS_MESSAGE, STORAGE_ROOT_KEY, SentStatus, StatisticL, StatisticsTag, StatisticsVersion, StoreKeys, TagChangeType, Type, UPLOAD_FILE_CHUNK_SIZE, UltraGroupChannelChangeType, UltraGroupChannelType, UltraMentionedType, UltraMsgChangeType, UltraMsgSubChangeType, UploadMethod, UserGroupChangeType, VERSION, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketNavi, appendUrl, assert, clone, cloneByJSON, deInitLogDB, forEach, getBrowser, getClientMessageId, getMimeKey, getUUID, getUUID22, getUploadFileName, getbundleId, indexOf, initLogDB, initStatisticDB, isArray, isArrayBuffer, isBoolean, isConnnectAckCode as isConnnectAck, isDisconnectCode as isDisconnectedByServer, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isString, isTypeInConversationList, isUndefined, isValidChannelId, isValidChrmEntryKey, isValidChrmEntryValue, isValidConversationType, isValidExpansion, isValidFileType, isValidNotificationLevel, base as logger, map, notEmptyArray, notEmptyObject, notEmptyString, pushConfigsToJSON, pushJSONToConfigs, statisticTranscsv, todo, transcsv, unInitStatisticDB, urlCenter, usingCppEngine, validate, version };
|