@webex/internal-plugin-metrics 3.0.0-beta.38 → 3.0.0-beta.380

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 (73) hide show
  1. package/dist/batcher.js +40 -1
  2. package/dist/batcher.js.map +1 -1
  3. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js +65 -0
  4. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -0
  5. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +476 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -0
  7. package/dist/call-diagnostic/call-diagnostic-metrics.js +841 -0
  8. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
  9. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +364 -0
  10. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -0
  11. package/dist/call-diagnostic/config.js +627 -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 +2 -1
  16. package/dist/config.js.map +1 -1
  17. package/dist/index.js +33 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/metrics.js +23 -28
  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 +299 -0
  24. package/dist/new-metrics.js.map +1 -0
  25. package/dist/prelogin-metrics-batcher.js +82 -0
  26. package/dist/prelogin-metrics-batcher.js.map +1 -0
  27. package/dist/types/batcher.d.ts +7 -0
  28. package/dist/types/call-diagnostic/call-diagnostic-metrics-batcher.d.ts +2 -0
  29. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +204 -0
  30. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +425 -0
  31. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +103 -0
  32. package/dist/types/call-diagnostic/config.d.ts +178 -0
  33. package/dist/types/client-metrics-batcher.d.ts +2 -0
  34. package/dist/types/config.d.ts +36 -0
  35. package/dist/types/index.d.ts +15 -0
  36. package/dist/types/metrics.d.ts +3 -0
  37. package/dist/types/metrics.types.d.ts +105 -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 +27 -0
  42. package/dist/utils.js.map +1 -0
  43. package/package.json +16 -8
  44. package/src/batcher.js +38 -0
  45. package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +72 -0
  46. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +435 -0
  47. package/src/call-diagnostic/call-diagnostic-metrics.ts +899 -0
  48. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +392 -0
  49. package/src/call-diagnostic/config.ts +685 -0
  50. package/src/client-metrics-batcher.js +1 -0
  51. package/src/config.js +1 -0
  52. package/src/index.ts +54 -0
  53. package/src/metrics.js +18 -24
  54. package/src/metrics.types.ts +168 -0
  55. package/src/new-metrics.ts +278 -0
  56. package/src/prelogin-metrics-batcher.ts +95 -0
  57. package/src/utils.ts +17 -0
  58. package/test/unit/spec/batcher.js +2 -0
  59. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +457 -0
  60. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +520 -0
  61. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +2137 -0
  62. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +629 -0
  63. package/test/unit/spec/client-metrics-batcher.js +2 -0
  64. package/test/unit/spec/metrics.js +66 -97
  65. package/test/unit/spec/new-metrics.ts +234 -0
  66. package/test/unit/spec/prelogin-metrics-batcher.ts +250 -0
  67. package/test/unit/spec/utils.ts +22 -0
  68. package/tsconfig.json +6 -0
  69. package/dist/call-diagnostic-events-batcher.js +0 -60
  70. package/dist/call-diagnostic-events-batcher.js.map +0 -1
  71. package/src/call-diagnostic-events-batcher.js +0 -62
  72. package/src/index.js +0 -17
  73. package/test/unit/spec/call-diagnostic-events-batcher.js +0 -195
