import Destroyable from '../destroyable/Destroyable'; import EventBufferConfiguration from '../eventbufferconfiguration/EventBufferConfiguration'; import MeetingHistoryState from '../eventcontroller/MeetingHistoryState'; import EventData from '../eventreporter/EventData'; import EventsClientConfiguration from '../eventsclientconfiguration/EventsClientConfiguration'; import Logger from '../logger/Logger'; import EventBuffer from './EventBuffer'; /** * [[InMemoryJSONEventBuffer]] is an in-memory implementation for buffering and * sending events. It buffers events based on number of events and its size whichever reaches * first. Events are sent out at an scheduled interval where important events are sent immediately. * It also retries sending events if failed upto the retry count limit. It implements * beaconing mechanism based on 'pagehide' and 'visibilitychange' to beacon all events as a last attempt. */ export default class InMemoryJSONEventBuffer implements EventBuffer, Destroyable { private static readonly SENDING_FAILURE_CODES; private static readonly RETRY_FIXED_BACKOFF_WAIT_MS; private static readonly RETRY_SHORT_BACKOFF_MS; private static readonly RETRY_LONG_BACKOFF_MS; private static readonly MAX_PAYLOAD_ITEMS; private static readonly MAX_ITEM_SIZE_BYTES_ALLOWED; private maxBufferCapacityBytes; private totalBufferItems; private buffer; private bufferSize; private maxBufferItemCapacityBytes; private currentIngestionEvent; private ingestionEventSize; private logger; private flushIntervalMs; private flushSize; private intervalScheduler; private failedIngestionEvents; private retryCountLimit; private ingestionURL; private lock; private metadata; private highEntropyUpdated; private userAgentParser; private type; private v; private beaconEventListener; private cancellableEvents; private importantEvents; private authenticationToken; private attributesToFilter; constructor(eventBufferConfiguration: EventBufferConfiguration, eventsClientConfiguration: EventsClientConfiguration, ingestionURL: string, importantEvents: MeetingHistoryState[], logger: Logger); private updateMetadataWithHighEntropyValues; private addEventListeners; private beaconEventHandler; private removeEventListeners; start(): void; stop(): void; addItem(item: EventData): Promise; private filterAttributes; private initializeAndGetCurrentIngestionEvent; private deepCopyCurrentIngestionEvent; private bufferItemThresholdReached; private getSize; private getPrimitiveSize; private isFull; private isEmpty; private getItems; private sendEvents; private makeBeaconRequestBody; private makeRequestBody; private sendEventImmediately; private send; private sendBeacon; private reset; destroy(): Promise; }