frontend: rename ParticipantTokenService to ParticipantService
This commit is contained in:
parent
083350b402
commit
5f672c86b3
@ -5,7 +5,7 @@ import {
|
|||||||
AuthService,
|
AuthService,
|
||||||
GlobalPreferencesService,
|
GlobalPreferencesService,
|
||||||
NavigationService,
|
NavigationService,
|
||||||
ParticipantTokenService,
|
ParticipantService,
|
||||||
RecordingManagerService,
|
RecordingManagerService,
|
||||||
RoomService
|
RoomService
|
||||||
} from '@lib/services';
|
} from '@lib/services';
|
||||||
@ -55,7 +55,7 @@ export const checkParticipantRoleAndAuthGuard: CanActivateFn = async (
|
|||||||
const authService = inject(AuthService);
|
const authService = inject(AuthService);
|
||||||
const preferencesService = inject(GlobalPreferencesService);
|
const preferencesService = inject(GlobalPreferencesService);
|
||||||
const roomService = inject(RoomService);
|
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
|
// Get the role that the participant will have in the room based on the room ID and secret
|
||||||
let participantRole: ParticipantRole;
|
let participantRole: ParticipantRole;
|
||||||
|
|||||||
@ -1,13 +1,13 @@
|
|||||||
import { inject } from '@angular/core';
|
import { inject } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, CanActivateFn } from '@angular/router';
|
import { ActivatedRouteSnapshot, CanActivateFn } from '@angular/router';
|
||||||
import { ErrorReason } from '@lib/models';
|
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';
|
import { WebComponentProperty } from '@lib/typings/ce/webcomponent/properties.model';
|
||||||
|
|
||||||
export const extractRoomQueryParamsGuard: CanActivateFn = (route: ActivatedRouteSnapshot) => {
|
export const extractRoomQueryParamsGuard: CanActivateFn = (route: ActivatedRouteSnapshot) => {
|
||||||
const navigationService = inject(NavigationService);
|
const navigationService = inject(NavigationService);
|
||||||
const roomService = inject(RoomService);
|
const roomService = inject(RoomService);
|
||||||
const participantService = inject(ParticipantTokenService);
|
const participantService = inject(ParticipantService);
|
||||||
const sessionStorageService = inject(SessionStorageService);
|
const sessionStorageService = inject(SessionStorageService);
|
||||||
|
|
||||||
const { roomId, participantName, secret, leaveRedirectUrl, showOnlyRecordings } = extractParams(route);
|
const { roomId, participantName, secret, leaveRedirectUrl, showOnlyRecordings } = extractParams(route);
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import { inject } from '@angular/core';
|
import { inject } from '@angular/core';
|
||||||
import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router';
|
import { ActivatedRouteSnapshot, CanActivateFn, RouterStateSnapshot } from '@angular/router';
|
||||||
import { ErrorReason } from '@lib/models';
|
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.
|
* 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
|
_state: RouterStateSnapshot
|
||||||
) => {
|
) => {
|
||||||
const roomService = inject(RoomService);
|
const roomService = inject(RoomService);
|
||||||
const participantTokenService = inject(ParticipantTokenService);
|
const participantTokenService = inject(ParticipantService);
|
||||||
const navigationService = inject(NavigationService);
|
const navigationService = inject(NavigationService);
|
||||||
|
|
||||||
const roomId = roomService.getRoomId();
|
const roomId = roomService.getRoomId();
|
||||||
|
|||||||
@ -1,14 +1,14 @@
|
|||||||
import { HttpErrorResponse, HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http';
|
import { HttpErrorResponse, HttpEvent, HttpHandlerFn, HttpInterceptorFn, HttpRequest } from '@angular/common/http';
|
||||||
import { inject } from '@angular/core';
|
import { inject } from '@angular/core';
|
||||||
import { Router } from '@angular/router';
|
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';
|
import { catchError, from, Observable, switchMap } from 'rxjs';
|
||||||
|
|
||||||
export const httpInterceptor: HttpInterceptorFn = (req: HttpRequest<unknown>, next: HttpHandlerFn) => {
|
export const httpInterceptor: HttpInterceptorFn = (req: HttpRequest<unknown>, next: HttpHandlerFn) => {
|
||||||
const router: Router = inject(Router);
|
const router: Router = inject(Router);
|
||||||
const authService: AuthService = inject(AuthService);
|
const authService: AuthService = inject(AuthService);
|
||||||
const roomService = inject(RoomService);
|
const roomService = inject(RoomService);
|
||||||
const participantTokenService = inject(ParticipantTokenService);
|
const participantTokenService = inject(ParticipantService);
|
||||||
const recordingService = inject(RecordingManagerService);
|
const recordingService = inject(RecordingManagerService);
|
||||||
|
|
||||||
const pageUrl = router.getCurrentNavigation()?.finalUrl?.toString() || router.url;
|
const pageUrl = router.getCurrentNavigation()?.finalUrl?.toString() || router.url;
|
||||||
|
|||||||
@ -22,7 +22,7 @@ import {
|
|||||||
MeetingService,
|
MeetingService,
|
||||||
NavigationService,
|
NavigationService,
|
||||||
NotificationService,
|
NotificationService,
|
||||||
ParticipantTokenService,
|
ParticipantService,
|
||||||
RecordingManagerService,
|
RecordingManagerService,
|
||||||
RoomService,
|
RoomService,
|
||||||
SessionStorageService,
|
SessionStorageService,
|
||||||
@ -31,7 +31,6 @@ import {
|
|||||||
import {
|
import {
|
||||||
LeftEventReason,
|
LeftEventReason,
|
||||||
MeetRoom,
|
MeetRoom,
|
||||||
MeetRoomPreferences,
|
|
||||||
ParticipantRole,
|
ParticipantRole,
|
||||||
WebComponentEvent,
|
WebComponentEvent,
|
||||||
WebComponentOutboundEventMessage
|
WebComponentOutboundEventMessage
|
||||||
@ -43,13 +42,13 @@ import {
|
|||||||
} from '@lib/typings/ce/event.model';
|
} from '@lib/typings/ce/event.model';
|
||||||
import {
|
import {
|
||||||
ApiDirectiveModule,
|
ApiDirectiveModule,
|
||||||
|
ParticipantService as ComponentParticipantService,
|
||||||
DataPacket_Kind,
|
DataPacket_Kind,
|
||||||
OpenViduComponentsUiModule,
|
OpenViduComponentsUiModule,
|
||||||
OpenViduService,
|
OpenViduService,
|
||||||
ParticipantLeftEvent,
|
ParticipantLeftEvent,
|
||||||
ParticipantLeftReason,
|
ParticipantLeftReason,
|
||||||
ParticipantModel,
|
ParticipantModel,
|
||||||
ParticipantService,
|
|
||||||
RecordingStartRequestedEvent,
|
RecordingStartRequestedEvent,
|
||||||
RecordingStopRequestedEvent,
|
RecordingStopRequestedEvent,
|
||||||
RemoteParticipant,
|
RemoteParticipant,
|
||||||
@ -108,14 +107,14 @@ export class MeetingComponent implements OnInit {
|
|||||||
constructor(
|
constructor(
|
||||||
protected route: ActivatedRoute,
|
protected route: ActivatedRoute,
|
||||||
protected navigationService: NavigationService,
|
protected navigationService: NavigationService,
|
||||||
protected participantTokenService: ParticipantTokenService,
|
protected participantTokenService: ParticipantService,
|
||||||
protected recManagerService: RecordingManagerService,
|
protected recManagerService: RecordingManagerService,
|
||||||
protected authService: AuthService,
|
protected authService: AuthService,
|
||||||
protected roomService: RoomService,
|
protected roomService: RoomService,
|
||||||
protected meetingService: MeetingService,
|
protected meetingService: MeetingService,
|
||||||
protected openviduService: OpenViduService,
|
protected openviduService: OpenViduService,
|
||||||
protected participantService: ParticipantTokenService,
|
protected participantService: ParticipantService,
|
||||||
protected componentParticipantService: ParticipantService,
|
protected componentParticipantService: ComponentParticipantService,
|
||||||
protected appDataService: AppDataService,
|
protected appDataService: AppDataService,
|
||||||
protected wcManagerService: WebComponentManagerService,
|
protected wcManagerService: WebComponentManagerService,
|
||||||
protected sessionStorageService: SessionStorageService,
|
protected sessionStorageService: SessionStorageService,
|
||||||
|
|||||||
@ -3,7 +3,7 @@ export * from './http.service';
|
|||||||
export * from './auth.service';
|
export * from './auth.service';
|
||||||
export * from './global-preferences.service';
|
export * from './global-preferences.service';
|
||||||
export * from './room.service';
|
export * from './room.service';
|
||||||
export * from './participant-token.service';
|
export * from './participant.service';
|
||||||
export * from './meeting.service';
|
export * from './meeting.service';
|
||||||
export * from './feature-configuration.service';
|
export * from './feature-configuration.service';
|
||||||
export * from './recording-manager.service';
|
export * from './recording-manager.service';
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { HttpService, ParticipantTokenService } from '@lib/services';
|
import { HttpService, ParticipantService } from '@lib/services';
|
||||||
import { LoggerService } from 'openvidu-components-angular';
|
import { LoggerService } from 'openvidu-components-angular';
|
||||||
|
|
||||||
@Injectable({
|
@Injectable({
|
||||||
@ -13,7 +13,7 @@ export class MeetingService {
|
|||||||
constructor(
|
constructor(
|
||||||
protected loggerService: LoggerService,
|
protected loggerService: LoggerService,
|
||||||
protected httpService: HttpService,
|
protected httpService: HttpService,
|
||||||
protected participantService: ParticipantTokenService
|
protected participantService: ParticipantService
|
||||||
) {
|
) {
|
||||||
this.log = this.loggerService.get('OpenVidu Meet - MeetingService');
|
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 participantId - The unique identifier of the participant whose role is to be changed
|
||||||
* @param newRole - The new role to be assigned to the participant
|
* @param newRole - The new role to be assigned to the participant
|
||||||
*/
|
*/
|
||||||
async changeParticipantRole(
|
async changeParticipantRole(roomId: string, participantId: string, newRole: string): Promise<void> {
|
||||||
roomId: string,
|
|
||||||
participantId: string,
|
|
||||||
newRole: string
|
|
||||||
): Promise<void> {
|
|
||||||
const path = `${this.MEETINGS_API}/${roomId}/participants/${participantId}`;
|
const path = `${this.MEETINGS_API}/${roomId}/participants/${participantId}`;
|
||||||
const headers = this.participantService.getParticipantRoleHeader();
|
const headers = this.participantService.getParticipantRoleHeader();
|
||||||
const body = { role: newRole };
|
const body = { role: newRole };
|
||||||
|
|||||||
@ -8,7 +8,7 @@ import { LoggerService } from 'openvidu-components-angular';
|
|||||||
@Injectable({
|
@Injectable({
|
||||||
providedIn: 'root'
|
providedIn: 'root'
|
||||||
})
|
})
|
||||||
export class ParticipantTokenService {
|
export class ParticipantService {
|
||||||
protected readonly PARTICIPANTS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/participants`;
|
protected readonly PARTICIPANTS_API = `${HttpService.INTERNAL_API_PATH_PREFIX}/participants`;
|
||||||
|
|
||||||
protected participantName?: string;
|
protected participantName?: string;
|
||||||
@ -1,7 +1,7 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MatDialog } from '@angular/material/dialog';
|
import { MatDialog } from '@angular/material/dialog';
|
||||||
import { ShareRecordingDialogComponent } from '@lib/components';
|
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 { MeetRecordingFilters, MeetRecordingInfo, RecordingPermissions } from '@lib/typings/ce';
|
||||||
import { getValidDecodedToken } from '@lib/utils';
|
import { getValidDecodedToken } from '@lib/utils';
|
||||||
import { LoggerService } from 'openvidu-components-angular';
|
import { LoggerService } from 'openvidu-components-angular';
|
||||||
@ -23,7 +23,7 @@ export class RecordingManagerService {
|
|||||||
constructor(
|
constructor(
|
||||||
protected loggerService: LoggerService,
|
protected loggerService: LoggerService,
|
||||||
private httpService: HttpService,
|
private httpService: HttpService,
|
||||||
protected participantService: ParticipantTokenService,
|
protected participantService: ParticipantService,
|
||||||
protected authService: AuthService,
|
protected authService: AuthService,
|
||||||
protected dialog: MatDialog
|
protected dialog: MatDialog
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,10 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import {
|
import { FeatureConfigurationService, HttpService, ParticipantService, SessionStorageService } from '@lib/services';
|
||||||
FeatureConfigurationService,
|
|
||||||
HttpService,
|
|
||||||
ParticipantTokenService,
|
|
||||||
SessionStorageService
|
|
||||||
} from '@lib/services';
|
|
||||||
import {
|
import {
|
||||||
MeetRoom,
|
MeetRoom,
|
||||||
MeetRoomFilters,
|
MeetRoomFilters,
|
||||||
@ -30,7 +25,7 @@ export class RoomService {
|
|||||||
constructor(
|
constructor(
|
||||||
protected loggerService: LoggerService,
|
protected loggerService: LoggerService,
|
||||||
protected httpService: HttpService,
|
protected httpService: HttpService,
|
||||||
protected participantService: ParticipantTokenService,
|
protected participantService: ParticipantService,
|
||||||
protected featureConfService: FeatureConfigurationService,
|
protected featureConfService: FeatureConfigurationService,
|
||||||
protected sessionStorageService: SessionStorageService
|
protected sessionStorageService: SessionStorageService
|
||||||
) {
|
) {
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
import { Injectable } from '@angular/core';
|
import { Injectable } from '@angular/core';
|
||||||
import { MeetingService, ParticipantTokenService, RoomService } from '@lib/services';
|
import { MeetingService, ParticipantService, RoomService } from '@lib/services';
|
||||||
import {
|
import {
|
||||||
WebComponentCommand,
|
WebComponentCommand,
|
||||||
WebComponentEvent,
|
WebComponentEvent,
|
||||||
@ -26,7 +26,7 @@ export class WebComponentManagerService {
|
|||||||
|
|
||||||
constructor(
|
constructor(
|
||||||
protected loggerService: LoggerService,
|
protected loggerService: LoggerService,
|
||||||
protected participantService: ParticipantTokenService,
|
protected participantService: ParticipantService,
|
||||||
protected openviduService: OpenViduService,
|
protected openviduService: OpenViduService,
|
||||||
protected roomService: RoomService,
|
protected roomService: RoomService,
|
||||||
protected meetingService: MeetingService
|
protected meetingService: MeetingService
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user