@rongcloud/plugin-rtc 5.36.1-nctest-alpha.2 → 5.38.0-alpha.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -1,7 +1,5 @@
1
- import { LogL, EnableLogL, IPluginGenerator } from '@nexconn/engine';
2
- import { EventEmitter, IPromiseResult, IRuntime, IAsyncRes, RTCMode as RTCMode$1 } from 'common-utils';
3
- import * as _base_imlib_wrapper from '@base/imlib-wrapper';
4
- import { BasicLogger, IRTCPluginContext, ErrorCode, IRTCNaviInfo, ConversationType, ISendMsgOptions, IReceivedMessage, RCConnectionStatus } from '@base/imlib-wrapper';
1
+ import * as _rongcloud_engine from '@rongcloud/engine';
2
+ import { EventEmitter, BasicLogger, INaviInfo, RTCPluginContext, Codec, IPromiseResult, ErrorCode, KVString, IRuntime, IAsyncRes, RCConnectionStatus, ConversationType, ISendMsgOptions, IReceivedMessage, LogL, EnableLogL, RTCMode as RTCMode$1, IPluginGenerator } from '@rongcloud/engine';
5
3
 
6
4
  /**
7
5
  * 错误码,与移动端对齐
@@ -918,6 +916,11 @@ interface ICDNUris {
918
916
  'pull_safe': boolean;
919
917
  }
920
918
 
919
+ declare enum RCRTCAISwitchType {
920
+ OPEN = 1,
921
+ CLOSE = 0
922
+ }
923
+
921
924
  /**
922
925
  * 设置 RTC 人员 inner、outer 数据
923
926
  */
@@ -1089,6 +1092,28 @@ interface IEndRoomPKOptions {
1089
1092
  */
1090
1093
  keys: string[];
1091
1094
  }
1095
+ interface IRTCNaviInfo extends INaviInfo {
1096
+ /**
1097
+ * jwt token
1098
+ */
1099
+ jwt?: string;
1100
+ /**
1101
+ * http3 上报域名
1102
+ */
1103
+ logServer?: string;
1104
+ /**
1105
+ * 数据中心
1106
+ */
1107
+ dc?: string;
1108
+ /**
1109
+ * openGzip 开启标识,默认是false,开启使用true
1110
+ */
1111
+ openGzip?: boolean;
1112
+ /**
1113
+ * AI 开关是否打开,1: 打开,0: 关闭
1114
+ */
1115
+ rtcAISwitch?: RCRTCAISwitchType;
1116
+ }
1092
1117
 
