@webex/internal-plugin-metrics 3.0.0-beta.31 → 3.0.0-beta.310

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/batcher.js +2 -1
  2. package/dist/batcher.js.map +1 -1
  3. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js +66 -0
  4. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -0
  5. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +456 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -0
  7. package/dist/call-diagnostic/call-diagnostic-metrics.js +830 -0
  8. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
  9. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +337 -0
  10. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -0
  11. package/dist/call-diagnostic/config.js +610 -0
  12. package/dist/call-diagnostic/config.js.map +1 -0
  13. package/dist/client-metrics-batcher.js +2 -1
  14. package/dist/client-metrics-batcher.js.map +1 -1
  15. package/dist/config.js +22 -2
  16. package/dist/config.js.map +1 -1
  17. package/dist/index.js +30 -1
  18. package/dist/index.js.map +1 -1
  19. package/dist/metrics.js +30 -30
  20. package/dist/metrics.js.map +1 -1
  21. package/dist/metrics.types.js +7 -0
  22. package/dist/metrics.types.js.map +1 -0
  23. package/dist/new-metrics.js +333 -0
  24. package/dist/new-metrics.js.map +1 -0
  25. package/dist/types/batcher.d.ts +2 -0
  26. package/dist/types/call-diagnostic/call-diagnostic-metrics-batcher.d.ts +2 -0
  27. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +194 -0
  28. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +411 -0
  29. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +96 -0
  30. package/dist/types/call-diagnostic/config.d.ts +172 -0
  31. package/dist/types/client-metrics-batcher.d.ts +2 -0
  32. package/dist/types/config.d.ts +36 -0
  33. package/dist/types/index.d.ts +13 -0
  34. package/dist/types/metrics.d.ts +3 -0
  35. package/dist/types/metrics.types.d.ts +104 -0
  36. package/dist/types/new-metrics.d.ts +139 -0
  37. package/dist/types/utils.d.ts +6 -0
  38. package/dist/utils.js +27 -0
  39. package/dist/utils.js.map +1 -0
  40. package/package.json +13 -8
  41. package/src/batcher.js +1 -0
  42. package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +83 -0
  43. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +414 -0
  44. package/src/call-diagnostic/call-diagnostic-metrics.ts +896 -0
  45. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +362 -0
  46. package/src/call-diagnostic/config.ts +666 -0
  47. package/src/client-metrics-batcher.js +1 -0
  48. package/src/config.js +20 -0
  49. package/src/index.ts +43 -0
  50. package/src/metrics.js +25 -27
  51. package/src/metrics.types.ts +160 -0
  52. package/src/new-metrics.ts +317 -0
  53. package/src/utils.ts +17 -0
  54. package/test/unit/spec/batcher.js +2 -0
  55. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +465 -0
  56. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +477 -0
  57. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +2012 -0
  58. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +565 -0
  59. package/test/unit/spec/client-metrics-batcher.js +2 -0
  60. package/test/unit/spec/metrics.js +66 -97
  61. package/test/unit/spec/new-metrics.ts +269 -0
  62. package/test/unit/spec/utils.ts +22 -0
  63. package/tsconfig.json +6 -0
  64. package/dist/call-diagnostic-events-batcher.js +0 -60
  65. package/dist/call-diagnostic-events-batcher.js.map +0 -1
  66. package/src/call-diagnostic-events-batcher.js +0 -62
  67. package/src/index.js +0 -17
  68. package/test/unit/spec/call-diagnostic-events-batcher.js +0 -195
