backend: Prevent instantiation of utility classes by adding private constructors in helpers
This commit is contained in:
parent
74254be37b
commit
7dffc6b60a
@ -13,6 +13,10 @@ const enum OpenViduComponentsDataTopic {
|
||||
}
|
||||
|
||||
export class OpenViduComponentsAdapterHelper {
|
||||
private constructor() {
|
||||
// Prevent instantiation of this utility class
|
||||
}
|
||||
|
||||
static generateRecordingSignal(recordingInfo: MeetRecordingInfo) {
|
||||
const options: SendDataOptions = {
|
||||
destinationSids: [],
|
||||
|
||||
@ -3,6 +3,10 @@ import { MeetRecordingInfo, MeetRecordingOutputMode, MeetRecordingStatus } from
|
||||
import { EgressStatus } from '@livekit/protocol';
|
||||
|
||||
export class RecordingHelper {
|
||||
private constructor() {
|
||||
// Prevent instantiation of this utility class
|
||||
}
|
||||
|
||||
static toRecordingInfo(egressInfo: EgressInfo): MeetRecordingInfo {
|
||||
const status = RecordingHelper.extractOpenViduStatus(egressInfo.status);
|
||||
const size = RecordingHelper.extractSize(egressInfo);
|
||||
@ -140,8 +144,9 @@ export class RecordingHelper {
|
||||
* @param egressInfo - The EgressInfo object containing the endedAt value.
|
||||
* @returns The endedAt value converted to milliseconds.
|
||||
*/
|
||||
static extractEndDate(egressInfo: EgressInfo): number {
|
||||
return this.toMilliseconds(Number(egressInfo.endedAt ?? 0));
|
||||
static extractEndDate(egressInfo: EgressInfo): number | undefined {
|
||||
const endDateMs = this.toMilliseconds(Number(egressInfo.endedAt ?? 0));
|
||||
return endDateMs !== 0 ? endDateMs : undefined;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@ -4,6 +4,10 @@ import { MEET_NAME_ID } from '../environment.js';
|
||||
import { uid } from 'uid/single';
|
||||
|
||||
export class OpenViduRoomHelper {
|
||||
private constructor() {
|
||||
// Prevent instantiation of this utility class
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts an OpenViduMeetRoom object to an OpenViduMeetRoomOptions object.
|
||||
*
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user