Skip to content

@sourceloop/video-conferencing-service / Exports / ChatSessionService

Class: ChatSessionService

Table of contents

Constructors

Properties

Methods

Constructors

constructor

new ChatSessionService(videoChatSessionRepository, videoChatProvider, generator, sessionAttendeesRepository, config)

Parameters

Name Type
videoChatSessionRepository VideoChatSessionRepository
videoChatProvider VideoChatInterface
generator MeetingLinkIdGenerator
sessionAttendeesRepository SessionAttendeesRepository
config IConfig

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:32

Properties

config

Private Readonly config: IConfig

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:42


generator

generator: MeetingLinkIdGenerator

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:38


sessionAttendeesRepository

Private Readonly sessionAttendeesRepository: SessionAttendeesRepository

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:40


videoChatProvider

Private Readonly videoChatProvider: VideoChatInterface

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:36


videoChatSessionRepository

Private Readonly videoChatSessionRepository: VideoChatSessionRepository

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:34

Methods

_validateExpireTime

Private _validateExpireTime(expireTime?): void

The function _validateExpireTime checks if the provided expire time is in the correct format and not in the past.

Parameters

Name Type Description
expireTime? Date The _validateExpireTime function is used to validate the expireTime parameter. It checks if the expireTime is provided and if it is a valid Date object. It also ensures that the expireTime is not in the past.

Returns

void

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:155


_validateMeetingLinkId

Private _validateMeetingLinkId(meetingLinkId): void

The function _validateMeetingLinkId checks if the provided meeting link ID is a valid non-empty string in TypeScript.

Parameters

Name Type Description
meetingLinkId string The meetingLinkId parameter is a string that represents the link to a meeting. The _validateMeetingLinkId function is used to check if the meetingLinkId is a valid string and not empty. If the meetingLinkId is not a valid string or is empty, it will throw

Returns

void

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:142


checkWebhookPayload

checkWebhookPayload(webhookPayload): Promise<void>

Parameters

Name Type
webhookPayload VonageSessionWebhookPayload

Returns

Promise<void>

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:253


editMeeting

editMeeting(meetingLinkId, body): Promise<void>

Parameters

Name Type
meetingLinkId string
body Partial<VideoChatSession>

Returns

Promise<void>

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:168


endSession

endSession(meetingLinkId): Promise<void>

Parameters

Name Type
meetingLinkId string

Returns

Promise<void>

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:224


getAttendeesList

getAttendeesList(meetingLinkId, active): Promise<SessionAttendees[]>

Parameters

Name Type
meetingLinkId string
active string

Returns

Promise<SessionAttendees[]>

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:278


getMeetingLink(meetingOptions): Promise<MeetingLink>

Parameters

Name Type
meetingOptions MeetingOptions

Returns

Promise<MeetingLink>

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:45


getMeetingToken

getMeetingToken(sessionOptions, meetingLinkId): Promise<SessionResponse>

The function getMeetingToken retrieves a session token for a meeting based on provided options and meeting link ID, with validation checks for session existence, expiration, and scheduled start time.

Parameters

Name Type Description
sessionOptions SessionOptions The sessionOptions parameter in the getMeetingToken function represents the options for the session, such as the configuration settings for the meeting. It is an object that contains various properties like expireTime, sessionId, etc., which are used to customize the session behavior.
meetingLinkId string The meetingLinkId parameter is a string that represents the unique identifier for a specific meeting or session. It is used to retrieve information about the meeting from the database and validate its status before generating a meeting token.

Returns

Promise<SessionResponse>

The getMeetingToken function returns a Promise that resolves to a SessionResponse object.

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:97


processStreamDestroyedEvent

processStreamDestroyedEvent(webhookPayload, sessionAttendeeDetail, updatedAttendee): Promise<void>

Parameters

Name Type
webhookPayload VonageSessionWebhookPayload
sessionAttendeeDetail SessionAttendees
updatedAttendee Partial<SessionAttendees>

Returns

Promise<void>

Defined in

services/video-conferencing-service/src/services/chat-session.service.ts:256