agora-edu-core-lb
Version:
For publishing npm package agora-edu-core (Web & Electron). Get more information from https://docs.agora.io
132 lines (131 loc) • 3.73 kB
TypeScript
import { ApiBase, ApiBaseInitializerParams } from './base';
declare type ReportParams = {
/**
* 当前通话的cid
*/
cid?: number;
/**
* 协议ID
*/
id: number;
/**
* 上报内容, base64(pb二进制内容)
*/
payload: string;
/**
* 消息级别
* 1: 默认, 101: 测试
*/
qos: number;
/**
* 签名规则: md5(payload=base64(XX)&src=XX&ts=XX)
* 保留字段, XX为字段值 32位小写
*/
sign: string;
/**
* 来源/请求方
*/
src: string;
/**
* 时间戳, 10位, 秒
*/
ts: number;
/**
* 厂商ID
*/
vid?: number;
};
declare type ReportUserParams = {
/**
* 时间戳,必须存在
*/
lts?: number;
/**
* vid
*/
vid: number;
/**
* apaas版本号
*/
ver: string;
/**
* apaas场景,如education/meeting/entertainment
*/
scenario: string;
/**
* 异常码,若有
*/
errorCode?: number;
/**
* apaas用户id,同RTM uid
*/
uid: string;
/**
* 用户名,用于显示
*/
userName: string;
/**
* rtc流id
*/
streamUid: number;
/**
* rtc流id
*/
streamSuid: string;
/**
* apaas角色
*/
role: string;
/**
* rtc sid
*/
streamSid: string;
/**
* rtm sid
*/
rtmSid: string;
/**
* apaas房间id,与rtc/rtm channelName相同
*/
roomId: string;
/**
* 房间创建的时间戳
*/
roomCreateTs: number;
};
export declare class ReportServiceV2 extends ApiBase {
reportUserParams: ReportUserParams;
protected qos: number;
constructor(params: ApiBaseInitializerParams);
protected Uint8ToBase64(u8Arr: Uint8Array): string;
protected buildUserJoinPaylod(payloadParams: ReportUserParams): string;
protected buildUserQuitPaylod(payloadParams: ReportUserParams): string;
protected buildUserReconnectPaylod(payloadParams: ReportUserParams): string;
protected buildScreenShareStar(payloadParams: ReportUserParams): string;
protected buildScreenShareEnd(payloadParams: ReportUserParams): string;
protected buildBaseParams(id: number, src: string, payload: string): ReportParams;
protected buildApaasUserJoinParams(src: string, payloadParams: ReportUserParams, lts: number, errorCode: number): ReportParams;
protected buildApaasUserQuitParams(src: string, payloadParams: ReportUserParams, lts: number, errorCode: number): ReportParams;
protected buildApaasUserReconnectParams(src: string, payloadParams: ReportUserParams, lts: number, errorCode: number): ReportParams;
protected buildScreenShareStartParams(src: string, payloadParams: ReportUserParams, lts: number, errorCode: number): ReportParams;
protected buildScreenShareEndParams(src: string, payloadParams: ReportUserParams, lts: number, errorCode: number): ReportParams;
guardParams(): boolean;
get apiPath(): string;
initReportConfig(config?: {
sdkDomain: string;
qos: number;
}): void;
initReportUserParams(params: ReportUserParams): void;
request(params: {
method: string;
data: ReportParams;
path: string;
}): Promise<any>;
reportApaasUserJoin(lts: number, errorCode: number): Promise<any>;
reportApaasUserQuit(lts: number, errorCode: number): Promise<any>;
reportApaasUserReconnect(lts: number, errorCode: number): Promise<any>;
reportScreenShareStart(lts: number, errorCode: number): Promise<any>;
reportScreenShareEnd(lts: number, errorCode: number): Promise<any>;
}
export declare const reportServiceV2: ReportServiceV2;
export {};