@@ -0,0 +1,411 @@
1
+ import { StatelessWebexPlugin } from '@webex/webex-core';
2
+ import { Event, ClientType, SubClientType, NetworkType, EnvironmentType, NewEnvironmentType, ClientEvent, SubmitClientEventOptions, MediaQualityEvent, SubmitMQEOptions, SubmitMQEPayload, ClientLaunchMethodType, ClientEventError, ClientEventPayload, ClientSubServiceType } from '../metrics.types';
3
+ type GetOriginOptions = {
4
+ clientType: ClientType;
5
+ subClientType: SubClientType;
6
+ networkType?: NetworkType;
7
+ clientLaunchMethod?: ClientLaunchMethodType;
8
+ environment?: EnvironmentType;
9
+ newEnvironment?: NewEnvironmentType;
10
+ };
11
+ type GetIdentifiersOptions = {
12
+ meeting?: any;
13
+ mediaConnections?: any[];
14
+ correlationId?: string;
15
+ preLoginId?: string;
16
+ globalMeetingId?: string;
17
+ webexConferenceIdStr?: string;
18
+ };
19
+ /**
20
+ * @description Util class to handle Call Analyzer Metrics
21
+ * @export
22
+ * @class CallDiagnosticMetrics
23
+ */
24
+ export default class CallDiagnosticMetrics extends StatelessWebexPlugin {
25
+ private callDiagnosticEventsBatcher;
26
+ private logger;
27
+ validator: (options: {
28
+ type: 'mqe' | 'ce';
29
+ event: Event;
30
+ }) => Promise<{
31
+ event: Event;
32
+ valid: boolean;
33
+ }>;
34
+ /**
35
+ * Constructor
36
+ * @param args
37
+ */
38
+ constructor(...args: any[]);
39
+ /**
40
+ * Returns the login type of the current user
41
+ * @returns one of 'login-ci','unverified-guest', null
42
+ */
43
+ getCurLoginType(): "unverified-guest" | "login-ci";
44
+ /**
45
+ * Returns if the meeting has converged architecture enabled
46
+ * @param options.meetingId
47
+ */
48
+ getIsConvergedArchitectureEnabled({ meetingId }: {
49
+ meetingId?: string;
50
+ }): boolean;
51
+ /**
52
+ * Returns meeting's subServiceType
53
+ * @param meeting
54
+ * @returns
55
+ */
56
+ getSubServiceType(meeting?: any): ClientSubServiceType;
57
+ /**
58
+ * Get origin object for Call Diagnostic Event payload.
59
+ * @param options
60
+ * @param meetingId
61
+ * @returns
62
+ */
63
+ getOrigin(options: GetOriginOptions, meetingId?: string): {
64
+ name: "endpoint" | "antares" | "beech" | "breakout" | "cb" | "cloudproxy" | "edonus" | "givr" | "hecate" | "hedge" | "hesiod" | "homer" | "superhomer" | "l2sip" | "linus" | "locus" | "mcc" | "mcs" | "mercury" | "mes" | "mjs" | "mmp" | "mygdon" | "orpheus" | "page" | "poros" | "rhesos" | "terminus" | "tpgw" | "ucc" | "wdm" | "webexivr";
65
+ userAgent: string;
66
+ buildType?: "debug" | "test" | "prod" | "tap" | "analyzer-test";
67
+ upgradeChannel?: string;
68
+ instanceId?: string;
69
+ networkType: "wifi" | "ethernet" | "cellular" | "unknown";
70
+ localIP?: string;
71
+ usingProxy?: boolean;
72
+ mediaEngineSoftwareVersion?: string;
73
+ environment?: string;
74
+ newEnvironment?: string;
75
+ clientInfo?: {
76
+ os?: "windows" | "mac" | "ios" | "android" | "chrome" | "linux" | "other" | "android-x64" | "uwp-arm64";
77
+ osVersion?: string;
78
+ localIP?: string;
79
+ gatewayIP?: string;
80
+ macAddress?: string;
81
+ localNetworkPrefix?: string;
82
+ publicNetworkPrefix?: string;
83
+ browserLaunchMethod?: "url-handler" | "activex" | "npapi" | "extension" | "cwsapi" | "java" | "tfs" | "webacd" | "thinclient" | "switch-to-web" | "switch-to-native";
84
+ clientLaunchMethod?: "url-handler" | "universal-link" | "voice-command" | "notification" | "manual" | "teams-cross-launch" | "mc-cross-launch";
85
+ browser?: string;
86
+ browserVersion?: string;
87
+ 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";
88
+ subClientType?: "TEAMS_DEVICE" | "DESKTOP_APP" | "DESKTOP_APP_VDI" | "DEVICE_CURRENT" | "DEVICE_LEGACY_2020" | "HOLOGRAM_HEADSET_APP" | "HVDI_APP" | "MOBILE_APP" | "MOBILE_NETWORK" | "VDI_APP" | "WEB_APP";
89
+ clientVersion?: string;
90
+ clientVersionStatus?: "CURRENT" | "LEGACY" | "UNSUPPORTED";
91
+ localClientVersion?: string;
92
+ modelNumber?: string;
93
+ joinFirstUpdateLater?: "ep-enabled" | "sp-enabled" | "not-enabled";
94
+ standbyUsed?: boolean;
95
+ prefetchDocShowUsed?: boolean;
96
+ fastJoinUsed?: boolean;
97
+ clientDownloadSize?: number;
98
+ clientDownloadFileCount?: number;
99
+ nodeId?: number;
100
+ machineInfo?: string;
101
+ parentAppName?: string;
102
+ parentAppInPermitList?: boolean;
103
+ meetingSiteType?: "train" | "webex-11" | "orion";
104
+ CDNEnabled?: boolean;
105
+ clientMajorVersion?: string;
106
+ majorVersion?: number;
107
+ minorVersion?: number;
108
+ revision?: number;
109
+ isValidClientVersion?: boolean;
110
+ cpuInfo?: {
111
+ description: string;
112
+ clockSpeedGigaHertz: number;
113
+ numberOfCores: number;
114
+ architecture: "unknown" | "intel32" | "intel64" | "amd32" | "amd64" | "arm32" | "arm64";
115
+ staticPerformance?: string;
116
+ additionalProperties?: false;
117
+ };
118
+ 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";
119
+ videoDisplayMode?: "grid-view" | "active-speaker-view";
120
+ videoLayoutType?: "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare";
121
+ videoRenderType?: "wme" | "client_d3d" | "client_gdi";
122
+ vdiInfo?: {};
123
+ is64BitsClient?: boolean;
124
+ webexAppVersion?: string;
125
+ launch32BitsReason?: "forcewin32" | "disablewin64" | "platform_win32" | "platform_arm" | "platform_unknown" | "version_below_41.11";
126
+ inMeetingUpdate?: boolean;
127
+ mtaVersion?: string;
128
+ isWarholOpening?: boolean;
129
+ additionalProperties?: false;
130
+ };
131
+ emmVendorId?: string;
132
+ isHybridMedia?: boolean;
133
+ originData?: {};
134
+ additionalProperties?: false;
135
+ };
136
+ /**
137
+ * Gather identifier details for call diagnostic payload.
138
+ * @throws Error if initialization fails.
139
+ * @param options
140
+ */
141
+ getIdentifiers(options: GetIdentifiersOptions): {
142
+ attendeeId?: string;
143
+ breakoutGroupId?: string;
144
+ breakoutMoveId?: string;
145
+ breakoutSessionId?: string;
146
+ confluenceId?: string;
147
+ cpaasIdentifiers?: {
148
+ imiTenantId: string;
149
+ devClientId: string;
150
+ imiServiceId: string;
151
+ imiAppId: string;
152
+ sessionId: string;
153
+ sessionInstanceId: string;
154
+ additionalProperties?: false;
155
+ };
156
+ csdmDeviceUrl?: string;
157
+ destinationBreakoutSessionId?: string;
158
+ destinationLocusSessionId?: string;
159
+ destinationLocusUrl?: string;
160
+ destinationVenueId?: string;
161
+ deviceId?: string;
162
+ globalMeetingId?: string;
163
+ ivrCallId?: string;
164
+ ivrDialogId?: string;
165
+ ivrId?: string;
166
+ callId?: string;
167
+ locusId?: string;
168
+ locusSessionId?: string;
169
+ locusStartTime?: string;
170
+ locusUrl?: string;
171
+ machineId?: string;
172
+ mediaAgentAlias?: string;
173
+ mediaAgentGroupId?: string;
174
+ meetClusterName?: string;
175
+ meetingLookupUrl?: string;
176
+ meetingOrgId?: string;
177
+ msteamsTenantGuid?: string;
178
+ msteamsConferenceId?: string;
179
+ oauth2ClientId?: string;
180
+ orgId?: string;
181
+ provisionalCorrelationId?: string;
182
+ roomId?: string;
183
+ sipCallId?: string;
184
+ sipSessionId?: {
185
+ local?: string;
186
+ remote?: string;
187
+ additionalProperties?: false;
188
+ };
189
+ sipUri?: string;
190
+ subConfId?: string;
191
+ tenantId?: string;
192
+ trackingId?: string;
193
+ userId?: string;
194
+ venueId?: string;
195
+ venueUrl?: string;
196
+ whiteboardUrl?: string;
197
+ webexConferenceId?: number;
198
+ webexClusterName?: string;
199
+ webexConferenceIdStr?: string;
200
+ webexDataCenter?: string;
201
+ webexGuestId?: number;
202
+ webexMeetingId?: number;
203
+ webexNodeId?: number;
204
+ webexSiteId?: number;
205
+ webexSiteName?: string;
206
+ webexUserId?: number;
207
+ webexWebDomain?: string;
208
+ correlationId: string;
209
+ additionalProperties?: false;
210
+ } | {
211
+ attendeeId?: string;
212
+ breakoutGroupId?: string;
213
+ breakoutMoveId?: string;
214
+ breakoutSessionId?: string;
215
+ confluenceId?: string;
216
+ cpaasIdentifiers?: {
217
+ imiTenantId: string;
218
+ devClientId: string;
219
+ imiServiceId: string;
220
+ imiAppId: string;
221
+ sessionId: string;
222
+ sessionInstanceId: string;
223
+ additionalProperties?: false;
224
+ };
225
+ csdmDeviceUrl?: string;
226
+ destinationBreakoutSessionId?: string;
227
+ destinationLocusSessionId?: string;
228
+ destinationLocusUrl?: string;
229
+ destinationVenueId?: string;
230
+ deviceId?: string;
231
+ globalMeetingId?: string;
232
+ ivrCallId?: string;
233
+ ivrDialogId?: string;
234
+ ivrId?: string;
235
+ callId?: string;
236
+ locusId?: string;
237
+ locusSessionId?: string;
238
+ locusStartTime?: string;
239
+ locusUrl?: string;
240
+ machineId?: string;
241
+ mediaAgentAlias?: string;
242
+ mediaAgentGroupId?: string;
243
+ meetClusterName?: string;
244
+ meetingLookupUrl?: string;
245
+ meetingOrgId?: string;
246
+ msteamsTenantGuid?: string;
247
+ msteamsConferenceId?: string;
248
+ oauth2ClientId?: string;
249
+ orgId?: string;
250
+ provisionalCorrelationId?: string;
251
+ roomId?: string;
252
+ sipCallId?: string;
253
+ sipSessionId?: {
254
+ local?: string;
255
+ remote?: string;
256
+ additionalProperties?: false;
257
+ };
258
+ sipUri?: string;
259
+ subConfId?: string;
260
+ tenantId?: string;
261
+ trackingId?: string;
262
+ userId?: string;
263
+ venueId?: string;
264
+ venueUrl?: string;
265
+ whiteboardUrl?: string;
266
+ webexConferenceId?: number;
267
+ webexClusterName?: string;
268
+ webexConferenceIdStr?: string;
269
+ webexDataCenter?: string;
270
+ webexGuestId?: number;
271
+ webexMeetingId?: number;
272
+ webexNodeId?: number;
273
+ webexSiteId?: number;
274
+ webexSiteName?: string;
275
+ webexUserId?: number;
276
+ webexWebDomain?: string;
277
+ correlationId: string;
278
+ additionalProperties?: false;
279
+ };
280
+ /**
281
+ * Create diagnostic event, which can hold client event, feature event or MQE event data.
282
+ * This just initiates the shared properties that are required for all the 3 event categories.
283
+ * @param eventData
284
+ * @param options
285
+ * @returns
286
+ */
287
+ prepareDiagnosticEvent(eventData: Event['event'], options: any): Event;
288
+ /**
289
+ * TODO: NOT IMPLEMENTED
290
+ * Submit Feature Event
291
+ * @returns
292
+ */
293
+ submitFeatureEvent(): void;
294
+ /**
295
+ * Submit Media Quality Event
296
+ * @param args - submit params
297
+ * @param arg.name - event key
298
+ * @param arg.payload - additional payload to be merge with the default payload
299
+ * @param arg.options - options
300
+ */
301
+ submitMQE({ name, payload, options, }: {
302
+ name: MediaQualityEvent['name'];
303
+ payload: SubmitMQEPayload;
304
+ options: SubmitMQEOptions;
305
+ }): void;
306
+ /**
307
+ * Return Client Event payload by client error code
308
+ * @param arg - get error arg
309
+ * @param arg.clientErrorCode
310
+ * @param arg.serviceErrorCode
311
+ * @param arg.payloadOverrides
312
+ * @returns
313
+ */
314
+ getErrorPayloadForClientErrorCode({ clientErrorCode, serviceErrorCode, serviceErrorName, payloadOverrides, }: {
315
+ clientErrorCode: number;
316
+ serviceErrorCode: any;
317
+ serviceErrorName?: any;
318
+ payloadOverrides?: any;
319
+ }): ClientEventError;
320
+ /**
321
+ * Generate error payload for Client Event
322
+ * @param rawError
323
+ */
324
+ generateClientEventErrorPayload(rawError: any): {
325
+ fatal: boolean;
326
+ category: "other" | "signaling" | "media" | "network" | "expected";
327
+ errorDescription?: string;
328
+ errorCode?: number;
329
+ errorCodeStr?: string;
330
+ httpCode?: number;
331
+ errorCodeExt1?: number;
332
+ errorData?: {};
333
+ shownToUser: boolean;
334
+ serviceErrorCode?: number;
335
+ name: "other" | "locus.response" | "media-engine" | "ice.failed" | "locus.leave" | "client.leave" | "media-device" | "media-sca" | "wxc";
336
+ additionalProperties?: false;
337
+ };
338
+ /**
339
+ * Create client event object for in meeting events
340
+ * @param arg - create args
341
+ * @param arg.event - event key
342
+ * @param arg.options - options
343
+ * @returns object
344
+ */
345
+ private createClientEventObjectInMeeting;
346
+ /**
347
+ * Create client event object for pre meeting events
348
+ * @param arg - create args
349
+ * @param arg.event - event key
350
+ * @param arg.options - payload
351
+ * @returns object
352
+ */
353
+ private createClientEventObjectPreMeeting;
354
+ /**
355
+ * Prepare Client Event CA event.
356
+ * @param arg - submit params
357
+ * @param arg.event - event key
358
+ * @param arg.payload - additional payload to be merged with default payload
359
+ * @param arg.options - payload
360
+ * @returns {any} options to be with fetch
361
+ * @throws
362
+ */
363
+ private prepareClientEvent;
364
+ /**
365
+ * Submit Client Event CA event.
366
+ * @param arg - submit params
367
+ * @param arg.event - event key
368
+ * @param arg.payload - additional payload to be merged with default payload
369
+ * @param arg.options - payload
370
+ * @throws
371
+ */
372
+ submitClientEvent({ name, payload, options, }: {
373
+ name: ClientEvent['name'];
374
+ payload?: ClientEventPayload;
375
+ options?: SubmitClientEventOptions;
376
+ }): Promise<any>;
377
+ /**
378
+ * Prepare the event and send the request to metrics-a service.
379
+ * @param event
380
+ * @returns promise
381
+ */
382
+ submitToCallDiagnostics(event: Event): Promise<any>;
383
+ /**
384
+ * Pre login events are not batched. We make the request directly.
385
+ * @param event
386
+ * @param preLoginId
387
+ * @returns
388
+ */
389
+ submitToCallDiagnosticsPreLogin: (event: Event, preLoginId?: string) => Promise<any>;
390
+ /**
391
+ * Builds a request options object to later be passed to fetch().
392
+ * @param arg - submit params
393
+ * @param arg.event - event key
394
+ * @param arg.payload - additional payload to be merged with default payload
395
+ * @param arg.options - client event options
396
+ * @returns {Promise<any>}
397
+ * @throws
398
+ */
399
+ buildClientEventFetchRequestOptions({ name, payload, options, }: {
400
+ name: ClientEvent['name'];
401
+ payload?: ClientEventPayload;
402
+ options?: SubmitClientEventOptions;
403
+ }): Promise<any>;
404
+ /**
405
+ * Returns true if the specified serviceErrorCode maps to an expected error.
406
+ * @param {number} serviceErrorCode the service error code
407
+ * @returns {boolean}
408
+ */
409
+ isServiceErrorExpected(serviceErrorCode: number): boolean;
410
+ }
411
+ export {};
@@ -0,0 +1,96 @@
1
+ import { Event } from '../metrics.types';
2
+ export declare const anonymizeIPAddress: (localIp: any) => string;
3
+ /**
4
+ * Returns a formated string of the user agent.
5
+ *
6
+ * @returns {string} formatted user agent information
7
+ */
8
+ export declare const userAgentToString: ({ clientName, webexVersion }: {
9
+ clientName: any;
10
+ webexVersion: any;
11
+ }) => string;
12
+ /**
13
+ * Iterates object recursively and removes any
14
+ * property that returns isEmpty for it's associated value
15
+ * isEmpty = implementation from Lodash.
16
+ *
17
+ * It modifies the object in place (mutable)
18
+ *
19
+ * @param obj - input
20
+ * @returns
21
+ */
22
+ export declare const clearEmptyKeysRecursively: (obj: any) => void;
23
+ /**
24
+ * Locus error codes start with 2. The next three digits are the
25
+ * HTTP status code related to the error code (like 400, 403, 502, etc.)
26
+ * The remaining three digits are just an increasing integer.
27
+ * If it is 7 digits and starts with a 2, it is locus.
28
+ *
29
+ * @param errorCode
30
+ * @returns {boolean}
31
+ */
32
+ export declare const isLocusServiceErrorCode: (errorCode: string | number) => boolean;
33
+ /**
34
+ * MeetingInfo errors sometimes has body.data.meetingInfo object
35
+ * MeetingInfo errors come with a wbxappapi url
36
+ *
37
+ * @param {Object} rawError
38
+ * @returns {boolean}
39
+ */
40
+ export declare const isMeetingInfoServiceError: (rawError: any) => boolean;
41
+ /**
42
+ * Returns true if the raw error is a network related error
43
+ *
44
+ * @param {Object} rawError
45
+ * @returns {boolean}
46
+ */
47
+ export declare const isNetworkError: (rawError: any) => boolean;
48
+ /**
49
+ * Returns true if the error is an unauthorized error
50
+ *
51
+ * @param {Object} rawError
52
+ * @returns {boolean}
53
+ */
54
+ export declare const isUnauthorizedError: (rawError: any) => boolean;
55
+ /**
56
+ * MDN Media Devices getUserMedia() method returns a name if it errs
57
+ * Documentation can be found here: https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
58
+ *
59
+ * @param errorCode
60
+ * @returns
61
+ */
62
+ export declare const isBrowserMediaErrorName: (errorName: any) => boolean;
63
+ /**
64
+ * @param webClientDomain
65
+ * @returns
66
+ */
67
+ export declare const getBuildType: (webClientDomain: any, markAsTestEvent?: boolean) => Event['origin']['buildType'];
68
+ /**
69
+ * Prepare metric item for submission.
70
+ * @param {Object} webex sdk instance
71
+ * @param {Object} item
72
+ * @returns {Object} prepared item
73
+ */
74
+ export declare const prepareDiagnosticMetricItem: (webex: any, item: any) => any;
75
+ /**
76
+ * Sets the originTime value(s) before the request/fetch.
77
+ * This function is only useful if you are about to submit a metrics
78
+ * request using pre-built fetch options;
79
+ *
80
+ * @param {any} options
81
+ * @returns {any} the updated options object
82
+ */
83
+ export declare const setMetricTimings: (options: any) => any;
84
+ export declare const extractVersionMetadata: (version: string) => {
85
+ majorVersion: number;
86
+ minorVersion: number;
87
+ };
88
+ /**
89
+ * Generates client error codes for specific ice failures
90
+ * that happen when trying to add media in a meeting.
91
+ */
92
+ export declare const generateClientErrorCodeForIceFailure: ({ signalingState, iceConnectionState, turnServerUsed, }: {
93
+ signalingState: RTCPeerConnection['signalingState'];
94
+ iceConnectionState: RTCPeerConnection['iceConnectionState'];
95
+ turnServerUsed: boolean;
96
+ }) => number;
@@ -0,0 +1,172 @@
1
+ import { ClientEventError, ClientSubServiceType } from '../metrics.types';
2
+ export declare const CALL_DIAGNOSTIC_LOG_IDENTIFIER = "call-diagnostic-events -> ";
3
+ export declare const AUTHENTICATION_FAILED_CODE = 1010;
4
+ export declare const NETWORK_ERROR = 1026;
5
+ export declare const NEW_LOCUS_ERROR_CLIENT_CODE = 4008;
6
+ export declare const MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE = 4100;
7
+ export declare const UNKNOWN_ERROR = 9999;
8
+ export declare const ICE_FAILURE_CLIENT_CODE = 2004;
9
+ export declare const MISSING_ROAP_ANSWER_CLIENT_CODE = 2007;
10
+ export declare const DTLS_HANDSHAKE_FAILED_CLIENT_CODE = 2008;
11
+ export declare const ICE_FAILED_WITH_TURN_TLS_CLIENT_CODE = 2010;
12
+ export declare const ICE_FAILED_WITHOUT_TURN_TLS_CLIENT_CODE = 2009;
13
+ export declare const WBX_APP_API_URL = "wbxappapi";
14
+ export declare const WEBEX_SUB_SERVICE_TYPES: Record<string, ClientSubServiceType>;
15
+ export declare const BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP: {
16
+ [x: string]: number;
17
+ };
18
+ export declare const ERROR_DESCRIPTIONS: {
19
+ UNKNOWN_CALL_FAILURE: string;
20
+ LOCUS_RATE_LIMITED_INCOMING: string;
21
+ LOCUS_RATE_LIMITED_OUTGOING: string;
22
+ LOCUS_UNAVAILABLE: string;
23
+ LOCUS_CONFLICT: string;
24
+ TIMEOUT: string;
25
+ LOCUS_INVALID_SEQUENCE_HASH: string;
26
+ AUTHENTICATION_FAILED: string;
27
+ NETWORK_ERROR: string;
28
+ UPDATE_MEDIA_FAILED: string;
29
+ FAILED_TO_CONNECT_MEDIA: string;
30
+ MEDIA_ENGINE_LOST: string;
31
+ MEDIA_CONNECTION_LOST: string;
32
+ ICE_FAILURE: string;
33
+ MEDIA_ENGINE_HANG: string;
34
+ ICE_SERVER_REJECTED: string;
35
+ CALL_FULL: string;
36
+ ROOM_TOO_LARGE: string;
37
+ GUEST_ALREADY_ADDED: string;
38
+ LOCUS_USER_NOT_AUTHORISED: string;
39
+ CLOUDBERRY_UNAVAILABLE: string;
40
+ ROOM_TOO_LARGE_FREE_ACCOUNT: string;
41
+ MEETING_INACTIVE: string;
42
+ MEETING_LOCKED: string;
43
+ MEETING_TERMINATING: string;
44
+ MODERATOR_PIN_OR_GUEST_REQUIRED: string;
45
+ MODERATOR_PIN_OR_GUEST_PIN_REQUIRED: string;
46
+ MODERATOR_REQUIRED: string;
47
+ USER_NOT_MEMBER_OF_ROOM: string;
48
+ NEW_LOCUS_ERROR: string;
49
+ NETWORK_UNAVAILABLE: string;
50
+ MEETING_UNAVAILABLE: string;
51
+ MEETING_ID_INVALID: string;
52
+ MEETING_SITE_INVALID: string;
53
+ LOCUS_INVALID_JOINTIME: string;
54
+ LOBBY_EXPIRED: string;
55
+ MEDIA_CONNECTION_LOST_PAIRED: string;
56
+ PHONE_NUMBER_NOT_A_NUMBER: string;
57
+ PHONE_NUMBER_TOO_LONG: string;
58
+ INVALID_DIALABLE_KEY: string;
59
+ ONE_ON_ONE_TO_SELF_NOT_ALLOWED: string;
60
+ REMOVED_PARTICIPANT: string;
61
+ MEETING_LINK_NOT_FOUND: string;
62
+ PHONE_NUMBER_TOO_SHORT_AFTER_IDD: string;
63
+ INVALID_INVITEE_ADDRESS: string;
64
+ PMR_USER_ACCOUNT_LOCKED_OUT: string;
65
+ GUEST_FORBIDDEN: string;
66
+ PMR_ACCOUNT_SUSPENDED: string;
67
+ EMPTY_PHONE_NUMBER_OR_COUNTRY_CODE: string;
68
+ CONVERSATION_NOT_FOUND: string;
69
+ SIP_CALLEE_BUSY: string;
70
+ SIP_CALLEE_NOT_FOUND: string;
71
+ START_RECORDING_FAILED: string;
72
+ RECORDING_IN_PROGRESS_FAILED: string;
73
+ MEETING_INFO_LOOKUP_ERROR: string;
74
+ CALL_FULL_ADD_GUEST: string;
75
+ REQUIRE_WEBEX_LOGIN: string;
76
+ USER_NOT_ALLOWED_ACCESS_MEETING: string;
77
+ USER_NEEDS_ACTIVATION: string;
78
+ SIGN_UP_INVALID_EMAIL: string;
79
+ UNKNOWN_ERROR: string;
80
+ NO_MEDIA_FOUND: string;
81
+ STREAM_ERROR_NO_MEDIA: string;
82
+ CAMERA_PERMISSION_DENIED: string;
83
+ FRAUD_DETECTION: string;
84
+ E2EE_NOT_SUPPORTED: string;
85
+ LOCUS_LOBBY_FULL_CMR: string;
86
+ USER_NOT_INVITED_TO_JOIN: string;
87
+ MISSING_ROAP_ANSWER: string;
88
+ DTLS_HANDSHAKE_FAILED: string;
89
+ ICE_FAILED_WITHOUT_TURN_TLS: string;
90
+ ICE_FAILED_WITH_TURN_TLS: string;
91
+ };
92
+ export declare const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP: {
93
+ 58400: number;
94
+ 99002: number;
95
+ 99009: number;
96
+ 58500: number;
97
+ 400001: number;
98
+ 403004: number;
99
+ 403028: number;
100
+ 403032: number;
101
+ 403034: number;
102
+ 403036: number;
103
+ 403038: number;
104
+ 403040: number;
105
+ 403041: number;
106
+ 403047: number;
107
+ 403408: number;
108
+ 403043: number;
109
+ 403048: number;
110
+ 403049: number;
111
+ 403100: number;
112
+ 403101: number;
113
+ 403102: number;
114
+ 403103: number;
115
+ 403104: number;
116
+ 404001: number;
117
+ 404006: number;
118
+ 423001: number;
119
+ 423005: number;
120
+ 423006: number;
121
+ 423010: number;
122
+ 423012: number;
123
+ 423013: number;
124
+ 429005: number;
125
+ 2403001: number;
126
+ 2403002: number;
127
+ 2403003: number;
128
+ 2403004: number;
129
+ 2403018: number;
130
+ 2403019: number;
131
+ 2423003: number;
132
+ 2423004: number;
133
+ 2423005: number;
134
+ 2423006: number;
135
+ 2423016: number;
136
+ 2423017: number;
137
+ 2423018: number;
138
+ 2423012: number;
139
+ 2423021: number;
140
+ 2423007: number;
141
+ 2403010: number;
142
+ 2403014: number;
143
+ 2403015: number;
144
+ 2423010: number;
145
+ 2400008: number;
146
+ 2400011: number;
147
+ 2400012: number;
148
+ 2403007: number;
149
+ 2401002: number;
150
+ 2404002: number;
151
+ 2400009: number;
152
+ 2400025: number;
153
+ 2423009: number;
154
+ 2403022: number;
155
+ 2423008: number;
156
+ 2400006: number;
157
+ 2400014: number;
158
+ 2404001: number;
159
+ 2403025: number;
160
+ 2405001: number;
161
+ 2409005: number;
162
+ 2409062: number;
163
+ 2423025: number;
164
+ 100002: number;
165
+ 100007: number;
166
+ 100001: number;
167
+ 100006: number;
168
+ 100005: number;
169
+ 100004: number;
170
+ };
171
+ export declare const CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD: Record<number, Partial<ClientEventError>>;
172
+ export declare const CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND = "js_sdk_call_diagnostic_event_failed_to_send";
@@ -0,0 +1,2 @@
1
+ export default ClientMetricsBatcher;
2
+ declare const ClientMetricsBatcher: any;