mirror of
https://github.com/OneUptime/oneuptime
synced 2024-11-22 23:30:10 +00:00
21 lines
482 B
TypeScript
21 lines
482 B
TypeScript
import ObjectID from "../Types/ObjectID";
|
|
import ModelEventType from "../Types/Realtime/ModelEventType";
|
|
|
|
export default class RealtimeUtil {
|
|
public static getRoomId(
|
|
tenantId: string | ObjectID,
|
|
modelName: string,
|
|
eventType: ModelEventType,
|
|
modelId?: string | ObjectID,
|
|
): string {
|
|
const roomId: string =
|
|
tenantId.toString() + "-" + modelName + "-" + eventType;
|
|
|
|
if (modelId) {
|
|
return roomId + "-" + modelId;
|
|
}
|
|
|
|
return roomId;
|
|
}
|
|
}
|