@rongcloud/engine 5.8.4 → 5.8.5-alpha.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.d.ts CHANGED
@@ -1432,6 +1432,16 @@ declare enum ErrorCode {
1432
1432
  * 设置的代理地址不可用
1433
1433
  */
1434
1434
  RC_CONN_PROXY_UNAVAILABLE = 34245,
1435
+ /**
1436
+ * 不支持V4已读回执功能
1437
+ * @since todo
1438
+ */
1439
+ READ_RECEIPT_V4_NOT_SUPPORT = 34292,
1440
+ /**
1441
+ * 不支持更新v4已读回执信息
1442
+ * @since todo
1443
+ */
1444
+ READ_RECEIPT_V4_UPDATE_NOT_SUPPORT = 34293,
1435
1445
  /**
1436
1446
  * 方法未支持
1437
1447
  */
@@ -1468,6 +1478,10 @@ declare enum ErrorCode {
1468
1478
  * 搜索字段对应消息错误
1469
1479
  */
1470
1480
  SEARCH_PROPS_LIMIT_ERROR = 35022,
1481
+ /**
1482
+ * 无效的数据中心请求, appkey 不是该数据中心的,需要重定向到正确的数据中心
1483
+ */
1484
+ CLOUD_DATA_CENTER_INVALID = 20512,
1471
1485
  /** ============================= 错误码 -- 废弃部分 ============================= */
1472
1486
  /**
1473
1487
  * 未知原因失败。
@@ -1890,6 +1904,10 @@ declare enum MessageType {
1890
1904
  * 合并转发消息
1891
1905
  */
1892
1906
  COMBINE = "RC:CombineMsg",
1907
+ /**
1908
+ * 合并转发消息 v2 版本
1909
+ */
1910
+ COMBINE_V2 = "RC:CombineV2Msg",
1893
1911
  /**
1894
1912
  * 聊天室 KV 通知消息
1895
1913
  */
@@ -1935,9 +1953,13 @@ declare enum MessageType {
1935
1953
  */
1936
1954
  SYNC_READ_STATUS = "RC:SRSMsg",
1937
1955
  /**
1938
- * 接受群已读回执更新消息(导航开关grpRRVer1时使用)
1956
+ * 接受群已读回执更新消息(导航开关grpRRVer = 1时使用)
1939
1957
  */
1940
1958
  GROUP_READ_RECEIPT_REQUEST = "RC:RRMsg",
1959
+ /**
1960
+ * 已读回执消息(V4)(导航开关grpRRVer = 3 时使用),支持单群聊
1961
+ */
1962
+ READ_STATE = "RC:RSMsg",
1941
1963
  /**
1942
1964
  * 消息送达报告,仅单聊
1943
1965
  */
@@ -1977,7 +1999,11 @@ declare enum MessageType {
1977
1999
  /**
1978
2000
  * 拦截消息,(当发送的消息的敏感词时,服务会下发一个拦截消息,内容包含被拦截消息信息)
1979
2001
  */
1980
- INTERCEPT = "RC:InterceptMsg"
2002
+ INTERCEPT = "RC:InterceptMsg",
2003
+ /**
2004
+ * 云控消息
2005
+ */
2006
+ CLOUD_CONTROL = "RC:CCConfigChangeRequestMsg"
1981
2007
  }
1982
2008
 
1983
2009
  /**
@@ -2201,6 +2227,12 @@ declare enum LogTagId {
2201
2227
  A_CALLBACK_O = "A-callback-O",
2202
2228
  A_CALLBACK_E = "A-callback-E",
2203
2229
  L_CALLBACK_E = "L-callback-E",
2230
+ A_SEND_MESSAGE_READ_RECEIPT_T = "A-send_message_read_receipt-T",
2231
+ A_SEND_MESSAGE_READ_RECEIPT_R = "A-send_message_read_receipt-R",
2232
+ A_GET_MESSAGE_READ_RECEIPT_T = "A-get_message_read_receipt-T",
2233
+ A_GET_MESSAGE_READ_RECEIPT_R = "A-get_message_read_receipt-R",
2234
+ A_SYNC_READ_STATUS_T = "A-sync_read_status-T",
2235
+ A_SYNC_READ_STATUS_R = "A-sync_read_status-R",
2204
2236
  A_GET_TOP_CONVERSATION_LIST_E = "A-get_top_conversation_list-E",
2205
2237
  /**
2206
2238
  * PB 数据编码错误
@@ -2247,7 +2279,16 @@ declare enum LogTagId {
2247
2279
  /** 获取静态配置 */
2248
2280
  L_GET_STATIC_CONF_T = "L-get_static_conf-T",
2249
2281
  L_GET_STATIC_CONF_R = "L-get_static_conf-R",
2250
- L_GET_STATIC_CONF_E = "L-get_static_conf-E"
2282
+ L_GET_STATIC_CONF_E = "L-get_static_conf-E",
2283
+ /** 云控日志 */
2284
+ L_CLOUD_DISABLED = "L-cloud_disabled",
2285
+ L_CLOUD_EXPIRE = "L-cloud_expire",
2286
+ L_CLOUD_OVERCLOCK = "L-cloud_overclock",
2287
+ L_CLOUD_APPKEY_REGION_E = "L-cloud_appkey_region_error",
2288
+ L_CLOUD_CONFIG_DATA_E = "L-cloud_config_data_error",
2289
+ L_CLOUD_SET_CACHE_O = "L-cloud_set_cache-O",
2290
+ L_CLOUD_GET_CACHE_O = "L-cloud_get_cache-O",
2291
+ L_CLOUD_MSG_NTF_O = "L-cloud_msg_ntf-O"
2251
2292
  }
2252
2293
 
2253
2294
  /** 统计数据标签 */
@@ -2258,7 +2299,10 @@ declare enum StatisticsTag {
2258
2299
  IM_CMP = "IM-stats_cmp-S",
2259
2300
  IM_CMP_RMTP = "IM-stats_cmp_rmtp-S",
2260
2301
  IM_STATS_CS = "IM-stats_cs-S",
2261
- IM_NETWORK_CHANGE = "IM-stats_network_change-S"
2302
+ IM_NETWORK_CHANGE = "IM-stats_network_change-S",
2303
+ /** 云控配置埋点 */
2304
+ L_CLOUD_INFO_FETCH_T = "L-cloud_info_fetch-T",
2305
+ L_CLOUD_INFO_FETCH_R = "L-cloud_info_fetch-R"
2262
2306
  }
2263
2307
 
2264
2308
  /**
@@ -2659,7 +2703,15 @@ interface IMessageReaderResponse {
2659
2703
  list: IMessageReader[];
2660
2704
  }
2661
2705
  interface ILocalReadReceiptInfo {
2706
+ /**
2707
+ * 仅已读 V2 支持
2708
+ * @hidden
2709
+ */
2662
2710
  hasRespond?: boolean;
2711
+ /**
2712
+ * 仅已读 V2 支持
2713
+ * @hidden
2714
+ */
2663
2715
  readerInfo?: {
2664
2716
  [userId: string]: number;
2665
2717
  };
@@ -2671,21 +2723,61 @@ interface ILocalReadReceiptInfo {
2671
2723
  */
2672
2724
  interface IReadReceiptInfo {
2673
2725
  /**
2674
- * 是否已经发送已读回执
2726
+ * 是否已经发送已读回执, 仅 V2 支持
2675
2727
  */
2676
2728
  hasRespond?: boolean;
2677
2729
  /**
2678
- * 已阅读用户列表(不准确)
2730
+ * 已阅读用户列表(不准确), 仅 V2 支持
2679
2731
  */
2680
2732
  readerList?: IMessageReader[];
2681
2733
  /**
2682
- * 阅读人数(不准确)
2734
+ * 阅读人数
2735
+ */
2736
+ readCount?: number;
2737
+ /**
2738
+ * 群组总人数
2739
+ */
2740
+ totalCount?: number;
2741
+ }
2742
+ /**
2743
+ * 已读回执事件通知数据
2744
+ * @category Interface
2745
+ * @since todo
2746
+ */
2747
+ interface IReadReceiptData {
2748
+ privateReadReceipt?: IPrivateReadReceiptData;
2749
+ groupReadReceipt?: IGroupReadReceiptData;
2750
+ }
2751
+ interface IPrivateReadReceiptData extends IConversationOption {
2752
+ /**
2753
+ * 最后已读消息时间 (单聊)
2683
2754
  */
2755
+ endMsgTime?: number;
2756
+ }
2757
+ interface IGroupReadReceiptData extends IConversationOption {
2758
+ /**
2759
+ * 已读人数 (群聊)
2760
+ */
2684
2761
  readCount?: number;
2685
2762
  /**
2686
- * 群组总人数(不准确)
2763
+ * 消息发送时群总人数 (群聊)
2687
2764
  */
2688
2765
  totalCount?: number;
2766
+ /**
2767
+ * 消息 UID(群聊)
2768
+ */
2769
+ messageUId?: string;
2770
+ }
2771
+ /**
2772
+ * 多端同步会话已读状态事件数据
2773
+ * @category Interface
2774
+ * @since todo
2775
+ */
2776
+ interface ISyncReadStatusData extends IConversationOption {
2777
+ /**
2778
+ * 已读消息时间
2779
+ */
2780
+ timestamp: number;
2689
2781
  }
2690
2782
  /**
2691
2783
  * 从服务端接收到的消息数据
@@ -3237,6 +3329,64 @@ interface MentionedInfoBody {
3237
3329
  userIdList?: string[];
3238
3330
  mentionedContent?: string;
3239
3331
  }
3332
+ /**
3333
+ * 被合并的消息数据结构
3334
+ */
3335
+ interface ICombinedMessage {
3336
+ /**
3337
+ * 消息发送者的用户 Id
3338
+ */
3339
+ fromUserId: string;
3340
+ /**
3341
+ * 消息所属会话 Id
3342
+ */
3343
+ targetId: string;
3344
+ /**
3345
+ * 消息发送时间
3346
+ */
3347
+ timestamp: number;
3348
+ /**
3349
+ * 消息类型
3350
+ */
3351
+ objectName: string;
3352
+ /**
3353
+ * 消息内容
3354
+ */
3355
+ content: any;
3356
+ }
3357
+ /**
3358
+ * v2 版本合并转发消息 content 结构
3359
+ */
3360
+ interface ICombineV2MessageContent {
3361
+ /**
3362
+ * 被合并消息的来源会话类型
3363
+ */
3364
+ conversationType: ConversationType;
3365
+ /**
3366
+ * 合并信息摘要,建议取被合并消息中的前三条消息的内容
3367
+ */
3368
+ summaryList: string[];
3369
+ /**
3370
+ * 名称列表,单聊时为双方的名称,群聊时为群组名称
3371
+ */
3372
+ nameList: string[];
3373
+ /**
3374
+ * 被合并消息的条目数量
3375
+ */
3376
+ msgNum: number;
3377
+ /**
3378
+ * 被合并消息的消息内容,仅当内容 JSON 序列化后长度小于 120K 时有值;当长度大于 120K 时,内容将被以文件的形式远端存储。
3379
+ */
3380
+ msgList?: Array<ICombinedMessage>;
3381
+ /**
3382
+ * 被合并消息的内容 JSON 序列化后长度大于 120K 时的文件名,暂时无作用,移动端依据此字段判断是否有文件需要下载,而非 remoteUrl 字段
3383
+ */
3384
+ jsonMsgKey?: string;
3385
+ /**
3386
+ * 远端存储文件的 URL,仅 jsonMsgKey 有值时存在
3387
+ */
3388
+ remoteUrl?: string;
3389
+ }
3240
3390
 
3241
3391
  interface IUpdateItem {
3242
3392
  isTop?: {
@@ -3342,6 +3492,10 @@ interface IReceivedConversation {
3342
3492
  * 会话操作时间,暂仅 Electron 平台支持
3343
3493
  */
3344
3494
  operationTime?: number;
3495
+ /**
3496
+ * 会话草稿
3497
+ */
3498
+ draft?: string;
3345
3499
  }
3346
3500
  /**
3347
3501
  * @category Interface
@@ -4105,9 +4259,19 @@ interface INaviInfo {
4105
4259
  */
4106
4260
  crypto?: string;
4107
4261
  /**
4108
- * 群组回执开关, 1: 打开,0(或者没有): 关闭
4262
+ * 群组回执开关,
4263
+ * 0(或者没有): 关闭 v1 版本
4264
+ * 1: 打开, v2 版本
4265
+ * 2: 废弃
4266
+ * 3: V4 版本,单群聊已读回执
4109
4267
  */
4110
4268
  grpRRVer?: number;
4269
+ /**
4270
+ * 会话驱动类型
4271
+ * 0: 默认,客户端离线消息驱动计算未读数(客户端通过pullMsg结果计算)
4272
+ * 1: 服务端会话驱动计算未读数(调用pullSes进行初始化),暂只影响更新会话已读时间接口
4273
+ */
4274
+ sesDriven?: number;
4111
4275
  /**
4112
4276
  * 防黑产开关, 1: 打开,0:关闭
4113
4277
  */
@@ -4429,9 +4593,22 @@ declare class IndexDBStatisticReporter extends BasicStatisticReporter {
4429
4593
  }
4430
4594
 
4431
4595
  declare enum AreaCode {
4596
+ /**
4597
+ * 默认值,北京数据中心
4598
+ */
4432
4599
  BJ = 1,
4600
+ /**
4601
+ * 新加坡数据中心
4602
+ */
4433
4603
  SG = 2,
4434
- NA = 3
4604
+ /**
4605
+ * 北美数据中心
4606
+ */
4607
+ NA = 3,
4608
+ /**
4609
+ * 新增新加坡数据中心
4610
+ */
4611
+ SG_A = 4
4435
4612
  }
4436
4613
 
4437
4614
  interface IStaticConfigData {
@@ -4483,7 +4660,8 @@ declare abstract class BasicNavi {
4483
4660
  protected readonly statisticLog: BasicStatistic;
4484
4661
  protected readonly staticConfigManager: BasicStaticConfigManager;
4485
4662
  private readonly isRequestProfile;
4486
- constructor(appkey: string, logger: BasicLogger, statisticLog: BasicStatistic, staticConfigManager: BasicStaticConfigManager, isRequestProfile?: boolean);
4663
+ private readonly isUseDynamicNaviUrl;
4664
+ constructor(appkey: string, logger: BasicLogger, statisticLog: BasicStatistic, staticConfigManager: BasicStaticConfigManager, isRequestProfile?: boolean, isUseDynamicNaviUrl?: boolean);
4487
4665
  /**
4488
4666
  * 当前进行中的导航请求
4489
4667
  */
@@ -5270,13 +5448,25 @@ interface IEngine {
5270
5448
  getTagsForConversation(conversation: IConversationOption): IPromiseResult<IConversationTag[]>;
5271
5449
  /**
5272
5450
  * 发送群组消息已读回执
5273
- * 导航下发已读回执开关为 true 时调用
5451
+ * 导航下发已读回执开关为 1 时调用
5274
5452
  */
5275
5453
  sendReadReceiptMessage(targetId: string, messageUIds: string[], channelId?: string): Promise<IAsyncRes>;
5276
5454
  /**
5277
5455
  * 获取群组消息已读列表
5278
5456
  */
5279
5457
  getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
5458
+ /**
5459
+ * 发送已读回执(V4)
5460
+ */
5461
+ sendReadReceiptMessageV4(conversation: IConversationOption, startMsgUid: string, endMsgUid: string): Promise<IAsyncRes>;
5462
+ /**
5463
+ * 获取消息已读回执列表, 暂仅支持群聊(V4)
5464
+ */
5465
+ getMessageReadReceiptV4(conversation: IConversationOption, messageUid: string): IPromiseResult<IMessageReader[]>;
5466
+ /**
5467
+ * 多端同步会话的已读时间(V4)
5468
+ */
5469
+ updateConversationReadTime(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes>;
5280
5470
  /**
5281
5471
  * 获取服务器时间
5282
5472
  */
@@ -5931,7 +6121,7 @@ declare abstract class BasicReporter {
5931
6121
  * @param logId 拉取事务 Id,用于上传日志时的 Http 请求
5932
6122
  * @param messageUId 消息 messageUId
5933
6123
  */
5934
- report(startTime: number, endTime: number, platform: string, uri: string, logId: string, messageUId: string): Promise<void>;
6124
+ report(startTime: number, endTime: number, platform: string, uri: string, logId: string, messageUId: string, isCloudControl?: boolean): Promise<void>;
5935
6125
  /**
5936
6126
  * 以 `POST` 方法向服务发送日志数据
5937
6127
  * @param url
@@ -5978,7 +6168,7 @@ declare class IndexDBReporter extends BasicReporter {
5978
6168
  * @param logId
5979
6169
  * @param messageUId
5980
6170
  */
5981
- report(startTime: number, endTime: number, platform: string, uri: string, logId: string, messageUId: string): Promise<void>;
6171
+ report(startTime: number, endTime: number, platform: string, uri: string, logId: string, messageUId: string, isCloudControl?: boolean): Promise<void>;
5982
6172
  protected realtimeReport(url: string, level: LogL, itv: number): Promise<void>;
5983
6173
  }
5984
6174
 
@@ -6171,6 +6361,14 @@ interface IWatcher {
6171
6361
  ultraGroupChannelUserKicked?: (list: IUltraChannelUserKickedInfo[]) => void;
6172
6362
  ultraGroupChannelDelete?: (list: IUltraChannelDeleteInfo[]) => void;
6173
6363
  userGroupStatus?: (data: IUserGroupStatusInfo) => void;
6364
+ /**
6365
+ * 已读回执 V4
6366
+ */
6367
+ messageReadReceipt?: (data: IReadReceiptData) => void;
6368
+ /**
6369
+ * 同步已读状态 V4
6370
+ */
6371
+ syncReadStatus?: (data: ISyncReadStatusData) => void;
6174
6372
  }
6175
6373
  interface IAPIContextOption {
6176
6374
  /**
@@ -6465,6 +6663,8 @@ declare class APIContext {
6465
6663
  private _ultraGroupChannelUserKickedListener;
6466
6664
  private _ultraGroupChannelDeleteListener;
6467
6665
  private _userGroupStatusListener;
6666
+ private _messageReadReceipt;
6667
+ private _syncReadStatus;
6468
6668
  /**
6469
6669
  * rtc 数据变更通知 pluginContext
6470
6670
  */
@@ -6570,6 +6770,18 @@ declare class APIContext {
6570
6770
  * @param messageUIds
6571
6771
  */
6572
6772
  getMessageReader(targetId: string, messageUId: string, channelId?: string): Promise<IAsyncRes<IMessageReaderResponse>>;
6773
+ /**
6774
+ * 发送已读回执(V4)
6775
+ */
6776
+ sendReadReceiptMessageV4(conversation: IConversationOption, startMsgUid: string, endMsgUid: string): Promise<IAsyncRes>;
6777
+ /**
6778
+ * 获取消息已读回执列表, 暂仅支持群聊(V4)
6779
+ */
6780
+ getMessageReadReceiptV4(conversation: IConversationOption, messageUid: string): IPromiseResult<IMessageReader[]>;
6781
+ /**
6782
+ * 多端同步会话的已读时间(V4)
6783
+ */
6784
+ updateConversationReadTime(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes>;
6573
6785
  /**
6574
6786
  * 反初始化,清空所有监听及计时器
6575
6787
  */
@@ -7196,7 +7408,7 @@ declare class PluginContext {
7196
7408
  */
7197
7409
  ondestroy?(): void;
7198
7410
  /**
7199
- * beem 专有接口,做 groupCall 用到
7411
+ * groupCall 用到
7200
7412
  */
7201
7413
  onCallInfo?(data: string): void;
7202
7414
  /**
@@ -7491,6 +7703,14 @@ interface IEngineWatcher extends IConnectionListener {
7491
7703
  callInfo: (data: string) => void;
7492
7704
  onNaviDataChange: (naviInfo: INaviInfo) => void;
7493
7705
  userGroupStatus: (info: IUserGroupStatusInfo) => void;
7706
+ /**
7707
+ * 已读回执 V4
7708
+ */
7709
+ messageReadReceipt: (data: IReadReceiptData) => void;
7710
+ /**
7711
+ * 同步已读状态 V4
7712
+ */
7713
+ syncReadStatus: (data: ISyncReadStatusData) => void;
7494
7714
  }
7495
7715
  /**
7496
7716
  * 引擎定义
@@ -7762,6 +7982,18 @@ declare abstract class AEngine {
7762
7982
  * @param messageUIds
7763
7983
  */
7764
7984
  abstract getMessageReader(targetId: string, messageUId: string, channelId?: string): IPromiseResult<IMessageReaderResponse>;
7985
+ /**
7986
+ * 发送已读回执(V4)
7987
+ */
7988
+ abstract sendReadReceiptMessageV4(conversation: IConversationOption, startMsgUid: string, endMsgUid: string): Promise<IAsyncRes>;
7989
+ /**
7990
+ * 获取消息已读回执列表, 暂仅支持群聊(V4)
7991
+ */
7992
+ abstract getMessageReadReceiptV4(conversation: IConversationOption, messageUid: string): IPromiseResult<IMessageReader[]>;
7993
+ /**
7994
+ * 多端同步会话的已读时间(V4)
7995
+ */
7996
+ abstract updateConversationReadTime(conversation: IConversationOption, timestamp: number): Promise<IAsyncRes>;
7765
7997
  /**
7766
7998
  * 断开连接
7767
7999
  * @param closeDB 是否关闭数据库,默认为 true,仅 Electron 平台有效
@@ -8306,7 +8538,7 @@ declare class UrlCenter {
8306
8538
  /**
8307
8539
  * 获取导航 URL 列表
8308
8540
  */
8309
- getNaviUrlList(token: string): string[];
8541
+ getNaviUrlList(token: string, isUseDynamicNaviUrl: boolean): string[];
8310
8542
  /**
8311
8543
  * 获取日志上传
8312
8544
  */
@@ -8319,6 +8551,10 @@ declare class UrlCenter {
8319
8551
  * 获取静态配置地址
8320
8552
  */
8321
8553
  getStaticConfigUrl(): string[];
8554
+ /**
8555
+ * @returns 获取云控地址
8556
+ */
8557
+ getCloudControllerUrl(areaCode?: number): string[];
8322
8558
  }
8323
8559
  declare const urlCenter: UrlCenter;
8324
8560
 
@@ -8394,6 +8630,10 @@ declare class VersionManage {
8394
8630
  };
8395
8631
  }
8396
8632
 
8633
+ declare function isStartCloudController(): boolean;
8634
+
8635
+ declare const getDeviceId: (runtime: IRuntime) => string;
8636
+
8397
8637
  /**
8398
8638
  * 检查参数是否为字符串
8399
8639
  * 只做类型检查,不做长度检查,故当字符串长度为 0,结果依然为 true
@@ -8529,6 +8769,16 @@ declare namespace base {
8529
8769
  declare const getUUID: () => string;
8530
8770
  declare const getUUID22: () => string;
8531
8771
 
8772
+ declare class SuspendablePromise<T> {
8773
+ private readonly _promise;
8774
+ private _resolve;
8775
+ private _onCancel;
8776
+ constructor(handle: (resolve: (val: T) => void) => void, onCancel: (resolve: (val: T) => void) => void);
8777
+ private _onResolve;
8778
+ result(): Promise<T>;
8779
+ abort(): void;
8780
+ }
8781
+
8532
8782
  /**
8533
8783
  * 预定义的验证规则,只包含`值类型`数据验证
8534
8784
  * 引用类型数据需使用自定义 validator 校验函数进行校验
@@ -8646,7 +8896,7 @@ declare const getbundleId: () => string;
8646
8896
  declare const decryptCBC: (data: string, key: string, iv: string) => Promise<string>;
8647
8897
  declare function fixUrlProtocol(url: string, protocol?: EConnectProtocol): string;
8648
8898
 
8649
- declare function httpRequest(options: IRequest): Promise<IResponse>;
8899
+ declare function httpRequest(options: IRequest): SuspendablePromise<IResponse>;
8650
8900
 
8651
8901
  /**
8652
8902
  * @todo 后期禁用此方法,容易滥用,且会丢失上下文的数据类型跟踪
@@ -8766,6 +9016,7 @@ declare const FORMATED_VERSION: string;
8766
9016
  declare const MAX_UPLOAD_FILE_SIZE: number;
8767
9017
  declare const UPLOAD_FILE_CHUNK_SIZE: number;
8768
9018
  declare const STATIC_CONFIG_CACHE_TIME: number;
9019
+ declare const RC_DEFAULT_USER = "rongcloudsystem";
8769
9020
  /**
8770
9021
  * localStorage 中的 key 值
8771
9022
  */
@@ -8818,8 +9069,157 @@ declare const LOCAL_STORAGE_KEYS: {
8818
9069
  * staticConfig 静态配置
8819
9070
  */
8820
9071
  STATIC_CONFIG_KEY: (appKey: string) => string;
9072
+ /**
9073
+ * 云控配置存储
9074
+ */
9075
+ CLOUD_CONTROL_KEY: (appKey: string) => string;
8821
9076
  };
8822
9077
 
9078
+ interface ICloudConfig {
9079
+ temporary: boolean;
9080
+ enable: boolean;
9081
+ expire: number;
9082
+ interval: number;
9083
+ }
9084
+ interface IUploadLogConfig {
9085
+ temporary: boolean;
9086
+ tasks: IUploadTask[];
9087
+ }
9088
+ interface IUploadTask {
9089
+ /**
9090
+ * 消息类型
9091
+ */
9092
+ objectName: string;
9093
+ /**
9094
+ * 上报地址
9095
+ */
9096
+ uri: string;
9097
+ /**
9098
+ * 日志 id
9099
+ */
9100
+ logId: string;
9101
+ /**
9102
+ * 开始时间
9103
+ */
9104
+ startTime?: number;
9105
+ /**
9106
+ * 结束时间
9107
+ */
9108
+ endTime?: number;
9109
+ /**
9110
+ * 平台标识
9111
+ */
9112
+ platform?: string;
9113
+ /**
9114
+ * 移动端包名,web 暂未使用
9115
+ */
9116
+ packageName?: string;
9117
+ /**
9118
+ * 会话类型
9119
+ */
9120
+ conversationType?: number;
9121
+ /**
9122
+ * 目标 id
9123
+ */
9124
+ targetId?: string;
9125
+ /**
9126
+ * 频道 id
9127
+ */
9128
+ channelId?: string;
9129
+ /**
9130
+ * 消息 id list
9131
+ * 移动端拉取消息列表使用,web 暂未使用
9132
+ */
9133
+ msgUids?: string;
9134
+ /**
9135
+ * 用户 id
9136
+ */
9137
+ userId?: string;
9138
+ }
9139
+ interface ICloudController {
9140
+ /**
9141
+ * 云控配置
9142
+ */
9143
+ cc: ICloudConfig;
9144
+ /**
9145
+ * 云控配置版本
9146
+ */
9147
+ uploadLog: IUploadLogConfig;
9148
+ /**
9149
+ * 时间戳
9150
+ */
9151
+ timestamp: number;
9152
+ /**
9153
+ * 最后一次请求时间
9154
+ */
9155
+ lastRequestTime: number;
9156
+ /**
9157
+ * 区域码
9158
+ */
9159
+ targetRegion?: number;
9160
+ }
9161
+ declare enum InvokerType {
9162
+ init = 1,
9163
+ newWorkChange = 2,
9164
+ other = 3
9165
+ }
9166
+
9167
+ declare class UploadTaskManage {
9168
+ private readonly reporter;
9169
+ private logId;
9170
+ private uploadTask;
9171
+ private taskLock;
9172
+ constructor(reporter: BasicReporter);
9173
+ uploadLogCmdTask(data: IUploadTask): void;
9174
+ private reportLogCmdTask;
9175
+ private enqueueTask;
9176
+ }
9177
+
9178
+ declare abstract class BaseCloudController {
9179
+ protected logger: BasicLogger;
9180
+ protected appkey: string;
9181
+ protected reporter: BasicReporter;
9182
+ protected statisticLog: BasicStatistic;
9183
+ /**
9184
+ * 是否启用云控
9185
+ */
9186
+ private isEable;
9187
+ /**
9188
+ * 配置有效期, 单位为毫秒
9189
+ */
9190
+ protected expire: number;
9191
+ /**
9192
+ * 配置刷新间隔, 单位为毫秒
9193
+ */
9194
+ protected interval: number;
9195
+ /**
9196
+ * 配置更新时间
9197
+ */
9198
+ protected timestamp: number;
9199
+ /**
9200
+ * 最近一次发起请求时间
9201
+ */
9202
+ protected lastRequestTime: number;
9203
+ protected uploadTaskManage: UploadTaskManage;
9204
+ /**
9205
+ * 缓存矫正 areacode
9206
+ */
9207
+ protected changeAreaCode: number | undefined;
9208
+ protected _cache: ICloudController | null;
9209
+ constructor(logger: BasicLogger, appkey: string, reporter: BasicReporter, statisticLog: BasicStatistic);
9210
+ protected init(): void;
9211
+ protected abstract httpRequest(url: string, method: HttpMethod, headers: {
9212
+ [key: string]: string;
9213
+ }, body: any): IPromiseResult<ICloudController>;
9214
+ protected abstract setCloudControllerCache(data: ICloudController): void;
9215
+ protected abstract getLocalCloudControllerCache(): string | null;
9216
+ private isExire;
9217
+ private isOverclock;
9218
+ private logCmdMsgTasks;
9219
+ protected dataHandle(data: ICloudController): void;
9220
+ request(uri: string, invoker: InvokerType, token?: string): Promise<number>;
9221
+ }
9222
+
8823
9223
  /**
8824
9224
  * 请使用 `Codec` 替代 `AbsCodec`
8825
9225
  * @deprecated
@@ -8832,4 +9232,4 @@ declare type AbsCodec<T> = Codec<T>;
8832
9232
  */
8833
9233
  declare const version: string;
8834
9234
 
8835
- export { AConnectionMgr, AEngine, APIContext, AbsCodec, AppStorage, AreaCode, AssertRules, BasicLogger, BasicNavi, BasicReporter, BasicStaticConfigManager, 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, EConnectProtocol, EnableLogL, EnterpriseType, ErrorCode, EventEmitter, FORMATED_VERSION, FileType, HTTP_TIMEOUT, HttpMethod, IAPIContextOption, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBaseStatisticsData, IBlockedMessageInfo, ICancelRoomPKOptions, IChannelAndUserGroupChangeData, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomJoinResponse, IChatroomListener, IChatroomListenerData, IChatroomNotifyBan, IChatroomNotifyBlock, IChatroomNotifyMultiLoginSync, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IChrmKVEntries, IChrmKVEntry, IConnectResult, IConnectionListener, IConnectionStatusListener, IConversationIdentifier, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDeletedExpansion, IDeliveredUser, IDownloadAuth, 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, IStaticConfig, 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, IUpdateItem, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUserGroupChangeData, IUserGroupStatusInfo, IUserProfile, IWatcher, IWebSocket, IiOSPushConfig, IndexDBLogger, IndexDBReporter, IndexDBStatistic, IndexDBStatisticReporter, RTCKeyMaps as InnerRTCKeyMaps, ItypingStateListener, KVString, LOCAL_STORAGE_KEYS, 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, MentionedInfoBody, 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, STATIC_CONFIG_CACHE_TIME, STATIC_CONFIG_IV, STATIC_CONFIG_KEY, STATUS_MESSAGE, 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, decryptCBC, fixUrlProtocol, forEach, getBrowser, getClientMessageId, getMimeKey, getUUID, getUUID22, getUploadFileName, getbundleId, httpRequest, 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 };
9235
+ export { AConnectionMgr, AEngine, APIContext, AbsCodec, AppStorage, AreaCode, AssertRules, BaseCloudController, BasicLogger, BasicNavi, BasicReporter, BasicStaticConfigManager, 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, EConnectProtocol, EnableLogL, EnterpriseType, ErrorCode, EventEmitter, FORMATED_VERSION, FileType, HTTP_TIMEOUT, HttpMethod, IAPIContextOption, IAndroidPushConfig, IAsyncRes, IBaseConversationInfo, IBaseStatisticsData, IBlockedMessageInfo, ICancelRoomPKOptions, IChannelAndUserGroupChangeData, IChatRoomEntries, IChatRoomEntry, IChatroomEntries, IChatroomEntry, IChatroomEntryListenerData, IChatroomInfo, IChatroomJoinResponse, IChatroomListener, IChatroomListenerData, IChatroomNotifyBan, IChatroomNotifyBlock, IChatroomNotifyMultiLoginSync, IChatroomRejoinedFailed, IChatroomRejoinedInfo, IChatroomRejoinedSuccessed, IChatroomUser, IChatroomUserChangeInfo, IChrmKVEntries, IChrmKVEntry, ICloudController, ICombineV2MessageContent, ICombinedMessage, IConnectResult, IConnectionListener, IConnectionStatusListener, IConversationIdentifier, IConversationOption, IConversationState, IConversationStateListener, IConversationTag, IConversationTagListener, IDeletedExpansion, IDeliveredUser, IDownloadAuth, IEndRoomPKOptions, IEngine, IEngineWatcher, IEventListener, IExpansionListener, IExpansionListenerData, IExpansionMsgContent, IExtraMethod, IGetMsgOption, IGetUltraGroupListOption, IGooglePushConfig, IGroupMessageDeliverInfo, IGroupMessageDeliverStatus, IGroupMessageDeliveredStatusInfo, IGroupReadReceiptData, 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, IPrivateReadReceiptData, IProcessCache, IProcessInfo, IPromiseResult, IProxy, IPushConfig, IRTCInnerListener, IRTCJoinedInfo, IRTCRoomBindOption, IRTCRoomInfo, IRTCUserData, IRTCUsers, IReadReceiptData, IReadReceiptInfo, IRecallMsgContent, IRecallMsgOptions, IReceivedConversation, IReceivedConversationByTag, IReceivedMessage, IRemoveChatRoomEntries, IRemoveChatRoomEntry, IRemoveChatroomEntries, IRemoveChatroomEntry, IReqRoomPKOptions, IRequest, IResRoomPKOptions, IResponse, IRtcTokenData, IRuntime, ISendExMsgOptions, ISendMsgOptions, IServerConversationStatus, IServerRTCRoomEntry, IServerUserSetting, ISetConversationStatusOptions, IStaticConfig, IStatistic, IStatisticDB, IStatisticData, IStatisticsCMPData, IStatisticsCSData, IStatisticsDurData, IStatisticsNaviData, IStatisticsNetworkData, IStatisticsRMTPData, IStatisticsWebsocketData, IStorage, ISyncReadStatusData, ITagInfo, ITagListener, ITagParam, ITagStatus, ITypingInfo, ITypingMessage, ITypingUser, IUltraChannelChangeInfo, IUltraChannelDeleteInfo, IUltraChannelUserKickedInfo, IUltraExMsgOptions, IUltraGroupConversation, IUltraGroupOption, IUltraGroupUnreadInfo, IUltraGroupUnreadMentionedOption, IUltraModifyMsgOptions, IUltraMsgQueryOptions, IUltraUnreadConversation, IUltraUnreadMsg, IUpdateItem, IUpdatedConversation, IUpdatedExpansion, IUploadAuth, IUploadTask, IUserGroupChangeData, IUserGroupStatusInfo, IUserProfile, IWatcher, IWebSocket, IiOSPushConfig, IndexDBLogger, IndexDBReporter, IndexDBStatistic, IndexDBStatisticReporter, RTCKeyMaps as InnerRTCKeyMaps, InvokerType, ItypingStateListener, KVString, LOCAL_STORAGE_KEYS, 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, MentionedInfoBody, MentionedType, MessageBlockSourceType, MessageBlockType, MessageDirection, MessageType, NAVI_CACHE_DURATION, NAVI_REQ_TIMEOUT, NaviCacheType, NetworkType, NotificationLevel, NotificationStatus, ONE_LOG_SIZE_MAX, OperateStatus, PluginContext, ProtocalType, RCAssertError, RCConnectionStatus, RC_DEFAULT_USER, REAT_TIME_LOG_SIZE, RTCApiType, RTCIdentityChangeType, RTCJoinType, RTCMode, RTCPluginContext, ReceivedStatus, SEND_MESSAGE_TYPE_OPTION, STATIC_CONFIG_CACHE_TIME, STATIC_CONFIG_IV, STATIC_CONFIG_KEY, STATUS_MESSAGE, SentStatus, StatisticL, StatisticsTag, StatisticsVersion, StoreKeys, SuspendablePromise, TagChangeType, Type, UPLOAD_FILE_CHUNK_SIZE, UltraGroupChannelChangeType, UltraGroupChannelType, UltraMentionedType, UltraMsgChangeType, UltraMsgSubChangeType, UploadMethod, UserGroupChangeType, VERSION, VersionManage, WEB_SOCKET_TIMEOUT, WebSocketNavi, appendUrl, assert, clone, cloneByJSON, deInitLogDB, decryptCBC, fixUrlProtocol, forEach, getBrowser, getClientMessageId, getDeviceId, getMimeKey, getUUID, getUUID22, getUploadFileName, getbundleId, httpRequest, indexOf, initLogDB, initStatisticDB, isArray, isArrayBuffer, isBoolean, isConnnectAckCode as isConnnectAck, isDisconnectCode as isDisconnectedByServer, isFunction, isHttpUrl, isInObject, isInclude, isNull, isNumber, isObject, isStartCloudController, 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 };