@@ -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 } 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 preLoginMetricsBatcher;
27
+ private logger;
28
+ private hasLoggedBrowserSerial;
29
+ validator: (options: {
30
+ type: 'mqe' | 'ce';
31
+ event: Event;
32
+ }) => Promise<{
33
+ event: Event;
34
+ valid: boolean;
35
+ }>;
36
+ /**
37
+ * Constructor
38
+ * @param args
39
+ */
40
+ constructor(...args: any[]);
41
+ /**
42
+ * Returns the login type of the current user
43
+ * @returns one of 'login-ci','unverified-guest', null
44
+ */
45
+ getCurLoginType(): "unverified-guest" | "login-ci";
46
+ /**
47
+ * Returns if the meeting has converged architecture enabled
48
+ * @param options.meetingId
49
+ */
50
+ getIsConvergedArchitectureEnabled({ meetingId }: {
51
+ meetingId?: string;
52
+ }): boolean;
53
+ /**
54
+ * Returns meeting's subServiceType
55
+ * @param meeting
56
+ * @returns
57
+ */
58
+ getSubServiceType(meeting?: any): ClientSubServiceType;
59
+ /**
60
+ * Get origin object for Call Diagnostic Event payload.
61
+ * @param options
62
+ * @param meetingId
63
+ * @returns
64
+ */
65
+ getOrigin(options: GetOriginOptions, meetingId?: string): {
66
+ 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";
67
+ userAgent: string;
68
+ buildType?: "debug" | "test" | "prod" | "tap" | "analyzer-test";
69
+ upgradeChannel?: string;
70
+ instanceId?: string;
71
+ networkType: "wifi" | "ethernet" | "cellular" | "unknown";
72
+ localIP?: string;
73
+ usingProxy?: boolean;
74
+ mediaEngineSoftwareVersion?: string;
75
+ environment?: string;
76
+ newEnvironment?: string;
77
+ clientInfo?: {
78
+ os?: "windows" | "mac" | "ios" | "android" | "chrome" | "linux" | "other" | "android-x64" | "android-arm64" | "uwp-arm64";
79
+ osVersion?: string;
80
+ localIP?: string;
81
+ gatewayIP?: string;
82
+ macAddress?: string;
83
+ localNetworkPrefix?: string;
84
+ publicNetworkPrefix?: string;
85
+ browserLaunchMethod?: "url-handler" | "activex" | "npapi" | "extension" | "cwsapi" | "java" | "tfs" | "webacd" | "thinclient" | "switch-to-web" | "switch-to-native";
86
+ clientLaunchMethod?: "url-handler" | "universal-link" | "voice-command" | "notification" | "manual" | "teams-cross-launch" | "mc-cross-launch";
87
+ browser?: string;
88
+ browserVersion?: string;
89
+ 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";
90
+ 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";
91
+ clientVersion?: string; /**
92
+ * Returns the login type of the current user
93
+ * @returns one of 'login-ci','unverified-guest', null
94
+ */
95
+ clientVersionStatus?: "CURRENT" | "LEGACY" | "UNSUPPORTED";
96
+ localClientVersion?: string;
97
+ modelNumber?: string;
98
+ joinFirstUpdateLater?: "ep-enabled" | "sp-enabled" | "not-enabled"; /**
99
+ * Returns if the meeting has converged architecture enabled
100
+ * @param options.meetingId
101
+ */
102
+ standbyUsed?: boolean;
103
+ prefetchDocShowUsed?: boolean;
104
+ fastJoinUsed?: boolean;
105
+ clientDownloadSize?: number;
106
+ clientDownloadFileCount?: number;
107
+ nodeId?: number;
108
+ machineInfo?: string;
109
+ parentAppName?: string;
110
+ parentAppInPermitList?: boolean;
111
+ meetingSiteType?: "train" | "webex-11" | "orion";
112
+ CDNEnabled?: boolean;
113
+ clientMajorVersion?: string;
114
+ majorVersion?: number;
115
+ minorVersion?: number;
116
+ revision?: number;
117
+ isValidClientVersion?: boolean;
118
+ cpuInfo?: {
119
+ description: string;
120
+ clockSpeedGigaHertz: number;
121
+ numberOfCores: number;
122
+ architecture: "unknown" | "intel32" | "intel64" | "amd32" | "amd64" | "arm32" | "arm64";
123
+ staticPerformance?: string;
124
+ additionalProperties?: false;
125
+ };
126
+ 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";
127
+ videoDisplayMode?: "grid-view" | "active-speaker-view";
128
+ videoLayoutType?: "stack" | "stackWithShare" | "sideBySide" | "sideBySideWithShare" | "grid" | "floatingActive" | "floatingThumbnail" | "floatingGrid" | "overlay" | "focus" | "prominent" | "focusWithShare" | "prominentWithShare" | "equal" | "equalWithShare";
129
+ videoRenderType?: "wme" | "client_d3d" | "client_gdi";
130
+ vdiInfo?: {};
131
+ is64BitsClient?: boolean;
132
+ webexAppVersion?: string;
133
+ launch32BitsReason?: "forcewin32" | "disablewin64" | "platform_win32" | "platform_arm" | "platform_unknown" | "version_below_41.11";
134
+ inMeetingUpdate?: boolean;
135
+ mtaVersion?: string;
136
+ isWarholOpening?: boolean;
137
+ additionalProperties?: false;
138
+ };
139
+ emmVendorId?: string;
140
+ isHybridMedia?: boolean;
141
+ originData?: {};
142
+ additionalProperties?: false;
143
+ };
144
+ /**
145
+ * Gather identifier details for call diagnostic payload.
146
+ * @throws Error if initialization fails.
147
+ * @param options
148
+ */
149
+ getIdentifiers(options: GetIdentifiersOptions): {
150
+ attendeeId?: string;
151
+ breakoutGroupId?: string;
152
+ breakoutMoveId?: string;
153
+ breakoutSessionId?: string;
154
+ confluenceId?: string;
155
+ cpaasIdentifiers?: {
156
+ imiTenantId: string;
157
+ devClientId: string;
158
+ imiServiceId: string;
159
+ imiAppId: string;
160
+ sessionId: string;
161
+ sessionInstanceId: string;
162
+ additionalProperties?: false;
163
+ };
164
+ csdmDeviceUrl?: string;
165
+ destinationBreakoutSessionId?: string;
166
+ destinationLocusSessionId?: string;
167
+ destinationLocusUrl?: string;
168
+ destinationVenueId?: string;
169
+ deviceId?: string;
170
+ globalMeetingId?: string;
171
+ ivrCallId?: string;
172
+ ivrDialogId?: string;
173
+ ivrId?: string;
174
+ callId?: string;
175
+ locusId?: string;
176
+ locusSessionId?: string;
177
+ locusStartTime?: string;
178
+ locusUrl?: string;
179
+ machineId?: string;
180
+ mediaAgentAlias?: string;
181
+ mediaAgentGroupId?: string;
182
+ meetClusterName?: string;
183
+ meetingInstanceId?: string;
184
+ meetingLookupUrl?: string;
185
+ meetingOrgId?: string;
186
+ msteamsTenantGuid?: string;
187
+ msteamsConferenceId?: string;
188
+ oauth2ClientId?: string;
189
+ orgId?: string;
190
+ provisionalCorrelationId?: string;
191
+ roomId?: string;
192
+ sipCallId?: string;
193
+ sipSessionId?: {
194
+ local?: string;
195
+ remote?: string;
196
+ additionalProperties?: false;
197
+ };
198
+ sipUri?: string;
199
+ subConfId?: string;
200
+ tenantId?: string;
201
+ trackingId?: string;
202
+ userId?: string;
203
+ venueId?: string;
204
+ venueUrl?: string;
205
+ whiteboardUrl?: string;
206
+ webexConferenceId?: number;
207
+ webexClusterName?: string;
208
+ webexConferenceIdStr?: string;
209
+ webexDataCenter?: string;
210
+ webexGuestId?: number;
211
+ webexMeetingId?: number;
212
+ webexNodeId?: number;
213
+ webexSiteId?: number;
214
+ webexSiteName?: string;
215
+ webexSiteUuid?: string;
216
+ webexUserId?: number;
217
+ webexWebDomain?: string;
218
+ correlationId: string;
219
+ additionalProperties?: false;
220
+ } | {
221
+ attendeeId?: string;
222
+ breakoutGroupId?: string;
223
+ breakoutMoveId?: string;
224
+ breakoutSessionId?: string;
225
+ confluenceId?: string;
226
+ cpaasIdentifiers?: {
227
+ imiTenantId: string;
228
+ devClientId: string;
229
+ imiServiceId: string;
230
+ imiAppId: string;
231
+ sessionId: string;
232
+ sessionInstanceId: string;
233
+ additionalProperties?: false;
234
+ };
235
+ csdmDeviceUrl?: string;
236
+ destinationBreakoutSessionId?: string;
237
+ destinationLocusSessionId?: string;
238
+ destinationLocusUrl?: string;
239
+ destinationVenueId?: string;
240
+ deviceId?: string;
241
+ globalMeetingId?: string;
242
+ ivrCallId?: string;
243
+ ivrDialogId?: string;
244
+ ivrId?: string;
245
+ callId?: string;
246
+ locusId?: string;
247
+ locusSessionId?: string;
248
+ locusStartTime?: string;
249
+ locusUrl?: string;
250
+ machineId?: string;
251
+ mediaAgentAlias?: string;
252
+ mediaAgentGroupId?: string;
253
+ meetClusterName?: string;
254
+ meetingInstanceId?: string;
255
+ meetingLookupUrl?: string;
256
+ meetingOrgId?: string;
257
+ msteamsTenantGuid?: string;
258
+ msteamsConferenceId?: string;
259
+ oauth2ClientId?: string;
260
+ orgId?: string;
261
+ provisionalCorrelationId?: string;
262
+ roomId?: string;
263
+ sipCallId?: string;
264
+ sipSessionId?: {
265
+ local?: string;
266
+ remote?: string;
267
+ additionalProperties?: false;
268
+ };
269
+ sipUri?: string;
270
+ subConfId?: string;
271
+ tenantId?: string;
272
+ trackingId?: string;
273
+ userId?: string;
274
+ venueId?: string;
275
+ venueUrl?: string;
276
+ whiteboardUrl?: string;
277
+ webexConferenceId?: number;
278
+ webexClusterName?: string;
279
+ webexConferenceIdStr?: string;
280
+ webexDataCenter?: string;
281
+ webexGuestId?: number;
282
+ webexMeetingId?: number;
283
+ webexNodeId?: number;
284
+ webexSiteId?: number;
285
+ webexSiteName?: string;
286
+ webexSiteUuid?: string;
287
+ webexUserId?: number;
288
+ webexWebDomain?: string;
289
+ correlationId: string;
290
+ additionalProperties?: false;
291
+ };
292
+ /**
293
+ * Create diagnostic event, which can hold client event, feature event or MQE event data.
294
+ * This just initiates the shared properties that are required for all the 3 event categories.
295
+ * @param eventData
296
+ * @param options
297
+ * @returns
298
+ */
299
+ prepareDiagnosticEvent(eventData: Event['event'], options: any): Event;
300
+ /**
301
+ * TODO: NOT IMPLEMENTED
302
+ * Submit Feature Event
303
+ * @returns
304
+ */
305
+ submitFeatureEvent(): void;
306
+ /**
307
+ * Submit Media Quality Event
308
+ * @param args - submit params
309
+ * @param arg.name - event key
310
+ * @param arg.payload - additional payload to be merge with the default payload
311
+ * @param arg.options - options
312
+ */
313
+ submitMQE({ name, payload, options, }: {
314
+ name: MediaQualityEvent['name'];
315
+ payload: SubmitMQEPayload;
316
+ options: SubmitMQEOptions;
317
+ }): void;
318
+ /**
319
+ * Return Client Event payload by client error code
320
+ * @param arg - get error arg
321
+ * @param arg.clientErrorCode
322
+ * @param arg.serviceErrorCode
323
+ * @param arg.payloadOverrides
324
+ * @returns
325
+ */
326
+ getErrorPayloadForClientErrorCode({ clientErrorCode, serviceErrorCode, serviceErrorName, rawErrorMessage, payloadOverrides, }: {
327
+ clientErrorCode: number;
328
+ serviceErrorCode: any;
329
+ serviceErrorName?: any;
330
+ rawErrorMessage?: string;
331
+ payloadOverrides?: any;
332
+ }): ClientEventError;
333
+ /**
334
+ * Generate error payload for Client Event
335
+ * @param rawError
336
+ */
337
+ generateClientEventErrorPayload(rawError: any): {
338
+ fatal: boolean;
339
+ category: "other" | "signaling" | "media" | "network" | "expected";
340
+ errorDescription?: string;
341
+ errorCode?: number;
342
+ errorCodeStr?: string;
343
+ httpCode?: number;
344
+ errorCodeExt1?: number;
345
+ errorData?: {};
346
+ rawErrorMessage?: 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";