/** * @module Webinar */ import { BehaviorSubject, Subscription } from "rxjs"; import { Contact } from '../../models/contact.model'; import { Webinar, WebinarCloneParams } from "../../models/webinar.model"; import { Service } from "../../services/service"; import { WebinarConferenceService } from "../../services/webinars/webinarConference.service"; import { WebinarParticipantsService } from "../../services/webinars/webinarParticipants.service"; import { WebinarSpeakersService } from "../../services/webinars/webinarSpeakers.service"; import { BubbleServiceRB } from '../../services/bubbles/bubble.service'; import type { ConversationServiceRB } from "../../services/conversation/conversation.service"; export declare const WEBINAR_SVC = "WebinarService"; export interface WebinarService { speakers: WebinarSpeakersService; /** * Create an empty webinar instance */ createWebinarInstance(): Webinar; /** * This async method has to be call to start the webinar service */ start(): Promise; /** * This async method waits until the webinar service is fully started */ waitUntilStart(): Promise; /** * This async method has to be call to stop the webinar service * @param nowait - when set to true the leave method is call asynchronously without waiting response of rest request, * this mode has to be used when stop method is called in the onUnload browser event (try to send a sessionTerminate message * when browser or tab is closed brutally) */ stop(nowait: boolean): void; /** * This asynchronous method has to be call when connection is retreive after a connection lost */ reconnect(): void; /** * This method permits to observe webinar change * @param observer - Webinar change to observe */ subscribe(handler: any, eventNames?: string | string[]): Subscription; /** * Asynchronous method to create a new webinar on server * @param webinar - the webinar to create server side */ createWebinar(webinar: Webinar): Promise; /** * Asynchronous method to clone a webinar * @param webinar - the webinar to clone * @param params - The webinar parameters to clone * @returns the cloned webinar */ cloneWebinar(webinar: Webinar, params: WebinarCloneParams): Promise; /** * Asynchronous method to update an existing webinar on server * @param webinarData - the webinarData to update on server(should be partial data) */ updateWebinar(webinarData: Webinar): Promise; /** * Asynchronous method to update webinar avatar on server * @param webinar - the webinar to update * @param avatarImg - base64 encoded webinar avatar */ updateWebinarAvatar(webinar: Webinar, avatarImg: string): Promise; /** * Asynchronous method to update webinar logo on server * @param webinar - the webinar to update * @param logoSrc - base64 encoded webinar logo */ updateWebinarLogo(webinar: Webinar, logoSrc: string): Promise; /** * Synchronous method to get and order webinars (no server request) * @param order - sort order (available values : "name", "date") */ getWebinars(order: string): Webinar[]; /** * Asynchronous method to retreive webinar from server (reentrant ready method) * @param webinarId - the identifiant of webinar to get */ getWebinar(webinarId: string): Promise; /** * Synchronous method to retreive webinar from cache * @param webinarId - the identifiant of webinar to get */ getWebinarById(webinarId: string): Webinar | undefined; /** * Asynchronous method to retreive public webinar informations (this method can be call without authentication) * @param openInviteId - the webinar openInviteId * @param joinUuid - the webinar joinUuid * @param registrationCall - the registrationClickCount for statisitics (optional) */ getPublicWebinarInfo(openInviteId: string, joinUuid: string, registrationCall?: boolean): Promise; /** * Asynchronous method to update the webinar already in cache with server data * @param webinar - the webinar openInviteId */ updateWebinarFromServer(webinar: Webinar): Promise; /** * Asynchronous method to delete a webinar * @param webinarId - the webinarId */ deleteWebinar(webinarId: string): Promise; /** * Asynchronous method to publish a webinar * @param webinar - the webinar */ publishWebinar(webinar: Webinar): Promise; /** * Asynchronous method to notified webinar moderators * @param webinar - the webinar */ notifyModerators(webinar: Webinar): Promise; /** * Asynchronous method to check if a user has a webinar licence * @param userId - the webinarId */ hasWebinarLicence(userId: string): Promise; /** * Asynchronous method to get available licence between a starting and ending dates * @param webinarStartDate - the start date * @param webinarEndDate - the end datae */ getAvailableLicences(webinarStartDate: string, webinarEndDate: string): Promise; /** * Method to check if connected user has active or futur webinars */ hasActiveOrFutureWebinar(): boolean; /** * getWebinarConversation * @param webinar - the webinar */ getWebinarTextConversation(webinar: Webinar): Promise; /** * Asynchronous method to get webinar associated room from room service * @param webinar - the webinar to upadte * @param practice - when true also get practice room */ getWebinarRooms(webinar: Webinar, practice?: boolean): Promise; /** * getGlobalAnalytics * @param webinar - the webinar */ getGlobalAnalytics(webinar: Webinar): Promise; /** * getParticipantsAnalytics * @param webinar - the webinar */ getParticipantsAnalytics(webinar: Webinar): Promise; /** * getAttendeesAnalytics * @param webinar - the webinar */ getAttendeesAnalytics(webinar: Webinar): Promise; /** * Compute the webinar color depending its name * @param name - the webinar name */ computeWebinarColor(name: string): string; started: BehaviorSubject; conference: WebinarConferenceService; participants: WebinarParticipantsService; muteAudioElements: boolean; /** * Downloads the recording of the given webinar. * @param webinar - The webinar whose recording should be downloaded. * @returns A promise that resolves when the download is complete. */ downloadRecord(webinar: Webinar): Promise; /** * Retrieves the list of scheduled webinars within a given time range. * @param startDate - The start of the time range as an ISO 8601 string. * @param endDate - The end of the time range as an ISO 8601 string. * @returns A promise that resolves to the list of webinars scheduled in the given range. */ getScheduledWebinars(startDate: string, endDate: string): Promise; /** * Retrieves all webinar licences available for the current user. * @returns A promise that resolves to the list of licences, each containing a `totalLicenses` count. */ getAllLicences(): Promise; } /** * Event published by the WebinarService. */ export declare enum WebinarServiceEvents { /** * This RB event is send when the webinars list has changed. * @eventProperty WEBINARS_UPDATE */ WEBINARS_UPDATE = "WEBINARS_UPDATE", /** * This RB event is send when the webinar is published * @eventProperty WEBINAR_PUBLISHED */ WEBINAR_PUBLISHED = "WEBINAR_PUBLISHED", /** * This RB event is send when the webinar is terminated * @eventProperty WEBINAR_TERMINATED */ WEBINAR_TERMINATED = "WEBINAR_TERMINATED", /** * This RB event is send when the webinar is terminated * @eventProperty WEBINAR_CONVERSATION_RELOADED */ WEBINAR_CONVERSATION_RELOADED = "WEBINAR_CONVERSATION_RELOADED", /** * This RB event is send when an unmute demand is received * @eventProperty WEBINAR_UNMUTE_DEMAND_RECEIVED */ WEBINAR_UNMUTE_DEMAND_RECEIVED = "WEBINAR_UNMUTE_DEMAND_RECEIVED", /** * This RB event is send when a webinar shared a screen * @eventProperty WEBINAR_SHARED_SCREEN */ WEBINAR_SHARED_SCREEN = "WEBINAR_SHARED_SCREEN", /** * This RB event is send when a webinar emits a notification * @eventProperty WEBINAR_NOTIFICATION */ WEBINAR_NOTIFICATION = "WEBINAR_NOTIFICATION", WEBINAR_REQUEST_STAGING = "WEBINAR_REQUEST_STAGING", WEBINAR_REFUSE_STAGING = "WEBINAR_REFUSE_STAGING", WEBINAR_REQUEST_ATTENDEE_STAGING = "WEBINAR_REQUEST_ATTENDEE_STAGING", WEBINAR_REQUEST_ATTENDEE_UNSTAGING = "WEBINAR_REQUEST_ATTENDEE_UNSTAGING" } export declare class WebinarServiceRB extends Service implements WebinarService { private readonly profileService; private readonly mainService; private readonly logger; private readonly authService; private readonly contactService; private readonly xmppService; private readonly errorHelperService; private readonly fileStorageService; readonly conversationService: ConversationServiceRB; bubbleService: BubbleServiceRB; centralizedService?: any; browserReady: BehaviorSubject; private subject; private webinars; private webinarsMap; private subscription; private xmppHandlers; private createInProgress; private getWebinarPromise; conference: WebinarConferenceService; speakers: WebinarSpeakersService; participants: WebinarParticipantsService; userContact: Contact | null; guestMode: boolean; muteAudioElements: boolean; started: BehaviorSubject; /** * This the webinarService singleton */ static getInstance(): WebinarServiceRB; static build(): WebinarServiceRB; private constructor(); /** * This async method has to be call to start the webinar service */ start(): Promise; /** * This async method has to be call to stop the webinar service * @param nowait - when set to true the leave method is call asynchronously without waiting response of rest request, * this mode has to be used when stop method is called in the onUnload browser event (try to send a sessionTerminate message * when browser or tab is closed brutally) */ stop(nowait?: boolean): void; /** * This asynchronous method has to be call when connection is retreive after a connection lost */ reconnect(): void; waitUntilStart(): Promise; /** * This method permits to observe webinar change * @param handler - handler function called when webinar object * @param eventNames - (optional) event to subscribe */ subscribe(handler: any, eventNames?: string | string[]): Subscription; /** * Used to fired a webinar change event * @param name - name of the event * @param data - data free entry of the event */ submitEvent(name: string, data?: any): void; createWebinarInstance(): Webinar; /** * Asynchronous method to create a new webinar on server * @param webinar - the webinar to create server side * @param addToCache - add to cache if true */ createWebinar(webinar: Webinar, addToCache?: boolean): Promise; cloneWebinar(webinar: Webinar, params: WebinarCloneParams): Promise; /** * Asynchronous method to update an existing webinar on server * @param webinarData - the webinarData to update on server(should be partial data) * @param eventName - specific event name to fire (optional) */ updateWebinar(webinarData: Webinar, eventName?: string): Promise; /** * Asynchronous method to update webinar avatar on server * @param webinar - the webinar to update * @param avatarImg - base64 encoded webinar avatar */ updateWebinarAvatar(webinar: Webinar, avatarImg?: string): Promise; /** * Asynchronous method to update webinar logo on server * @param webinar - the webinar to update * @param logoSrc - base64 encoded webinar logo */ updateWebinarLogo(webinar: Webinar, logoSrc?: string): Promise; /** * Asynchronous method to update waiting room video media for an existing webinar on server * @param webinarData - webinar instance which contains only "id and "waitingRoomMultimediaURL" fields */ updateWebinarWaitingRoomMedias(webinarData: Webinar): Promise; acceptInvitation(webinarInvitation: Webinar): Promise; /** * Synchronous method to get and order webinars (no server request) * @param order - sort order (available values : "name", "date") */ getWebinars(order?: string): Webinar[]; /** * Asynchronous method to retreive all webinars from server */ private getServerWebinars; /** * Asynchronous method to retreive webinar room from server * @param webinarsData - data */ getActiveAndFutureWebinarsRooms(webinarsData: any): Promise; /** * Asynchronous method to retreive webinar from server (reentrant ready method) * @param webinarId - the identifiant of webinar to get */ getWebinar(webinarId: string): Promise; /** * Synchronous method to retreive webinar from cache * @param webinarId - the identifiant of webinar to get */ getWebinarById(webinarId: string): Webinar | undefined; /** * Method to retreive webinar from cache * @param sessionId - session identifier * @param confId - the conference identifier (optional) */ getWebinarBySessionId(sessionId: string, confId?: string): Webinar | undefined; /** * Method to retreive webinar from cache * @param roomId - room identifier */ getWebinarByRoomId(roomId: string): Webinar | undefined; /** * Asynchronous method to retreive public webinar informations (this method can be call without authentication) * @param openInviteId - the webinar openInviteId * @param joinUuid - the webinar joinUuid * @param registrationCall - the registrationClickCount for statisitics (optional) */ getPublicWebinarInfo(openInviteId: string, joinUuid: string, registrationCall?: boolean): Promise; /** * Asynchronous method to update the webinar already in cache with server data * @param webinar - the webinar openInviteId */ updateWebinarFromServer(webinar: Webinar): Promise; /** * Asynchronous method to delete a webinar * @param webinarId - the webinarId */ deleteWebinar(webinarId: string): Promise; /** * Method to update webinar role fields * @param webinar - the webinar to update */ updateRoles(webinar: Webinar): void; updateWebinarRoomFromServer(webinar: Webinar): Promise; updateWebinarPracticeRoomFromServer(webinar: Webinar): Promise; /** * Asynchronous method to check if a user has a webinar licence * @param userId - the webinarId */ hasWebinarLicence(userId: string): Promise; /** * Asynchronous method to get available licence between a starting and ending dates * @param webinarStartDate - the start date * @param webinarEndDate - the end datae * @param excludeWebinarId - the webinarId to exclude frow search (optional) */ getAvailableLicences(webinarStartDate: string, webinarEndDate: string, excludeWebinarId?: string): Promise; /** * Asynchronous method to notified webinar moderators * @param webinar - the webinar */ notifyModerators(webinar: Webinar): Promise; /** * Asynchronous method to publish a webinar * @param webinar - the webinar */ publishWebinar(webinar: Webinar): Promise; /** * Compute the webinar color depending its name * @param name - the webinar name */ computeWebinarColor(name: string): string; /** * Subscribe to room events (observable and xmpp events) */ private handleBubbleEvents; /** * Xmpp room event handler * @param stanza - the xmpp stanza event */ private onManagementMessage; private handleWebinarRecording; /** * Asynchronous method to get webinar associated room from room service * @param webinar - the webinar to upadte * @param practice - when true also get practice room */ getWebinarRooms(webinar: Webinar, practice?: boolean): Promise; /** * Method to check if connected user has active or futur webinars */ hasActiveOrFutureWebinar(): boolean; hasWebinar(): boolean; /** * Internal method to remove a webinar from the cache * @param webinar - the webinar to remove from cache */ removeWebinar(webinar: Webinar): void; /** * getWebinarConversation * @param webinar - the webinar */ getWebinarTextConversation(webinar: Webinar): Promise; /** * getGlobalAnalytics * @param webinar - the webinar */ getGlobalAnalytics(webinar: Webinar): Promise; /** * getParticipantsAnalytics * @param webinar - the webinar */ getParticipantsAnalytics(webinar: Webinar): Promise; /** * getAttendeesAnalytics * @param webinar - the webinar */ getAttendeesAnalytics(webinar: Webinar): Promise; /** * add a webinar to service cache * @param webinar - the webinar */ addWebinarToCache(webinar: Webinar): void; /** * Create webinar session from bubble information * @param webinar - the webinar * @param from - the origin of the request */ createWebinarSession(webinar: Webinar, from: string): void; /** * Get all webinars scheduled for a given time slot * @param startDate - the begin of the time slot * @param endDate - the end of the time slot */ getScheduledWebinars(startDate: string, endDate: string): Promise; /** * Get all licences available of the user's company */ getAllLicences(): Promise; /** * Compute busy slot */ computeBusySlots(date: string): Promise; downloadRecord(webinar: Webinar): Promise; private getHours; private getMinutes; private findIntersection; private compareHour; private deltaInMinutes; myParseInt(hour: string): number; } //# sourceMappingURL=webinars.service.d.ts.map