diff --git a/.prettierrc.js b/.prettierrc.js index c8c6a549..c43fd34d 100644 --- a/.prettierrc.js +++ b/.prettierrc.js @@ -1,6 +1,6 @@ module.exports = { semi: true, - trailingComma: 'all', + trailingComma: 'es5', // Trailing commas only where valid in ES5 (objects, arrays, not function arguments) singleQuote: true, printWidth: 120, tabWidth: 4, diff --git a/app/src/HtmlInjector.js b/app/src/HtmlInjector.js index 4982092c..fa92f78f 100644 --- a/app/src/HtmlInjector.js +++ b/app/src/HtmlInjector.js @@ -86,7 +86,7 @@ class HtmlInjector { // Replace placeholders with dynamic data (OG, TITLE, etc.) const modifiedHTML = this.cache[filePath].replace( /{{(OG_[A-Z_]+)}}/g, - (_, key) => this.injectData[key] || '', + (_, key) => this.injectData[key] || '' ); if (!res.headersSent) { diff --git a/app/src/Logger.js b/app/src/Logger.js index d90ffe5f..fe7f4881 100644 --- a/app/src/Logger.js +++ b/app/src/Logger.js @@ -32,7 +32,7 @@ module.exports = class Logger { console.debug( '[' + this.getDateTime() + '] [' + this.appName + '] ' + msg, util.inspect(op, options), - this.timeElapsedMs, + this.timeElapsedMs ); this.timeStart = Date.now(); } @@ -45,21 +45,21 @@ module.exports = class Logger { info(msg, op = '') { console.info( '[' + this.getDateTime() + '] [' + this.appName + '] ' + colors.green(msg), - util.inspect(op, options), + util.inspect(op, options) ); } warn(msg, op = '') { console.warn( '[' + this.getDateTime() + '] [' + this.appName + '] ' + colors.yellow(msg), - util.inspect(op, options), + util.inspect(op, options) ); } error(msg, op = '') { console.error( '[' + this.getDateTime() + '] [' + this.appName + '] ' + colors.red(msg), - util.inspect(op, options), + util.inspect(op, options) ); } diff --git a/app/src/Room.js b/app/src/Room.js index e999757e..cc9ffb39 100644 --- a/app/src/Room.js +++ b/app/src/Room.js @@ -225,7 +225,7 @@ module.exports = class Room { room, host = 'localhost', port = 1935, - inputVideoURL = 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4', + inputVideoURL = 'https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/BigBuckBunny.mp4' ) { if (!this.rtmp || !this.rtmp.enabled) { log.debug('[startRTMPfromURL] Server is not enabled or missing the config'); @@ -756,13 +756,13 @@ module.exports = class Room { error: error.message, }); throw new Error( - `Failed to create producer for peer ${peer.peer_name} with transport ID ${producerTransportId}`, + `Failed to create producer for peer ${peer.peer_name} with transport ID ${producerTransportId}` ); } if (!peerProducer) { throw new Error( - `Failed to create producer for peer ${peer_name} with ID ${producerTransportId} for peer ${socket_id}`, + `Failed to create producer for peer ${peer_name} with ID ${producerTransportId} for peer ${socket_id}` ); } @@ -819,7 +819,7 @@ module.exports = class Room { if (!this.router.canConsume({ producerId, rtpCapabilities })) { throw new Error( - `Cannot consume producer for peer ${peer_name} with ID ${producerId} type ${type}, router validation failed`, + `Cannot consume producer for peer ${peer_name} with ID ${producerId} type ${type}, router validation failed` ); } @@ -834,13 +834,13 @@ module.exports = class Room { error: error.message, }); throw new Error( - `Failed to create consumer for peer ${peer_name} with transport ID ${consumer_transport_id} and producer ID ${producerId} type ${type} for peer ${socket_id}`, + `Failed to create consumer for peer ${peer_name} with transport ID ${consumer_transport_id} and producer ID ${producerId} type ${type} for peer ${socket_id}` ); } if (!peerConsumer) { throw new Error( - `Consumer creation failed for peer ${peer_name} with transport ID ${consumer_transport_id} and producer ID ${producerId}`, + `Consumer creation failed for peer ${peer_name} with transport ID ${consumer_transport_id} and producer ID ${producerId}` ); } diff --git a/app/src/Server.js b/app/src/Server.js index ef734dee..b80ed20c 100644 --- a/app/src/Server.js +++ b/app/src/Server.js @@ -64,7 +64,7 @@ dev dependencies: { * @license For commercial or closed source, contact us at license.mirotalk@gmail.com or purchase directly via CodeCanyon * @license CodeCanyon: https://codecanyon.net/item/mirotalk-sfu-webrtc-realtime-video-conferences/40769970 * @author Miroslav Pejic - miroslav.pejic.85@gmail.com - * @version 1.8.54 + * @version 1.8.55 * */ @@ -427,7 +427,7 @@ function startServer() { res.setHeader('Content-Type', 'application/javascript'); } //... }, - }), + }) ); app.use(cors(corsOptions)); app.use(compression()); @@ -752,7 +752,7 @@ function startServer() { // 2. Protect room access with configuration check if (!OIDC.enabled && hostCfg.protected && !hostCfg.users_from_db) { const roomExists = hostCfg.users.some( - (user) => user.allowed_rooms && (user.allowed_rooms.includes(roomId) || roomList.has(roomId)), + (user) => user.allowed_rooms && (user.allowed_rooms.includes(roomId) || roomList.has(roomId)) ); log.debug('/join/:roomId exists from config allowed rooms', roomExists); return roomExists ? htmlInjector.injectHtml(views.room, res) : res.redirect('/whoAreYou/' + roomId); @@ -840,7 +840,7 @@ function startServer() { }); const isPresenter = Boolean( - hostCfg?.presenters?.join_first || hostCfg?.presenters?.list?.includes(username), + hostCfg?.presenters?.join_first || hostCfg?.presenters?.list?.includes(username) ); const token = encodeToken({ username: username, password: password, presenter: isPresenter }); @@ -1354,7 +1354,7 @@ function startServer() { if (restApi.allowed && !restApi.allowed.slack) { return res.end( - '`This endpoint has been disabled`. Please contact the administrator for further information.', + '`This endpoint has been disabled`. Please contact the administrator for further information.' ); } @@ -1514,7 +1514,7 @@ function startServer() { ╚══════╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝ ╚══════╝╚══════╝╚═╝ ╚═╝ ╚═══╝ ╚══════╝╚═╝ ╚═╝ started... `, - 'font-family:monospace', + 'font-family:monospace' ); if (config?.integrations?.ngrok?.enabled && config?.integrations?.ngrok?.authToken !== '') { @@ -1799,7 +1799,7 @@ function startServer() { if (room.isLobbyEnabled() && !isPresenter) { log.debug( - 'The user is currently waiting to join the room because the lobby is enabled, and they are not a presenter', + 'The user is currently waiting to join the room because the lobby is enabled, and they are not a presenter' ); room.broadCast(socket.id, 'roomLobby', { peer_id: peer_id, @@ -1965,7 +1965,7 @@ function startServer() { producerTransportId, rtpParameters, kind, - appData.mediaType, + appData.mediaType ); log.debug('Produce', { @@ -2346,7 +2346,7 @@ function startServer() { socket.room_id, socket.id, data.from_peer_name, - data.from_peer_uuid, + data.from_peer_uuid ); if (!isPresenter) return; } @@ -2692,7 +2692,7 @@ function startServer() { Authorization: `Bearer ${config?.integrations?.deepSeek?.apiKey}`, 'Content-Type': 'application/json', }, - }, + } ); // Extract the assistant's response @@ -2801,7 +2801,7 @@ function startServer() { 'content-type': 'application/json', 'x-api-key': config?.integrations?.videoAI?.apiKey, }, - }, + } ); const data = { response: response.data }; @@ -2831,7 +2831,7 @@ function startServer() { 'Content-Type': 'application/json', 'X-Api-Key': config?.integrations?.videoAI?.apiKey, }, - }, + } ); const data = { response: response.data.data }; @@ -2861,7 +2861,7 @@ function startServer() { 'Content-Type': 'application/json', 'X-Api-Key': config?.integrations?.videoAI?.apiKey, }, - }, + } ); const data = { response: response.data }; @@ -2894,7 +2894,7 @@ function startServer() { 'Content-Type': 'application/json', 'X-Api-Key': config?.integrations?.videoAI?.apiKey, }, - }, + } ); const data = { response: response.data }; @@ -2926,7 +2926,7 @@ function startServer() { 'Content-Type': 'application/json', 'X-Api-Key': config?.integrations?.videoAI?.apiKey, }, - }, + } ); const data = { response: response.data }; @@ -2986,7 +2986,7 @@ function startServer() { 'Content-Type': 'application/json', 'X-Api-Key': config?.integrations?.videoAI?.apiKey, }, - }, + } ); const data = { response: response.data }; @@ -3538,7 +3538,7 @@ function startServer() { }, { timeout: 5000, // Timeout set to 5 seconds (5000 milliseconds) - }, + } ); return response.data && response.data.message === true; } catch (error) { @@ -3669,7 +3669,7 @@ function startServer() { }, { timeout: 5000, // Timeout set to 5 seconds (5000 milliseconds) - }, + } ); log.debug('AXIOS roomExistsForUser', { room: room, exists: true }); return response.data && response.data.message === true; @@ -3696,7 +3696,7 @@ function startServer() { }, { timeout: 5000, // Timeout set to 5 seconds (5000 milliseconds) - }, + } ); const allowedRooms = response.data ? response.data.message : {}; log.debug('AXIOS getUserAllowedRooms', allowedRooms); @@ -3749,7 +3749,7 @@ function startServer() { }, { timeout: hostCfg.users_api_timeout || 5000, - }, + } ); if (response.data && (response.data === true || response.data.message === true)) { @@ -3791,7 +3791,7 @@ function startServer() { log.debug( isAllowed ? 'isRoomAllowedForUser - Room allowed' : 'isRoomAllowedForUser - Room not allowed', - { room, username }, + { room, username } ); return isAllowed; } diff --git a/app/src/ServerApi.js b/app/src/ServerApi.js index afb20204..65e6cc0c 100644 --- a/app/src/ServerApi.js +++ b/app/src/ServerApi.js @@ -52,7 +52,7 @@ module.exports = class ServerApi { hand: peer_hand, os: os_name ? `${os_name} ${os_version}` : '', browser: browser_name ? `${browser_name} ${browser_version}` : '', - }), + }) ); return { roomId: id, diff --git a/package.json b/package.json index 0a23b443..1b483867 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "mirotalksfu", - "version": "1.8.54", + "version": "1.8.55", "description": "WebRTC SFU browser-based video calls", "main": "Server.js", "scripts": { diff --git a/public/js/Brand.js b/public/js/Brand.js index 0de51834..02878b33 100644 --- a/public/js/Brand.js +++ b/public/js/Brand.js @@ -64,7 +64,7 @@ let BRAND = { }, about: { imageUrl: '../images/mirotalk-logo.gif', - title: 'WebRTC SFU v1.8.54', + title: 'WebRTC SFU v1.8.55', html: `