import { getAttendeeList , GetAttendeeListRequest , getUserNameByAttendeeId , GetUserNameByAttendeeIdRequest , joinMeeting , JoinMeetingRequest } from "./attendee" ; import { createMeeting , endMeeting , EndMeetingRequest , GetMeetingInfoRequest , getMeetingInfo , CreateMeetingRequest } from "./meeting" ; import { startTranscribe , StartTranscribeRequest , stopTranscribe , StopTranscribeRequest } from "./operations" ; type GenerateOnetimeCodeResponse = { code : string ; ontimecodeExpireDate : number ; uuid : string ; } ; type SinginWithOnetimeCodeRequestResponse = { uuid : string ; codes : string [ ] ; status : string ; meetingName : string ; attendeeId : string ; } ; type SinginWithOnetimeCodeResponse = { result : boolean ; idToken ? : string ; accessToken ? : string ; attendeeName ? : string ; } ; type StartManagerResponse = { code : string ; uuid : string ; meetingName : string ; attendeeId : string ; restAPIEndpoint : string ; url : string ; bucketArn : string ; bucketName : string ; } ; type GetManagerInfoRequest = { code : string ; publicIp : string ; lastStatus : string ; desiredStatus : string ; } ; export type RestApiClientContext = { baseUrl : string ; idToken : string ; accessToken : string ; refreshToken : string ; codeToAccess ? : string ; } ; export class RestApiClient { private context : RestApiClientContext ; constructor ( baseUrl ) { this . context = { baseUrl , idToken : "" , accessToken : "" , refreshToken : "" } ; } init ( idToken , accessToken , refreshToken ) { this . context = { ... this . context , idToken , accessToken , refreshToken } ; } initWithCode ( codeToAccess ) { this . context = { ... this . context , codeToAccess } ; } createMeeting = async ( params ) => { return createMeeting ( params , this . context ! ) ; } ; endMeeting = async ( params ) => { return endMeeting ( params , this . context ! ) ; } ; getMeetingInfo = async ( params ) => { return getMeetingInfo ( params , this . context ! ) ; } ; joinMeeting = async ( params ) => { return joinMeeting ( params , this . context ! ) ; } ; getUserNameByAttendeeId = async ( params ) => { return getUserNameByAttendeeId ( params , this . context ! ) ; } ; getAttendeeList = async ( params ) => { getAttendeeList ( params , this . context ! ) ; } ; startTranscribe = async ( params ) => { startTranscribe ( params , this . context ) ; } ; stopTranscribe = async ( params ) => { stopTranscribe ( params , this . context ) ; } ; }