import type { ClientEvent as RawClientEvent, Event as RawEvent, MediaQualityEvent as RawMediaQualityEvent, FeatureEvent as RawFeatureEvent, } from '@webex/event-dictionary-ts'; export type Event = Omit & { event: RawClientEvent | RawMediaQualityEvent | RawFeatureEvent; }; export type ClientEventError = NonNullable[0]; export type EnvironmentType = NonNullable; export type NewEnvironmentType = NonNullable; export type ClientLaunchMethodType = NonNullable< RawEvent['origin']['clientInfo'] >['clientLaunchMethod']; export type ClientUserNameInput = NonNullable; export type ClientEmailInput = NonNullable; export type BrowserLaunchMethodType = NonNullable< RawEvent['origin']['clientInfo'] >['browserLaunchMethod']; export type MetricEventProduct = 'webex' | 'wxcc_desktop' | 'wxcc_crm' | 'wxcc_sdk'; export type MetricEventAgent = 'user' | 'browser' | 'system' | 'sdk' | 'redux' | 'service' | 'api'; export type MetricEventVerb = | 'abort' | 'accept' | 'activate' | 'apply' | 'answer' | 'authorize' | 'build' | 'cancel' | 'change' | 'click' | 'close' | 'complete' | 'connect' | 'create' | 'deactivate' | 'decrypt' | 'delete' | 'deliver' | 'destroy' | 'disable' | 'disconnect' | 'dismiss' | 'display' | 'download' | 'edit' | 'enable' | 'encrypt' | 'end' | 'expire' | 'fail' | 'fetch' | 'fire' | 'generate' | 'get' | 'hide' | 'hover' | 'ignore' | 'initialize' | 'initiate' | 'invalidate' | 'join' | 'list' | 'load' | 'login' | 'logout' | 'notify' | 'offer' | 'open' | 'press' | 'receive' | 'refer' | 'refresh' | 'register' | 'release' | 'reload' | 'reject' | 'request' | 'reset' | 'resize' | 'respond' | 'retry' | 'revoke' | 'save' | 'search' | 'select' | 'send' | 'set' | 'sign' | 'start' | 'submit' | 'switch' | 'sync' | 'toggle' | 'transfer' | 'unregister' | 'update' | 'upload' | 'use' | 'validate' | 'view' | 'visit' | 'wait' | 'warn' | 'exit'; export type MetricEventJoinFlowVersion = 'Other' | 'NewFTE'; export type MetricEventMeetingJoinPhase = 'pre-join' | 'join' | 'in-meeting'; export type SubmitClientEventOptions = { meetingId?: string; mediaConnections?: any[]; rawError?: any; correlationId?: string; sessionCorrelationId?: string; preLoginId?: string; environment?: EnvironmentType; newEnvironmentType?: NewEnvironmentType; clientLaunchMethod?: ClientLaunchMethodType; browserLaunchMethod?: BrowserLaunchMethodType; webexConferenceIdStr?: string; globalMeetingId?: string; joinFlowVersion?: MetricEventJoinFlowVersion; meetingJoinPhase?: MetricEventMeetingJoinPhase; triggeredTime?: string; emailInput?: ClientEmailInput; userNameInput?: ClientUserNameInput; vendorId?: string; }; export type SubmitMQEOptions = { meetingId: string; mediaConnections?: any[]; networkType?: Event['origin']['networkType']; webexConferenceIdStr?: string; globalMeetingId?: string; }; export type InternalEvent = { name: | 'internal.client.meetinginfo.request' | 'internal.client.meetinginfo.response' | 'internal.register.device.request' | 'internal.register.device.response' | 'internal.reset.join.latencies' | 'internal.client.meeting.click.joinbutton' | 'internal.host.meeting.participant.admitted' | 'internal.client.meeting.interstitial-window.showed' | 'internal.client.interstitial-window.click.joinbutton' | 'internal.client.add-media.turn-discovery.start' | 'internal.client.add-media.turn-discovery.end' | 'internal.client.share.initiated' | 'internal.client.share.stopped'; payload?: never; options?: never; }; export interface ClientEvent { name: RawClientEvent['name']; payload?: RawClientEvent; options?: SubmitClientEventOptions; } export interface DeviceContext { app: {version: string}; device: {id: string}; locale: string; os: { name: string; version: string; }; } export type MetricType = 'behavioral' | 'operational' | 'business'; export type Table = 'wbxapp_callend_metrics' | 'business_metrics' | 'business_ucf' | 'default'; type InternalEventPayload = string | number | boolean; export type EventPayload = Record; export type BehavioralEventPayload = EventPayload; // for compatibilty, can be remove after wxcc-desktop did change their imports. export interface BusinessEventPayload { metricName: string; timestamp: number; context: DeviceContext; browserDetails: object; value: EventPayload; } export interface BusinessEvent { type: string[]; eventPayload: BusinessEventPayload; } export interface TaggedEvent { context: DeviceContext; metricName: string; tags: EventPayload; timestamp: number; type: [MetricType]; } export type BehavioralEvent = TaggedEvent; export type OperationalEvent = TaggedEvent; export interface FeatureEvent { name: RawFeatureEvent['name']; payload?: RawFeatureEvent; options?: SubmitClientEventOptions; } export interface MediaQualityEvent { name: RawMediaQualityEvent['name']; payload?: RawMediaQualityEvent; options: SubmitMQEOptions; } export type RecursivePartial = { [P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial[] : T[P] extends object ? RecursivePartial : T[P]; }; export type MetricEventNames = | InternalEvent['name'] | ClientEvent['name'] | BehavioralEvent['metricName'] | OperationalEvent['metricName'] | BusinessEvent['eventPayload']['metricName'] | FeatureEvent['name'] | MediaQualityEvent['name']; export type ClientInfo = NonNullable; export type ClientType = NonNullable['clientType']; export type SubClientType = NonNullable['subClientType']; export type NetworkType = NonNullable['networkType']; export type ClientSubServiceType = ClientEvent['payload']['webexSubServiceType']; export type ClientEventPayload = RecursivePartial; export type ClientEventLeaveReason = ClientEvent['payload']['leaveReason']; export type ClientEventPayloadError = ClientEvent['payload']['errors']; export type ClientFeatureEventPayload = RecursivePartial; export type MediaQualityEventAudioSetupDelayPayload = NonNullable< MediaQualityEvent['payload'] >['audioSetupDelay']; export type MediaQualityEventVideoSetupDelayPayload = NonNullable< MediaQualityEvent['payload'] >['videoSetupDelay']; export type SubmitMQEPayload = RecursivePartial & { intervals: NonNullable['intervals']; }; export type SubmitInternalEvent = (args: { name: InternalEvent['name']; payload?: RecursivePartial; options?: any; }) => void; export type SubmitBehavioralEvent = (args: { product: MetricEventProduct; agent: MetricEventAgent; target: string; verb: MetricEventVerb; payload?: EventPayload; }) => void; export type SubmitClientEvent = (args: { name: ClientEvent['name']; payload?: RecursivePartial; options?: SubmitClientEventOptions; }) => Promise; export type SubmitOperationalEvent = (args: { name: OperationalEvent['metricName']; payload: EventPayload; }) => void; export type SubmitBusinessEvent = (args: { name: OperationalEvent['metricName']; payload: EventPayload; metadata?: EventPayload; table?: Table; }) => void; export type SubmitMQE = (args: { name: MediaQualityEvent['name']; payload: SubmitMQEPayload; options: any; }) => void; export type BuildClientEventFetchRequestOptions = (args: { name: ClientEvent['name']; payload?: RecursivePartial; options?: SubmitClientEventOptions; }) => Promise; export type PreComputedLatencies = | 'internal.client.pageJMT' | 'internal.download.time' | 'internal.get.cluster.time' | 'internal.click.to.interstitial' | 'internal.click.to.interstitial.with.user.delay' | 'internal.refresh.captcha.time' | 'internal.exchange.ci.token.time' | 'internal.get.u2c.time' | 'internal.call.init.join.req' | 'internal.other.app.api.time' | 'internal.api.fetch.intelligence.models'; export interface IdType { meetingId?: string; callId?: string; } export interface IMetricsAttributes { type: string; version: string; userId: string; correlationId: string; connectionId: string; data: any[]; meetingId?: string; callId?: string; } export interface DelayedClientEvent { name: ClientEvent['name']; payload?: RecursivePartial; options?: SubmitClientEventOptions; } export type SubmitFeatureEvent = (args: { name: FeatureEvent['name']; payload?: RecursivePartial; options?: SubmitClientEventOptions; }) => Promise; export interface DelayedClientFeatureEvent { name: FeatureEvent['name']; payload?: RecursivePartial; options?: SubmitClientEventOptions; }