跳到主要内容

控制台 API 数据结构

以下 TypeScript 定义描述五种语言共用的 HTTP JSON 字段。? 表示可选,[] 表示数组,Record<string, unknown> 表示由服务端定义字段的对象。ProtoInt64 可表示字符串、数字或 protobuf 整数对象。积分字段保留为字符串。

ActivityDetail​

export interface ActivityDetail {
summary?: ActivityNode | null;
activityId: string;
events: ActivityEvent[];
window: ActivityWindow;
hasMore: boolean;
nextCursor: string | null;
}

ActivityDetailInput​

export type ActivityDetailInput = ClassroomIdInput &
ActivityWindow & { eduUserId: string; activityId: string; cursor?: string; pageSize?: number };

ActivityEvent​

export interface ActivityEvent {
eventId: string;
occurredAt: string;
ingestedAt: string;
eventName: string;
source: string;
service: string;
observerUserId: string;
actorUserId: string;
targetUserId: string;
sessionId: string;
attemptId: string;
operationId: string;
signalId: string;
traceId: string;
deviceId: string;
connectionId: string;
connectionEpoch: number;
sequence: number;
stage: string;
result: string;
level: string;
durationMs: number;
elapsedMs: number;
errorCode: number;
errorMessage: string;
platform: string;
sdkVersion: string;
networkType: string;
correctedTimestamp: boolean;
clockOffsetMs: number;
duplicateCount: number;
attrs: Record<string, string>;
}

ActivityFilters​

export interface ActivityFilters {
from?: string;
to?: string;
deviceId?: string;
attemptId?: string;
category?: (typeof activityCategories)[number];
relation?: (typeof activityRelations)[number];
}

ActivityNode​

export interface ActivityNode {
id: string;
occurredAt: string;
lastEventAt: string;
action: string;
eventName: string;
category: string;
relation: string;
origin: string;
requestedState: string;
status: 'applied' | 'acknowledged' | 'failed' | 'rejected' | 'cancelled' | 'pending' | 'observed';
actorUserIds: string[];
targetUserIds: string[];
sessionIds: string[];
attemptIds: string[];
deviceIds: string[];
eventCount: number;
errorCount: number;
duplicateCount: number;
correctedTimestampCount: number;
errorMessage: string;
errorCode: number;
identifiersTruncated: boolean;
facet?: string;
severity?: 'critical' | 'warning' | 'info';
highlights?: Record<string, string>;
evidence: {
requested: boolean;
accepted: boolean;
httpCompleted: boolean;
signalSent: boolean;
providerAcknowledged: boolean;
received: boolean;
applied: boolean;
} | null;
}

ActivityOverview​

export interface ActivityOverview {
presenceMs: number;
onStageMs: number;
microphoneOnMs: number;
cameraOnMs: number;
offlineMs: number;
disconnectCount: number;
joinCount: number;
lastLeaveReason: string;
criticalCount?: number;
warningCount?: number;
window: ActivityWindow;
retentionDays: number;
}

ActivityPage​

export interface ActivityPage {
items: ActivityNode[];
window: ActivityWindow;
retentionDays: number;
generatedAt: string;
hasMore: boolean;
nextCursor: string | null;
coverage?: {
clientEventCount: number;
serverEventCount: number;
lastClientAt: string | null;
lastServerAt: string | null;
dropReportCount: number;
reportedDroppedCount: number;
} | null;
}

ActivityQuery​

export type ActivityQuery = ClassroomIdInput &
ActivityFilters & { eduUserId: string; cursor?: string; pageSize?: number };

ActivityTrackInterval​

export interface ActivityTrackInterval {
track: string;
from: string;
to: string;
state: string;
reason: string;
}

ActivityTracks​

export interface ActivityTracks {
tracks: ActivityTrackInterval[];
window: ActivityWindow;
retentionDays: number;
}

ActivityWindow​

export interface ActivityWindow {
from: string;
to: string;
asOf: string;
}

AddMemberInput​

export interface AddMemberInput extends ClassroomIdInput {
eduUserId: string;
role: 'teacher' | 'assistant' | 'student' | 'inspector';
}

AddWhiteboardCoursewareInput​

export interface AddWhiteboardCoursewareInput extends ClassroomIdInput {
coursewareId: string;
requestId: string;
}

AppEnvironment​

export type AppEnvironment = 'development' | 'staging' | 'production';

AppIdInput​

export interface AppIdInput {
appId: string;
}

AppRecord​

