import { StatelessWebexPlugin } from '@webex/webex-core'; import { Event, ClientType, SubClientType, NetworkType, EnvironmentType, NewEnvironmentType, ClientEvent, SubmitClientEventOptions, MediaQualityEvent, SubmitMQEOptions, SubmitMQEPayload, ClientLaunchMethodType, ClientEventError, ClientEventPayload, ClientSubServiceType, BrowserLaunchMethodType, DelayedClientEvent, FeatureEvent, ClientFeatureEventPayload } from '../metrics.types'; type GetOriginOptions = { clientType: ClientType; subClientType: SubClientType; networkType?: NetworkType; clientLaunchMethod?: ClientLaunchMethodType; browserLaunchMethod?: BrowserLaunchMethodType; environment?: EnvironmentType; newEnvironment?: NewEnvironmentType; vendorId?: string; }; type GetIdentifiersOptions = { meeting?: any; mediaConnections?: any[]; correlationId?: string; sessionCorrelationId?: string; preLoginId?: string; globalMeetingId?: string; webexConferenceIdStr?: string; }; /** * @description Util class to handle Call Analyzer Metrics * @export * @class CallDiagnosticMetrics */ export default class CallDiagnosticMetrics extends StatelessWebexPlugin { private callDiagnosticEventsBatcher; private preLoginMetricsBatcher; private logger; private hasLoggedBrowserSerial; private device; private delayedClientEvents; private delayedClientFeatureEvents; private eventErrorCache; private isMercuryConnected; private eventLimitTracker; private eventLimitWarningsLogged; validator: (options: { type: 'mqe' | 'ce'; event: Event; }) => Promise<{ event: Event; valid: boolean; }>; /** * Constructor * @param args */ constructor(...args: any[]); /** * Returns the login type of the current user * @returns one of 'login-ci','unverified-guest', null */ getCurLoginType(): "unverified-guest" | "login-ci"; /** * Returns if the meeting has converged architecture enabled * @param options.meetingId */ getIsConvergedArchitectureEnabled({ meetingId }: { meetingId?: string; }): boolean; /** * Sets mercury connected status for event data object in CA events * @public * @param status - boolean value indicating mercury connection status * @return {void} */ setMercuryConnectedStatus(status: boolean): void; /** * Returns meeting's subServiceType * @param meeting * @returns */ getSubServiceType(meeting?: any): ClientSubServiceType; /** * Get origin object for Call Diagnostic Event payload. * @param options * @param meetingId * @returns */ getOrigin(options: GetOriginOptions, meetingId?: string): { name: "endpoint" | "addin" | "antares" | "appapi" | "beech" | "breakout" | "calendar" | "cb" | "cca" | "ccc" | "cloudproxy" | "crc" | "edonus" | "givr" | "hecate" | "hedge" | "hesiod" | "homer" | "idbroker" | "superhomer" | "l2sip" | "linus" | "locus" | "mbs" | "mcc" | "mcs" | "mercury" | "mes" | "mjs" | "mmp" | "mrs" | "mygdon" | "ngpage" | "ngservice" | "oauth" | "orpheus" | "page" | "poros" | "publicapi" | "rhesos" | "sbs" | "terminus" | "tpgw" | "ucc" | "wdm" | "webexivr" | "meetingcontainer"; userAgent: string; buildType?: "debug" | "test" | "prod" | "tap" | "analyzer-test"; upgradeChannel?: string; instanceId?: string; networkType: "wifi" | "ethernet" | "cellular" | "unknown"; localIP?: string; usingProxy?: boolean; mediaEngineSoftwareVersion?: string; environment?: string; newEnvironment?: string; clientInfo?: { os?: "windows" | "mac" | "ios" | "android" | "chrome" | "linux" | "other" | "android-x64" | "android-arm64" | "uwp-arm64"; osVersion?: string; localIP?: string; gatewayIP?: string; macAddress?: string; localNetworkPrefix?: string; publicNetworkPrefix?: string; browserLaunchMethod?: "url-handler" | "activex" | "npapi" | "extension" | "cwsapi" | "java" | "tfs" | "webacd" | "thinclient" | "switch-to-web" | "switch-to-native"; cwsStatus?: "starting-converged-mtg" | "webexapp-launched" | "webex-launcher-launched"; cwsVersion?: string; clientLaunchMethod?: "url-handler" | "universal-link" | "voice-command" | "notification" | "manual" | "teams-cross-launch" | "mc-cross-launch" | "cws" | "installer" | "installer-launcher" | "launcher" | "cws-launcher"; urlProtocolLaunchMethod?: "manual" | "auto" | "extension-fallback"; browser?: string; browserVersion?: string; clientType?: "MEETING_CENTER" | "EVENT_CENTER" | "TRAINING_CENTER" | "TEAMS_CLIENT" | "TEAMS_DEVICE" | "TEAMS_SHARE" | "SIP" | "RECORDING" | "CLOUD_AWARE_SIP" | "TEAMS_WXC_CLIENT" | "WXC_CLIENT" | "WXC_DEVICE" | "WEBEX_JS_SDK" | "VOICEA_CLIENT" | "CISCO_SIP_GW" | "WEBEX_SDK" | "CPAAS_THIRD_PARTY_SDK" | "WXC_THIRD_PARTY" | "WXCC" | "TEAMS_PHONE" | "WEBEX_RELAY"; subClientType?: "TEAMS_DEVICE" | "SIP" | "AUTOMOTIVE_APP" | "BROWSER_EXTENSION" | "DESKTOP_APP" | "DESKTOP_APP_VDI" | "DEVICE_CURRENT" | "DEVICE_LEGACY_2020" | "HOLOGRAM_HEADSET_APP" | "HVDI_APP" | "MIXED" | "MOBILE_APP" | "MOBILE_NETWORK" | "PAGE" | "VDI_APP" | "WEB_APP" | "PHONE_NOVUM" | "PHONE_ESPRESSO" | "PHONE_BUMBLEBEE" | "SIP_PSTN"; schedulingClientType?: "TEAMS_CLIENT" | "GOOGLE_ADDON" | "PT" | "PUBLIC_API" | "UNIFIED_PAGE" | "WEBEX_PAGE" | "GOOGLE_NOTIFICATION_CALENDAR" | "MSFT_NOTIFICATION_ADDIN" | "MSFT_NOTIFICATION_CALENDAR" | "OUTLOOK_ADDIN"; clientVersion?: string; clientVersionStatus?: "CURRENT" | "LEGACY" | "UNSUPPORTED"; localClientVersion?: string; launcherVersion?: string; modelNumber?: string; joinFirstUpdateLater?: "ep-enabled" | "sp-enabled" | "not-enabled"; standbyUsed?: boolean; prefetchDocShowUsed?: boolean; fastJoinUsed?: boolean; clientDownloadSize?: number; clientDownloadFileCount?: number; nodeId?: number; machineInfo?: string; parentAppName?: string; parentAppInPermitList?: boolean; meetingSiteType?: "train" | "webex-11" | "orion"; CDNEnabled?: boolean; clientMajorVersion?: string; majorVersion?: number; minorVersion?: number; revision?: number; isValidClientVersion?: boolean; cpuInfo?: { description: string; numberOfCores: number; architecture: "unknown" | "intel32" | "intel64" | "amd32" | "amd64" | "arm32" | "arm64" | "armv9" | "armv8" | "armv7" | "armv6" | "x86_64" | "x86_32"; staticPerformance?: string; clockSpeedGigaHertz?: number; additionalProperties?: false; }; shareType?: "cb-normal-share" | "ce-airplay-share" | "ce-direct-share" | "ce-gui-loopback-share" | "ce-input-source-share" | "ce-input-source-share-hdmi" | "ce-input-source-share-usbc" | "ce-jpg-share" | "ce-miracast-share" | "mcs-normal-share" | "mcs-normal-audio-share" | "mcs-hfps-share" | "mcs-hfps-audio-share"; videoDisplayMode?: "grid-view" | "active-speaker-view"; videoLayoutType?: "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare" | "largeGallery"; videoRenderType?: "wme" | "client_d3d" | "client_gdi"; vdiInfo?: {}; is64BitsClient?: boolean; webexAppVersion?: string; launch32BitsReason?: "forcewin32" | "disablewin64" | "platform_win32" | "platform_arm" | "platform_unknown" | "version_below_41.11"; inMeetingUpdate?: boolean; mtaVersion?: string; isWarholOpening?: boolean; vendorId?: string; staticPerformanceLevel?: string; staticPerformanceScore?: number; additionalProperties?: false; }; emmVendorId?: string; isHybridMedia?: boolean; originData?: {}; serviceVersion?: string; additionalProperties?: false; }; /** * Gather identifier details for call diagnostic payload. * @throws Error if initialization fails. * @param options */ getIdentifiers(options: GetIdentifiersOptions): { aggregatedBreakoutMoveId?: string; attendeeId?: string; participantId?: string; breakoutGroupId?: string; breakoutMoveId?: string; breakoutSessionId?: string; browserId?: string; ciExchangeTokenUrl?: string; confluenceId?: string; cpaasIdentifiers?: { imiTenantId: string; devClientId: string; imiServiceId: string; imiAppId: string; sessionId: string; sessionInstanceId: string; additionalProperties?: false; }; csdmDeviceUrl?: string; destinationBreakoutSessionId?: string; destinationLocusSessionId?: string; destinationLocusUrl?: string; destinationVenueId?: string; deviceId?: string; globalMeetingId?: string; installationId?: string; webexMeetingUUID?: string; ivrCallId?: string; ivrDialogId?: string; ivrId?: string; callId?: string; pairCallId?: string; locusId?: string; locusJoinUrl?: string; locusSessionId?: string; locusStartTime?: string; locusUrl?: string; machineId?: string; mediaAgentAlias?: string; mediaAgentGroupId?: string; meetClusterName?: string; meetingInstanceId?: string; meetingLookupUrl?: string; meetingOrgId?: string; metricServiceUrl?: string; msteamsTenantGuid?: string; msteamsConferenceId?: string; msteamsMeetingId?: string; oauth2ClientId?: string; orgId?: string; provisionalCorrelationId?: string; roomId?: string; sessionCorrelationId?: string; sharedMediaId?: string; sipCallId?: string; sipSessionId?: { local?: string; remote?: string; additionalProperties?: false; }; sipUri?: string; subConfId?: string; tenantId?: string; trackingId?: string; userId?: string; venueId?: string; venueUrl?: string; whiteboardUrl?: string; wdmDeviceRegistrationUrl?: string; webexConferenceId?: number; webexClusterName?: string; webexConferenceIdStr?: string; webexDataCenter?: string; webexGuestId?: number; webexMeetingId?: number; webexNodeId?: number; webexSiteId?: number; webexSiteName?: string; webexSiteUuid?: string; webexUserId?: number; webexWebDomain?: string; recordingId?: string; clientCorrelationId?: string; idForEndpointAB?: string; customerOrgId?: string; correlationId: string; additionalProperties?: false; } | { aggregatedBreakoutMoveId?: string; attendeeId?: string; participantId?: string; breakoutGroupId?: string; breakoutMoveId?: string; breakoutSessionId?: string; browserId?: string; ciExchangeTokenUrl?: string; confluenceId?: string; cpaasIdentifiers?: { imiTenantId: string; devClientId: string; imiServiceId: string; imiAppId: string; sessionId: string; sessionInstanceId: string; additionalProperties?: false; }; csdmDeviceUrl?: string; destinationBreakoutSessionId?: string; destinationLocusSessionId?: string; destinationLocusUrl?: string; destinationVenueId?: string; deviceId?: string; globalMeetingId?: string; installationId?: string; webexMeetingUUID?: string; ivrCallId?: string; ivrDialogId?: string; ivrId?: string; callId?: string; pairCallId?: string; locusId?: string; locusJoinUrl?: string; locusSessionId?: string; locusStartTime?: string; locusUrl?: string; machineId?: string; mediaAgentAlias?: string; mediaAgentGroupId?: string; meetClusterName?: string; meetingInstanceId?: string; meetingLookupUrl?: string; meetingOrgId?: string; metricServiceUrl?: string; msteamsTenantGuid?: string; msteamsConferenceId?: string; msteamsMeetingId?: string; oauth2ClientId?: string; orgId?: string; provisionalCorrelationId?: string; roomId?: string; sessionCorrelationId?: string; sharedMediaId?: string; sipCallId?: string; sipSessionId?: { local?: string; remote?: string; additionalProperties?: false; }; sipUri?: string; subConfId?: string; tenantId?: string; trackingId?: string; userId?: string; venueId?: string; venueUrl?: string; whiteboardUrl?: string; wdmDeviceRegistrationUrl?: string; webexConferenceId?: number; webexClusterName?: string; webexConferenceIdStr?: string; webexDataCenter?: string; webexGuestId?: number; webexMeetingId?: number; webexNodeId?: number; webexSiteId?: number; webexSiteName?: string; webexSiteUuid?: string; webexUserId?: number; webexWebDomain?: string; recordingId?: string; clientCorrelationId?: string; idForEndpointAB?: string; customerOrgId?: string; correlationId: string; additionalProperties?: false; } | { aggregatedBreakoutMoveId?: string; attendeeId?: string; participantId?: string; breakoutGroupId?: string; breakoutMoveId?: string; breakoutSessionId?: string; browserId?: string; ciExchangeTokenUrl?: string; confluenceId?: string; cpaasIdentifiers?: { imiTenantId: string; devClientId: string; imiServiceId: string; imiAppId: string; sessionId: string; sessionInstanceId: string; additionalProperties?: false; }; csdmDeviceUrl?: string; destinationBreakoutSessionId?: string; destinationLocusSessionId?: string; destinationLocusUrl?: string; destinationVenueId?: string; deviceId?: string; globalMeetingId?: string; installationId?: string; webexMeetingUUID?: string; ivrCallId?: string; ivrDialogId?: string; ivrId?: string; callId?: string; pairCallId?: string; locusId?: string; locusJoinUrl?: string; locusSessionId?: string; locusStartTime?: string; locusUrl?: string; machineId?: string; mediaAgentAlias?: string; mediaAgentGroupId?: string; meetClusterName?: string; meetingInstanceId?: string; meetingLookupUrl?: string; meetingOrgId?: string; metricServiceUrl?: string; msteamsTenantGuid?: string; msteamsConferenceId?: string; msteamsMeetingId?: string; oauth2ClientId?: string; orgId?: string; provisionalCorrelationId?: string; roomId?: string; sessionCorrelationId?: string; sharedMediaId?: string; sipCallId?: string; sipSessionId?: { local?: string; remote?: string; additionalProperties?: false; }; sipUri?: string; subConfId?: string; tenantId?: string; trackingId?: string; userId?: string; venueId?: string; venueUrl?: string; whiteboardUrl?: string; wdmDeviceRegistrationUrl?: string; webexConferenceId?: number; webexClusterName?: string; webexConferenceIdStr?: string; webexDataCenter?: string; webexGuestId?: number; webexMeetingId?: number; webexNodeId?: number; webexSiteId?: number; webexSiteName?: string; webexSiteUuid?: string; webexUserId?: number; webexWebDomain?: string; recordingId?: string; clientCorrelationId?: string; idForEndpointAB?: string; customerOrgId?: string; correlationId: string; additionalProperties?: false; }; /** * Create diagnostic event, which can hold client event, feature event or MQE event data. * This just initiates the shared properties that are required for all the 3 event categories. * @param eventData * @param options * @returns */ prepareDiagnosticEvent(eventData: Event['event'], options: any): Event; /** * Create feature event * @param name * @param payload * @param options * @returns */ private prepareClientFeatureEvent; /** * Submit Feature Event * submit to business_ucf * @returns */ submitFeatureEvent({ name, payload, options, delaySubmitEvent, }: { name: FeatureEvent['name']; payload?: ClientFeatureEventPayload; options?: SubmitClientEventOptions; delaySubmitEvent?: boolean; }): Promise; /** * Submit Feature Event * type is business * @param event */ submitToCallFeatures(event: Event): Promise; /** * Submit Media Quality Event * @param args - submit params * @param arg.name - event key * @param arg.payload - additional payload to be merge with the default payload * @param arg.options - options */ submitMQE({ name, payload, options, }: { name: MediaQualityEvent['name']; payload: SubmitMQEPayload; options: SubmitMQEOptions; }): void; /** * Return Client Event payload by client error code * @param arg - get error arg * @param arg.clientErrorCode * @param arg.serviceErrorCode * @param arg.payloadOverrides * @param arg.httpStatusCode * @returns */ getErrorPayloadForClientErrorCode({ clientErrorCode, serviceErrorCode, serviceErrorName, rawErrorMessage, payloadOverrides, httpStatusCode, }: { clientErrorCode: number; serviceErrorCode: any; serviceErrorName?: any; rawErrorMessage?: string; payloadOverrides?: any; httpStatusCode?: number; }): ClientEventError; /** * Clear the error cache */ clearErrorCache(): void; /** * Checks if an event should be limited based on criteria defined in the event dictionary. * Returns true if the event should be sent, false if it has reached its limit. * @param event - The diagnostic event object * @returns boolean indicating whether the event should be sent */ private shouldSendEvent; /** * Checks the current count for a limit key and increments if under limit. * @param limitKey - The unique key for this limit combination * @param maxCount - Maximum allowed count * @param eventDescription - Description for logging * @returns true if under limit and incremented, false if at/over limit */ private checkAndIncrementEventCount; /** * Clears event limit tracking */ clearEventLimits(): void; /** * Clears event limit tracking for a specific correlationId only. * Keeps limits for other meetings intact. */ clearEventLimitsForCorrelationId(correlationId: string): void; /** * Generate error payload for Client Event * @param rawError */ generateClientEventErrorPayload(rawError: any): any[]; /** * Create common object for in meeting events * @param name * @param options * @param eventType - 'client' | 'feature' * @returns object */ private createCommonEventObjectInMeeting; /** * Create client event object for in meeting events * @param arg - create args * @param arg.event - event key * @param arg.options - options * @returns object */ private createClientEventObjectInMeeting; /** * Create feature event object for in meeting function event * @param name * @param options * @returns object */ private createFeatureEventObjectInMeeting; /** * Create client event object for pre meeting events * @param arg - create args * @param arg.event - event key * @param arg.options - payload * @returns object */ private createClientEventObjectPreMeeting; /** * Prepare Client Event CA event. * @param arg - submit params * @param arg.event - event key * @param arg.payload - additional payload to be merged with default payload * @param arg.options - payload * @returns {any} options to be with fetch * @throws */ private prepareClientEvent; /** * Submit Client Event CA event. * @param arg - submit params * @param arg.event - event key * @param arg.payload - additional payload to be merged with default payload * @param arg.options - payload * @param arg.delaySubmitEvent - a boolean value indicating whether to delay the submission of client events. * @throws */ submitClientEvent({ name, payload, options, delaySubmitEvent, }: { name: ClientEvent['name']; payload?: ClientEventPayload; options?: SubmitClientEventOptions; delaySubmitEvent?: boolean; }): Promise; /** * Submit Delayed Client Event CA events. Clears delayedClientEvents array after submission. */ submitDelayedClientEvents(overrides?: Partial): Promise | Promise; /** * Submit Delayed feature Event CA events. Clears submitDelayedClientFeatureEvents array after submission. */ submitDelayedClientFeatureEvents(overrides?: Partial): Promise | Promise; /** * Prepare the event and send the request to metrics-a service. * @param event * @returns promise */ submitToCallDiagnostics(event: Event): Promise; /** * Prepare the event and send the request to metrics-a service, pre login. * @param event * @param preLoginId * @returns */ submitToCallDiagnosticsPreLogin: (event: Event, preLoginId?: string) => Promise; /** * Builds a request options object to later be passed to fetch(). * @param arg - submit params * @param arg.event - event key * @param arg.payload - additional payload to be merged with default payload * @param arg.options - client event options * @returns {Promise} * @throws */ buildClientEventFetchRequestOptions({ name, payload, options, }: { name: ClientEvent['name']; payload?: ClientEventPayload; options?: SubmitClientEventOptions; }): Promise; /** * Returns true if the specified serviceErrorCode maps to an expected error. * @param {number} serviceErrorCode the service error code * @returns {boolean} */ isServiceErrorExpected(serviceErrorCode: number): boolean; /** * This method is used to set the device information by internal-plugin-device * @param {device} object The webex.internal.device object * @returns {undefined} */ setDeviceInfo(device: any): void; } export {};