import { Provider , service } from '@loopback/core' ; import { ArchiveResponse , ArchiveResponseList , SessionResponse , } from '../../types' ; import { VonageVideoChat , VonageMeetingOptions , VonageMeetingResponse , VonageSessionOptions , VonageS3TargetOptions , VonageAzureTargetOptions , } from './types' ; import { VonageService } from './vonage.service' ; export class VonageProvider implements Provider < VonageVideoChat > { constructor ( @ service ( VonageService ) private readonly vonageService ) { } value ( ) { return { getMeetingLink : async ( meetingOptions ) : Promise < VonageMeetingResponse > => this . vonageService . getMeetingLink ( meetingOptions ) , getToken : async ( sessionId , options ) : Promise < SessionResponse > => this . vonageService . getToken ( sessionId , options ) , getArchives : async ( archiveId ) : Promise < ArchiveResponse | ArchiveResponseList > => this . vonageService . getArchives ( archiveId ) , deleteArchive : async ( archiveId ) => { await this . vonageService . deleteArchive ( archiveId ) ; } , setUploadTarget : async ( storageConfig ) : Promise < void > => { await this . vonageService . setUploadTarget ( storageConfig ) ; } , } ; } }