export interface AppRecord {
appId: string;
name: string;
environment: AppEnvironment;
appKey: string;
appSecret?: string;
config: Record<string, unknown>;
status: AppStatus;
/** 业务侧回调 URL;未配置时为空 */
webhookUrl?: string;
/** 已订阅的 Webhook 事件 type;未配置回调时为空数组 */
subscribedEvents?: string[];
createdAt: string;
updatedAt: string;
}

AppStatus​

export type AppStatus = 'active' | 'disabled';

AttendanceInput​

export interface AttendanceInput extends ClassroomIdInput {
eduUserId?: string;
}

AttendanceMember​

export interface AttendanceMember {
eduUserId: string;
role: string;
inRoomSeconds: ProtoInt64;
onStageSeconds: ProtoInt64;
firstStartedAt: string;
lastEndedAt: string;
open: boolean;
}

AttendanceResult​

export interface AttendanceResult {
members: AttendanceMember[];
segments: AttendanceSegment[];
}

AttendanceSegment​

export interface AttendanceSegment {
segmentId: string;
eduUserId: string;
role: string;
kind: string;
startedAt: string;
endedAt: string;
endReason: string;
durationSeconds: ProtoInt64;
}

AuthMethods​

export type AuthMethods = {
site: 'cn' | 'intl';
providers: AuthProvider[];
captcha: {
enabled: boolean;
appId: string;
};
};

AuthProvider​

export type AuthProvider = 'phone' | 'wechat' | 'email' | 'google';

AuthSession​

export type AuthSession = {
accessToken: string;
refreshToken: string;
expiresIn: number;
user: AuthUser;
};

AuthUser​

export type AuthUser = {
userId: string;
nickname: string;
avatar: string;
identities: string[];
phone?: string;
};

AutoRechargeRule​

export interface AutoRechargeRule {
tenantId?: string;
packageKey?: string;
thresholdPoints?: string;
monthlyLimit?: number;
enabled?: boolean;
usedThisMonth?: number;
}

BillingDetail​

export interface BillingDetail {
subjectId?: string;
subjectName?: string;
subjectRole?: string;
subjectOriginId?: string;
subjectAvatar?: string;
targetId?: string;
targetName?: string;
targetOriginId?: string;
targetAvatar?: string;
resourceId?: string;
resourceName?: string;
resourceType?: string;
durationSeconds?: number | null;
}

BillingDisplay​

export interface BillingDisplay extends BillingDetail {
description?: string;
quantity?: string;
unit?: string;
points?: string;
}

BindCoursewaresInput​

export interface BindCoursewaresInput extends ClassroomIdInput {
coursewareIds: string[];
}

BindCoursewaresResult​

export interface BindCoursewaresResult {
boundCount: number;
skippedCount: number;
boundCoursewareIds: string[];
skippedCoursewareIds: string[];
}

BindPhoneSendInput​

export type BindPhoneSendInput = Omit<SmsSendInput, 'scene'>;

CatalogList​

export interface CatalogList<T> {
items?: T[];
}

ClassroomApp​

export interface ClassroomApp {
appId: string;
opened?: number;
users?: number;
seconds?: number;
}

ClassroomAvSubscribeMode​

export type ClassroomAvSubscribeMode = 'teacher_only' | 'self_only' | 'on_stage_all';

ClassroomCoursewaresResult​

export interface ClassroomCoursewaresResult {
items: CoursewareRecord[];
}

ClassroomEnteredTraceEvent​

export interface ClassroomEnteredTraceEvent {
occurredAt: string;
ingestedAt: string;
ingestLagMs: number;
duplicateCount: number;
eventId: string;
sessionId: string;
traceId: string;
signalId: string;
operationId: string;
deviceId: string;
attemptNo: number;
attemptId: string;
connectionId: string;
connectionEpoch: number;
sequence: number;
source: string;
service: string;
eventName: string;
level: string;
stage: string;
result: string;
elapsedMs: number;
durationMs: number;
errorCode: number;
errorMessage: string;
platform: string;
sdkVersion: string;
appVersion: string;
osVersion: string;
deviceModel: string;
networkType: string;
provider: string;
vendorCode: string;
attrs: Record<string, string>;
}

ClassroomEnteredTraceQuery​

export interface ClassroomEnteredTraceQuery {
attemptId: string;
cursor?: string;
pageSize?: number;
sessionsCursor?: string;
sessionsPageSize?: number;
}

ClassroomEnteredTraceSession​