1093
1118
  declare enum RCRTCOperateSummarizationType {
1094
1119
  OPEN = "2",
@@ -1257,10 +1282,52 @@ declare enum RTCApiType {
1257
1282
  }
1258
1283
 
1259
1284
  declare enum RTCIdentityChangeType {
1260
- AnchorToViewer = 1,// 主播变观众
1285
+ AnchorToViewer = 1,
1261
1286
  ViewerToAnchor = 2
1262
1287
  }
1263
1288
 
1289
+ declare const keymaps: {
1290
+ readonly RtcInput: readonly ["roomType", "broadcastType", "extraInnerData", "needSysChatroom", "identityChangeType", "joinType", "innerDatas", "outerDatas", "supportNtf"];
1291
+ readonly RtcOutput: readonly ["version"];
1292
+ readonly RtcUserListOutput: readonly ["users", "token", "sessionId", "roomInfo", "version"];
1293
+ readonly SetUserStatusInput: readonly ["status"];
1294
+ readonly RtcSetDataInput: readonly ["interior", "target", "key", "value", "objectName", "content"];
1295
+ readonly RtcUserSetDataInput: readonly ["valueInfo", "objectName", "content"];
1296
+ readonly RtcDataInput: readonly ["interior", "target", "key", "objectName", "content"];
1297
+ readonly RtcSetOutDataInput: readonly ["target", "valueInfo", "objectName", "content"];
1298
+ readonly MCFollowInput: readonly ["state"];
1299
+ readonly RtcTokenOutput: readonly ["rtcToken"];
1300
+ readonly RtcQryOutput: readonly ["outInfo"];
1301
+ readonly RtcQryUserOutDataInput: readonly ["userId"];
1302
+ readonly RtcUserOutDataOutput: readonly ["user"];
1303
+ readonly RtcQueryListInput: readonly ["order"];
1304
+ readonly RtcRoomInfoOutput: readonly ["roomId", "roomData", "userCount", "list"];
1305
+ readonly RtcValueInfo: readonly ["key", "value"];
1306
+ readonly RtcKeyDeleteInput: readonly ["key"];
1307
+ readonly RtcNotifyMsg: readonly ["type", "time", "roomId"];
1308
+ readonly RtcPullKV: readonly ["timestamp", "roomId"];
1309
+ readonly RtcKVOutput: readonly ["entries", "bFullUpdate", "syncTime"];
1310
+ readonly RtcQueryUserJoinedInput: readonly ["userId"];
1311
+ readonly RtcQueryUserJoinedOutput: readonly ["info"];
1312
+ readonly RtcInviteInput: readonly ["invitedUserId", "timeoutTime", "invitedRoomId", "inviteInfo", "inviteSessionId"];
1313
+ readonly RtcCancelInviteInput: readonly ["invitedUserId", "invitedRoomId", "inviteInfo", "inviteSessionId"];
1314
+ readonly RtcInviteAnswerInput: readonly ["inviteUserId", "answerCode", "inviteRoomId", "inviteSessionId", "content", "key", "value"];
1315
+ readonly RtcEndInviteInput: readonly ["inviteRoomId", "inviteSessionId", "inviteContent", "inviteRoomKeys"];
1316
+ readonly RtcRoomStatusInput: readonly ["version"];
1317
+ readonly RtcRoomStatusOutput: readonly ["bFullStatus", "version", "usersData", "roomStatus"];
1318
+ readonly RtcReportSDKInput: readonly ["sdkInfo"];
1319
+ readonly RCRTCPBPolaris: readonly ["type", "appKey", "sessionId", "roomId", "roomCreateTime", "userId", "userRole", "joinTime", "signalDataCenter", "r1Info", "r2Info", "r3Info", "r4Info"];
1320
+ readonly RCRTCPBR1Info: readonly ["joinTime", "rtcVersion", "imVersion", "platform", "device", "os", "browserName", "browserVersion"];
1321
+ readonly RCRTCPBR2Info: readonly ["joinTime", "sendTime", "rtcActionType", "rtcActionStatus", "trackId"];
1322
+ readonly RCRTCPBR3Info: readonly ["info"];
1323
+ readonly RCRTCPBR4Info: readonly ["info"];
1324
+ readonly RCRTCPBStatusInfo: readonly ["joinTime", "receiveTime", "totalBitRate", "appCPUUsage", "systemCPUUsage", "systemCPUFrequency", "networkStatus", "googleRTTNetwork", "ipAddress", "useReceiveBroadBand", "useSendBroadBand", "packetLossCount", "streams"];
1325
+ readonly RCRTCPBStreamInfo: readonly ["trackId", "codeName", "volume", "samplingRate", "bitRate", "packetLossRate", "frameRate", "resolution", "blockTime", "jitterData", "nAckCount", "pliCount", "googleRTTTotalTime", "isReceiveFirstFrameRate", "codeType", "isEnabled"];
1326
+ readonly AsrTextMsg: readonly ["bms", "t", "isEnd", "msgId", "lang"];
1327
+ readonly AsrResTextMsg: readonly ["type", "uid", "asr"];
1328
+ };
1329
+ declare type RTCKeyMaps = typeof keymaps;
1330
+
1264
1331
  /**
1265
1332
  * 自定义上报北极星数据响应 code
1266
1333
  */
@@ -1273,11 +1340,11 @@ declare enum RCSendCode {
1273
1340
 
1274
1341
  declare class RTCContext {
1275
1342
  private context;
1343
+ logger: BasicLogger;
1344
+ private codec;
1276
1345
  roomCreateTime: number | undefined;
1277
1346
  userJoinTime: number | undefined;
1278
- private codec;
1279
- constructor(context: IRTCPluginContext);
1280
- get logger(): _base_imlib_wrapper.BasicLogger;
1347
+ constructor(context: RTCPluginContext, logger: BasicLogger, codec: Codec<RTCKeyMaps>);
1281
1348
  joinRTCRoom(roomId: string, mode: RTCMode, broadcastType?: number, joinType?: RTCJoinType, innerUserDatas?: IRTCUserData, outerUserDatas?: IRTCUserData, supportNtf?: boolean): IPromiseResult<IJoinRTCRoomData>;
1282
1349
  quitRTCRoom(roomId: string): Promise<ErrorCode>;
1283
1350
  getRTCRoomInfo(roomId: string): IPromiseResult<IRTCRoomInfo>;
@@ -1303,9 +1370,7 @@ declare class RTCContext {
1303
1370
  content: string;
1304
1371
  }[], valueInfo: string, objectName: string, mcuValInfo?: string, cdnValInfo?: string): Promise<ErrorCode>;
1305
1372
  setRTCCDNUris(roomId: string, objectName: string, CDNUris: string): Promise<ErrorCode>;
1306
- getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<{
1307
- [key: string]: string;
1308
- }>;
1373
+ getRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType): IPromiseResult<KVString>;
1309
1374
  removeRTCData(roomId: string, keys: string[], isInner: boolean, apiType: RTCApiType, message?: {
1310
1375
  name: string;
1311
1376
  content: string;
@@ -1347,7 +1412,7 @@ declare class RTCContext {
1347
1412
  };
1348
1413
  getCurrentId(): string;
1349
1414
  getNaviInfo(): IRTCNaviInfo | null;
1350
- getConnectionStatus(): number;
1415
+ getConnectionStatus(): RCConnectionStatus;
1351
1416
  getAppkey(): string;
1352
1417
  /** web 端发 rtcPing */
1353
1418
  webRtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<{
@@ -1360,10 +1425,12 @@ declare class RTCContext {
1360
1425
  * 协议栈 rtcping 依赖 imlib 编解码数据
1361
1426
  * web 单独走 imlib 提供的 rtcSignaling 方法,减少对 imlib 的依赖
1362
1427
  */
1363
- rtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<{
1364
- code: number;
1365
- data?: _base_imlib_wrapper.IRtcPingData | undefined;
1366
- }> | undefined;
1428
+ rtcPing(roomId: string, roomMode: RTCMode, broadcastType?: number): Promise<_rongcloud_engine.RCResult<any>> | Promise<{
1429
+ code: ErrorCode;
1430
+ data?: {
1431
+ version: number;
1432
+ } | undefined;
1433
+ }>;
1367
1434
  sendMessage(conversationType: ConversationType, targetId: string, options: ISendMsgOptions): IPromiseResult<IReceivedMessage>;
1368
1435
  registerRTCSignalListener(listener?: ((buffer: Uint8Array) => void) | undefined): void;
1369
1436
  registerConnectionStateChangeListener(listener: (status: RCConnectionStatus, code: ErrorCode) => void): void;
@@ -1371,20 +1438,20 @@ declare class RTCContext {
1371
1438
  registerDestroyListener(listener: () => void): void;
1372
1439
  registerMessageListener(listener: (message: IReceivedMessage) => boolean): void;
1373
1440
  getCoreVersion(): string;
1374
- getPluginContext(): IRTCPluginContext;
1441
+ getPluginContext(): RTCPluginContext;
1375
1442
  reportSDKInfo(versionInfo: {
1376
1443
  [name: string]: string;
1377
1444
  }): void;
1378
1445
  decodeAsrText(buffer: Uint8Array, seiData: number[]): (RCRTCASRContent | RCRTCRealtimeTranslationContent)[];
1379
1446
  }
1380
1447
 
1381
- type ISdpSemantics = 'plan-b' | 'unified-plan';
1448
+ declare type ISdpSemantics = 'plan-b' | 'unified-plan';
1382
1449
  interface IOfferInfo {
1383
1450
  type: 'offer';
1384
1451
  sdp: string;
1385
1452
  semantics: ISdpSemantics;
1386
1453
  }
1387
- type OutboundVideoInfo = {
1454
+ declare type OutboundVideoInfo = {
1388
1455
  trackId: string;
1389
1456
  simulcast: RCStreamType;
1390
1457
  resolution: string;
@@ -1465,7 +1532,7 @@ declare enum PullRoomStatusEvent {
1465
1532
  RESOURCECHANGE = 3
1466
1533
  }
1467
1534
 
1468
- type RCEncryptFunction = (data: Uint8Array) => Uint8Array;
1535
+ declare type RCEncryptFunction = (data: Uint8Array) => Uint8Array;
1469
1536
  interface IRCEncryptorHooks {
1470
1537
  /**
1471
1538
  * @since 5.7.3
@@ -2295,7 +2362,7 @@ interface IAudioLevelChangeHandler {
2295
2362
  /**
2296
2363
  * 房间资源数据
2297
2364
  */
2298
- type RoomData = {
2365
+ declare type RoomData = {
2299
2366
  [userId: string]: IPublishedResource[];
2300
2367
  };
2301
2368
  /**
@@ -2953,7 +3020,7 @@ declare class ReportMediaActionLogger {
2953
3020
  /**
2954
3021
  * 加房间
2955
3022
  */
2956
- reportQualityJoinRoomData: (start: number, code: number, roomType: RTCMode$1, sessionId?: string) => void;
3023
+ reportQualityJoinRoomData: (start: number, code: ErrorCode, roomType: RTCMode$1, sessionId?: string | undefined) => void;
2957
3024
  /**
2958
3025
  * 异常掉线
2959
3026
  */
@@ -3079,7 +3146,7 @@ declare enum RCLivingType {
3079
3146
  AUDIO = 1
3080
3147
  }
3081
3148
 
3082
- type IOnRecvPKMsg = (msg: IReceivedMessage) => void;
3149
+ declare type IOnRecvPKMsg = (msg: IReceivedMessage) => void;
3083
3150
  interface IRoomPKEventListener {
3084
3151
  /**
3085
3152
  * 收到连麦邀请
@@ -3235,7 +3302,7 @@ declare class RCLivingPKHandler {
3235
3302
  };
3236
3303
  }
3237
3304
 
3238
- type ResourceMsgContent = {
3305
+ declare type ResourceMsgContent = {
3239
3306
  /**
3240
3307
  * 旧版本兼容参数,当收到非 `RTCMessageName.TOTAL_CONTENT_RESOURCE` 时:
3241
3308
  * * ignore 值为 `true` 表示该消息由 signal server 向旧版本 RTCLib 提供的兼容消息,无需处理
@@ -3422,9 +3489,7 @@ declare abstract class RCAbstractRoom extends EventEmitter {
3422
3489
  */
3423
3490
  getRoomAttributes(keys?: string[], isInner?: boolean): Promise<{
3424
3491
  code: RCRTCCode;
3425
- data?: {
3426
- [key: string]: string;
3427
- };
3492
+ data?: KVString;
3428
3493
  }>;
3429
3494
  /**
3430
3495
  * 设置当前用户属性(暂不开放)
@@ -4321,7 +4386,7 @@ declare enum CommandPriority {
4321
4386
  NORMAL = 1,
4322
4387
  HIGH = 2
4323
4388
  }
4324
- type ICommandResult<R = void> = {
4389
+ declare type ICommandResult<R = void> = {
4325
4390
  code: number;
4326
4391
  data?: R;
4327
4392
  };
@@ -4833,7 +4898,7 @@ declare class RCLivingRoom extends RCAbstractRoom {
4833
4898
  /**
4834
4899
  * @private
4835
4900
  */
4836
- __innerInitByIdentityChange(traceId: string): Promise<number>;
4901
+ __innerInitByIdentityChange(traceId: string): Promise<ErrorCode>;
4837
4902
  /**
4838
4903
  * 增量发布资源,若发布的资源 tag 及媒体类型重复,后者将覆盖前者进行发布。
4839
4904
  * @param tracks 待发布的 RCLocalTrack 实例
@@ -5167,9 +5232,7 @@ declare class RCRTCClient extends RCMediaStreamCapture {
5167
5232
  private readonly _runtime;
5168
5233
  private _options;
5169
5234
  private readonly _service;
5170
- static _instance: RCRTCClient | null;
5171
5235
  constructor(_context: RTCContext, _runtime: IRuntime, _options: IRCRTCInitOptions);
5172
- static init(options: IRCRTCInitOptions | undefined, pluginContext: IRTCPluginContext, runtime: IRuntime): RCRTCClient;
5173
5236
  private _handleMessage;
5174
5237
  /**
5175
5238
  * voip 变更、jwt 变更需要触发重走嗅探逻辑
@@ -5179,10 +5242,6 @@ declare class RCRTCClient extends RCMediaStreamCapture {
5179
5242
  * 获取加入的连麦房间
5180
5243
  */
5181
5244
  private _getJoinedPKRoomList;
5182
- /**
5183
- * 获取 RTC 插件上下文(含 logger 等),供 CallPlus 等依赖使用
5184
- */
5185
- getPluginContext(): IRTCPluginContext;
5186
5245
  /**
5187
5246
  * 获取当前用户 Id,若 IM 未连接,这返回 `''`
5188
5247
  * @returns
@@ -5364,7 +5423,7 @@ declare const device: {
5364
5423
  * RTC 插件生成器
5365
5424
  * @public
5366
5425
  */
5367
- declare const installer: IPluginGenerator<RCRTCClient, void>;
5426
+ declare const installer: IPluginGenerator<RCRTCClient, IRCRTCInitOptions>;
5368
5427
  /**
5369
5428
  * 预定义的资源 tag
5370
5429
  */