From 5f672c86b311d488ff307c6996b92ca310b0ff3c Mon Sep 17 00:00:00 2001 From: juancarmore Date: Wed, 13 Aug 2025 17:35:06 +0200 Subject: [PATCH] frontend: rename ParticipantTokenService to ParticipantService --- .../src/lib/guards/auth.guard.ts | 4 ++-- .../src/lib/guards/extract-query-params.guard.ts | 4 ++-- .../src/lib/guards/validate-access.guard.ts | 4 ++-- .../src/lib/interceptors/http.interceptor.ts | 4 ++-- .../src/lib/pages/meeting/meeting.component.ts | 11 +++++------ .../shared-meet-components/src/lib/services/index.ts | 2 +- .../src/lib/services/meeting.service.ts | 10 +++------- ...cipant-token.service.ts => participant.service.ts} | 2 +- .../src/lib/services/recording-manager.service.ts | 4 ++-- .../src/lib/services/room.service.ts | 9 ++------- .../src/lib/services/webcomponent-manager.service.ts | 4 ++-- 11 files changed, 24 insertions(+), 34 deletions(-) rename frontend/projects/shared-meet-components/src/lib/services/{participant-token.service.ts => participant.service.ts} (99%) diff --git a/frontend/projects/shared-meet-components/src/lib/guards/auth.guard.ts b/frontend/projects/shared-meet-components/src/lib/guards/auth.guard.ts index 36586d9..91e5cfd 100644 --- a/frontend/projects/shared-meet-components/src/lib/guards/auth.guard.ts +++ b/frontend/projects/shared-meet-components/src/lib/guards/auth.guard.ts @@ -5,7 +5,7 @@ import { AuthService, GlobalPreferencesService, NavigationService, - ParticipantTokenService, + ParticipantService, RecordingManagerService, RoomService } from '@lib/services'; @@ -55,7 +55,7 @@ export const checkParticipantRoleAndAuthGuard: CanActivateFn = async ( const authService = inject(AuthService); const preferencesService = inject(GlobalPreferencesService); const roomService = inject(RoomService); - const participantService = inject(ParticipantTokenService); + const participantService = inject(ParticipantService); // Get the role that the participant will have in the room based on the room ID and secret let participantRole: ParticipantRole; diff --git a/frontend/projects/shared-meet-components/src/lib/guards/extract-query-params.guard.ts b/frontend/projects/shared-meet-components/src/lib/guards/extract-query-params.guard.ts index 99738e2..8efed55 100644 --- a/frontend/projects/shared-meet-components/src/lib/guards/extract-query-params.guard.ts +++ b/frontend/projects/shared-meet-components/src/lib/guards/extract-query-params.guard.ts @@ -1,13 +1,13 @@ import { inject } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivateFn } from '@angular/router'; import { ErrorReason } from '@lib/models'; -import { NavigationService, ParticipantTokenService, RoomService, SessionStorageService } from '@lib/services'; +import { NavigationService, ParticipantService, RoomService, SessionStorageService } from '@lib/services'; import { WebComponentProperty } from '@lib/typings/ce/webcomponent/properties.model'; export const extractRoomQueryParamsGuard: CanActivateFn = (route: ActivatedRouteSnapshot) => { const navigationService = inject(NavigationService); const roomService = inject(RoomService); - const participantService = inject(ParticipantTokenService); + const participantService = inject(ParticipantService); const sessionStorageService = inject(SessionStorageService); const { roomId, participantName, secret, leaveRedirectUrl, showOnlyRecordings } = extractParams(route); diff --git a/frontend/projects/shared-meet-components/src/lib/guards/validate-access.guard.ts b/frontend/projects/shared-meet-components/src/lib/guards/validate-access.guard.ts index 740ee66..5d258c8 100644 --- a/frontend/projects/shared-meet-components/src/lib/guards/validate-access.guard.ts +++ b/frontend/projects/shared-meet-components/src/lib/guards/validate-access.guard.ts @@ -1,7 +1,7 @@ import { inject } from '@angular/core'; import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router'; import { ErrorReason } from '@lib/models'; -import { NavigationService, ParticipantTokenService, RecordingManagerService, RoomService } from '@lib/services'; +import { NavigationService, ParticipantService, RecordingManagerService, RoomService } from '@lib/services'; /** * Guard to validate the access to recordings of a room by generating a recording token. @@ -53,7 +53,7 @@ export const validateRoomAccessGuard: CanActivateFn = async ( _state: RouterStateSnapshot ) => { const roomService = inject(RoomService); - const participantTokenService = inject(ParticipantTokenService); + const participantTokenService = inject(ParticipantService); const navigationService = inject(NavigationService); const roomId = roomService.getRoomId(); diff --git a/frontend/projects/shared-meet-components/src/lib/interceptors/http.interceptor.ts b/frontend/projects/shared-meet-components/src/lib/interceptors/http.interceptor.ts index 83253ff..f26bc68 100644 --- a/frontend/projects/shared-meet-components/src/lib/interceptors/http.interceptor.ts +++ b/frontend/projects/shared-meet-components/src/lib/interceptors/http.interceptor.ts @@ -1,14 +1,14 @@ import { HttpErrorResponse, HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http'; import { inject } from '@angular/core'; import { Router } from '@angular/router'; -import { AuthService, ParticipantTokenService, RecordingManagerService, RoomService } from '@lib/services'; +import { AuthService, ParticipantService, RecordingManagerService, RoomService } from '@lib/services'; import { catchError, from, Observable, switchMap } from 'rxjs'; export const httpInterceptor: HttpInterceptorFn = (req: HttpRequest, next: HttpHandlerFn) => { const router: Router = inject(Router); const authService: AuthService = inject(AuthService); const roomService = inject(RoomService); - const participantTokenService = inject(ParticipantTokenService); + const participantTokenService = inject(ParticipantService); const recordingService = inject(RecordingManagerService); const pageUrl = router.getCurrentNavigation()?.finalUrl?.toString() || router.url; diff --git a/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts b/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts index 0c18674..1ea2379 100644 --- a/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts +++ b/frontend/projects/shared-meet-components/src/lib/pages/meeting/meeting.component.ts @@ -22,7 +22,7 @@ import { MeetingService, NavigationService, NotificationService, - ParticipantTokenService, + ParticipantService, RecordingManagerService, RoomService, SessionStorageService, @@ -31,7 +31,6 @@ import { import { LeftEventReason, MeetRoom, - MeetRoomPreferences, ParticipantRole, WebComponentEvent, WebComponentOutboundEventMessage @@ -43,13 +42,13 @@ import { } from '@lib/typings/ce/event.model'; import { ApiDirectiveModule, + ParticipantService as ComponentParticipantService, DataPacket_Kind, OpenViduComponentsUiModule, OpenViduService, ParticipantLeftEvent, ParticipantLeftReason, ParticipantModel, - ParticipantService, RecordingStartRequestedEvent, RecordingStopRequestedEvent, RemoteParticipant, @@ -108,14 +107,14 @@ export class MeetingComponent implements OnInit { constructor( protected route: ActivatedRoute, protected navigationService: NavigationService, - protected participantTokenService: ParticipantTokenService, + protected participantTokenService: ParticipantService, protected recManagerService: RecordingManagerService, protected authService: AuthService, protected roomService: RoomService, protected meetingService: MeetingService, protected openviduService: OpenViduService, - protected participantService: ParticipantTokenService, - protected componentParticipantService: ParticipantService, + protected participantService: ParticipantService, + protected componentParticipantService: ComponentParticipantService, protected appDataService: AppDataService, protected wcManagerService: WebComponentManagerService, protected sessionStorageService: SessionStorageService, diff --git a/frontend/projects/shared-meet-components/src/lib/services/index.ts b/frontend/projects/shared-meet-components/src/lib/services/index.ts index bc4aa17..0d62197 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/index.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/index.ts @@ -3,7 +3,7 @@ export * from './http.service'; export * from './auth.service'; export * from './global-preferences.service'; export * from './room.service'; -export * from './participant-token.service'; +export * from './participant.service'; export * from './meeting.service'; export * from './feature-configuration.service'; export * from './recording-manager.service'; diff --git a/frontend/projects/shared-meet-components/src/lib/services/meeting.service.ts b/frontend/projects/shared-meet-components/src/lib/services/meeting.service.ts index fedf35f..57b41f9 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/meeting.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/meeting.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { HttpService, ParticipantTokenService } from '@lib/services'; +import { HttpService, ParticipantService } from '@lib/services'; import { LoggerService } from 'openvidu-components-angular'; @Injectable({ @@ -13,7 +13,7 @@ export class MeetingService { constructor( protected loggerService: LoggerService, protected httpService: HttpService, - protected participantService: ParticipantTokenService + protected participantService: ParticipantService ) { this.log = this.loggerService.get('OpenVidu Meet - MeetingService'); } @@ -51,11 +51,7 @@ export class MeetingService { * @param participantId - The unique identifier of the participant whose role is to be changed * @param newRole - The new role to be assigned to the participant */ - async changeParticipantRole( - roomId: string, - participantId: string, - newRole: string - ): Promise { + async changeParticipantRole(roomId: string, participantId: string, newRole: string): Promise { const path = `${this.MEETINGS_API}/${roomId}/participants/${participantId}`; const headers = this.participantService.getParticipantRoleHeader(); const body = { role: newRole }; diff --git a/frontend/projects/shared-meet-components/src/lib/services/participant-token.service.ts b/frontend/projects/shared-meet-components/src/lib/services/participant.service.ts similarity index 99% rename from frontend/projects/shared-meet-components/src/lib/services/participant-token.service.ts rename to frontend/projects/shared-meet-components/src/lib/services/participant.service.ts index 94eeb89..5ad7813 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/participant-token.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/participant.service.ts @@ -8,7 +8,7 @@ import { LoggerService } from 'openvidu-components-angular'; @Injectable({ providedIn: 'root' }) -export class ParticipantTokenService { +export class ParticipantService { protected readonly PARTICIPANTS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/participants`; protected participantName?: string; diff --git a/frontend/projects/shared-meet-components/src/lib/services/recording-manager.service.ts b/frontend/projects/shared-meet-components/src/lib/services/recording-manager.service.ts index 85e465f..fcb8b9a 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/recording-manager.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/recording-manager.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@angular/core'; import { MatDialog } from '@angular/material/dialog'; import { ShareRecordingDialogComponent } from '@lib/components'; -import { AuthService, HttpService, ParticipantTokenService } from '@lib/services'; +import { AuthService, HttpService, ParticipantService } from '@lib/services'; import { MeetRecordingFilters, MeetRecordingInfo, RecordingPermissions } from '@lib/typings/ce'; import { getValidDecodedToken } from '@lib/utils'; import { LoggerService } from 'openvidu-components-angular'; @@ -23,7 +23,7 @@ export class RecordingManagerService { constructor( protected loggerService: LoggerService, private httpService: HttpService, - protected participantService: ParticipantTokenService, + protected participantService: ParticipantService, protected authService: AuthService, protected dialog: MatDialog ) { diff --git a/frontend/projects/shared-meet-components/src/lib/services/room.service.ts b/frontend/projects/shared-meet-components/src/lib/services/room.service.ts index f2ba4a8..d1710d2 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/room.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/room.service.ts @@ -1,10 +1,5 @@ import { Injectable } from '@angular/core'; -import { - FeatureConfigurationService, - HttpService, - ParticipantTokenService, - SessionStorageService -} from '@lib/services'; +import { FeatureConfigurationService, HttpService, ParticipantService, SessionStorageService } from '@lib/services'; import { MeetRoom, MeetRoomFilters, @@ -30,7 +25,7 @@ export class RoomService { constructor( protected loggerService: LoggerService, protected httpService: HttpService, - protected participantService: ParticipantTokenService, + protected participantService: ParticipantService, protected featureConfService: FeatureConfigurationService, protected sessionStorageService: SessionStorageService ) { diff --git a/frontend/projects/shared-meet-components/src/lib/services/webcomponent-manager.service.ts b/frontend/projects/shared-meet-components/src/lib/services/webcomponent-manager.service.ts index bd226d5..5644b98 100644 --- a/frontend/projects/shared-meet-components/src/lib/services/webcomponent-manager.service.ts +++ b/frontend/projects/shared-meet-components/src/lib/services/webcomponent-manager.service.ts @@ -1,5 +1,5 @@ import { Injectable } from '@angular/core'; -import { MeetingService, ParticipantTokenService, RoomService } from '@lib/services'; +import { MeetingService, ParticipantService, RoomService } from '@lib/services'; import { WebComponentCommand, WebComponentEvent, @@ -26,7 +26,7 @@ export class WebComponentManagerService { constructor( protected loggerService: LoggerService, - protected participantService: ParticipantTokenService, + protected participantService: ParticipantService, protected openviduService: OpenViduService, protected roomService: RoomService, protected meetingService: MeetingService