export interface ClassroomEnteredTraceSession {
sessionId: string;
attemptId: string;
attemptNo: number;
startedAt: string;
lastEventAt: string;
joinStatus: string;
apiOk: boolean;
uiReady: boolean;
controlReady: boolean;
fullReady: boolean;
expectedDomains: string[];
readyDomains: string[];
missingDomains: string[];
joined: boolean;
failed: boolean;
leftRoom: boolean;
whiteboardDegraded: boolean;
rtcFailed: boolean;
failedStage: string;
failureDomain: string;
errorCode: number;
errorCount: number;
eventCount: number;
duplicateEventCount: number;
telemetryDroppedCount: number;
correctedTimestampCount: number;
result: string;
traceId: string;
deviceId: string;
platform: string;
sdkVersion: string;
appVersion: string;
osVersion: string;
deviceModel: string;
networkType: string;
provider: string;
providers: string[];
latestIngestLagMs: number;
maxIngestLagMs: number;
durations: {
joinHttpMs: number;
joinSucceededMs: number;
imLoginMs: number;
imGroupMs: number;
sessionReadyMs: number;
roomJoinedMs: number;
rtcEnteredMs: number;
rtcFirstFrameMs: number;
whiteboardReadyMs: number;
};
}

ClassroomEnteredUserRecord​

export interface ClassroomEnteredUserRecord {
eduUserId: string;
nickname: string;
avatar: string;
signupSource?: string;
role: string;
lastEnteredAt: string;
imOnline: boolean;
stageStatus: string;
sessionCount: number;
lastJoinResult: string;
/** 最近一次进房尝试的权威关联键,用于从用户列表精确下钻。 */
sessionId: string;
attemptId: string;
attemptNo: number;
failedStage: string;
errorCode: number;
deviceId: string;
platform: string;
sdkVersion: string;
networkType: string;
}

ClassroomEnteredUserTrace​

export interface ClassroomEnteredUserTrace {
user: {
eduUserId: string;
nickname: string;
avatar: string;
role: string;
lastEnteredAt: string;
imOnline: boolean;
};
sessions: ClassroomEnteredTraceSession[];
events: ClassroomEnteredTraceEvent[];
selectedSessionId: string | null;
selectedAttemptId: string | null;
selectedAttemptNo: number | null;
contextSnapshot?: Record<string, string> | null;
eventPage: CursorPage;
sessionsPage: CursorPage;
}

ClassroomEstimatePayload​

export interface ClassroomEstimatePayload {
onStageCount: number;
audienceCount?: number;
durationMinutes: number;
resolutionTier?: string;
recordMode?: string;
aiSubtitle?: boolean;
aiSummary?: boolean;
transcodeMinutes?: number;
storageGbMonth?: number;
cdnGb?: number;
}

ClassroomEstimateResult​

export interface ClassroomEstimateResult {
points: string;
lines?: EstimateRatedLine[];
}

ClassroomIdInput​

export interface ClassroomIdInput {
classroomId: string;
}

ClassroomJoinAttemptRecord​

export interface ClassroomJoinAttemptRecord extends ClassroomEnteredTraceSession {
eduUserId: string;
nickname: string;
avatar: string;
signupSource?: string;
role: string;
imOnline: boolean;
stageStatus: string;
}

ClassroomJoinPolicy​

export type ClassroomJoinPolicy = 'invite_only' | 'open_app';

ClassroomMemberRecord​

export interface ClassroomMemberRecord {
eduUserId: string;
role: string;
joinedAt?: string;
stageStatus?: string;
}

ClassroomRecord​

export interface ClassroomRecord {
classroomId: string;
appId: string;
name: string;
status: ClassroomStatus;
classroomType: ClassroomType | string;
resolution: ClassroomResolution | string;
maxOnStage: number;
maxAudience?: number;
liveSourceKind?: string;
liveVideoId?: string;
pullStreamUrl?: string;
teacherEduUserId: string;
teacher?: ClassroomTeacher | null;
startsAt: string;
/** 计划结束时间(startsAt + durationMinutes) */
endsAt: string;
/** 课时时长(分钟) */
durationMinutes?: number;
createdAt?: string;
recordMode?: ClassroomRecordMode | string;
defaultOnStage?: boolean;
allowTeacherControlDevice?: boolean;
avSubscribeMode?: ClassroomAvSubscribeMode | string;
overtimeMinutes?: number;
autoStartOnSchedule?: boolean;
recordBackgroundUrl?: string;
/** 进课策略:invite_only / open_app */
joinPolicy?: ClassroomJoinPolicy | string;
/** 纯视频课(无白板) */
videoOnly?: boolean;
createdBy?: string;
uiConfig?: Record<string, unknown>;
}

ClassroomRecordMode​

export type ClassroomRecordMode = 'none' | 'classroom' | 'mix' | 'page';

ClassroomResolution​

