typings: Update recording status enums and improve webhook models for clarity and consistency

This commit is contained in:
Carlos Santos 2025-03-19 19:31:54 +01:00
parent baec69c3db
commit 2d4f005d3b
2 changed files with 28 additions and 32 deletions

View File

@ -1,30 +1,31 @@
export const enum MeetRecordingStatus {
STARTING = 'STARTING',
STARTED = 'STARTED',
STOPPING = 'STOPPING',
STOPPED = 'STOPPED',
ACTIVE = 'ACTIVE',
ENDING = 'ENDING',
COMPLETE = 'COMPLETE',
FAILED = 'FAILED',
READY = 'READY'
ABORTED = 'ABORTED',
LIMITED_REACHED = 'LIMITED_REACHED',
}
export const enum MeetRecordingOutputMode {
COMPOSED = 'COMPOSED',
INDIVIDUAL = 'INDIVIDUAL'
COMPOSED = 'COMPOSED'
}
/**
* Interface representing a recording
*/
export interface MeetRecordingInfo {
id: string;
roomName: string;
// TODO: Delete roomId
recordingId: string;
roomId: string;
outputMode: MeetRecordingOutputMode;
status: MeetRecordingStatus;
filename?: string;
startedAt?: number;
endedAt?: number;
startDate?: number;
endDate?: number;
duration?: number;
size?: number;
errorCode?: number;
error?: string;
details?: string;
}

View File

@ -1,24 +1,19 @@
import { MeetRecordingStatus } from './recording.model.js';
/** THIS HEADER IS AUTOGENERATED. DO NOT MODIFY MANUALLY. For any changes, please update the '/openvidu-meet/typings' directory. */
export interface OpenViduWebhookEvent {
import { MeetRecordingInfo } from './recording.model.js';
import { OpenViduMeetRoom } from './room.js';
export type MeetWebhookPayload = MeetRecordingInfo | OpenViduMeetRoom;
export const enum MeetWebhookEventType {
RECORDING_STARTED = 'recordingStarted',
RECORDING_UPDATED = 'recordingUpdated',
RECORDING_ENDED = 'recordingEnded',
ROOM_FINISHED = 'roomFinished',
}
export interface MeetWebhookEvent {
creationDate: number;
event: OpenViduWebhookEventType;
data: RoomWebhookData | RecordingWebhookData;
}
export const enum OpenViduWebhookEventType {
RECORDING_STARTED = 'recording_started',
RECORDING_STOPPED = 'recording_stopped',
ROOM_FINISHED = 'room_finished'
}
export interface RecordingWebhookData {
recordingId: string;
filename?: string;
roomName: string;
status: MeetRecordingStatus;
}
export interface RoomWebhookData {
roomName: string;
event: MeetWebhookEventType;
data: MeetWebhookPayload;
}