@rongcloud/engine 5.7.8 → 5.7.9
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 +780 -49
- 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
|
*/
|
|
@@ -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
|
*/
|
|
@@ -1470,6 +1490,17 @@ declare enum LogTagId {
|
|
|
1470
1490
|
L_WEBSOCKET_DISACCORD_E = "L-websocket_disaccord-e"
|
|
1471
1491
|
}
|
|
1472
1492
|
|
|
1493
|
+
/** 统计数据标签 */
|
|
1494
|
+
declare enum StatisticsTag {
|
|
1495
|
+
IM_NAVI = "IM-stats_navi-S",
|
|
1496
|
+
IM_WEBSOCKET = "IM-stats_websocket-S",
|
|
1497
|
+
IM_CONNECTION_DURATION = "IM-stats_con_dur-S",
|
|
1498
|
+
IM_CMP = "IM-stats_cmp-S",
|
|
1499
|
+
IM_CMP_RMTP = "IM-stats_cmp_rmtp-S",
|
|
1500
|
+
IM_STATS_CS = "IM-stats_cs-S",
|
|
1501
|
+
IM_NETWORK_CHANGE = "IM-stats_network_change-S"
|
|
1502
|
+
}
|
|
1503
|
+
|
|
1473
1504
|
/**
|
|
1474
1505
|
* 聊天室成员进入和退出状态
|
|
1475
1506
|
* @category Enum
|
|
@@ -1554,6 +1585,55 @@ declare enum UserGroupChangeType {
|
|
|
1554
1585
|
CHANNEL_BIND_USER_GROUP = 4,
|
|
1555
1586
|
CHANNEL_UNBIND_USER_GROUP = 5
|
|
1556
1587
|
}
|
|
1588
|
+
declare enum UltraMentionedType {
|
|
1589
|
+
/**
|
|
1590
|
+
* 非 @ 消息
|
|
1591
|
+
*/
|
|
1592
|
+
NOT_MENTIONED = 0,
|
|
1593
|
+
/**
|
|
1594
|
+
* 所有人
|
|
1595
|
+
*/
|
|
1596
|
+
ALL = 1,
|
|
1597
|
+
/**
|
|
1598
|
+
* 部分人
|
|
1599
|
+
*/
|
|
1600
|
+
ME = 2
|
|
1601
|
+
}
|
|
1602
|
+
|
|
1603
|
+
/**
|
|
1604
|
+
* 私有云、公有云枚举
|
|
1605
|
+
* 1 私有云
|
|
1606
|
+
* 0 公有云
|
|
1607
|
+
*/
|
|
1608
|
+
declare enum EnterpriseType {
|
|
1609
|
+
PRIVATE = 1,
|
|
1610
|
+
OPEN = 0
|
|
1611
|
+
}
|
|
1612
|
+
/**
|
|
1613
|
+
* 协议表示枚举
|
|
1614
|
+
*/
|
|
1615
|
+
declare enum ProtocalType {
|
|
1616
|
+
NAVI = 1,
|
|
1617
|
+
TCP = 2,
|
|
1618
|
+
WS = 3
|
|
1619
|
+
}
|
|
1620
|
+
declare enum NaviCacheType {
|
|
1621
|
+
REQUEST = 0,
|
|
1622
|
+
LOCAL = 1
|
|
1623
|
+
}
|
|
1624
|
+
declare enum StatisticsVersion {
|
|
1625
|
+
CURRENT = 2
|
|
1626
|
+
}
|
|
1627
|
+
declare enum StatisticsConnectType {
|
|
1628
|
+
CONNECT = 0,
|
|
1629
|
+
RECONNECT = 1
|
|
1630
|
+
}
|
|
1631
|
+
declare enum StatisticsCSReason {
|
|
1632
|
+
CONNECT = 0,
|
|
1633
|
+
RECONNECT = 1,
|
|
1634
|
+
REDIRECTED = 3,
|
|
1635
|
+
TIMEOUT = 4
|
|
1636
|
+
}
|
|
1557
1637
|
|
|
1558
1638
|
/**
|
|
1559
1639
|
* 音视频模式
|
|
@@ -2443,6 +2523,11 @@ interface IReceivedConversation {
|
|
|
2443
2523
|
*/
|
|
2444
2524
|
versionTime?: number;
|
|
2445
2525
|
unreadMentionedCount?: number;
|
|
2526
|
+
/**
|
|
2527
|
+
* @ 我的未读消息数
|
|
2528
|
+
* @since 5.7.9
|
|
2529
|
+
*/
|
|
2530
|
+
unreadMentionedMeCount?: number;
|
|
2446
2531
|
}
|
|
2447
2532
|
/**
|
|
2448
2533
|
* @category Interface
|
|
@@ -2504,6 +2589,11 @@ interface IUpdatedConversation {
|
|
|
2504
2589
|
* @ 消息未读数
|
|
2505
2590
|
*/
|
|
2506
2591
|
unreadMentionedCount?: number;
|
|
2592
|
+
/**
|
|
2593
|
+
* @ 我的未读消息数
|
|
2594
|
+
* @since 5.7.9
|
|
2595
|
+
*/
|
|
2596
|
+
unreadMentionedMeCount?: number;
|
|
2507
2597
|
}
|
|
2508
2598
|
/**
|
|
2509
2599
|
* @category Interface
|
|
@@ -2570,6 +2660,94 @@ interface IUltraUnreadConversation {
|
|
|
2570
2660
|
channelId?: string;
|
|
2571
2661
|
}
|
|
2572
2662
|
|
|
2663
|
+
/**
|
|
2664
|
+
* 聊天室多端同步时,消息中的状态:加入/离开
|
|
2665
|
+
* @category Enum
|
|
2666
|
+
* @since 5.7.9
|
|
2667
|
+
*/
|
|
2668
|
+
declare enum ChrmSyncStatus {
|
|
2669
|
+
/**
|
|
2670
|
+
* 离开
|
|
2671
|
+
*/
|
|
2672
|
+
QUIT = 0,
|
|
2673
|
+
/**
|
|
2674
|
+
* 加入
|
|
2675
|
+
*/
|
|
2676
|
+
JOIN = 1
|
|
2677
|
+
}
|
|
2678
|
+
|
|
2679
|
+
/**
|
|
2680
|
+
* 聊天室解封/封禁用户消息,操作类型枚举
|
|
2681
|
+
* @category Enum
|
|
2682
|
+
* @since 5.7.9
|
|
2683
|
+
*/
|
|
2684
|
+
declare enum ChrmMemOperateType {
|
|
2685
|
+
/**
|
|
2686
|
+
* 解封
|
|
2687
|
+
*/
|
|
2688
|
+
Deblock = 0,
|
|
2689
|
+
/**
|
|
2690
|
+
* 封禁
|
|
2691
|
+
*/
|
|
2692
|
+
Blocked = 1
|
|
2693
|
+
}
|
|
2694
|
+
|
|
2695
|
+
/**
|
|
2696
|
+
* 聊天室禁言/解除禁言操作类型枚举
|
|
2697
|
+
* @category Enum
|
|
2698
|
+
* @since 5.7.9
|
|
2699
|
+
*/
|
|
2700
|
+
declare enum ChrmMemBanType {
|
|
2701
|
+
/**
|
|
2702
|
+
* 解除指定聊天室中用户禁言
|
|
2703
|
+
*/
|
|
2704
|
+
UnmuteUsers = 0,
|
|
2705
|
+
/**
|
|
2706
|
+
* 禁言指定聊天室中用户
|
|
2707
|
+
*/
|
|
2708
|
+
MuteUsers = 1,
|
|
2709
|
+
/**
|
|
2710
|
+
* 解除聊天室全体禁言
|
|
2711
|
+
*/
|
|
2712
|
+
UnmuteAll = 2,
|
|
2713
|
+
/**
|
|
2714
|
+
* 聊天室全体禁言
|
|
2715
|
+
*/
|
|
2716
|
+
MuteAll = 3,
|
|
2717
|
+
/**
|
|
2718
|
+
* 移出禁言用户白名单
|
|
2719
|
+
*/
|
|
2720
|
+
RemoveWhitelist = 4,
|
|
2721
|
+
/**
|
|
2722
|
+
* 添加禁言用户白名单
|
|
2723
|
+
*/
|
|
2724
|
+
AddWhitelist = 5,
|
|
2725
|
+
/**
|
|
2726
|
+
* 解除用户聊天室全局禁言
|
|
2727
|
+
*/
|
|
2728
|
+
UnmuteGloble = 6,
|
|
2729
|
+
/**
|
|
2730
|
+
* 用户聊天室全局禁言
|
|
2731
|
+
*/
|
|
2732
|
+
MuteGloble = 7
|
|
2733
|
+
}
|
|
2734
|
+
|
|
2735
|
+
/**
|
|
2736
|
+
* 聊天室多端同步时,离开聊天室的原因
|
|
2737
|
+
* @category Enum
|
|
2738
|
+
* @since 5.7.9
|
|
2739
|
+
*/
|
|
2740
|
+
declare enum ChatroomSyncStatusReason {
|
|
2741
|
+
/**
|
|
2742
|
+
* 自己主动离开
|
|
2743
|
+
*/
|
|
2744
|
+
LeaveOnMyOwn = 0,
|
|
2745
|
+
/**
|
|
2746
|
+
* 多端加入互踢导致离开
|
|
2747
|
+
*/
|
|
2748
|
+
OtherDeviceLogin = 1
|
|
2749
|
+
}
|
|
2750
|
+
|
|
2573
2751
|
/**
|
|
2574
2752
|
* @category Interface
|
|
2575
2753
|
*/
|
|
@@ -2630,6 +2808,92 @@ interface IChatroomUserChangeInfo {
|
|
|
2630
2808
|
};
|
|
2631
2809
|
chatroomId: string;
|
|
2632
2810
|
}
|
|
2811
|
+
/**
|
|
2812
|
+
* @category Interface
|
|
2813
|
+
* @since 5.7.9
|
|
2814
|
+
*/
|
|
2815
|
+
interface IChatroomNotifyMultiLoginSync {
|
|
2816
|
+
/**
|
|
2817
|
+
* 聊天室ID
|
|
2818
|
+
*/
|
|
2819
|
+
chatroomId: string;
|
|
2820
|
+
/**
|
|
2821
|
+
* 变更的状态,0:离开, 1:加入
|
|
2822
|
+
*/
|
|
2823
|
+
status: ChrmSyncStatus;
|
|
2824
|
+
/**
|
|
2825
|
+
* 如果status是0的情况,区分离开类型,0:主动离开, 1:多端加入被踢
|
|
2826
|
+
*/
|
|
2827
|
+
reason: ChatroomSyncStatusReason;
|
|
2828
|
+
/**
|
|
2829
|
+
* 用户加入/退出/被踢的时间(毫秒时间戳)
|
|
2830
|
+
*/
|
|
2831
|
+
time: number;
|
|
2832
|
+
/**
|
|
2833
|
+
* 附加信息
|
|
2834
|
+
*/
|
|
2835
|
+
extra: string;
|
|
2836
|
+
}
|
|
2837
|
+
/**
|
|
2838
|
+
* @category Interface
|
|
2839
|
+
* @since 5.7.9
|
|
2840
|
+
*/
|
|
2841
|
+
interface IChatroomNotifyBlock {
|
|
2842
|
+
/**
|
|
2843
|
+
* 聊天室ID
|
|
2844
|
+
*/
|
|
2845
|
+
chatroomId: string;
|
|
2846
|
+
/**
|
|
2847
|
+
* 封禁类型,0是解封,1是封禁
|
|
2848
|
+
*/
|
|
2849
|
+
operateType: ChrmMemOperateType;
|
|
2850
|
+
/**
|
|
2851
|
+
* 封禁时长(毫秒),封禁时有此字段,封禁时长最大值为43200分钟(1个月), 最小值1分钟
|
|
2852
|
+
*/
|
|
2853
|
+
durationTime: number;
|
|
2854
|
+
/**
|
|
2855
|
+
* 操作时间(毫秒时间戳)
|
|
2856
|
+
*/
|
|
2857
|
+
operateTime: number;
|
|
2858
|
+
/**
|
|
2859
|
+
* 被封禁/解封的用户 ID 列表
|
|
2860
|
+
*/
|
|
2861
|
+
userIdList: string[];
|
|
2862
|
+
/**
|
|
2863
|
+
* 附加信息
|
|
2864
|
+
*/
|
|
2865
|
+
extra: string;
|
|
2866
|
+
}
|
|
2867
|
+
/**
|
|
2868
|
+
* @category Interface
|
|
2869
|
+
* @since 5.7.9
|
|
2870
|
+
*/
|
|
2871
|
+
interface IChatroomNotifyBan {
|
|
2872
|
+
/**
|
|
2873
|
+
* 聊天室ID
|
|
2874
|
+
*/
|
|
2875
|
+
chatroomId: string;
|
|
2876
|
+
/**
|
|
2877
|
+
* 禁言类型
|
|
2878
|
+
*/
|
|
2879
|
+
banType: ChrmMemBanType;
|
|
2880
|
+
/**
|
|
2881
|
+
* 禁言时长(毫秒),禁言时有此字段,禁言时长最大值为43200分钟(1个月), 最小值1分钟
|
|
2882
|
+
*/
|
|
2883
|
+
durationTime: number;
|
|
2884
|
+
/**
|
|
2885
|
+
* 操作时间(毫秒时间戳)
|
|
2886
|
+
*/
|
|
2887
|
+
operateTime: number;
|
|
2888
|
+
/**
|
|
2889
|
+
* 禁言/解禁言用户 ID 列表
|
|
2890
|
+
*/
|
|
2891
|
+
userIdList: string[];
|
|
2892
|
+
/**
|
|
2893
|
+
* 附加信息
|
|
2894
|
+
*/
|
|
2895
|
+
extra: string;
|
|
2896
|
+
}
|
|
2633
2897
|
declare type IChatroomRejoinedInfo = IChatroomRejoinedFailed | IChatroomRejoinedSuccessed;
|
|
2634
2898
|
/**
|
|
2635
2899
|
* 聊天室信息
|
|
@@ -2652,6 +2916,18 @@ interface IChatroomListenerData {
|
|
|
2652
2916
|
* 聊天室销毁
|
|
2653
2917
|
*/
|
|
2654
2918
|
chatroomDestroyed?: string;
|
|
2919
|
+
/**
|
|
2920
|
+
* 加入退出多端同步通知
|
|
2921
|
+
*/
|
|
2922
|
+
chatroomNotifyMultiLoginSync?: IChatroomNotifyMultiLoginSync;
|
|
2923
|
+
/**
|
|
2924
|
+
* 聊天室用户封禁通知
|
|
2925
|
+
*/
|
|
2926
|
+
chatroomNotifyBlock?: IChatroomNotifyBlock;
|
|
2927
|
+
/**
|
|
2928
|
+
* 聊天室用户禁言通知
|
|
2929
|
+
*/
|
|
2930
|
+
chatroomNotifyBan?: IChatroomNotifyBan;
|
|
2655
2931
|
}
|
|
2656
2932
|
/**
|
|
2657
2933
|
* @category Interface
|
|
@@ -3055,6 +3331,10 @@ interface IWebSocket {
|
|
|
3055
3331
|
*/
|
|
3056
3332
|
close(code?: number, reason?: string): void;
|
|
3057
3333
|
}
|
|
3334
|
+
interface INetwork {
|
|
3335
|
+
status: boolean;
|
|
3336
|
+
type: NetworkType | string;
|
|
3337
|
+
}
|
|
3058
3338
|
/**
|
|
3059
3339
|
* 平台运行时抽象
|
|
3060
3340
|
*/
|
|
@@ -3097,6 +3377,16 @@ interface IRuntime {
|
|
|
3097
3377
|
* 2g 3g 4g wifi unkown
|
|
3098
3378
|
*/
|
|
3099
3379
|
getNetworkType(): Promise<NetworkType>;
|
|
3380
|
+
/**
|
|
3381
|
+
* 网络状态变更监听
|
|
3382
|
+
* @since 5.7.9
|
|
3383
|
+
*/
|
|
3384
|
+
setNetworkStatusListener: (callback: any) => void;
|
|
3385
|
+
/**
|
|
3386
|
+
* 去除网络状态变更监听
|
|
3387
|
+
* @since 5.7.9
|
|
3388
|
+
*/
|
|
3389
|
+
removeNetworkStatusListener: () => void;
|
|
3100
3390
|
}
|
|
3101
3391
|
|
|
3102
3392
|
/**
|
|
@@ -3112,7 +3402,32 @@ interface IExtraMethod {
|
|
|
3112
3402
|
}
|
|
3113
3403
|
|
|
3114
3404
|
/**
|
|
3115
|
-
*
|
|
3405
|
+
* 连接协议
|
|
3406
|
+
* 截止 5.7.4 版本,暂不支持 rpp 和 quic
|
|
3407
|
+
* v2 版本文档: https://a5bq662kv5.feishu.cn/wiki/wikcnfo3lEo2CPbonDxuXFvU0Kb#K7nbeN
|
|
3408
|
+
*/
|
|
3409
|
+
declare enum EConnectProtocol {
|
|
3410
|
+
RMTP = 1,
|
|
3411
|
+
TLS = 2,
|
|
3412
|
+
RPP = 3,
|
|
3413
|
+
QUIC = 4,
|
|
3414
|
+
WS = 5,
|
|
3415
|
+
WSS = 6
|
|
3416
|
+
}
|
|
3417
|
+
interface INaviRequestOption {
|
|
3418
|
+
appkey: string;
|
|
3419
|
+
uri: string;
|
|
3420
|
+
token: string;
|
|
3421
|
+
platform: string;
|
|
3422
|
+
isTcp?: boolean;
|
|
3423
|
+
}
|
|
3424
|
+
interface ICmpData {
|
|
3425
|
+
addr: string;
|
|
3426
|
+
protocol: EConnectProtocol;
|
|
3427
|
+
weight: number;
|
|
3428
|
+
}
|
|
3429
|
+
/**
|
|
3430
|
+
* 导航信息数据结构
|
|
3116
3431
|
*/
|
|
3117
3432
|
interface INaviInfo {
|
|
3118
3433
|
/**
|
|
@@ -3139,15 +3454,18 @@ interface INaviInfo {
|
|
|
3139
3454
|
/**
|
|
3140
3455
|
* CMP 服务 Websocket 连接地址,包含域名与端口,不含 ws 或 wss 协议头
|
|
3141
3456
|
* @example a.domain.com:443
|
|
3457
|
+
* @note 在 V2 版本废弃
|
|
3142
3458
|
*/
|
|
3143
3459
|
server: string;
|
|
3144
3460
|
/**
|
|
3145
3461
|
* 备用 CMP 服务地址,包含域名与端口,不含 ws 或 wss 协议头,多个备用地址以 ',' 分割
|
|
3146
3462
|
* @example a.domain.com:443,b.domain.com:443
|
|
3463
|
+
* @note 在 V2 版本废弃
|
|
3147
3464
|
*/
|
|
3148
3465
|
backupServer?: string;
|
|
3149
3466
|
/**
|
|
3150
3467
|
* 备用 CMP 服务地址,POST 请求 TCP 连接返回的是 bs 字段,非 backupServer 字段
|
|
3468
|
+
* @note 在 V2 版本废弃
|
|
3151
3469
|
*/
|
|
3152
3470
|
bs?: string;
|
|
3153
3471
|
/**
|
|
@@ -3186,8 +3504,9 @@ interface INaviInfo {
|
|
|
3186
3504
|
* @description
|
|
3187
3505
|
* 1. 公有云下,该地址为七牛云服务器地址
|
|
3188
3506
|
* 2. 私有云下,该地址为私有云自研文件服务器地址
|
|
3507
|
+
* @note 在 V2 版本废弃
|
|
3189
3508
|
*/
|
|
3190
|
-
uploadServer
|
|
3509
|
+
uploadServer?: string;
|
|
3191
3510
|
/**
|
|
3192
3511
|
* 实时位置共享配置,web 端无需处理
|
|
3193
3512
|
*/
|
|
@@ -3234,6 +3553,7 @@ interface INaviInfo {
|
|
|
3234
3553
|
* @todo
|
|
3235
3554
|
* 1. 确定其控制的功能
|
|
3236
3555
|
* 2. 确定 web 相关性
|
|
3556
|
+
* @note 在 V2 版本废弃
|
|
3237
3557
|
*/
|
|
3238
3558
|
isFormatted: number;
|
|
3239
3559
|
/**
|
|
@@ -3268,6 +3588,7 @@ interface INaviInfo {
|
|
|
3268
3588
|
* 百度 BOS 存储服务地址
|
|
3269
3589
|
* @description 公有云独有配置
|
|
3270
3590
|
* @example `gz.bcebos.com`
|
|
3591
|
+
* @deprecated 已废弃
|
|
3271
3592
|
*/
|
|
3272
3593
|
bosAddr?: string;
|
|
3273
3594
|
/**
|
|
@@ -3324,6 +3645,7 @@ interface INaviInfo {
|
|
|
3324
3645
|
onlinelogserver?: string;
|
|
3325
3646
|
/**
|
|
3326
3647
|
* 链路加密字段,内容为 JSON 字符串,仅限 C++ 可用
|
|
3648
|
+
* @note 在 V2 版本废弃
|
|
3327
3649
|
*/
|
|
3328
3650
|
crypto?: string;
|
|
3329
3651
|
/**
|
|
@@ -3338,6 +3660,295 @@ interface INaviInfo {
|
|
|
3338
3660
|
* 鉴权认证
|
|
3339
3661
|
*/
|
|
3340
3662
|
jwt?: string;
|
|
3663
|
+
/**
|
|
3664
|
+
* 数据中心
|
|
3665
|
+
*/
|
|
3666
|
+
dc?: string;
|
|
3667
|
+
/**
|
|
3668
|
+
* 是否开启 tls
|
|
3669
|
+
*/
|
|
3670
|
+
openTLS?: number;
|
|
3671
|
+
/**
|
|
3672
|
+
* V2 版本中新增字段
|
|
3673
|
+
* 服务地址列表
|
|
3674
|
+
*/
|
|
3675
|
+
serverAddr?: ICmpData[];
|
|
3676
|
+
/**
|
|
3677
|
+
* V2 版本中新增字段
|
|
3678
|
+
* 新版本控制tag
|
|
3679
|
+
*/
|
|
3680
|
+
excludeLogTag?: string;
|
|
3681
|
+
}
|
|
3682
|
+
|
|
3683
|
+
declare type Content = string | number | boolean | null;
|
|
3684
|
+
declare type Type = 'IM' | 'RTC';
|
|
3685
|
+
/**
|
|
3686
|
+
* 对外暴露的 Logger 工具接口定义,以隐藏 BasicLogger 其他实现
|
|
3687
|
+
*/
|
|
3688
|
+
interface IStatistic {
|
|
3689
|
+
/**
|
|
3690
|
+
* 设置日志打印等级,默认为 `LogL.WARN`
|
|
3691
|
+
* @param level
|
|
3692
|
+
*/
|
|
3693
|
+
/**
|
|
3694
|
+
* 创建事务追踪 ID,全局唯一,便于跨进程、异步事务追踪,需要考虑多进程
|
|
3695
|
+
*/
|
|
3696
|
+
createTraceId(): string;
|
|
3697
|
+
}
|
|
3698
|
+
|
|
3699
|
+
/**
|
|
3700
|
+
* LogLevel 等级定义,与大数据服务器日志等级保持一致
|
|
3701
|
+
*/
|
|
3702
|
+
declare enum StatisticL {
|
|
3703
|
+
/**
|
|
3704
|
+
* IM 质量数据日志,控制台不打印
|
|
3705
|
+
*/
|
|
3706
|
+
STATISTICS = -2,
|
|
3707
|
+
/**
|
|
3708
|
+
* 接口调用日志等级【一期日志埋点标识】
|
|
3709
|
+
*/
|
|
3710
|
+
RECORD = -1
|
|
3711
|
+
}
|
|
3712
|
+
|
|
3713
|
+
interface IStatisticData {
|
|
3714
|
+
/**
|
|
3715
|
+
* 日志原始内容
|
|
3716
|
+
*/
|
|
3717
|
+
content?: Content;
|
|
3718
|
+
/**
|
|
3719
|
+
* 日志标签,如 `L-INIT-O`
|
|
3720
|
+
*/
|
|
3721
|
+
tag: string;
|
|
3722
|
+
/**
|
|
3723
|
+
* logger 实例 Id,用于确定日志由谁埋点,如 `RCEngien` 为 engine 包埋点日志
|
|
3724
|
+
*/
|
|
3725
|
+
loggerId: string;
|
|
3726
|
+
/**
|
|
3727
|
+
* 日志生成时间
|
|
3728
|
+
*/
|
|
3729
|
+
time: number;
|
|
3730
|
+
/**
|
|
3731
|
+
* 应用的声明周期 sessionId
|
|
3732
|
+
* @description
|
|
3733
|
+
* Electron 环境下,以主进程 sessionId 入库,渲染进程 sessionId 存储于 content 内。
|
|
3734
|
+
* 日志上报时,通过 `${mainSessionId}:${renderSessionId}` 形式作为 sessionId 上报
|
|
3735
|
+
* @TODO 需确认服务是否允许 `${mainSessionId}:${renderSessionId}` 的方式,以及 sessionId 是否超出长度。
|
|
3736
|
+
*/
|
|
3737
|
+
sessionId: string;
|
|
3738
|
+
/**
|
|
3739
|
+
* 日志类型,仅用于大数据后台查阅统计
|
|
3740
|
+
*/
|
|
3741
|
+
type: 'IM' | 'RTC';
|
|
3742
|
+
/**
|
|
3743
|
+
* 日志等级,该等级与服务器统计等级保持一致,为入库等级
|
|
3744
|
+
*/
|
|
3745
|
+
level: StatisticL;
|
|
3746
|
+
/**
|
|
3747
|
+
* 事务跟踪 ID
|
|
3748
|
+
*/
|
|
3749
|
+
traceId?: string;
|
|
3750
|
+
}
|
|
3751
|
+
|
|
3752
|
+
/**
|
|
3753
|
+
* 日志数据库接口
|
|
3754
|
+
*/
|
|
3755
|
+
interface IStatisticDB {
|
|
3756
|
+
/**
|
|
3757
|
+
* 获取实时日志上报的时间戳记录。
|
|
3758
|
+
* 时间戳不以人为维度记录,避免换账户登录时,一次拉取巨量的历史日志。
|
|
3759
|
+
*/
|
|
3760
|
+
getTimestamp4RealtimeLog(): number;
|
|
3761
|
+
/**
|
|
3762
|
+
* 设置实时日志上报的时间戳记录
|
|
3763
|
+
* @param timestamp
|
|
3764
|
+
*/
|
|
3765
|
+
setTimestamp4RealtimeLog(timestamp: number): void;
|
|
3766
|
+
/**
|
|
3767
|
+
* 根据时间戳和日志等级获取全量日志
|
|
3768
|
+
* @param startTime
|
|
3769
|
+
* @param endTime
|
|
3770
|
+
* @param level
|
|
3771
|
+
* @param realtimeReport 是否实时上报。实时上报时,需要取质量数据日志
|
|
3772
|
+
*/
|
|
3773
|
+
getStatistics(startTime: number, endTime: number, level: StatisticL, realtimeReport: boolean): Promise<{
|
|
3774
|
+
logs: IStatisticData[];
|
|
3775
|
+
dbReady: boolean;
|
|
3776
|
+
}>;
|
|
3777
|
+
}
|
|
3778
|
+
|
|
3779
|
+
/**
|
|
3780
|
+
* 初始化 DB 模块,按 APPKEY 分库,后续需要将日志与业务数据库也分开
|
|
3781
|
+
* @param appkey
|
|
3782
|
+
* @param logger
|
|
3783
|
+
* @param expireTime 日志有效期,单位 `h`,默认为 `168h`
|
|
3784
|
+
*/
|
|
3785
|
+
declare const initStatisticDB: (appkey: string, logger: ILogger, expireTime?: number) => void;
|
|
3786
|
+
/**
|
|
3787
|
+
* IndexDB 日志数据库反初始化,在切换 APPKEY 时调用
|
|
3788
|
+
* @returns
|
|
3789
|
+
*/
|
|
3790
|
+
declare const unInitStatisticDB: () => Promise<void>;
|
|
3791
|
+
|
|
3792
|
+
/**
|
|
3793
|
+
* 日志数据转为 csv 结构数据
|
|
3794
|
+
* @param log
|
|
3795
|
+
* @returns
|
|
3796
|
+
*/
|
|
3797
|
+
declare const statisticTranscsv: (log: IStatisticData) => string;
|
|
3798
|
+
|
|
3799
|
+
/**
|
|
3800
|
+
* Statistic 抽象基类,定义埋点采集接口,
|
|
3801
|
+
* 由子类继承实现入库逻辑
|
|
3802
|
+
*/
|
|
3803
|
+
declare abstract class BasicStatistic {
|
|
3804
|
+
protected readonly _appkey: string;
|
|
3805
|
+
protected readonly _id: string;
|
|
3806
|
+
protected readonly _type: Type;
|
|
3807
|
+
constructor(_appkey: string, _id: string, _type: Type);
|
|
3808
|
+
/**
|
|
3809
|
+
* 由子类继承实现日志入库
|
|
3810
|
+
* @override
|
|
3811
|
+
*/
|
|
3812
|
+
protected abstract flush(data: IStatisticData): void;
|
|
3813
|
+
private _writer;
|
|
3814
|
+
/**
|
|
3815
|
+
* 内部质量数据统计接口,仅限 IMLib 与 RTCLib 内部使用
|
|
3816
|
+
*/
|
|
3817
|
+
__statistics: (tag: string, content?: Content | undefined, traceId?: string | undefined) => void;
|
|
3818
|
+
/**
|
|
3819
|
+
* 创建事务追踪 ID,全局唯一,便于跨进程、异步事务追踪,需要考虑多进程
|
|
3820
|
+
*/
|
|
3821
|
+
createTraceId(): string;
|
|
3822
|
+
/**
|
|
3823
|
+
* 获取当前进程的 sessionId,全局唯一
|
|
3824
|
+
* @returns
|
|
3825
|
+
*/
|
|
3826
|
+
getSessionId(): string;
|
|
3827
|
+
}
|
|
3828
|
+
|
|
3829
|
+
/**
|
|
3830
|
+
* 日志上报工具,负责处理实时日志上报和下消息拉日志业务。
|
|
3831
|
+
* 通过 DB 和 Logger 两个抽象接口组合使用,
|
|
3832
|
+
* 避免业务与不同平台不同的 DB 数据库耦合,从而最大限度代码复用,
|
|
3833
|
+
* 上报工具仅处理业务,无需关心 DB 和 Logger 的实际类型
|
|
3834
|
+
*/
|
|
3835
|
+
declare abstract class BasicStatisticReporter {
|
|
3836
|
+
private appkey;
|
|
3837
|
+
private deviceId;
|
|
3838
|
+
/**
|
|
3839
|
+
* 设备描述信息
|
|
3840
|
+
*/
|
|
3841
|
+
private deviceInfo;
|
|
3842
|
+
/**
|
|
3843
|
+
* statistic 数据库实例,有日志数据库的读写方法,使上报与数据库解耦
|
|
3844
|
+
*/
|
|
3845
|
+
protected readonly statisticDB: IStatisticDB;
|
|
3846
|
+
/**
|
|
3847
|
+
* logger 实例
|
|
3848
|
+
*/
|
|
3849
|
+
protected readonly logger: BasicLogger;
|
|
3850
|
+
/**
|
|
3851
|
+
* 上报主体类实例
|
|
3852
|
+
*/
|
|
3853
|
+
protected readonly reportClass: BasicLogger | BasicStatistic;
|
|
3854
|
+
/**
|
|
3855
|
+
* 当前用户 id
|
|
3856
|
+
*/
|
|
3857
|
+
protected userId: string;
|
|
3858
|
+
constructor(appkey: string, deviceId: string,
|
|
3859
|
+
/**
|
|
3860
|
+
* 设备描述信息
|
|
3861
|
+
*/
|
|
3862
|
+
deviceInfo: string,
|
|
3863
|
+
/**
|
|
3864
|
+
* statistic 数据库实例,有日志数据库的读写方法,使上报与数据库解耦
|
|
3865
|
+
*/
|
|
3866
|
+
statisticDB: IStatisticDB,
|
|
3867
|
+
/**
|
|
3868
|
+
* logger 实例
|
|
3869
|
+
*/
|
|
3870
|
+
logger: BasicLogger,
|
|
3871
|
+
/**
|
|
3872
|
+
* 上报主体类实例
|
|
3873
|
+
*/
|
|
3874
|
+
reportClass?: BasicLogger | BasicStatistic);
|
|
3875
|
+
private timer;
|
|
3876
|
+
protected started: boolean;
|
|
3877
|
+
/**
|
|
3878
|
+
* 根据配置启动实时日志上报,在导航获取完成后启动,导航中包含 userId 信息
|
|
3879
|
+
* 实时日志仅获取当前时间 - 10s 以前的日志上报,避免多页面并行写库造成数据遗漏
|
|
3880
|
+
*/
|
|
3881
|
+
checkStart(navi: INaviInfo): Promise<void>;
|
|
3882
|
+
/**
|
|
3883
|
+
* 实时日志上报
|
|
3884
|
+
* @override IndexDBReporter 重载此方法,增加同设备多页面多端时进程竞争检测
|
|
3885
|
+
*/
|
|
3886
|
+
protected realtimeReport(uri: string, level: StatisticL, itv: number): Promise<void>;
|
|
3887
|
+
protected abstract compressStatistics(logs: IStatisticData[]): Promise<{
|
|
3888
|
+
success: boolean;
|
|
3889
|
+
data: string;
|
|
3890
|
+
}>;
|
|
3891
|
+
/**
|
|
3892
|
+
* 处理下消息拉日志,以拉取包含 `LogL.DEBUG` 级别的全量日志
|
|
3893
|
+
* @param startTime 拉取起始时间
|
|
3894
|
+
* @param endTime 拉取结束时间
|
|
3895
|
+
* @param platform 平台
|
|
3896
|
+
* @param uri 本次拉取的上传地址,若无值,使用导航配置下发地址
|
|
3897
|
+
* @param logId 拉取事务 Id,用于上传日志时的 Http 请求
|
|
3898
|
+
* @param messageUId 消息 messageUId
|
|
3899
|
+
*/
|
|
3900
|
+
report(startTime: number, endTime: number, platform: string, uri: string, logId: string, messageUId: string): Promise<void>;
|
|
3901
|
+
/**
|
|
3902
|
+
* 以 `POST` 方法向服务发送日志数据
|
|
3903
|
+
* @param url
|
|
3904
|
+
* @param content
|
|
3905
|
+
*/
|
|
3906
|
+
protected abstract send(req: IRequest): Promise<IResponse>;
|
|
3907
|
+
/**
|
|
3908
|
+
* 清理计时器,停止定时任务
|
|
3909
|
+
*/
|
|
3910
|
+
stop(): void;
|
|
3911
|
+
}
|
|
3912
|
+
|
|
3913
|
+
/**
|
|
3914
|
+
* 实现基于 IndexDB 存储的日志类
|
|
3915
|
+
*/
|
|
3916
|
+
declare class IndexDBStatistic extends BasicStatistic {
|
|
3917
|
+
protected flush(data: IStatisticData): void;
|
|
3918
|
+
}
|
|
3919
|
+
|
|
3920
|
+
declare class IndexDBStatisticReporter extends BasicStatisticReporter {
|
|
3921
|
+
private runtime;
|
|
3922
|
+
constructor(appkey: string, runtime: IRuntime, logger: BasicLogger,
|
|
3923
|
+
/**
|
|
3924
|
+
* 客户端配置的上报等级,仅限 Beem IndexDB 日志版本可用,不设置时,以服务器 navi 下发配置为准
|
|
3925
|
+
*/
|
|
3926
|
+
statisticLog: BasicStatistic);
|
|
3927
|
+
protected send(req: IRequest): Promise<IResponse>;
|
|
3928
|
+
/**
|
|
3929
|
+
* @override 重写实现
|
|
3930
|
+
*/
|
|
3931
|
+
checkStart(navi: INaviInfo): Promise<void>;
|
|
3932
|
+
protected compressStatistics(logs: IStatisticData[]): Promise<{
|
|
3933
|
+
success: boolean;
|
|
3934
|
+
data: string;
|
|
3935
|
+
}>;
|
|
3936
|
+
/**
|
|
3937
|
+
* 进程竞争检测,检查是否为执行上报的进程
|
|
3938
|
+
* @param callback
|
|
3939
|
+
* @returns
|
|
3940
|
+
*/
|
|
3941
|
+
private isReporter;
|
|
3942
|
+
/**
|
|
3943
|
+
* @param startTime
|
|
3944
|
+
* @param endTime
|
|
3945
|
+
* @param platform
|
|
3946
|
+
* @param uri
|
|
3947
|
+
* @param logId
|
|
3948
|
+
* @param messageUId
|
|
3949
|
+
*/
|
|
3950
|
+
report(startTime: number, endTime: number, platform: string, uri: string, logId: string, messageUId: string): Promise<void>;
|
|
3951
|
+
protected realtimeReport(url: string, level: StatisticL, itv: number): Promise<void>;
|
|
3341
3952
|
}
|
|
3342
3953
|
|
|
3343
3954
|
declare type INaviCache = {
|
|
@@ -3351,15 +3962,8 @@ declare type INaviCache = {
|
|
|
3351
3962
|
declare abstract class BasicNavi {
|
|
3352
3963
|
protected readonly appkey: string;
|
|
3353
3964
|
protected readonly logger: BasicLogger;
|
|
3354
|
-
|
|
3355
|
-
|
|
3356
|
-
*/
|
|
3357
|
-
protected readonly navigators: string[];
|
|
3358
|
-
constructor(appkey: string, logger: BasicLogger,
|
|
3359
|
-
/**
|
|
3360
|
-
* 业务层的自定义导航配置
|
|
3361
|
-
*/
|
|
3362
|
-
navigators: string[]);
|
|
3965
|
+
protected readonly statisticLog: BasicStatistic;
|
|
3966
|
+
constructor(appkey: string, logger: BasicLogger, statisticLog: BasicStatistic);
|
|
3363
3967
|
/**
|
|
3364
3968
|
* 当前进行中的导航请求
|
|
3365
3969
|
*/
|
|
@@ -3371,7 +3975,9 @@ declare abstract class BasicNavi {
|
|
|
3371
3975
|
* @param ignoreExpire 是否忽略有效期检查。理论上只需要在建立连接时需要检测 navi 有效期,其他场景无需检测
|
|
3372
3976
|
* @param traceId 事务日志跟踪 ID
|
|
3373
3977
|
*/
|
|
3374
|
-
request(token: string, ignoreCache: boolean, ignoreExpire: boolean, traceId: string
|
|
3978
|
+
request(token: string, ignoreCache: boolean, ignoreExpire: boolean, traceId: string, contextInfo?: {
|
|
3979
|
+
[key: string]: any;
|
|
3980
|
+
}): IPromiseResult<INaviInfo>;
|
|
3375
3981
|
private sendRequest;
|
|
3376
3982
|
/**
|
|
3377
3983
|
* 从指定服务列表中顺序尝试获取导航
|
|
@@ -3389,7 +3995,17 @@ declare abstract class BasicNavi {
|
|
|
3389
3995
|
* @param timeout 请求超时时间
|
|
3390
3996
|
* @param traceId
|
|
3391
3997
|
*/
|
|
3392
|
-
protected abstract httpRequest(uri: string, appkey: string, token: string,
|
|
3998
|
+
protected abstract httpRequest(uri: string, appkey: string, token: string, traceId: string, finished: boolean): IPromiseResult<INaviInfo>;
|
|
3999
|
+
/**
|
|
4000
|
+
* 向目标导航服务发送请求
|
|
4001
|
+
* @param uri 导航服务地址
|
|
4002
|
+
* @param appkey
|
|
4003
|
+
* @param token
|
|
4004
|
+
* @param version
|
|
4005
|
+
* @param timeout 请求超时时间
|
|
4006
|
+
* @param traceId
|
|
4007
|
+
*/
|
|
4008
|
+
protected abstract httpRequestV2(uri: string, appkey: string, token: string, traceId: string, finished: boolean): IPromiseResult<INaviInfo>;
|
|
3393
4009
|
/**
|
|
3394
4010
|
* 转换 Navi 接口 HTTP 请求状态码为 ErrorCode 定义
|
|
3395
4011
|
* @param code
|
|
@@ -3418,6 +4034,12 @@ declare abstract class BasicNavi {
|
|
|
3418
4034
|
* @param voipCallInfo
|
|
3419
4035
|
*/
|
|
3420
4036
|
updateVoipCallInfo(token: string, voipCallInfo: string): void;
|
|
4037
|
+
protected getNaviV2RequestOption(option: INaviRequestOption): IRequest;
|
|
4038
|
+
/**
|
|
4039
|
+
* 是否使用 v2 版本导航
|
|
4040
|
+
* 仅私有云 rcx 使用 v1 版本
|
|
4041
|
+
*/
|
|
4042
|
+
useV2Navi(): boolean;
|
|
3421
4043
|
}
|
|
3422
4044
|
|
|
3423
4045
|
/**
|
|
@@ -3425,16 +4047,9 @@ declare abstract class BasicNavi {
|
|
|
3425
4047
|
*/
|
|
3426
4048
|
declare class WebSocketNavi extends BasicNavi {
|
|
3427
4049
|
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>;
|
|
4050
|
+
constructor(appkey: string, logger: BasicLogger, statisticLog: BasicStatistic, runtime: IRuntime);
|
|
4051
|
+
protected httpRequest(uri: string, appkey: string, token: string, traceId: string, finished: boolean): IPromiseResult<INaviInfo>;
|
|
4052
|
+
protected httpRequestV2(uri: string, appkey: string, token: string, traceId: string): IPromiseResult<INaviInfo>;
|
|
3438
4053
|
protected getNaviCache(formatedToken: string): INaviCache | null;
|
|
3439
4054
|
protected setNaviCache(formatedToken: string, naviInfo: INaviInfo): void;
|
|
3440
4055
|
}
|
|
@@ -3577,18 +4192,32 @@ declare abstract class AConnectionMgr {
|
|
|
3577
4192
|
protected readonly appkey: string;
|
|
3578
4193
|
private navi;
|
|
3579
4194
|
protected logger: BasicLogger;
|
|
4195
|
+
protected statisticLog: BasicStatistic;
|
|
3580
4196
|
private listener;
|
|
3581
|
-
constructor(appkey: string, navi: BasicNavi, logger: BasicLogger, listener: IConnectionListener);
|
|
4197
|
+
constructor(appkey: string, navi: BasicNavi, logger: BasicLogger, statisticLog: BasicStatistic, listener: IConnectionListener);
|
|
3582
4198
|
/**
|
|
3583
4199
|
* 当前连接所用 token
|
|
3584
4200
|
*/
|
|
3585
4201
|
private token;
|
|
4202
|
+
protected curCmpUrl: string;
|
|
3586
4203
|
/**
|
|
3587
4204
|
* 获取当前连接中使用的 token
|
|
3588
4205
|
* @returns
|
|
3589
4206
|
*/
|
|
3590
4207
|
getToken(): string;
|
|
3591
4208
|
private reconnectKick;
|
|
4209
|
+
/**
|
|
4210
|
+
* 控制连接时长埋点开关
|
|
4211
|
+
*/
|
|
4212
|
+
private _connectDurSwitch;
|
|
4213
|
+
/**
|
|
4214
|
+
* 重连次数
|
|
4215
|
+
*/
|
|
4216
|
+
retryCount: number;
|
|
4217
|
+
uuid: string;
|
|
4218
|
+
reason: number;
|
|
4219
|
+
private connectedTime;
|
|
4220
|
+
private _network;
|
|
3592
4221
|
/**
|
|
3593
4222
|
* 当前连接状态
|
|
3594
4223
|
*/
|
|
@@ -3602,6 +4231,11 @@ declare abstract class AConnectionMgr {
|
|
|
3602
4231
|
* @returns
|
|
3603
4232
|
*/
|
|
3604
4233
|
getCurrentUserId(): string;
|
|
4234
|
+
/**
|
|
4235
|
+
* 缓存的 cmp 权重
|
|
4236
|
+
* disconnect 时重置
|
|
4237
|
+
*/
|
|
4238
|
+
protected cmpWeightCache?: ICmpData[];
|
|
3605
4239
|
/**
|
|
3606
4240
|
* 修改连接状态
|
|
3607
4241
|
* @param status
|
|
@@ -3613,6 +4247,16 @@ declare abstract class AConnectionMgr {
|
|
|
3613
4247
|
* @returns
|
|
3614
4248
|
*/
|
|
3615
4249
|
getConnectionStatus(): RCConnectionStatus;
|
|
4250
|
+
/**
|
|
4251
|
+
* 设置网络状态
|
|
4252
|
+
* @returns
|
|
4253
|
+
*/
|
|
4254
|
+
setNetwork(data: INetwork, isUnPrintLog?: boolean): void;
|
|
4255
|
+
/**
|
|
4256
|
+
* 获取网络连接状态
|
|
4257
|
+
* @returns
|
|
4258
|
+
*/
|
|
4259
|
+
getNetwork(): INetwork;
|
|
3616
4260
|
/**
|
|
3617
4261
|
* 建立连接
|
|
3618
4262
|
* @param token
|
|
@@ -3649,6 +4293,7 @@ declare abstract class AConnectionMgr {
|
|
|
3649
4293
|
*/
|
|
3650
4294
|
private createConnectionTask;
|
|
3651
4295
|
private reconnectTimer;
|
|
4296
|
+
private setReconnectReason;
|
|
3652
4297
|
/**
|
|
3653
4298
|
* 尝试重连
|
|
3654
4299
|
* @param ignoreNaviCache 是否忽略 navi 缓存以重新请求 navi
|
|
@@ -3701,6 +4346,15 @@ declare abstract class AConnectionMgr {
|
|
|
3701
4346
|
* 清理重连计时器
|
|
3702
4347
|
*/
|
|
3703
4348
|
private stopReconnectTimer;
|
|
4349
|
+
/**
|
|
4350
|
+
* 获取 CMP 列表
|
|
4351
|
+
*/
|
|
4352
|
+
protected getCmpList(navi: INaviInfo, isTcp?: boolean): ICmpData[];
|
|
4353
|
+
/**
|
|
4354
|
+
* 修改 CMP 权重
|
|
4355
|
+
*/
|
|
4356
|
+
protected updateCmpWeight(cmpUrl: string, isRise?: boolean): void;
|
|
4357
|
+
private clearCmpWeightCache;
|
|
3704
4358
|
}
|
|
3705
4359
|
|
|
3706
4360
|
/**
|
|
@@ -4810,6 +5464,12 @@ declare const DelayTimer: {
|
|
|
4810
5464
|
getTime: () => number;
|
|
4811
5465
|
};
|
|
4812
5466
|
|
|
5467
|
+
declare enum AreaCode {
|
|
5468
|
+
BJ = 1,
|
|
5469
|
+
SG = 2,
|
|
5470
|
+
NA = 3
|
|
5471
|
+
}
|
|
5472
|
+
|
|
4813
5473
|
declare type IMessageListnenr = (message: IReceivedMessage, leftCount?: number, hasMore?: boolean) => void;
|
|
4814
5474
|
declare type IMessagesListnenr = (messages: IReceivedMessage[], leftCount?: number, hasMore?: boolean) => void;
|
|
4815
5475
|
declare type IConnectionStatusListener = (status: RCConnectionStatus | ErrorCode | ConnectionStatus) => void;
|
|
@@ -4925,6 +5585,14 @@ interface IAPIContextOption {
|
|
|
4925
5585
|
* IndexDB 数据库内的日志有效期,单位为小时,有效值为 `24` - `168`,默认 IndexDB 内日志数据有效期 168 小时
|
|
4926
5586
|
*/
|
|
4927
5587
|
logExpireTime?: number;
|
|
5588
|
+
/**
|
|
5589
|
+
* 区域码
|
|
5590
|
+
*/
|
|
5591
|
+
areaCode?: AreaCode;
|
|
5592
|
+
/**
|
|
5593
|
+
* 日志服务地址
|
|
5594
|
+
*/
|
|
5595
|
+
logServerUrl?: string;
|
|
4928
5596
|
}
|
|
4929
5597
|
|
|
4930
5598
|
interface IPluginGenerator<API, InitOption> {
|
|
@@ -5066,6 +5734,52 @@ declare class APIContext {
|
|
|
5066
5734
|
private _processChrmMemChangeMessage;
|
|
5067
5735
|
private _processTypingStatusMessage;
|
|
5068
5736
|
private _processInterceptMessage;
|
|
5737
|
+
/**
|
|
5738
|
+
* 聊天室用户加入退出多端同步消息
|
|
5739
|
+
* @since 5.7.9
|
|
5740
|
+
* 多端登录相关事件通知回调,包含三种通知 case
|
|
5741
|
+
* 1. 多端登录情况, 一端加入聊天室, 需要通知另一终端, 指定聊天室中所有成员,包括当前加入用户
|
|
5742
|
+
* 2. 多端登录情况, 一端退出聊天室, 需要通知另一终端, 指定聊天室中所有成员,包括当前退出用户
|
|
5743
|
+
* 3. 用户多端加入聊天室场景: 用户在 Android 端加入聊天室, 在 Web 端登录后又加入一个新的聊天室,
|
|
5744
|
+
* 自动将用户从上一个聊天室踢出, 被踢出聊天室中的所有成员,包括被踢出用户
|
|
5745
|
+
* 注:case 3 如果开通了一个用户可加入多个聊天室的情况不会进行通知
|
|
5746
|
+
*/
|
|
5747
|
+
private _processChrmSyncMessage;
|
|
5748
|
+
/**
|
|
5749
|
+
* @since 5.7.9
|
|
5750
|
+
* 封禁用户相关事件通知回调, 包含两种通知 case
|
|
5751
|
+
* 1. 封禁用户,聊天室中所有成员,包括被封禁用户
|
|
5752
|
+
* 注:
|
|
5753
|
+
* 封禁后用户被自动踢出聊天室
|
|
5754
|
+
* 封禁后用户不会再收到被踢出的通知
|
|
5755
|
+
*
|
|
5756
|
+
* 2. 解除封禁,被解除封禁的成员
|
|
5757
|
+
* 注:
|
|
5758
|
+
* 用户未在线时,再登录时不会收到通知
|
|
5759
|
+
* 服务端仅对主动解除封禁做通知,封禁时间到了,自动解除的不通知, 此刻调用加入聊天室接口可成功
|
|
5760
|
+
*/
|
|
5761
|
+
private _processChrmMemBlockMessage;
|
|
5762
|
+
/**
|
|
5763
|
+
* @since 5.7.9
|
|
5764
|
+
* 禁言相关事件通知回调,包含以下 case
|
|
5765
|
+
* 注:禁言,受到白名单保护,即白名单中用户不会被禁言
|
|
5766
|
+
* 1. 禁言指定聊天室中用户,指定聊天室中任何成员
|
|
5767
|
+
* 2. 解除指定聊天室中用户禁言,指定聊天室中任何成员
|
|
5768
|
+
*
|
|
5769
|
+
* 注:全体禁言,也受到白名单保护,即白名单中用户不会被禁言
|
|
5770
|
+
* 3. 聊天室全体禁言,针对聊天室中所有成员
|
|
5771
|
+
* 4. 解除聊天室全体禁言,针对聊天室中所有成员
|
|
5772
|
+
*
|
|
5773
|
+
* 注:白名单是聊天室维度,添加后,用户在此聊天室内无法被设置禁言,即被保护
|
|
5774
|
+
* 生命周期跟随聊天室,销毁后,清空白名单,重建聊天室时,需要再次调用接口添加
|
|
5775
|
+
* 5. 添加禁言用户白名单,对应聊天室中所有成员
|
|
5776
|
+
* 6. 移出禁言用户白名单,对应聊天室中所有成员
|
|
5777
|
+
*
|
|
5778
|
+
* 注:全局禁言是最高优先级,全局禁言后,禁言用户在所有聊天室内都无法发言,即便配置白名单也不行
|
|
5779
|
+
* 7. 用户聊天室全局禁言,指定全局禁言用户
|
|
5780
|
+
* 8. 解除用户聊天室全局禁言,指定解除全局禁言用户
|
|
5781
|
+
*/
|
|
5782
|
+
private _processChrmMemBanMessage;
|
|
5069
5783
|
/**
|
|
5070
5784
|
* 消息处理器(v2/v4/next 版本中兼容)
|
|
5071
5785
|
* 返回 false | undefined:消息继续向上抛出,true:内部处理或转为事件回调,无需向上抛出
|
|
@@ -6132,6 +6846,7 @@ declare abstract class AEngine {
|
|
|
6132
6846
|
protected readonly _watcher: IEngineWatcher;
|
|
6133
6847
|
protected readonly _options: IAPIContextOption;
|
|
6134
6848
|
protected readonly logger: BasicLogger;
|
|
6849
|
+
protected readonly statisticLog: BasicStatistic;
|
|
6135
6850
|
/**
|
|
6136
6851
|
* 连接时间
|
|
6137
6852
|
*/
|
|
@@ -6142,7 +6857,7 @@ declare abstract class AEngine {
|
|
|
6142
6857
|
* 引擎初始化
|
|
6143
6858
|
* @param _appkey
|
|
6144
6859
|
*/
|
|
6145
|
-
constructor(runtime: IRuntime, rtcCodec: Codec<RTCKeyMaps>, _watcher: IEngineWatcher, _options: IAPIContextOption, logger: BasicLogger);
|
|
6860
|
+
constructor(runtime: IRuntime, rtcCodec: Codec<RTCKeyMaps>, _watcher: IEngineWatcher, _options: IAPIContextOption, logger: BasicLogger, statisticLog: BasicStatistic);
|
|
6146
6861
|
protected _rtcSignalingListener?: (buffer: Uint8Array) => void;
|
|
6147
6862
|
/**
|
|
6148
6863
|
* 注册 RTC KV 变更监听器
|
|
@@ -6165,6 +6880,10 @@ declare abstract class AEngine {
|
|
|
6165
6880
|
* 获取 engine 包内部 logger 工具
|
|
6166
6881
|
*/
|
|
6167
6882
|
getInnerLogger(): BasicLogger;
|
|
6883
|
+
/**
|
|
6884
|
+
* 获取 engine 包内部 logger 工具
|
|
6885
|
+
*/
|
|
6886
|
+
getInnerStatisticLog(): BasicStatistic;
|
|
6168
6887
|
/**
|
|
6169
6888
|
* 调用非标准方法。所谓非标准方法,是为某些特定需求或产品添加,暂未作为标准接口添加至 API 层。
|
|
6170
6889
|
* 对于未实现的方法,接口响应 Unsupport 错误码
|
|
@@ -6879,8 +7598,36 @@ declare abstract class AEngine {
|
|
|
6879
7598
|
* 测试代理
|
|
6880
7599
|
*/
|
|
6881
7600
|
abstract testProxy(proxy: IProxy, testHost: string): Promise<IResponse>;
|
|
7601
|
+
/**
|
|
7602
|
+
* 设置当前网络
|
|
7603
|
+
*/
|
|
7604
|
+
abstract setNetwork(data: INetwork, isUnPrintLog?: boolean): void;
|
|
6882
7605
|
}
|
|
6883
7606
|
|
|
7607
|
+
interface IUrlCenterInitOption {
|
|
7608
|
+
areaCode?: AreaCode;
|
|
7609
|
+
navigators?: string[];
|
|
7610
|
+
logServerUrl?: string;
|
|
7611
|
+
miniCMPProxy?: string[];
|
|
7612
|
+
}
|
|
7613
|
+
declare class UrlCenter {
|
|
7614
|
+
private initOption;
|
|
7615
|
+
init(initOption: IUrlCenterInitOption): void;
|
|
7616
|
+
/**
|
|
7617
|
+
* 获取导航 URL 列表
|
|
7618
|
+
*/
|
|
7619
|
+
getNaviUrlList(token: string): string[];
|
|
7620
|
+
/**
|
|
7621
|
+
* 获取日志上传
|
|
7622
|
+
*/
|
|
7623
|
+
getLogUrlPolicyList(naviLogUrl?: string): string[];
|
|
7624
|
+
/**
|
|
7625
|
+
* 获取小程序平台 CMP 地址
|
|
7626
|
+
*/
|
|
7627
|
+
getMiniCmpUrlList(): string[];
|
|
7628
|
+
}
|
|
7629
|
+
declare const urlCenter: UrlCenter;
|
|
7630
|
+
|
|
6884
7631
|
declare class AppStorage {
|
|
6885
7632
|
private _cache;
|
|
6886
7633
|
private _storageKey;
|
|
@@ -7157,6 +7904,10 @@ declare const assert: (key: string, value: any, validator: AssertRules | ((value
|
|
|
7157
7904
|
*/
|
|
7158
7905
|
declare const validate: (key: string, value: any, validator: AssertRules | ((value?: any) => boolean), required?: boolean) => boolean;
|
|
7159
7906
|
|
|
7907
|
+
/**
|
|
7908
|
+
* engine 层业务相关工具方法
|
|
7909
|
+
*/
|
|
7910
|
+
|
|
7160
7911
|
/**
|
|
7161
7912
|
* 通过文件类型生成上传唯一文件名
|
|
7162
7913
|
*/
|
|
@@ -7194,6 +7945,9 @@ declare const isValidChrmEntryValue: (value: string) => Boolean;
|
|
|
7194
7945
|
* 注意: 这里的 messageId 与 websocketChannel 中的 messageId 不是同一个。
|
|
7195
7946
|
*/
|
|
7196
7947
|
declare const getClientMessageId: () => number;
|
|
7948
|
+
declare const getbundleId: () => string;
|
|
7949
|
+
declare const getSDKPrivate: EnterpriseType;
|
|
7950
|
+
declare const getServerPrivate: (type: number | undefined) => number;
|
|
7197
7951
|
|
|
7198
7952
|
/**
|
|
7199
7953
|
* @todo 后期禁用此方法,容易滥用,且会丢失上下文的数据类型跟踪
|
|
@@ -7245,22 +7999,6 @@ declare const NAVI_REQ_TIMEOUT: number;
|
|
|
7245
7999
|
* WebSocket 建立连接超时时间,单位毫秒
|
|
7246
8000
|
*/
|
|
7247
8001
|
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
8002
|
/**
|
|
7265
8003
|
* IM 接口超时时间,单位毫秒
|
|
7266
8004
|
*/
|
|
@@ -7322,13 +8060,6 @@ declare const REAT_TIME_LOG_SIZE: number;
|
|
|
7322
8060
|
declare const DB_LOG_MAX_SIZE = 100000;
|
|
7323
8061
|
declare const DB_LOG_FLUSH_FREQUENCY = 3000;
|
|
7324
8062
|
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
8063
|
/** SDK 版本号 */
|
|
7333
8064
|
declare const VERSION: string;
|
|
7334
8065
|
/**
|
|
@@ -7348,4 +8079,4 @@ declare type AbsCodec<T> = Codec<T>;
|
|
|
7348
8079
|
*/
|
|
7349
8080
|
declare const version: string;
|
|
7350
8081
|
|
|
7351
|
-
export { AConnectionMgr, AEngine, APIContext, AbsCodec, AppStorage,
|
|
8082
|
+
export { AConnectionMgr, AEngine, APIContext, AbsCodec, AppStorage, AreaCode, AssertRules, BasicLogger, BasicNavi, BasicReporter, BasicStatistic, BasicStatisticReporter, CPP_PROTOCAL_MSGTYPE_OPTION, CallLibMsgType, ChatroomEntryType, ChatroomUserChangeType, Codec, CodecPBMaps, 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, IBlockedMessageInfo, ICancelRoomPKOptions, IChannelAndUserGroupChangeData, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomListener, IChatroomListenerData, 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, 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, IStorage, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraExMsgOptions, IUltraGroupConversation, IUltraGroupOption, 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, 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, StatisticsCSReason, StatisticsConnectType, StatisticsTag, StatisticsVersion, StoreKeys, TagChangeType, Type, UltraGroupChannelChangeType, UltraGroupChannelType, UltraMentionedType, UltraMsgChangeType, UltraMsgSubChangeType, UploadMethod, UserGroupChangeType, VERSION, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketNavi, appendUrl, assert, clone, cloneByJSON, deInitLogDB, forEach, getBrowser, getClientMessageId, getMimeKey, getSDKPrivate, getServerPrivate, 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 };
|