export type ClassroomResolution = '360p' | '480p' | '720p' | '1080p';

ClassroomStatus​

export type ClassroomStatus = 'creating' | 'pending' | 'live' | 'ended' | 'expired';

ClassroomTeacher​

export interface ClassroomTeacher {
eduUserId: string;
nickname: string;
avatar: string;
status: string;
}

ClassroomTrend​

export interface ClassroomTrend {
at: string;
opened?: number;
users?: number;
seconds?: number;
}

ClassroomType​

export type ClassroomType = 'live' | 'realtime';

ClassroomWhiteboardCoursewareRecord​

export type ClassroomWhiteboardCoursewareRecord = {
appId: string;
classroomId: string;
coursewareId: string;
requestId: string;
whiteboardFileId: string;
loadOpId: string;
serverSeq: number | string;
pageCount: number;
boundAt: string;
duplicated?: boolean;
};

CoursewareFormat​

export type CoursewareFormat =
| 'ppt'
| 'pptx'
| 'pdf'
| 'doc'
| 'docx'
| 'xls'
| 'xlsx'
| 'txt'
| 'png'
| 'jpg'
| 'jpeg'
| 'webp'
| 'gif'
| 'bmp'
| 'svg';

CoursewareIdInput​

export interface CoursewareIdInput {
coursewareId: string;
}

CoursewareIssues​

export interface CoursewareIssues {
failed?: number;
processing?: number;
items: {
appId: string;
coursewareId: string;
name: string;
updatedAt: string;
}[];
}

CoursewareManifest​

export type CoursewareManifest = {
schemaVersion?: string;
coursewareId?: string;
version?: string;
document?: {
slideCount?: number;
totalStepCount?: number;
aspectRatio?: string;
};
slides?: CoursewareManifestSlide[];
};

CoursewareManifestSlide​

export type CoursewareManifestSlide = {
slideIndex: number;
slideId?: string;
stepCount?: number;
thumbnail?: string;
hasAudio?: boolean;
hasVideo?: boolean;
steps?: Array<{
stepIndex: number;
stepId?: string;
svg?: {
src?: string;
width?: number;
height?: number;
};
}>;
};

CoursewareRecord​

export type CoursewareRecord = {
coursewareId: string;
/** 列表按课堂筛选时可能有值;应用库上传默认无绑定 */
classroomId?: string;
ownerEduUserId?: string;
appId: string;
name: string;
originalName: string;
format: CoursewareFormat | string;
sizeBytes: number;
status: CoursewareStatus | string;
progress: number;
jobId: string;
objectKey: string;
sourceUrl: string;
resultManifestUrl: string;
coursewareBaseUrl: string;
wbCoursewareId: string;
errorCode: string;
errorMessage: string;
contentHash?: string;
createdAt: string;
updatedAt: string;
};

CoursewareStatus​

export type CoursewareStatus = 'uploading' | 'queued' | 'processing' | 'ready' | 'failed';

CreateAppPayload​

export interface CreateAppPayload {
name: string;
environment?: AppEnvironment;
config?: Record<string, unknown>;
}

CreateClassroomPayload​

export interface CreateClassroomPayload {
name: string;
teacherEduUserId: string;
startsAt: string;
/** 课时时长(分钟);计划结束时间由服务端派生 */
durationMinutes: number;
resolution?: ClassroomResolution;
maxOnStage?: number;
maxAudience?: number;
classroomType?: ClassroomType;
liveSourceKind?: string;
liveVideoId?: string;
pullStreamUrl?: string;
recordMode?: ClassroomRecordMode;
avSubscribeMode?: ClassroomAvSubscribeMode;
defaultOnStage?: boolean;
allowTeacherControlDevice?: boolean;
overtimeMinutes?: number;
autoStartOnSchedule?: boolean;
recordBackgroundUrl?: string;
joinPolicy?: ClassroomJoinPolicy;
/** 纯视频课(无白板);默认 false */
videoOnly?: boolean;
/** 可选:创建时绑定应用课件库中的课件(可多选) */
coursewareIds?: string[];
studentEduUserIds?: string[];
uiConfig?: Record<string, unknown>;
}

CreateCoursewarePayload​

export type CreateCoursewarePayload = {
fileName: string;
originalName: string;
format: string;
sizeBytes: number;
objectKey: string;
sourceUrl: string;
contentHash: string;
ownerEduUserId?: string;
};

CreateEduUserPayload​

export interface CreateEduUserPayload {
originId?: string;
nickname: string;
avatar: string;
}

CreateLiveVideoInput​

