@webex/internal-plugin-metrics 3.0.0-bnr.5 → 3.0.0-next.10

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