backend: Reorganize imports
This commit is contained in:
parent
2c1657a58d
commit
5e11be08b4
@ -1,19 +1,19 @@
|
||||
import { Container } from 'inversify';
|
||||
import {
|
||||
AuthService,
|
||||
MeetStorageService,
|
||||
StorageFactory,
|
||||
LiveKitService,
|
||||
LivekitWebhookService,
|
||||
LoggerService,
|
||||
MeetStorageService,
|
||||
MutexService,
|
||||
OpenViduWebhookService,
|
||||
ParticipantService,
|
||||
RecordingService,
|
||||
RedisService,
|
||||
RoomService,
|
||||
S3StorageProvider,
|
||||
S3Service,
|
||||
S3StorageProvider,
|
||||
StorageFactory,
|
||||
SystemEventService,
|
||||
TaskSchedulerService,
|
||||
TokenService,
|
||||
@ -60,5 +60,3 @@ export const initializeEagerServices = async () => {
|
||||
container.get(RecordingService);
|
||||
await container.get(MeetStorageService).initializeGlobalPreferences();
|
||||
};
|
||||
|
||||
export { injectable, inject } from 'inversify';
|
||||
|
||||
@ -1,16 +1,10 @@
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { Request, Response } from 'express';
|
||||
import { AuthService } from '../services/auth.service.js';
|
||||
import { TokenService } from '../services/token.service.js';
|
||||
import { LoggerService } from '../services/logger.service.js';
|
||||
import {
|
||||
MEET_ACCESS_TOKEN_EXPIRATION,
|
||||
MEET_REFRESH_TOKEN_EXPIRATION,
|
||||
} from '../environment.js';
|
||||
import { ClaimGrants } from 'livekit-server-sdk';
|
||||
import { getCookieOptions } from '../utils/cookie-utils.js';
|
||||
import { UserService } from '../services/user.service.js';
|
||||
import { container } from '../config/index.js';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
import { MEET_ACCESS_TOKEN_EXPIRATION, MEET_REFRESH_TOKEN_EXPIRATION } from '../environment.js';
|
||||
import { AuthService, LoggerService, TokenService, UserService } from '../services/index.js';
|
||||
import { getCookieOptions } from '../utils/cookie-utils.js';
|
||||
|
||||
export const login = async (req: Request, res: Response) => {
|
||||
const logger = container.get(LoggerService);
|
||||
@ -29,7 +23,11 @@ export const login = async (req: Request, res: Response) => {
|
||||
const tokenService = container.get(TokenService);
|
||||
const accessToken = await tokenService.generateAccessToken(user);
|
||||
const refreshToken = await tokenService.generateRefreshToken(user);
|
||||
res.cookie(INTERNAL_CONFIG.ACCESS_TOKEN_COOKIE_NAME, accessToken, getCookieOptions('/', MEET_ACCESS_TOKEN_EXPIRATION));
|
||||
res.cookie(
|
||||
INTERNAL_CONFIG.ACCESS_TOKEN_COOKIE_NAME,
|
||||
accessToken,
|
||||
getCookieOptions('/', MEET_ACCESS_TOKEN_EXPIRATION)
|
||||
);
|
||||
res.cookie(
|
||||
INTERNAL_CONFIG.REFRESH_TOKEN_COOKIE_NAME,
|
||||
refreshToken,
|
||||
@ -82,7 +80,11 @@ export const refreshToken = async (req: Request, res: Response) => {
|
||||
|
||||
try {
|
||||
const accessToken = await tokenService.generateAccessToken(user);
|
||||
res.cookie(INTERNAL_CONFIG.ACCESS_TOKEN_COOKIE_NAME, accessToken, getCookieOptions('/', MEET_ACCESS_TOKEN_EXPIRATION));
|
||||
res.cookie(
|
||||
INTERNAL_CONFIG.ACCESS_TOKEN_COOKIE_NAME,
|
||||
accessToken,
|
||||
getCookieOptions('/', MEET_ACCESS_TOKEN_EXPIRATION)
|
||||
);
|
||||
logger.info(`Token refreshed for user ${username}`);
|
||||
return res.status(200).json({ message: 'Token refreshed' });
|
||||
} catch (error) {
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { container } from '../../config/dependency-injector.config.js';
|
||||
import { Request, Response } from 'express';
|
||||
import { LoggerService } from '../../services/logger.service.js';
|
||||
import { MeetStorageService } from '../../services/storage/index.js';
|
||||
import { OpenViduMeetError } from '../../models/error.model.js';
|
||||
import { SecurityPreferencesDTO, UpdateSecurityPreferencesDTO } from '@typings-ce';
|
||||
import { Request, Response } from 'express';
|
||||
import { container } from '../../config/index.js';
|
||||
import { OpenViduMeetError } from '../../models/error.model.js';
|
||||
import { LoggerService, MeetStorageService } from '../../services/index.js';
|
||||
|
||||
export const updateSecurityPreferences = async (req: Request, res: Response) => {
|
||||
const logger = container.get(LoggerService);
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { container } from '../../config/dependency-injector.config.js';
|
||||
import { Request, Response } from 'express';
|
||||
import { LoggerService } from '../../services/logger.service.js';
|
||||
import { MeetStorageService } from '../../services/storage/index.js';
|
||||
import { OpenViduMeetError } from '../../models/error.model.js';
|
||||
import { WebhookPreferences } from '@typings-ce';
|
||||
import { Request, Response } from 'express';
|
||||
import { container } from '../../config/index.js';
|
||||
import { OpenViduMeetError } from '../../models/error.model.js';
|
||||
import { LoggerService, MeetStorageService } from '../../services/index.js';
|
||||
|
||||
export const updateWebhookPreferences = async (req: Request, res: Response) => {
|
||||
const logger = container.get(LoggerService);
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
export * from './auth.controller.js';
|
||||
export * from './recording.controller.js';
|
||||
export * from './room.controller.js';
|
||||
export * from './meeting.controller.js';
|
||||
export * from './participant.controller.js';
|
||||
export * from './recording.controller.js';
|
||||
export * from './livekit-webhook.controller.js';
|
||||
|
||||
export * from './global-preferences/appearance-preferences.controller.js';
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { Request, Response } from 'express';
|
||||
import { LoggerService } from '../services/logger.service.js';
|
||||
import { LivekitWebhookService } from '../services/livekit-webhook.service.js';
|
||||
import { WebhookEvent } from 'livekit-server-sdk';
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { container } from '../config/index.js';
|
||||
import { LivekitWebhookService, LoggerService } from '../services/index.js';
|
||||
|
||||
export const lkWebhookHandler = async (req: Request, res: Response) => {
|
||||
const logger = container.get(LoggerService);
|
||||
|
||||
@ -1,13 +1,13 @@
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { Request, Response } from 'express';
|
||||
import { OpenViduMeetError } from '../models/index.js';
|
||||
import { LoggerService, RoomService, LiveKitService } from '../services/index.js';
|
||||
import { container } from '../config/index.js';
|
||||
import { OpenViduMeetError } from '../models/error.model.js';
|
||||
import { LiveKitService, LoggerService, RoomService } from '../services/index.js';
|
||||
|
||||
export const endMeeting = async (req: Request, res: Response) => {
|
||||
const logger = container.get(LoggerService);
|
||||
const roomService = container.get(RoomService);
|
||||
const livekitService = container.get(LiveKitService);
|
||||
|
||||
|
||||
const { roomId } = req.params;
|
||||
|
||||
// Check if the room exists
|
||||
|
||||
@ -1,14 +1,11 @@
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { Request, Response } from 'express';
|
||||
import { LoggerService } from '../services/logger.service.js';
|
||||
import { ParticipantOptions } from '@typings-ce';
|
||||
import { OpenViduMeetError } from '../models/index.js';
|
||||
import { ParticipantService } from '../services/participant.service.js';
|
||||
import { MEET_PARTICIPANT_TOKEN_EXPIRATION } from '../environment.js';
|
||||
import { getCookieOptions } from '../utils/cookie-utils.js';
|
||||
import { TokenService } from '../services/token.service.js';
|
||||
import { RoomService } from '../services/room.service.js';
|
||||
import { Request, Response } from 'express';
|
||||
import { container } from '../config/index.js';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
import { MEET_PARTICIPANT_TOKEN_EXPIRATION } from '../environment.js';
|
||||
import { OpenViduMeetError } from '../models/error.model.js';
|
||||
import { LoggerService, ParticipantService, RoomService, TokenService } from '../services/index.js';
|
||||
import { getCookieOptions } from '../utils/cookie-utils.js';
|
||||
|
||||
export const generateParticipantToken = async (req: Request, res: Response) => {
|
||||
const logger = container.get(LoggerService);
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { Request, Response } from 'express';
|
||||
import { LoggerService } from '../services/logger.service.js';
|
||||
import { OpenViduMeetError } from '../models/error.model.js';
|
||||
import { RecordingService } from '../services/recording.service.js';
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { container } from '../config/index.js';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
import { OpenViduMeetError } from '../models/error.model.js';
|
||||
import { LoggerService, RecordingService } from '../services/index.js';
|
||||
|
||||
export const startRecording = async (req: Request, res: Response) => {
|
||||
const logger = container.get(LoggerService);
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { Request, Response } from 'express';
|
||||
import { LoggerService } from '../services/logger.service.js';
|
||||
import { OpenViduMeetError } from '../models/error.model.js';
|
||||
import { RoomService, ParticipantService } from '../services/index.js';
|
||||
import { MeetRoomFilters, MeetRoomOptions, MeetRoomRoleAndPermissions, ParticipantRole } from '@typings-ce';
|
||||
import { Request, Response } from 'express';
|
||||
import { container } from '../config/index.js';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
import { OpenViduMeetError } from '../models/error.model.js';
|
||||
import { LoggerService, ParticipantService, RoomService } from '../services/index.js';
|
||||
|
||||
export const createRoom = async (req: Request, res: Response) => {
|
||||
const logger = container.get(LoggerService);
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import dotenv from 'dotenv';
|
||||
import chalk from 'chalk';
|
||||
import dotenv from 'dotenv';
|
||||
|
||||
let envPath: string | undefined;
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
export * from './recording.helper.js';
|
||||
export * from './ov-components-adapter.helper.js';
|
||||
export * from './room.helper.js';
|
||||
export * from './utils.helper.js';
|
||||
export * from './password.helper.js';
|
||||
export * from './redis.helper.js';
|
||||
export * from './room.helper.js';
|
||||
export * from './recording.helper.js';
|
||||
export * from './ov-components-adapter.helper.js';
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
import { EgressInfo } from 'livekit-server-sdk';
|
||||
import { MeetRecordingInfo, MeetRecordingStatus } from '@typings-ce';
|
||||
import { EgressStatus } from '@livekit/protocol';
|
||||
import { MeetRecordingInfo, MeetRecordingStatus } from '@typings-ce';
|
||||
import { EgressInfo } from 'livekit-server-sdk';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
|
||||
export class RecordingHelper {
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
import { NextFunction, Request, RequestHandler, Response } from 'express';
|
||||
import { LoggerService, TokenService, UserService } from '../services/index.js';
|
||||
import { MEET_API_KEY } from '../environment.js';
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { ClaimGrants } from 'livekit-server-sdk';
|
||||
import { User, UserRole } from '@typings-ce';
|
||||
import { NextFunction, Request, RequestHandler, Response } from 'express';
|
||||
import rateLimit from 'express-rate-limit';
|
||||
import { ClaimGrants } from 'livekit-server-sdk';
|
||||
import ms from 'ms';
|
||||
import { container } from '../config/index.js';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
import { MEET_API_KEY } from '../environment.js';
|
||||
import {
|
||||
errorUnauthorized,
|
||||
errorInvalidToken,
|
||||
errorInvalidTokenSubject,
|
||||
errorInsufficientPermissions,
|
||||
errorInvalidApiKey,
|
||||
errorInvalidToken,
|
||||
errorInvalidTokenSubject,
|
||||
errorUnauthorized,
|
||||
OpenViduMeetError
|
||||
} from '../models/index.js';
|
||||
import rateLimit from 'express-rate-limit';
|
||||
import ms from 'ms';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
import { LoggerService, TokenService, UserService } from '../services/index.js';
|
||||
|
||||
/**
|
||||
* This middleware allows to chain multiple validators to check if the request is authorized.
|
||||
@ -97,7 +97,7 @@ export const participantTokenValidator = async (req: Request) => {
|
||||
try {
|
||||
const payload = await tokenService.verifyToken(token);
|
||||
const user = await getAuthenticatedUserOrAnonymous(req);
|
||||
|
||||
|
||||
req.session = req.session || {};
|
||||
req.session.tokenClaims = payload;
|
||||
req.session.user = user;
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
|
||||
export const mediaTypeValidatorMiddleware = (req: Request, res: Response, next: NextFunction) => {
|
||||
if (req.method === 'GET') {
|
||||
|
||||
@ -1,10 +1,11 @@
|
||||
export * from './content-type.middleware.js';
|
||||
export * from './auth.middleware.js';
|
||||
export * from './room.middleware.js';
|
||||
export * from './participant.middleware.js';
|
||||
export * from './recording.middleware.js';
|
||||
export * from './content-type.middleware.js';
|
||||
|
||||
export * from './request-validators/auth-validator.middleware.js';
|
||||
export * from './request-validators/participant-validator.middleware.js';
|
||||
export * from './request-validators/preferences-validator.middleware.js';
|
||||
export * from './request-validators/room-validator.middleware.js';
|
||||
export * from './request-validators/participant-validator.middleware.js';
|
||||
export * from './request-validators/recording-validator.middleware.js';
|
||||
export * from './request-validators/preferences-validator.middleware.js';
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { AuthMode, ParticipantRole, UserRole, ParticipantOptions } from '@typings-ce';
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { MeetStorageService, LoggerService, RoomService } from '../services/index.js';
|
||||
import { AuthMode, ParticipantOptions, ParticipantRole, UserRole } from '@typings-ce';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { container } from '../config/index.js';
|
||||
import { LoggerService, MeetStorageService, RoomService } from '../services/index.js';
|
||||
import { allowAnonymous, tokenAndRoleValidator, withAuth } from './auth.middleware.js';
|
||||
|
||||
/**
|
||||
|
||||
@ -1,10 +1,9 @@
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { OpenViduMeetPermissions, MeetRoom } from '@typings-ce';
|
||||
import { LoggerService } from '../services/logger.service.js';
|
||||
import { RoomService } from '../services/room.service.js';
|
||||
import { RecordingHelper } from '../helpers/recording.helper.js';
|
||||
import { OpenViduMeetError } from '../models/index.js';
|
||||
import { MeetRoom, OpenViduMeetPermissions } from '@typings-ce';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { container } from '../config/index.js';
|
||||
import { RecordingHelper } from '../helpers/index.js';
|
||||
import { OpenViduMeetError } from '../models/error.model.js';
|
||||
import { LoggerService, RoomService } from '../services/index.js';
|
||||
|
||||
const extractRoomIdFromRequest = (req: Request): string => {
|
||||
if (req.body.roomId) {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { z } from 'zod';
|
||||
|
||||
const LoginRequestSchema = z.object({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { ParticipantOptions } from '@typings-ce';
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { z } from 'zod';
|
||||
import { nonEmptySanitizedRoomId } from './room-validator.middleware.js';
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ import {
|
||||
ValidAuthMethodDTO,
|
||||
WebhookPreferences
|
||||
} from '@typings-ce';
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { z } from 'zod';
|
||||
|
||||
const WebhookPreferencesSchema: z.ZodType<WebhookPreferences> = z.object({
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { MeetRecordingFilters } from '@typings-ce';
|
||||
import { Request, Response, NextFunction } from 'express';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { z } from 'zod';
|
||||
import { nonEmptySanitizedRoomId } from './room-validator.middleware.js';
|
||||
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { container } from '../config/dependency-injector.config.js';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { LoggerService } from '../services/logger.service.js';
|
||||
import { MeetStorageService } from '../services/index.js';
|
||||
import { allowAnonymous, apiKeyValidator, tokenAndRoleValidator, withAuth } from './auth.middleware.js';
|
||||
import { AuthMode, ParticipantRole, UserRole } from '@typings-ce';
|
||||
import { NextFunction, Request, Response } from 'express';
|
||||
import { container } from '../config/index.js';
|
||||
import { LoggerService, MeetStorageService } from '../services/index.js';
|
||||
import { allowAnonymous, apiKeyValidator, tokenAndRoleValidator, withAuth } from './auth.middleware.js';
|
||||
|
||||
/**
|
||||
* Middleware that configures authentication for creating a room based on global settings.
|
||||
|
||||
@ -76,11 +76,7 @@ export const errorRecordingAlreadyStarted = (roomId: string): OpenViduMeetError
|
||||
};
|
||||
|
||||
export const errorRecordingStartTimeout = (roomId: string): OpenViduMeetError => {
|
||||
return new OpenViduMeetError(
|
||||
'Recording Error',
|
||||
`Recording in room '${roomId}' timed out while starting`,
|
||||
503
|
||||
);
|
||||
return new OpenViduMeetError('Recording Error', `Recording in room '${roomId}' timed out while starting`, 503);
|
||||
};
|
||||
|
||||
export const errorRoomHasNoParticipants = (roomId: string): OpenViduMeetError => {
|
||||
|
||||
@ -1,2 +1,3 @@
|
||||
export * from './error.model.js';
|
||||
export * from './redis.model.js';
|
||||
export * from './system-event.model.js';
|
||||
|
||||
@ -4,7 +4,7 @@ export const enum RedisKeyPrefix {
|
||||
|
||||
export const enum RedisKeyName {
|
||||
GLOBAL_PREFERENCES = `${RedisKeyPrefix.BASE}global_preferences`,
|
||||
ROOM = `${RedisKeyPrefix.BASE}room:`,
|
||||
ROOM = `${RedisKeyPrefix.BASE}room:`
|
||||
}
|
||||
|
||||
export const enum RedisLockPrefix {
|
||||
@ -16,5 +16,5 @@ export const enum RedisLockName {
|
||||
ROOM_GARBAGE_COLLECTOR = 'room_garbage_collector',
|
||||
RECORDING_ACTIVE = 'recording_active',
|
||||
SCHEDULED_TASK = 'scheduled_task',
|
||||
GLOBAL_PREFERENCES = 'global_preferences',
|
||||
GLOBAL_PREFERENCES = 'global_preferences'
|
||||
}
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { Router } from 'express';
|
||||
import bodyParser from 'body-parser';
|
||||
import * as authCtrl from '../controllers/auth.controller.js';
|
||||
import { validateLoginRequest, withLoginLimiter, tokenAndRoleValidator, withAuth } from '../middlewares/index.js';
|
||||
import { UserRole } from '@typings-ce';
|
||||
import bodyParser from 'body-parser';
|
||||
import { Router } from 'express';
|
||||
import * as authCtrl from '../controllers/auth.controller.js';
|
||||
import { tokenAndRoleValidator, validateLoginRequest, withAuth, withLoginLimiter } from '../middlewares/index.js';
|
||||
|
||||
export const authRouter = Router();
|
||||
authRouter.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
import { Router } from 'express';
|
||||
import { UserRole } from '@typings-ce';
|
||||
import bodyParser from 'body-parser';
|
||||
import { Router } from 'express';
|
||||
import * as appearancePrefCtrl from '../controllers/global-preferences/appearance-preferences.controller.js';
|
||||
import * as webhookPrefCtrl from '../controllers/global-preferences/webhook-preferences.controller.js';
|
||||
import * as securityPrefCtrl from '../controllers/global-preferences/security-preferences.controller.js';
|
||||
import * as webhookPrefCtrl from '../controllers/global-preferences/webhook-preferences.controller.js';
|
||||
import {
|
||||
tokenAndRoleValidator,
|
||||
validateSecurityPreferences,
|
||||
validateWebhookPreferences,
|
||||
withAuth,
|
||||
tokenAndRoleValidator
|
||||
withAuth
|
||||
} from '../middlewares/index.js';
|
||||
import { UserRole } from '@typings-ce';
|
||||
|
||||
export const preferencesRouter = Router();
|
||||
preferencesRouter.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
export * from './recording.routes.js';
|
||||
export * from './global-preferences.routes.js';
|
||||
export * from './room.routes.js';
|
||||
export * from './auth.routes.js';
|
||||
export * from './livekit.routes.js';
|
||||
export * from './participant.routes.js';
|
||||
export * from './room.routes.js';
|
||||
export * from './meeting.routes.js';
|
||||
export * from './participant.routes.js';
|
||||
export * from './recording.routes.js';
|
||||
export * from './livekit.routes.js';
|
||||
|
||||
@ -1,8 +1,8 @@
|
||||
import { Router } from 'express';
|
||||
import bodyParser from 'body-parser';
|
||||
import { Router } from 'express';
|
||||
import * as meetingCtrl from '../controllers/meeting.controller.js';
|
||||
import * as participantCtrl from '../controllers/participant.controller.js';
|
||||
import { withModeratorPermissions, participantTokenValidator, withAuth } from '../middlewares/index.js';
|
||||
import { participantTokenValidator, withAuth, withModeratorPermissions } from '../middlewares/index.js';
|
||||
|
||||
export const internalMeetingRouter = Router();
|
||||
internalMeetingRouter.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { Router } from 'express';
|
||||
import bodyParser from 'body-parser';
|
||||
import { Router } from 'express';
|
||||
import * as participantCtrl from '../controllers/participant.controller.js';
|
||||
import { validateParticipantTokenRequest, configureTokenAuth } from '../middlewares/index.js';
|
||||
import { configureTokenAuth, validateParticipantTokenRequest } from '../middlewares/index.js';
|
||||
|
||||
export const internalParticipantRouter = Router();
|
||||
internalParticipantRouter.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
import { Router } from 'express';
|
||||
import bodyParser from 'body-parser';
|
||||
import * as recordingCtrl from '../controllers/recording.controller.js';
|
||||
import { UserRole } from '@typings-ce';
|
||||
import bodyParser from 'body-parser';
|
||||
import { Router } from 'express';
|
||||
import * as recordingCtrl from '../controllers/recording.controller.js';
|
||||
import {
|
||||
withAuth,
|
||||
apiKeyValidator,
|
||||
participantTokenValidator,
|
||||
tokenAndRoleValidator,
|
||||
withRecordingEnabled,
|
||||
withAuth,
|
||||
withCanRecordPermission,
|
||||
withValidRecordingFiltersRequest,
|
||||
withRecordingEnabled,
|
||||
withValidRecordingBulkDeleteRequest,
|
||||
withValidRecordingFiltersRequest,
|
||||
withValidRecordingId,
|
||||
withValidStartRecordingRequest,
|
||||
apiKeyValidator
|
||||
withValidStartRecordingRequest
|
||||
} from '../middlewares/index.js';
|
||||
|
||||
export const recordingRouter = Router();
|
||||
|
||||
@ -1,21 +1,21 @@
|
||||
import { Router } from 'express';
|
||||
import { UserRole } from '@typings-ce';
|
||||
import bodyParser from 'body-parser';
|
||||
import { Router } from 'express';
|
||||
import * as roomCtrl from '../controllers/room.controller.js';
|
||||
import {
|
||||
withAuth,
|
||||
tokenAndRoleValidator,
|
||||
apiKeyValidator,
|
||||
participantTokenValidator,
|
||||
withValidRoomFiltersRequest,
|
||||
withValidRoomOptions,
|
||||
configureCreateRoomAuth,
|
||||
configureRoomAuthorization,
|
||||
withValidRoomPreferences,
|
||||
participantTokenValidator,
|
||||
tokenAndRoleValidator,
|
||||
withAuth,
|
||||
withValidRoomBulkDeleteRequest,
|
||||
withValidRoomDeleteRequest,
|
||||
withValidRoomFiltersRequest,
|
||||
withValidRoomId,
|
||||
withValidRoomDeleteRequest
|
||||
withValidRoomOptions,
|
||||
withValidRoomPreferences
|
||||
} from '../middlewares/index.js';
|
||||
import { UserRole } from '@typings-ce';
|
||||
|
||||
export const roomRouter = Router();
|
||||
roomRouter.use(bodyParser.urlencoded({ extended: true }));
|
||||
|
||||
@ -1,15 +1,11 @@
|
||||
import express, { Request, Response, Express } from 'express';
|
||||
import cors from 'cors';
|
||||
import chalk from 'chalk';
|
||||
import { registerDependencies, initializeEagerServices } from './config/dependency-injector.config.js';
|
||||
import { SERVER_PORT, SERVER_CORS_ORIGIN, logEnvVars } from './environment.js';
|
||||
import {
|
||||
publicApiHtmlFilePath,
|
||||
indexHtmlPath,
|
||||
publicFilesPath,
|
||||
webcomponentBundlePath,
|
||||
internalApiHtmlFilePath
|
||||
} from './utils/path-utils.js';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import cors from 'cors';
|
||||
import express, { Express, Request, Response } from 'express';
|
||||
import { initializeEagerServices, registerDependencies } from './config/index.js';
|
||||
import INTERNAL_CONFIG from './config/internal-config.js';
|
||||
import { SERVER_CORS_ORIGIN, SERVER_PORT, logEnvVars } from './environment.js';
|
||||
import { jsonSyntaxErrorHandler } from './middlewares/index.js';
|
||||
import {
|
||||
authRouter,
|
||||
internalMeetingRouter,
|
||||
@ -21,9 +17,13 @@ import {
|
||||
recordingRouter,
|
||||
roomRouter
|
||||
} from './routes/index.js';
|
||||
import cookieParser from 'cookie-parser';
|
||||
import { jsonSyntaxErrorHandler } from './middlewares/content-type.middleware.js';
|
||||
import INTERNAL_CONFIG from './config/internal-config.js';
|
||||
import {
|
||||
indexHtmlPath,
|
||||
internalApiHtmlFilePath,
|
||||
publicApiHtmlFilePath,
|
||||
publicFilesPath,
|
||||
webcomponentBundlePath
|
||||
} from './utils/path-utils.js';
|
||||
|
||||
const createApp = () => {
|
||||
const app: Express = express();
|
||||
@ -115,4 +115,4 @@ if (isMainModule()) {
|
||||
await initializeEagerServices();
|
||||
}
|
||||
|
||||
export { registerDependencies, createApp };
|
||||
export { createApp, registerDependencies };
|
||||
|
||||
@ -1,10 +1,8 @@
|
||||
import { MEET_ADMIN_SECRET, MEET_ADMIN_USER } from '../environment.js';
|
||||
import { inject, injectable } from '../config/dependency-injector.config.js';
|
||||
import { User } from '@typings-ce';
|
||||
import { UserService } from './user.service.js';
|
||||
import { MeetStorageService } from './storage/storage.service.js';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { PasswordHelper } from '../helpers/password.helper.js';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { MEET_ADMIN_SECRET, MEET_ADMIN_USER } from '../environment.js';
|
||||
import { PasswordHelper } from '../helpers/index.js';
|
||||
import { LoggerService, MeetStorageService, UserService } from './index.js';
|
||||
|
||||
@injectable()
|
||||
export class AuthService {
|
||||
|
||||
@ -1,20 +1,20 @@
|
||||
import { inject, injectable } from '../config/dependency-injector.config.js';
|
||||
import { EgressInfo, ParticipantInfo, Room, WebhookEvent, WebhookReceiver } from 'livekit-server-sdk';
|
||||
import { RecordingHelper } from '../helpers/recording.helper.js';
|
||||
import { LiveKitService } from './livekit.service.js';
|
||||
import { MeetRecordingInfo, MeetRecordingStatus } from '@typings-ce';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { EgressInfo, ParticipantInfo, Room, WebhookEvent, WebhookReceiver } from 'livekit-server-sdk';
|
||||
import { LIVEKIT_API_KEY, LIVEKIT_API_SECRET, MEET_NAME_ID } from '../environment.js';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { RoomService } from './room.service.js';
|
||||
import { S3Service } from './s3.service.js';
|
||||
import { RecordingService } from './recording.service.js';
|
||||
import { OpenViduWebhookService } from './openvidu-webhook.service.js';
|
||||
import { MutexService } from './mutex.service.js';
|
||||
import { SystemEventService } from './system-event.service.js';
|
||||
import { RecordingHelper } from '../helpers/index.js';
|
||||
import { SystemEventType } from '../models/system-event.model.js';
|
||||
import { MeetRoomHelper } from '../helpers/room.helper.js';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
import { MeetStorageService } from './storage/storage.service.js';
|
||||
import {
|
||||
LiveKitService,
|
||||
LoggerService,
|
||||
MeetStorageService,
|
||||
MutexService,
|
||||
OpenViduWebhookService,
|
||||
RecordingService,
|
||||
RoomService,
|
||||
S3Service,
|
||||
SystemEventService
|
||||
} from './index.js';
|
||||
|
||||
@injectable()
|
||||
export class LivekitWebhookService {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { inject, injectable } from '../config/dependency-injector.config.js';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import {
|
||||
CreateOptions,
|
||||
DataPacket_Kind,
|
||||
@ -15,7 +15,7 @@ import {
|
||||
StreamOutput
|
||||
} from 'livekit-server-sdk';
|
||||
import { LIVEKIT_API_KEY, LIVEKIT_API_SECRET, LIVEKIT_URL_PRIVATE } from '../environment.js';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { RecordingHelper } from '../helpers/index.js';
|
||||
import {
|
||||
errorLivekitIsNotAvailable,
|
||||
errorParticipantNotFound,
|
||||
@ -23,7 +23,7 @@ import {
|
||||
internalError,
|
||||
OpenViduMeetError
|
||||
} from '../models/error.model.js';
|
||||
import { RecordingHelper } from '../helpers/recording.helper.js';
|
||||
import { LoggerService } from './index.js';
|
||||
|
||||
@injectable()
|
||||
export class LiveKitService {
|
||||
|
||||
@ -1,4 +1,4 @@
|
||||
import { injectable } from '../config/dependency-injector.config.js';
|
||||
import { injectable } from 'inversify';
|
||||
import winston from 'winston';
|
||||
import { MEET_LOG_LEVEL } from '../environment.js';
|
||||
|
||||
|
||||
@ -1,9 +1,8 @@
|
||||
import { inject, injectable } from 'inversify';
|
||||
import ms from 'ms';
|
||||
import Redlock, { Lock } from 'redlock';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { RedisService } from './redis.service.js';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { MeetLock } from '../helpers/redis.helper.js';
|
||||
import { MeetLock } from '../helpers/index.js';
|
||||
import { LoggerService, RedisService } from './index.js';
|
||||
|
||||
export type RedisLock = Lock;
|
||||
@injectable()
|
||||
|
||||
@ -1,16 +1,15 @@
|
||||
import crypto from 'crypto';
|
||||
import { inject, injectable } from '../config/dependency-injector.config.js';
|
||||
import { Room } from 'livekit-server-sdk';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { MEET_API_KEY } from '../environment.js';
|
||||
import {
|
||||
MeetRecordingInfo,
|
||||
MeetWebhookEvent,
|
||||
MeetWebhookEventType,
|
||||
MeetRecordingInfo,
|
||||
MeetWebhookPayload,
|
||||
WebhookPreferences
|
||||
} from '@typings-ce';
|
||||
import { MeetStorageService } from './storage/storage.service.js';
|
||||
import crypto from 'crypto';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { Room } from 'livekit-server-sdk';
|
||||
import { MEET_API_KEY } from '../environment.js';
|
||||
import { LoggerService, MeetStorageService } from './index.js';
|
||||
|
||||
@injectable()
|
||||
export class OpenViduWebhookService {
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { injectable, inject } from 'inversify';
|
||||
import { ParticipantPermissions, ParticipantRole, ParticipantOptions } from '@typings-ce';
|
||||
import { ParticipantOptions, ParticipantPermissions, ParticipantRole } from '@typings-ce';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { ParticipantInfo } from 'livekit-server-sdk';
|
||||
import { errorParticipantAlreadyExists, errorParticipantNotFound } from '../models/index.js';
|
||||
import { errorParticipantAlreadyExists, errorParticipantNotFound } from '../models/error.model.js';
|
||||
import { LiveKitService, LoggerService, RoomService, TokenService } from './index.js';
|
||||
|
||||
@injectable()
|
||||
|
||||
@ -1,8 +1,12 @@
|
||||
import { MeetRecordingFilters, MeetRecordingInfo, MeetRecordingStatus } from '@typings-ce';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { EgressStatus, EncodedFileOutput, EncodedFileType, RoomCompositeOptions } from 'livekit-server-sdk';
|
||||
import { uid } from 'uid';
|
||||
import ms from 'ms';
|
||||
import { Readable } from 'stream';
|
||||
import { LiveKitService } from './livekit.service.js';
|
||||
import { uid } from 'uid';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
import { MEET_S3_BUCKET, MEET_S3_SUBBUCKET } from '../environment.js';
|
||||
import { MeetLock, OpenViduComponentsAdapterHelper, RecordingHelper, UtilsHelper } from '../helpers/index.js';
|
||||
import {
|
||||
errorRecordingAlreadyStarted,
|
||||
errorRecordingAlreadyStopped,
|
||||
@ -16,23 +20,20 @@ import {
|
||||
isErrorRecordingAlreadyStopped,
|
||||
isErrorRecordingCannotBeStoppedWhileStarting,
|
||||
isErrorRecordingNotFound,
|
||||
OpenViduMeetError
|
||||
} from '../models/error.model.js';
|
||||
import { S3Service } from './s3.service.js';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { MeetRecordingFilters, MeetRecordingInfo, MeetRecordingStatus } from '@typings-ce';
|
||||
import { RecordingHelper } from '../helpers/recording.helper.js';
|
||||
import { MEET_S3_BUCKET, MEET_S3_SUBBUCKET } from '../environment.js';
|
||||
import { RoomService } from './room.service.js';
|
||||
import { inject, injectable } from '../config/dependency-injector.config.js';
|
||||
import { MutexService, RedisLock } from './mutex.service.js';
|
||||
import { OpenViduComponentsAdapterHelper } from '../helpers/ov-components-adapter.helper.js';
|
||||
import { MeetLock } from '../helpers/redis.helper.js';
|
||||
import { IScheduledTask, TaskSchedulerService } from './task-scheduler.service.js';
|
||||
import { SystemEventService } from './system-event.service.js';
|
||||
import { SystemEventType } from '../models/system-event.model.js';
|
||||
import { UtilsHelper } from '../helpers/utils.helper.js';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
OpenViduMeetError,
|
||||
SystemEventType
|
||||
} from '../models/index.js';
|
||||
import {
|
||||
IScheduledTask,
|
||||
LiveKitService,
|
||||
LoggerService,
|
||||
MutexService,
|
||||
RedisLock,
|
||||
RoomService,
|
||||
S3Service,
|
||||
SystemEventService,
|
||||
TaskSchedulerService
|
||||
} from './index.js';
|
||||
|
||||
@injectable()
|
||||
export class RecordingService {
|
||||
|
||||
@ -1,22 +1,21 @@
|
||||
import { inject, injectable } from '../config/dependency-injector.config.js';
|
||||
import * as config from '../environment.js';
|
||||
import { EventEmitter } from 'events';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { Redis, RedisOptions, SentinelAddress } from 'ioredis';
|
||||
import ms from 'ms';
|
||||
import Redlock from 'redlock';
|
||||
import {
|
||||
checkModuleEnabled,
|
||||
REDIS_DB,
|
||||
REDIS_HOST,
|
||||
REDIS_PASSWORD,
|
||||
REDIS_PORT,
|
||||
REDIS_SENTINEL_MASTER_NAME,
|
||||
REDIS_SENTINEL_HOST_LIST,
|
||||
REDIS_SENTINEL_MASTER_NAME,
|
||||
REDIS_SENTINEL_PASSWORD,
|
||||
REDIS_USERNAME
|
||||
} from '../environment.js';
|
||||
import { internalError } from '../models/error.model.js';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { EventEmitter } from 'events';
|
||||
import Redlock from 'redlock';
|
||||
import ms from 'ms';
|
||||
import { SystemEventPayload } from '../models/system-event.model.js';
|
||||
import { internalError, SystemEventPayload } from '../models/index.js';
|
||||
import { LoggerService } from './index.js';
|
||||
|
||||
@injectable()
|
||||
export class RedisService extends EventEmitter {
|
||||
@ -249,7 +248,7 @@ export class RedisService extends EventEmitter {
|
||||
|
||||
private loadRedisConfig(): RedisOptions {
|
||||
// Check if openviduCall module is enabled. If not, exit the process
|
||||
config.checkModuleEnabled();
|
||||
checkModuleEnabled();
|
||||
|
||||
//Check if Redis Sentinel is configured
|
||||
if (REDIS_SENTINEL_HOST_LIST) {
|
||||
|
||||
@ -12,22 +12,21 @@ import {
|
||||
S3Client,
|
||||
S3ClientConfig
|
||||
} from '@aws-sdk/client-s3';
|
||||
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { Readable } from 'stream';
|
||||
import {
|
||||
MEET_S3_ACCESS_KEY,
|
||||
MEET_AWS_REGION,
|
||||
MEET_S3_ACCESS_KEY,
|
||||
MEET_S3_BUCKET,
|
||||
MEET_S3_SERVICE_ENDPOINT,
|
||||
MEET_S3_SECRET_KEY,
|
||||
MEET_S3_WITH_PATH_STYLE_ACCESS,
|
||||
MEET_S3_MAX_RETRIES_ATTEMPTS_ON_SAVE_ERROR,
|
||||
MEET_S3_INITIAL_RETRY_DELAY_MS,
|
||||
MEET_S3_SUBBUCKET
|
||||
MEET_S3_MAX_RETRIES_ATTEMPTS_ON_SAVE_ERROR,
|
||||
MEET_S3_SECRET_KEY,
|
||||
MEET_S3_SERVICE_ENDPOINT,
|
||||
MEET_S3_SUBBUCKET,
|
||||
MEET_S3_WITH_PATH_STYLE_ACCESS
|
||||
} from '../environment.js';
|
||||
import { errorS3NotAvailable, internalError } from '../models/error.model.js';
|
||||
import { Readable } from 'stream';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { inject, injectable } from '../config/dependency-injector.config.js';
|
||||
import { LoggerService } from './index.js';
|
||||
|
||||
@injectable()
|
||||
export class S3Service {
|
||||
|
||||
@ -1,13 +1,9 @@
|
||||
import { GlobalPreferences, MeetRoom } from '@typings-ce';
|
||||
import { StorageProvider } from '../storage.interface.js';
|
||||
import { S3Service } from '../../s3.service.js';
|
||||
import { LoggerService } from '../../logger.service.js';
|
||||
import { RedisService } from '../../redis.service.js';
|
||||
import { OpenViduMeetError } from '../../../models/error.model.js';
|
||||
import { inject, injectable } from '../../../config/dependency-injector.config.js';
|
||||
import { RedisKeyName } from '../../../models/redis.model.js';
|
||||
import { PutObjectCommandOutput } from '@aws-sdk/client-s3';
|
||||
import { GlobalPreferences, MeetRoom } from '@typings-ce';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import INTERNAL_CONFIG from '../../../config/internal-config.js';
|
||||
import { OpenViduMeetError, RedisKeyName } from '../../../models/index.js';
|
||||
import { LoggerService, RedisService, S3Service, StorageProvider } from '../../index.js';
|
||||
|
||||
/**
|
||||
* Implementation of the StorageProvider interface using AWS S3 for persistent storage
|
||||
|
||||
@ -1,8 +1,6 @@
|
||||
import { StorageProvider } from './storage.interface.js';
|
||||
import { S3StorageProvider } from './providers/s3-storage.provider.js';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { MEET_PREFERENCES_STORAGE_MODE } from '../../environment.js';
|
||||
import { inject, injectable } from '../../config/dependency-injector.config.js';
|
||||
import { LoggerService } from '../logger.service.js';
|
||||
import { LoggerService, S3StorageProvider, StorageProvider } from '../index.js';
|
||||
|
||||
/**
|
||||
* Factory class responsible for creating the appropriate storage provider based on configuration.
|
||||
|
||||
@ -1,14 +1,10 @@
|
||||
import { AuthMode, AuthType, GlobalPreferences, MeetRoom } from '@typings-ce';
|
||||
import { LoggerService } from '../logger.service.js';
|
||||
import { StorageProvider } from './storage.interface.js';
|
||||
import { StorageFactory } from './storage.factory.js';
|
||||
import { errorRoomNotFound, OpenViduMeetError } from '../../models/error.model.js';
|
||||
import { MEET_NAME_ID, MEET_SECRET, MEET_USER, MEET_WEBHOOK_ENABLED, MEET_WEBHOOK_URL } from '../../environment.js';
|
||||
import { injectable, inject } from '../../config/dependency-injector.config.js';
|
||||
import { PasswordHelper } from '../../helpers/password.helper.js';
|
||||
import { MutexService } from '../mutex.service.js';
|
||||
import { MeetLock } from '../../helpers/redis.helper.js';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import ms from 'ms';
|
||||
import { MEET_NAME_ID, MEET_SECRET, MEET_USER, MEET_WEBHOOK_ENABLED, MEET_WEBHOOK_URL } from '../../environment.js';
|
||||
import { MeetLock, PasswordHelper } from '../../helpers/index.js';
|
||||
import { errorRoomNotFound, OpenViduMeetError } from '../../models/error.model.js';
|
||||
import { LoggerService, MutexService, StorageFactory, StorageProvider } from '../index.js';
|
||||
|
||||
/**
|
||||
* A service for managing storage operations related to OpenVidu Meet rooms and preferences.
|
||||
@ -125,7 +121,6 @@ export class MeetStorageService<G extends GlobalPreferences = GlobalPreferences,
|
||||
return this.storageProvider.getArchivedRoomMetadata(roomId) as Promise<Partial<R> | null>;
|
||||
}
|
||||
|
||||
|
||||
async archiveRoomMetadata(roomId: string): Promise<void> {
|
||||
return this.storageProvider.archiveRoomMetadata(roomId);
|
||||
}
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { RedisService } from './redis.service.js';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { EventEmitter } from 'events';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { SystemEventPayload, SystemEventType } from '../models/system-event.model.js';
|
||||
import { LoggerService, RedisService } from './index.js';
|
||||
|
||||
@injectable()
|
||||
export class SystemEventService {
|
||||
|
||||
@ -1,11 +1,9 @@
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { LoggerService } from './index.js';
|
||||
import { SystemEventService } from './system-event.service.js';
|
||||
import { CronJob } from 'cron';
|
||||
import { MutexService } from './mutex.service.js';
|
||||
import { MeetLock } from '../helpers/redis.helper.js';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import ms from 'ms';
|
||||
import INTERNAL_CONFIG from '../config/internal-config.js';
|
||||
import { MeetLock } from '../helpers/index.js';
|
||||
import { LoggerService, MutexService, SystemEventService } from './index.js';
|
||||
|
||||
export type TaskType = 'cron' | 'timeout';
|
||||
|
||||
|
||||
@ -1,14 +1,14 @@
|
||||
import { ParticipantOptions, ParticipantPermissions, ParticipantRole, User } from '@typings-ce';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { AccessToken, AccessTokenOptions, ClaimGrants, TokenVerifier, VideoGrant } from 'livekit-server-sdk';
|
||||
import {
|
||||
MEET_ACCESS_TOKEN_EXPIRATION,
|
||||
MEET_REFRESH_TOKEN_EXPIRATION,
|
||||
LIVEKIT_API_KEY,
|
||||
LIVEKIT_API_SECRET,
|
||||
LIVEKIT_URL,
|
||||
MEET_ACCESS_TOKEN_EXPIRATION,
|
||||
MEET_PARTICIPANT_TOKEN_EXPIRATION,
|
||||
LIVEKIT_URL
|
||||
MEET_REFRESH_TOKEN_EXPIRATION
|
||||
} from '../environment.js';
|
||||
import { inject, injectable } from '../config/dependency-injector.config.js';
|
||||
import { AccessToken, AccessTokenOptions, ClaimGrants, TokenVerifier, VideoGrant } from 'livekit-server-sdk';
|
||||
import { ParticipantPermissions, ParticipantRole, ParticipantOptions, User } from '@typings-ce';
|
||||
import { LoggerService } from './index.js';
|
||||
|
||||
@injectable()
|
||||
|
||||
@ -1,8 +1,7 @@
|
||||
import { SingleUserAuth, SingleUserCredentials, User, UserRole } from '@typings-ce';
|
||||
import { inject, injectable } from 'inversify';
|
||||
import { MEET_ADMIN_USER } from '../environment.js';
|
||||
import { inject, injectable } from '../config/dependency-injector.config.js';
|
||||
import { UserRole, SingleUserAuth, User, SingleUserCredentials } from '@typings-ce';
|
||||
import { LoggerService } from './logger.service.js';
|
||||
import { MeetStorageService } from './storage/storage.service.js';
|
||||
import { LoggerService, MeetStorageService } from './index.js';
|
||||
|
||||
@injectable()
|
||||
export class UserService {
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import { fileURLToPath } from 'url';
|
||||
import path from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
const __dirname = path.dirname(__filename);
|
||||
|
||||
@ -1,11 +1,12 @@
|
||||
export * from './global-preferences.js';
|
||||
export * from './auth-preferences.js';
|
||||
export * from './room-preferences.js';
|
||||
export * from './participant.js';
|
||||
export * from './room.js';
|
||||
export * from './recording.model.js';
|
||||
export * from './webhook.model.js';
|
||||
export * from './user.js';
|
||||
export * from './global-preferences.js';
|
||||
|
||||
export * from './permissions/livekit-permissions.js';
|
||||
export * from './permissions/openvidu-permissions.js';
|
||||
export * from './participant.js';
|
||||
export * from './user.js';
|
||||
|
||||
export * from './room-preferences.js';
|
||||
export * from './room.js';
|
||||
export * from './recording.model.js';
|
||||
export * from './webhook.model.js';
|
||||
|
||||
@ -2,16 +2,16 @@
|
||||
* Defines OpenVidu-specific permissions for a participant.
|
||||
*/
|
||||
export interface OpenViduMeetPermissions {
|
||||
canPublishScreen: boolean; // Can publish screen sharing.
|
||||
canPublishScreen: boolean; // Can publish screen sharing.
|
||||
|
||||
// Permissions for recording
|
||||
canRecord: boolean; // Can start/stop recording the room.
|
||||
// canWatchRecording?: boolean; // Can watch the recording.
|
||||
// canDownloadRecording?: boolean; // Can download the recording.
|
||||
// canDeleteRecording?: boolean; // Can delete the recording.
|
||||
// Permissions for recording
|
||||
canRecord: boolean; // Can start/stop recording the room.
|
||||
// canWatchRecording?: boolean; // Can watch the recording.
|
||||
// canDownloadRecording?: boolean; // Can download the recording.
|
||||
// canDeleteRecording?: boolean; // Can delete the recording.
|
||||
|
||||
// Permissions for chat
|
||||
canChat: boolean; // Can send chat messages in the room.
|
||||
// Permissions for chat
|
||||
canChat: boolean; // Can send chat messages in the room.
|
||||
|
||||
canChangeVirtualBackground: boolean; // Can change the virtual background.
|
||||
canChangeVirtualBackground: boolean; // Can change the virtual background.
|
||||
}
|
||||
|
||||
@ -1,11 +1,11 @@
|
||||
export const enum MeetRecordingStatus {
|
||||
STARTING = 'STARTING',
|
||||
ACTIVE = 'ACTIVE',
|
||||
ENDING = 'ENDING',
|
||||
COMPLETE = 'COMPLETE',
|
||||
FAILED = 'FAILED',
|
||||
ABORTED = 'ABORTED',
|
||||
LIMIT_REACHED = 'LIMIT_REACHED',
|
||||
STARTING = 'STARTING',
|
||||
ACTIVE = 'ACTIVE',
|
||||
ENDING = 'ENDING',
|
||||
COMPLETE = 'COMPLETE',
|
||||
FAILED = 'FAILED',
|
||||
ABORTED = 'ABORTED',
|
||||
LIMIT_REACHED = 'LIMIT_REACHED'
|
||||
}
|
||||
|
||||
// export const enum MeetRecordingOutputMode {
|
||||
@ -16,23 +16,23 @@ export const enum MeetRecordingStatus {
|
||||
* Interface representing a recording
|
||||
*/
|
||||
export interface MeetRecordingInfo {
|
||||
recordingId: string;
|
||||
roomId: string;
|
||||
// outputMode: MeetRecordingOutputMode;
|
||||
status: MeetRecordingStatus;
|
||||
filename?: string;
|
||||
startDate?: number;
|
||||
endDate?: number;
|
||||
duration?: number;
|
||||
size?: number;
|
||||
errorCode?: number;
|
||||
error?: string;
|
||||
details?: string;
|
||||
recordingId: string;
|
||||
roomId: string;
|
||||
// outputMode: MeetRecordingOutputMode;
|
||||
status: MeetRecordingStatus;
|
||||
filename?: string;
|
||||
startDate?: number;
|
||||
endDate?: number;
|
||||
duration?: number;
|
||||
size?: number;
|
||||
errorCode?: number;
|
||||
error?: string;
|
||||
details?: string;
|
||||
}
|
||||
|
||||
export type MeetRecordingFilters = {
|
||||
maxItems?: number;
|
||||
nextPageToken?: string;
|
||||
roomId?: string;
|
||||
fields?: string;
|
||||
maxItems?: number;
|
||||
nextPageToken?: string;
|
||||
roomId?: string;
|
||||
fields?: string;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user