export interface CreateLiveVideoInput {
title: string;
objectKey: string;
contentHash?: string;
sizeBytes?: number;
}

CreateUploadUrlPayload​

export type CreateUploadUrlPayload = {
fileName: string;
contentHash: string;
contentType?: string;
expiresSeconds?: number;
ownerEduUserId?: string;
};

CurrentUserResult​

export interface CurrentUserResult {
user: AuthUser;
}

CursorPage​

export interface CursorPage {
hasMore: boolean;
nextCursor: string | null;
}

DASHBOARD_PARTS​

export const DASHBOARD_PARTS = [
'overview',
'trends',
'classrooms',
'quality',
'usage',
'issues',
] as const;

DashboardApp​

export interface DashboardApp {
appId: string;
name: string;
environment: string;
status: string;
}

DashboardClassroom​

export interface DashboardClassroom {
appId: string;
classroomId: string;
name: string;
teacherId: string;
teacherName?: string;
startsAt: string;
endsAt: string;
status: string;
online: number;
}

DashboardData​

export interface DashboardData {
overview: Section<Overview>;
trends: Section<{ trend: ClassroomTrend[]; applications: ClassroomApp[] }>;
classrooms: Section<{
live: DashboardClassroom[];
upcoming: DashboardClassroom[];
expired: DashboardClassroom[];
}>;
quality: Section<Quality>;
usage: {
usage: Section<Usage>;
wallet: Section<WalletSummary>;
entitlement: Section<EntitlementSnapshot>;
};
issues: Section<CoursewareIssues>;
}

DashboardPart​

export type DashboardPart = (typeof DASHBOARD_PARTS)[number];

DashboardPreset​

export type DashboardPreset = 'today' | 'yesterday' | '7d' | '30d' | 'custom';

DashboardQuery​

export interface DashboardQuery {
appId?: string;
environment?: string;
preset: DashboardPreset;
timezone: string;
fromDate?: string;
toDate?: string;
}

DashboardResponse​

export interface DashboardResponse<K extends DashboardPart> {
window: DashboardWindow;
apps: DashboardApp[];
data: DashboardData[K];
}

DashboardWindow​

export interface DashboardWindow {
from: string;
to: string;
previousFrom: string;
previousTo: string;
asOf: string;
timezone: string;
granularity: 'hour' | 'day';
availableFrom: string;
previousAvailable: boolean;
currentAvailable: boolean;
version: number;
}

DeleteResult​

export interface DeleteResult {
deleted: boolean;
}

EduUserRecord​

export interface EduUserRecord {
eduUserId: string;
appId: string;
originId: string;
nickname: string;
avatar: string;
status: EduUserStatus;
/** api:客户接口建档;platform_app:官方应用上课码建档 */
signupSource?: string;
createdAt?: string;
updatedAt?: string;
}

EduUserStatus​

export type EduUserStatus = 'active' | 'disabled';

EduUserTokenResult​

export interface EduUserTokenResult {
accessToken: string;
expiresIn: number;
expiresAt: string;
tokenType: string;
appId: string;
eduUserId: string;
originId?: string;
}

EmailSendInput​

export interface EmailSendInput {
email: string;
scene?: 'login' | 'bind';
}

EmailVerifyInput​

export interface EmailVerifyInput extends EmailSendInput {
code: string;
}

EmptyInput​

export type EmptyInput = Record<string, never>;

EnteredUserTraceInput​

export type EnteredUserTraceInput = ClassroomIdInput &
ClassroomEnteredTraceQuery & { eduUserId: string };

EnteredUsersInput​

export type EnteredUsersInput = ClassroomIdInput & ListClassroomEnteredUsersQuery;

EntitlementSnapshot​

export interface EntitlementSnapshot {
tenantId?: string;
appId?: string;
version?: ProtoInt64;
accountState?: string;
expiresAt?: string;
featuresJson?: string;
}

EntryCodeClaimRecord​

export interface EntryCodeClaimRecord {
eduUserId: string;
nickname: string;
claimedAt: string;
}

EntryCodeList​

export interface EntryCodeList {
codes: EntryCodeRecord[];
}

EntryCodeRecord​

export interface EntryCodeRecord {
entryCodeId: string;
role: string;
code: string;
status: string;
maxClaims: number;
claimedCount: number;
remark: string;
claims: EntryCodeClaimRecord[];
}

EstimateRatedLine​

export interface EstimateRatedLine {
meter: string;
rawQuantity: string;
rawUnit: string;
points: string;
ruleId?: string;
priceVersion?: string;
dimensions?: Record<string, string>;
}

GoogleAuthorizeResult​

export type GoogleAuthorizeResult = {
authorizeUrl: string;
state: string;
};

GoogleCallbackPayload​

export type GoogleCallbackPayload = {
code: string;
state: string;
redirectUri: string;
};

GoogleTokenInput​

export interface GoogleTokenInput {
idToken: string;
}

IssueEntryCodesInput​

export interface IssueEntryCodesInput extends ClassroomIdInput {
role: 'teacher' | 'student';
maxClaims: number;
count?: number;
remark?: string;
}

JoinAttemptsInput​

export type JoinAttemptsInput = ClassroomIdInput & ListClassroomJoinAttemptsQuery;

LedgerEntry​

export interface LedgerEntry {
ledgerId: string;
entryType: string;
points: string;
availableDelta: string;
reservedDelta: string;
consumedDelta: string;
reservationId?: string;
metadataJson: string;
createdAt: string;
usageEventId?: string;
description?: string;
detail?: BillingDetail;
display?: BillingDisplay;
}

LedgerInput​

export interface LedgerInput extends PaginationInput {
type?: string;
status?: string;
}

ListClassroomEnteredUsersQuery​

export interface ListClassroomEnteredUsersQuery {
page?: number;
pageSize?: number;
}

ListClassroomEnteredUsersResult​

export interface ListClassroomEnteredUsersResult {
users: ClassroomEnteredUserRecord[];
total: number;
page: number;
pageSize: number;
}

ListClassroomJoinAttemptsQuery​

export interface ListClassroomJoinAttemptsQuery {
result?: string;
joinStatus?: string;
failureDomain?: string;
platform?: string;
sdkVersion?: string;
appVersion?: string;
networkType?: string;
provider?: string;
eduUserId?: string;
startedAtFrom?: string;
startedAtTo?: string;
cursor?: string;
pageSize?: number;
}

ListClassroomJoinAttemptsResult​

export interface ListClassroomJoinAttemptsResult {
attempts: ClassroomJoinAttemptRecord[];
hasMore: boolean;
nextCursor: string | null;
pageSize: number;
}

ListClassroomMembersResult​

export interface ListClassroomMembersResult {
members: ClassroomMemberRecord[];
}

ListClassroomsQuery​

export interface ListClassroomsQuery {
status?: ClassroomStatus;
q?: string;
/** Scheduled start time lower bound (inclusive), ISO 8601. */
startsAtFrom?: string;
/** Scheduled start time upper bound (exclusive), ISO 8601. */
startsAtTo?: string;
actualStartedAtFrom?: string;
actualStartedAtTo?: string;
page?: number;
pageSize?: number;
}

ListClassroomsResult​

export interface ListClassroomsResult {
items: ClassroomRecord[];
total: number;
page: number;
pageSize: number;
}

ListCoursewaresInput​

export interface ListCoursewaresInput extends PaginationInput {
classroomId?: string;
ownerEduUserId?: string;
status?: CoursewareStatus;
q?: string;
}

ListCoursewaresResult​

export type ListCoursewaresResult = {
items: CoursewareRecord[];
total: number;
page: number;
pageSize: number;
};

ListEduUsersQuery​

export interface ListEduUsersQuery {
status?: EduUserStatus;
q?: string;
page?: number;
pageSize?: number;
}

ListEduUsersResult​

export interface ListEduUsersResult {
items: EduUserRecord[];
total: number;
page: number;
pageSize: number;
}

ListLiveVideosResult​

export interface ListLiveVideosResult {
videos: LiveVideoRecord[];
total: number;
page: number;
pageSize: number;
}

LivePlayAddress​

export interface LivePlayAddress {
webrtc: string;
flv: string;
hls: string;
rtmp: string;
}

LivePlayCredentials​

export interface LivePlayCredentials {
status: string;
relayVersion: number;
streams: LiveRelayStream[];
}

LivePushCredential​

export interface LivePushCredential {
pushUrl: string;
streamName: string;
expiresAt: string;
}

LiveRelayStream​

export interface LiveRelayStream {
streamName: string;
publisherUserId: string;
streamType: string;
play: LivePlayAddress;
expiresAt: string;
}

LiveSourceRecord​

export interface LiveSourceRecord {
classroomId: string;
kind: string;
liveVideoId: string;
pullStreamUrl: string;
streamName: string;
ingestStatus: string;
version: number;
}

LiveVideoIdInput​

export interface LiveVideoIdInput {
liveVideoId: string;
}

LiveVideoRecord​

export interface LiveVideoRecord {
liveVideoId: string;
appId: string;
title: string;
objectKey: string;
playbackUrl: string;
status: string;
contentHash: string;
sizeBytes: number;
createdAt: string;
}

LiveVideoUploadInput​

export interface LiveVideoUploadInput {
fileName: string;
contentType?: string;
}

LiveVideoUploadResult​

export interface LiveVideoUploadResult {
uploadUrl: string;
objectKey: string;
expiresAt: string;
}

LogoutResult​

export interface LogoutResult {
success: boolean;
}

MembershipResult​

export interface MembershipResult {
classroomId: string;
eduUserId: string;
role: string;
joinedAt?: string;
}

OAuthAuthorizeInput​

export interface OAuthAuthorizeInput {
redirectUri: string;
state?: string;
}

Overview​

export interface Overview {
current: Participation;
previous: Participation;
liveCount: number;
online: number;
}

Paged​

export interface Paged<T> {
items?: T[];
total: string;
page: number;
pageSize: number;
}

PaginationInput​

export interface PaginationInput {
page?: number;
pageSize?: number;
}

Participation​

export interface Participation {
opened: number;
ended: number;
scheduled: number;
expired: number;
users: number;
students: number;
teachers: number;
attendances: number;
seconds: number;
}

PhoneVerifyInput​

export interface PhoneVerifyInput {
phone: string;
code: string;
captchaTicket?: string;
captchaRandstr?: string;
}

PlanCatalogItem​

export interface PlanCatalogItem {
planKey: string;
name: string;
version: number;
status: string;
grantPoints: string;
featuresJson: string;
}

ProtoInt64​

export type ProtoInt64 = string | number | { low: number; high: number; unsigned?: boolean };

PurchasePackagePayload​

export interface PurchasePackagePayload {
packageKey: string;
idempotencyKey: string;
}

PurchasePlanPayload​

export interface PurchasePlanPayload {
planKey: string;
period?: string;
idempotencyKey: string;
}

PurchasePlanResult​

export interface PurchasePlanResult {
subscriptionId: string;
tenantId: string;
planKey: string;
planVersionId: string;
status: string;
startsAt: string;
endsAt: string;
entitlementVersion: ProtoInt64;
}

Quality​

export interface Quality {
current: QualitySummary;
previous: QualitySummary;
breakdown: {
platform: string;
sdkVersion: string;
attempts: number;
failed: number;
}[];
failures: { stage: string; count: number }[];
recent: QualityAttempt[];
}

QualityAttempt​

export interface QualityAttempt {
appId: string;
classroomId: string;
eduUserId: string;
sessionId: string;
attemptId: string;
startedAt: string;
status: string;
stage: string;
}

QualitySummary​

export interface QualitySummary {
attempts: number;
joined: number;
succeeded: number;
degraded: number;
failed: number;
abandoned: number;
pending: number;
latencySamples: number;
p50Ms: number | null;
p95Ms: number | null;
successRate: number | null;
rtcExpected: number;
rtcReady: number;
whiteboardExpected: number;
whiteboardReady: number;
dropped: number;
lastIngestAt: string | null;
}

RefreshInput​

export interface RefreshInput {
refreshToken: string;
}

ReplaceStudentsInput​

export interface ReplaceStudentsInput extends ClassroomIdInput {
eduUserIds: string[];
}

ReservationRecord​

export interface ReservationRecord {
reservationId: string;
appId: string;
roomId: string;
status: string;
estimatedPoints: string;
reservedPoints: string;
consumedPoints: string;
expectedEndAt?: string;
expiresAt: string;
createdAt: string;
settledAt?: string;
}

ReservationsInput​

export interface ReservationsInput extends PaginationInput {
status?: string;
}

ResourcePackageItem​

export interface ResourcePackageItem {
packageKey: string;
name: string;
points: string;
validityMonths: number;
}

RevokeEntryCodeInput​

export interface RevokeEntryCodeInput extends ClassroomIdInput {
entryCodeId: string;
}

SearchEduUsersQuery​

export interface SearchEduUsersQuery {
q?: string;
status?: EduUserStatus;
limit?: number;
requireOriginId?: boolean;
}

SearchEduUsersResult​

export interface SearchEduUsersResult {
items: EduUserRecord[];
}

Section​

export interface Section<T> {
status: 'ok' | 'unavailable';
data: T | null;
updatedAt: string | null;
}

SendCodeResult​

export interface SendCodeResult {
sent: boolean;
expiresIn: number;
message: string;
devCode?: string;
}

SetClassroomStudentsResult​

export interface SetClassroomStudentsResult {
classroomId: string;
studentCount: number;
eduUserIds: string[];
}

SetLiveSourceInput​

export interface SetLiveSourceInput extends ClassroomIdInput {
kind: 'device' | 'file' | 'push' | 'pull';
liveVideoId?: string;
pullStreamUrl?: string;
}

SmsSendInput​

export interface SmsSendInput {
phone: string;
scene?: 'login' | 'bind';
captchaTicket?: string;
captchaRandstr?: string;
}

SmsVerifyInput​

export interface SmsVerifyInput extends SmsSendInput {
code: string;
}

UnbindCoursewaresResult​

export interface UnbindCoursewaresResult {
unboundCount: number;
}

UpdateAppConfigInput​

export interface UpdateAppConfigInput extends AppIdInput {
config: Record<string, unknown>;
}

UpdateClassroomInput​

export type UpdateClassroomInput = ClassroomIdInput &
UpdateClassroomPayload & { uiConfig?: Record<string, unknown> };

UpdateClassroomPayload​

export type UpdateClassroomPayload = Omit<
CreateClassroomPayload,
'startsAt' | 'durationMinutes' | 'coursewareIds' | 'studentEduUserIds'
>;

UpdateEntryCodeInput​

export interface UpdateEntryCodeInput extends ClassroomIdInput {
entryCodeId: string;
maxClaims?: number;
remark?: string;
rotate?: boolean;
}

UpdateWebhookInput​

export interface UpdateWebhookInput extends AppIdInput {
webhookUrl: string;
subscribedEvents?: string[];
rotateSecret?: boolean;
}

UpdateWebhookResult​

export interface UpdateWebhookResult extends AppRecord {
webhookSecret?: string;
}

UploadUrlResult​

export type UploadUrlResult = {
uploadUrl: string;
objectKey: string;
sourceUrl: string;
contentType: string;
expiresAt: string;
};

UpsertAutoRechargePayload​

export interface UpsertAutoRechargePayload {
packageKey: string;
thresholdPoints: string;
monthlyLimit: number;
enabled: boolean;
}

Usage​

export interface Usage {
points: string;
previousPoints: string;
pending?: number;
late?: number;
rejected?: number;
trend: { at: string; points: string }[];
meters: UsageGroup[];
applications: UsageGroup[];
}

UsageGroup​

export interface UsageGroup {
key: string;
points: string;
count?: number;
}

UsageInput​

export interface UsageInput extends LedgerInput {
scope?: 'dashboard';
appId?: string;
environment?: AppEnvironment;
from?: string;
to?: string;
}

UsageRecord​

export interface UsageRecord {
usageEventId: string;
appId?: string;
reservationId?: string;
sourceService: string;
meter: string;
rawQuantity: string;
rawUnit: string;
dimensionsJson: string;
detailJson?: string;
detail?: BillingDetail;
display?: BillingDisplay;
ratedPoints?: string;
description?: string;
status: string;
occurredAt: string;
ruleId?: string;
priceVersion?: string;
rejectionReason?: string;
}

UserStatusInput​

export interface UserStatusInput {
eduUserId: string;
status: EduUserStatus;
}

UserTokenInput​

export interface UserTokenInput {
eduUserId: string;
expiresIn?: number;
}

WalletBucket​

export interface WalletBucket {
bucketId: string;
sourceType: string;
totalPoints: string;
availablePoints: string;
reservedPoints: string;
consumedPoints: string;
effectiveAt: string;
expiresAt?: string;
priority: number;
}

WalletSummary​

export interface WalletSummary {
walletId: string;
accountState: string;
availablePoints: string;
reservedPoints: string;
consumedPoints: string;
overdraftPoints: string;
version?: ProtoInt64;
buckets?: WalletBucket[];
}

WechatBindPhoneSendInput​

export interface WechatBindPhoneSendInput {
bindTicket: string;
phone: string;
captchaTicket?: string;
captchaRandstr?: string;
}

WechatBindPhoneVerifyInput​

export interface WechatBindPhoneVerifyInput extends WechatBindPhoneSendInput {
code: string;
}

WechatCallbackResult​

export type WechatCallbackResult =
| (AuthSession & { nextAction: 'session'; bindTicket?: string })
| { nextAction: 'bind_phone'; bindTicket: string };

WhiteboardCoursewaresResult​

export interface WhiteboardCoursewaresResult {
items: ClassroomWhiteboardCoursewareRecord[];
}

activityCategories​

export const activityCategories = [
'join',
'stage',
'media',
'permission',
'message',
'whiteboard',
'tool',
'connection',
'lifecycle',
'other',
] as const;

activityRelations​

export const activityRelations = ['initiated', 'affected', 'observed', 'system', 'server'] as const;