@webex/internal-plugin-metrics 3.0.0-beta.24 → 3.0.0-beta.241

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 (60) hide show
  1. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js +66 -0
  2. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -0
  3. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +446 -0
  4. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -0
  5. package/dist/call-diagnostic/call-diagnostic-metrics.js +704 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
  7. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +281 -0
  8. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -0
  9. package/dist/call-diagnostic/config.js +582 -0
  10. package/dist/call-diagnostic/config.js.map +1 -0
  11. package/dist/config.js +20 -1
  12. package/dist/config.js.map +1 -1
  13. package/dist/index.js +30 -1
  14. package/dist/index.js.map +1 -1
  15. package/dist/metrics.js +30 -30
  16. package/dist/metrics.js.map +1 -1
  17. package/dist/metrics.types.js +7 -0
  18. package/dist/metrics.types.js.map +1 -0
  19. package/dist/new-metrics.js +323 -0
  20. package/dist/new-metrics.js.map +1 -0
  21. package/dist/types/batcher.d.ts +2 -0
  22. package/dist/types/call-diagnostic/call-diagnostic-metrics-batcher.d.ts +2 -0
  23. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +189 -0
  24. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +385 -0
  25. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +73 -0
  26. package/dist/types/call-diagnostic/config.d.ts +87 -0
  27. package/dist/types/client-metrics-batcher.d.ts +2 -0
  28. package/dist/types/config.d.ts +35 -0
  29. package/dist/types/index.d.ts +13 -0
  30. package/dist/types/metrics.d.ts +3 -0
  31. package/dist/types/metrics.types.d.ts +99 -0
  32. package/dist/types/new-metrics.d.ts +133 -0
  33. package/dist/types/utils.d.ts +6 -0
  34. package/dist/utils.js +27 -0
  35. package/dist/utils.js.map +1 -0
  36. package/package.json +13 -8
  37. package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +80 -0
  38. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +403 -0
  39. package/src/call-diagnostic/call-diagnostic-metrics.ts +762 -0
  40. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +291 -0
  41. package/src/call-diagnostic/config.ts +580 -0
  42. package/src/config.js +19 -0
  43. package/src/index.ts +43 -0
  44. package/src/metrics.js +25 -27
  45. package/src/metrics.types.ts +152 -0
  46. package/src/new-metrics.ts +314 -0
  47. package/src/utils.ts +17 -0
  48. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +398 -0
  49. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +465 -0
  50. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +1303 -0
  51. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +479 -0
  52. package/test/unit/spec/metrics.js +65 -97
  53. package/test/unit/spec/new-metrics.ts +269 -0
  54. package/test/unit/spec/utils.ts +22 -0
  55. package/tsconfig.json +6 -0
  56. package/dist/call-diagnostic-events-batcher.js +0 -60
  57. package/dist/call-diagnostic-events-batcher.js.map +0 -1
  58. package/src/call-diagnostic-events-batcher.js +0 -62
  59. package/src/index.js +0 -17
  60. package/test/unit/spec/call-diagnostic-events-batcher.js +0 -195
@@ -0,0 +1,580 @@
1
+ /* eslint-disable import/prefer-default-export */
2
+ // Most client error codes are mapped based on
3
+ // https://sqbu-github.cisco.com/WebExSquared/event-dictionary/wiki/Error-codes-for-metric-events
4
+
5
+ import {ClientEventError} from '../metrics.types';
6
+
7
+ export const CALL_DIAGNOSTIC_LOG_IDENTIFIER = 'call-diagnostic-events -> ';
8
+
9
+ export const NEW_LOCUS_ERROR_CLIENT_CODE = 4008;
10
+ export const MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE = 4100;
11
+ export const UNKNOWN_ERROR = 9999; // Unexpected error that is not a meetingInfo error, locus error or browser media error.
12
+ export const ICE_FAILURE_CLIENT_CODE = 2004;
13
+ export const WBX_APP_API_URL = 'wbxappapi'; // MeetingInfo WebexAppApi response object normally contains a body.url that includes the string 'wbxappapi'
14
+
15
+ // Found in https://developer.mozilla.org/en-US/docs/Web/API/MediaDevices/getUserMedia
16
+ const BROWSER_MEDIA_ERROR_NAMES = {
17
+ PERMISSION_DENIED_ERROR: 'PermissionDeniedError',
18
+ NOT_ALLOWED_ERROR: 'NotAllowedError',
19
+ NOT_READABLE_ERROR: 'NotReadableError',
20
+ ABORT_ERROR: 'AbortError',
21
+ NOT_FOUND_ERROR: 'NotFoundError',
22
+ OVERCONSTRAINED_ERROR: 'OverconstrainedError',
23
+ SECURITY_ERROR: 'SecurityError',
24
+ TYPE_ERROR: 'TypeError',
25
+ };
26
+
27
+ export const BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP = {
28
+ [BROWSER_MEDIA_ERROR_NAMES.PERMISSION_DENIED_ERROR]: 4032, // User did not grant permission
29
+ [BROWSER_MEDIA_ERROR_NAMES.NOT_ALLOWED_ERROR]: 4032, // User did not grant permission
30
+ [BROWSER_MEDIA_ERROR_NAMES.NOT_READABLE_ERROR]: 2729, // Although the user granted permission to use the matching devices, a hardware error occurred at the operating system, browser, or Web page level which prevented access to the device.
31
+ [BROWSER_MEDIA_ERROR_NAMES.ABORT_ERROR]: 2729, // Although the user and operating system both granted access to the hardware device, and no hardware issues occurred that would cause a NotReadableError DOMException, throw if some problem occurred which prevented the device from being used.
32
+ [BROWSER_MEDIA_ERROR_NAMES.NOT_FOUND_ERROR]: 2729, // User did not grant permission
33
+ [BROWSER_MEDIA_ERROR_NAMES.OVERCONSTRAINED_ERROR]: 2729, // Thrown if the specified constraints resulted in no candidate devices which met the criteria requested.
34
+ [BROWSER_MEDIA_ERROR_NAMES.SECURITY_ERROR]: 2729, // Thrown if user media support is disabled on the Document on which getUserMedia() was called. The mechanism by which user media support is enabled and disabled is left up to the individual user agent.
35
+ [BROWSER_MEDIA_ERROR_NAMES.TYPE_ERROR]: 2729, // Thrown if the list of constraints specified is empty, or has all constraints set to false. This can also happen if you try to call getUserMedia() in an insecure context, since navigator.mediaDevices is undefined in an insecure context.
36
+ };
37
+
38
+ const ERROR_DESCRIPTIONS = {
39
+ UNKNOWN_CALL_FAILURE: 'UnknownCallFailure',
40
+ LOCUS_RATE_LIMITED_INCOMING: 'LocusRateLimitedIncoming',
41
+ LOCUS_RATE_LIMITED_OUTGOING: 'LocusRateLimitedOutgoing',
42
+ LOCUS_UNAVAILABLE: 'LocusUnavailable',
43
+ LOCUS_CONFLICT: 'LocusConflict',
44
+ TIMEOUT: 'Timeout',
45
+ LOCUS_INVALID_SEQUENCE_HASH: 'LocusInvalidSequenceHash',
46
+ UPDATE_MEDIA_FAILED: 'UpdateMediaFailed',
47
+ FAILED_TO_CONNECT_MEDIA: 'FailedToConnectMedia',
48
+ MEDIA_ENGINE_LOST: 'MediaEngineLost',
49
+ MEDIA_CONNECTION_LOST: 'MediaConnectionLost',
50
+ ICE_FAILURE: 'IceFailure',
51
+ MEDIA_ENGINE_HANG: 'MediaEngineHang',
52
+ ICE_SERVER_REJECTED: 'IceServerRejected',
53
+ CALL_FULL: 'CallFull',
54
+ ROOM_TOO_LARGE: 'RoomTooLarge',
55
+ GUEST_ALREADY_ADDED: 'GuestAlreadyAdded',
56
+ LOCUS_USER_NOT_AUTHORISED: 'LocusUserNotAuthorised',
57
+ CLOUDBERRY_UNAVAILABLE: 'CloudberryUnavailable',
58
+ ROOM_TOO_LARGE_FREE_ACCOUNT: 'RoomTooLarge_FreeAccount',
59
+ MEETING_INACTIVE: 'MeetingInactive',
60
+ MEETING_LOCKED: 'MeetingLocked',
61
+ MEETING_TERMINATING: 'MeetingTerminating',
62
+ MODERATOR_PIN_OR_GUEST_REQUIRED: 'Moderator_Pin_Or_Guest_Required',
63
+ MODERATOR_PIN_OR_GUEST_PIN_REQUIRED: 'Moderator_Pin_Or_Guest_PIN_Required',
64
+ MODERATOR_REQUIRED: 'Moderator_Required',
65
+ USER_NOT_MEMBER_OF_ROOM: 'UserNotMemberOfRoom',
66
+ NEW_LOCUS_ERROR: 'NewLocusError',
67
+ NETWORK_UNAVAILABLE: 'NetworkUnavailable',
68
+ MEETING_UNAVAILABLE: 'MeetingUnavailable',
69
+ MEETING_ID_INVALID: 'MeetingIDInvalid',
70
+ MEETING_SITE_INVALID: 'MeetingSiteInvalid',
71
+ LOCUS_INVALID_JOINTIME: 'LocusInvalidJoinTime',
72
+ LOBBY_EXPIRED: 'LobbyExpired',
73
+ MEDIA_CONNECTION_LOST_PAIRED: 'MediaConnectionLostPaired',
74
+ PHONE_NUMBER_NOT_A_NUMBER: 'PhoneNumberNotANumber',
75
+ PHONE_NUMBER_TOO_LONG: 'PhoneNumberTooLong',
76
+ INVALID_DIALABLE_KEY: 'InvalidDialableKey',
77
+ ONE_ON_ONE_TO_SELF_NOT_ALLOWED: 'OneOnOneToSelfNotAllowed',
78
+ REMOVED_PARTICIPANT: 'RemovedParticipant',
79
+ MEETING_LINK_NOT_FOUND: 'MeetingLinkNotFound',
80
+ PHONE_NUMBER_TOO_SHORT_AFTER_IDD: 'PhoneNumberTooShortAfterIdd',
81
+ INVALID_INVITEE_ADDRESS: 'InvalidInviteeAddress',
82
+ PMR_USER_ACCOUNT_LOCKED_OUT: 'PMRUserAccountLockedOut',
83
+ GUEST_FORBIDDEN: 'GuestForbidden',
84
+ PMR_ACCOUNT_SUSPENDED: 'PMRAccountSuspended',
85
+ EMPTY_PHONE_NUMBER_OR_COUNTRY_CODE: 'EmptyPhoneNumberOrCountryCode',
86
+ CONVERSATION_NOT_FOUND: 'ConversationNotFound',
87
+ SIP_CALLEE_BUSY: 'SIPCalleeBusy',
88
+ SIP_CALLEE_NOT_FOUND: 'SIPCalleeNotFound',
89
+ START_RECORDING_FAILED: 'StartRecordingFailed',
90
+ RECORDING_IN_PROGRESS_FAILED: 'RecordingInProgressFailed',
91
+ MEETING_INFO_LOOKUP_ERROR: 'MeetingInfoLookupError',
92
+ CALL_FULL_ADD_GUEST: 'CallFullAddGuest',
93
+ REQUIRE_WEBEX_LOGIN: 'RequireWebexLogin',
94
+ USER_NOT_ALLOWED_ACCESS_MEETING: 'UserNotAllowedAccessMeeting',
95
+ USER_NEEDS_ACTIVATION: 'UserNeedsActivation',
96
+ SIGN_UP_INVALID_EMAIL: 'SignUpInvalidEmail',
97
+ UNKNOWN_ERROR: 'UnknownError',
98
+ NO_MEDIA_FOUND: 'NoMediaFound',
99
+ STREAM_ERROR_NO_MEDIA: 'StreamErrorNoMedia',
100
+ CAMERA_PERMISSION_DENIED: 'CameraPermissionDenied',
101
+ };
102
+
103
+ export const SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP = {
104
+ // ---- Webex API ----
105
+ // Taken from https://wiki.cisco.com/display/HFWEB/MeetingInfo+API and https://sqbu-github.cisco.com/WebExSquared/spark-client-framework/blob/master/spark-client-framework/Services/WebexMeetingService/WebexMeetingModel.h
106
+ // Site not support the URL's domain
107
+ 58400: 4100,
108
+ 99002: 4100,
109
+ // Cannot find the data. Unkown meeting.
110
+ 99009: 4100,
111
+ // Meeting is not allow to cross env
112
+ 58500: 4100,
113
+ // Input parameters contain invalit item
114
+ 400001: 4100,
115
+ // Empty password or token. Meeting is not allow to access since require password
116
+ 403004: 4005,
117
+ // Wrong password. Meeting is not allow to access since password error
118
+ 403028: 4005,
119
+ // Wrong or expired permission. Meeting is not allow to access since permissionToken error or expire
120
+ 403032: 4005,
121
+ // Meeting is required login for current user
122
+ 403034: 4036,
123
+ // Meeting is not allow to access since require password or hostKey
124
+ // Empty password or host key
125
+ 403036: 4005,
126
+ // Meeting is not allow to access since password or hostKey error
127
+ // Wrong password or host key
128
+ 403038: 4005,
129
+ // CMR Meeting Not Supported (meeting exists, but not CMR meeting)
130
+ 403040: 4100,
131
+ // Requires Moderator Pin or Guest Pin
132
+ 403041: 4005,
133
+ // Email blocked
134
+ 403047: 4101,
135
+ // Device not authenticated for your organization
136
+ 403408: 4101,
137
+ // Invalid panelist Pin
138
+ 403043: 4005,
139
+ // Device not registered in org. Device not authenticated.
140
+ 403048: 4101,
141
+ // Not allowed to join external meetings. Violate meeting join policy. Your organization settings don't allow you to join this meeting.
142
+ 403049: 4101,
143
+ // Invalid email. Requires sign in meeting's current site.
144
+ 403100: 4101,
145
+ // Enforce sign in: need login before access when policy enforce sign in. GuestForceUserSignInPolicy
146
+ 403101: 4036,
147
+ // Enforce sign in: sign in with your email address that is approved by your organization
148
+ 403102: 4036,
149
+ // Join internal Meeting: need login before access when policy enforce sign in. Guest force user sign in internal meeting policy.
150
+ 403103: 4036,
151
+ // Join internal Meeting: The host's organization policy doesn't allow your account to join this meeting. Try switching to another account
152
+ 403104: 4101,
153
+ 404001: 4101,
154
+ // Site data not found. Unkonwn meeting. Site data not found(or null).
155
+ 404006: 4100,
156
+ // Invalid input with too many requests. Too many requests access, please input captcha code
157
+ 423001: 4005,
158
+ // Wrong password with too many requests. PasswordError too many time, please input captcha code
159
+ 423005: 4005,
160
+ // Wrong password or host key with too many requests
161
+ 423006: 4005,
162
+ // PasswordError with right captcha, please input captcha code
163
+ 423010: 4005,
164
+ // PasswordOrHostKeyError with right captcha, please input captcha code
165
+ 423012: 4005,
166
+ // Unverified or invalid input. Force show captcha. Please input captcha code"
167
+ 423013: 4005,
168
+ // Too many requests access
169
+ 429005: 4100,
170
+
171
+ // ---- Locus ------
172
+ // FREE_USER_MAX_PARTICIPANTS_EXCEEDED
173
+ 2403001: 3007,
174
+ // PAID_USER_MAX_PARTICIPANTS_EXCEEDED
175
+ 2403002: 3002,
176
+ // SERVICE_MAX_PARTICIPANTS_EXCEEDED
177
+ 2403003: 3002,
178
+ // LOCUS_INACTIVE
179
+ 2403004: 4001,
180
+ // LOCUS_FREE_USER_MAX_PARTICIPANTS_JOINED_EXCEEDED
181
+ 2403018: 3001,
182
+ // LOCUS_PAID_USER_MAX_PARTICIPANTS_JOINED_EXCEEDED
183
+ 2403019: 3001,
184
+ // LOCUS_LOCKED
185
+ 2423003: 4002,
186
+ // LOCUS_TERMINATING
187
+ 2423004: 4003,
188
+ // LOCUS_REQUIRES_MODERATOR_PIN_OR_GUEST
189
+ 2423005: 4005,
190
+ 2423006: 4005,
191
+ 2423016: 4005,
192
+ 2423017: 4005,
193
+ 2423018: 4005,
194
+ // LOCUS_REQUIRES_MODERATOR_ROLE
195
+ 2423007: 4006,
196
+ // LOCUS_JOIN_RESTRICTED_USER_NOT_IN_ROOM
197
+ 2403010: 4007,
198
+ // LOCUS_MEETING_NOT_FOUND
199
+ 2403014: 4011,
200
+ // LOCUS_NOT_WEBEX_SITE
201
+ 2403015: 4012,
202
+ // LOCUS_INVALID_JOIN_TIME
203
+ 2423010: 4013,
204
+ // LOCUS_PHONE_NUMBER_NOT_A_NUMBER
205
+ 2400008: 4016,
206
+ // LOCUS_PHONE_NUMBER_TOO_LONG
207
+ 2400011: 4017,
208
+ // LOCUS_INVALID_DIALABLE_KEY
209
+ 2400012: 4018,
210
+ // LOCUS_ONE_ON_ONE_TO_SELF_NOT_ALLOWED
211
+ 2403007: 4019,
212
+ // LOCUS_REMOVED_PARTICIPANT
213
+ 2401002: 4020,
214
+ // LOCUS_MEETING_LINK_NOT_FOUND
215
+ 2404002: 4021,
216
+ // LOCUS_PHONE_NUMBER_TOO_SHORT_AFTER_IDD
217
+ 2400009: 4022,
218
+ // LOCUS_INVALID_INVITEE_ADDRESS
219
+ 2400025: 4023,
220
+ // LOCUS_PMR_USER_ACCOUNT_LOCKEDOUT
221
+ 2423009: 4024,
222
+ // LOCUS_RESOURCE_GUEST_FORBIDDEN
223
+ 2403022: 4025,
224
+ // LOCUS_PMR_SUSPENDED
225
+ 2423008: 4026,
226
+ // LOCUS_EMPTY_PHONE_NUMBER_OR_COUNTRY_CODE
227
+ 2400006: 4027,
228
+ // LOCUS_INVALID_SINCE_OR_SEQUENCE_HASH_IN_REQUEST
229
+ 2400014: 1006,
230
+ // LOCUS_CONVERSATION_NOT_FOUND
231
+ 2404001: 4028,
232
+ // LOCUS_RECORDING_CONTROL_NOT_SUPPORTED
233
+ 2403025: 4029,
234
+ // LOCUS_RECORDING_NOT_STARTED
235
+ 2405001: 4029,
236
+ // LOCUS_RECORDING_NOT_ENABLED
237
+ 2409005: 4029,
238
+
239
+ // ---- U2C Sign in catalog ------
240
+ // The user exists, but hasn't completed activation. Needs to visit Atlas for more processing.
241
+ 100002: 4102,
242
+ // The user exists, had completed activation earlier, but requires re-activation because of change in login strategy.
243
+ // Common example is: user signed up using an OAuth provider, but that OAuth provider was removed by org's admin. Now the user needs to re-activate using alternate login strategies: password-pin, new OAuth provider, SSO, etc.
244
+ 100007: 4102,
245
+ // The user does not exist
246
+ 100001: 4103,
247
+ // The user wasn't found, and the organization used for search is a domain-claimed organization.
248
+ 100006: 4103,
249
+ 100005: 4103, // Depracated because of an issue in the UCF Clients
250
+ // If both email-hash and domain-hash are null or undefined.
251
+ 100004: 4103,
252
+ };
253
+
254
+ export const CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD: Record<number, Partial<ClientEventError>> = {
255
+ 1000: {
256
+ errorDescription: ERROR_DESCRIPTIONS.UNKNOWN_CALL_FAILURE,
257
+ category: 'signaling',
258
+ fatal: true,
259
+ name: 'locus.response',
260
+ },
261
+ 1001: {
262
+ errorDescription: ERROR_DESCRIPTIONS.LOCUS_RATE_LIMITED_INCOMING,
263
+ category: 'signaling',
264
+ fatal: true,
265
+ name: 'locus.response',
266
+ },
267
+ 1002: {
268
+ errorDescription: ERROR_DESCRIPTIONS.LOCUS_RATE_LIMITED_OUTGOING,
269
+ category: 'signaling',
270
+ fatal: true,
271
+ name: 'locus.response',
272
+ },
273
+ 1003: {
274
+ errorDescription: ERROR_DESCRIPTIONS.LOCUS_UNAVAILABLE,
275
+ category: 'signaling',
276
+ fatal: true,
277
+ name: 'locus.response',
278
+ },
279
+ 1004: {
280
+ errorDescription: ERROR_DESCRIPTIONS.LOCUS_CONFLICT,
281
+ category: 'signaling',
282
+ fatal: true,
283
+ name: 'locus.response',
284
+ },
285
+ 1005: {
286
+ errorDescription: ERROR_DESCRIPTIONS.TIMEOUT,
287
+ category: 'signaling',
288
+ fatal: true,
289
+ name: 'locus.response',
290
+ },
291
+ 1006: {
292
+ errorDescription: ERROR_DESCRIPTIONS.LOCUS_INVALID_SEQUENCE_HASH,
293
+ category: 'signaling',
294
+ fatal: true,
295
+ },
296
+ 1007: {
297
+ errorDescription: ERROR_DESCRIPTIONS.UPDATE_MEDIA_FAILED,
298
+ category: 'signaling',
299
+ fatal: true,
300
+ },
301
+ 2001: {
302
+ errorDescription: ERROR_DESCRIPTIONS.FAILED_TO_CONNECT_MEDIA,
303
+ category: 'signaling',
304
+ fatal: true,
305
+ },
306
+ 2002: {
307
+ errorDescription: ERROR_DESCRIPTIONS.MEDIA_ENGINE_LOST,
308
+ category: 'signaling',
309
+ fatal: true,
310
+ },
311
+ 2003: {
312
+ errorDescription: ERROR_DESCRIPTIONS.MEDIA_CONNECTION_LOST,
313
+ category: 'signaling',
314
+ fatal: true,
315
+ },
316
+ 2004: {
317
+ errorDescription: ERROR_DESCRIPTIONS.ICE_FAILURE,
318
+ category: 'signaling',
319
+ fatal: true,
320
+ },
321
+ 2005: {
322
+ errorDescription: ERROR_DESCRIPTIONS.MEDIA_ENGINE_HANG,
323
+ category: 'signaling',
324
+ fatal: true,
325
+ },
326
+ 2006: {
327
+ errorDescription: ERROR_DESCRIPTIONS.ICE_SERVER_REJECTED,
328
+ category: 'signaling',
329
+ fatal: true,
330
+ },
331
+ 3001: {
332
+ errorDescription: ERROR_DESCRIPTIONS.CALL_FULL,
333
+ category: 'expected',
334
+ fatal: true,
335
+ },
336
+ 3002: {
337
+ errorDescription: ERROR_DESCRIPTIONS.ROOM_TOO_LARGE,
338
+ category: 'expected',
339
+ fatal: true,
340
+ },
341
+ 3004: {
342
+ errorDescription: ERROR_DESCRIPTIONS.GUEST_ALREADY_ADDED,
343
+ category: 'expected',
344
+ fatal: false,
345
+ },
346
+ 3005: {
347
+ errorDescription: ERROR_DESCRIPTIONS.LOCUS_USER_NOT_AUTHORISED,
348
+ category: 'expected',
349
+ fatal: true,
350
+ },
351
+ 3006: {
352
+ errorDescription: ERROR_DESCRIPTIONS.CLOUDBERRY_UNAVAILABLE,
353
+ category: 'expected',
354
+ fatal: true,
355
+ },
356
+ 3007: {
357
+ errorDescription: ERROR_DESCRIPTIONS.STREAM_ERROR_NO_MEDIA,
358
+ category: 'expected',
359
+ fatal: true,
360
+ },
361
+ 3013: {
362
+ errorDescription: ERROR_DESCRIPTIONS.ROOM_TOO_LARGE_FREE_ACCOUNT,
363
+ category: 'expected',
364
+ fatal: false,
365
+ },
366
+ 4001: {
367
+ errorDescription: ERROR_DESCRIPTIONS.MEETING_INACTIVE,
368
+ category: 'expected',
369
+ fatal: true,
370
+ },
371
+ 4002: {
372
+ errorDescription: ERROR_DESCRIPTIONS.MEETING_LOCKED,
373
+ category: 'expected',
374
+ fatal: true,
375
+ name: 'locus.response',
376
+ },
377
+ 4003: {
378
+ errorDescription: ERROR_DESCRIPTIONS.MEETING_TERMINATING,
379
+ category: 'expected',
380
+ fatal: true,
381
+ name: 'locus.leave',
382
+ },
383
+ 4004: {
384
+ errorDescription: ERROR_DESCRIPTIONS.MODERATOR_PIN_OR_GUEST_REQUIRED,
385
+ category: 'expected',
386
+ fatal: false,
387
+ },
388
+ 4005: {
389
+ errorDescription: ERROR_DESCRIPTIONS.MODERATOR_PIN_OR_GUEST_PIN_REQUIRED,
390
+ category: 'expected',
391
+ fatal: false,
392
+ },
393
+ 4006: {
394
+ errorDescription: ERROR_DESCRIPTIONS.MODERATOR_REQUIRED,
395
+ category: 'expected',
396
+ fatal: false,
397
+ },
398
+ 4007: {
399
+ errorDescription: ERROR_DESCRIPTIONS.USER_NOT_MEMBER_OF_ROOM,
400
+ category: 'expected',
401
+ fatal: true,
402
+ },
403
+ 4008: {
404
+ errorDescription: ERROR_DESCRIPTIONS.NEW_LOCUS_ERROR,
405
+ category: 'signaling',
406
+ fatal: true,
407
+ },
408
+ 4009: {
409
+ errorDescription: ERROR_DESCRIPTIONS.NETWORK_UNAVAILABLE,
410
+ category: 'expected',
411
+ fatal: true,
412
+ },
413
+ 4010: {
414
+ errorDescription: ERROR_DESCRIPTIONS.MEETING_UNAVAILABLE,
415
+ category: 'expected',
416
+ fatal: true,
417
+ },
418
+ 4011: {
419
+ errorDescription: ERROR_DESCRIPTIONS.MEETING_ID_INVALID,
420
+ category: 'expected',
421
+ fatal: true,
422
+ },
423
+ 4012: {
424
+ errorDescription: ERROR_DESCRIPTIONS.MEETING_SITE_INVALID,
425
+ category: 'expected',
426
+ fatal: true,
427
+ },
428
+ 4013: {
429
+ errorDescription: ERROR_DESCRIPTIONS.LOCUS_INVALID_JOINTIME,
430
+ category: 'expected',
431
+ fatal: true,
432
+ },
433
+ 4014: {
434
+ errorDescription: ERROR_DESCRIPTIONS.LOBBY_EXPIRED,
435
+ category: 'expected',
436
+ fatal: true,
437
+ },
438
+ 4015: {
439
+ errorDescription: ERROR_DESCRIPTIONS.MEDIA_CONNECTION_LOST_PAIRED,
440
+ category: 'expected',
441
+ fatal: false,
442
+ },
443
+ 4016: {
444
+ errorDescription: ERROR_DESCRIPTIONS.PHONE_NUMBER_NOT_A_NUMBER,
445
+ category: 'expected',
446
+ fatal: true,
447
+ name: 'locus.response',
448
+ },
449
+ 4017: {
450
+ errorDescription: ERROR_DESCRIPTIONS.PHONE_NUMBER_TOO_LONG,
451
+ category: 'expected',
452
+ fatal: true,
453
+ name: 'locus.response',
454
+ },
455
+ 4018: {
456
+ errorDescription: ERROR_DESCRIPTIONS.INVALID_DIALABLE_KEY,
457
+ category: 'expected',
458
+ fatal: true,
459
+ name: 'locus.response',
460
+ },
461
+ 4019: {
462
+ errorDescription: ERROR_DESCRIPTIONS.ONE_ON_ONE_TO_SELF_NOT_ALLOWED,
463
+ category: 'expected',
464
+ fatal: true,
465
+ },
466
+ 4020: {
467
+ errorDescription: ERROR_DESCRIPTIONS.REMOVED_PARTICIPANT,
468
+ category: 'expected',
469
+ fatal: true,
470
+ },
471
+ 4021: {
472
+ errorDescription: ERROR_DESCRIPTIONS.MEETING_LINK_NOT_FOUND,
473
+ category: 'expected',
474
+ fatal: true,
475
+ },
476
+ 4022: {
477
+ errorDescription: ERROR_DESCRIPTIONS.PHONE_NUMBER_TOO_SHORT_AFTER_IDD,
478
+ category: 'expected',
479
+ fatal: true,
480
+ },
481
+ 4023: {
482
+ errorDescription: ERROR_DESCRIPTIONS.INVALID_INVITEE_ADDRESS,
483
+ category: 'expected',
484
+ fatal: true,
485
+ },
486
+ 4024: {
487
+ errorDescription: ERROR_DESCRIPTIONS.PMR_USER_ACCOUNT_LOCKED_OUT,
488
+ category: 'expected',
489
+ fatal: true,
490
+ },
491
+ 4025: {
492
+ errorDescription: ERROR_DESCRIPTIONS.GUEST_FORBIDDEN,
493
+ category: 'expected',
494
+ fatal: true,
495
+ },
496
+ 4026: {
497
+ errorDescription: ERROR_DESCRIPTIONS.PMR_ACCOUNT_SUSPENDED,
498
+ category: 'expected',
499
+ fatal: true,
500
+ },
501
+ 4027: {
502
+ errorDescription: ERROR_DESCRIPTIONS.EMPTY_PHONE_NUMBER_OR_COUNTRY_CODE,
503
+ category: 'expected',
504
+ fatal: true,
505
+ },
506
+ 4028: {
507
+ errorDescription: ERROR_DESCRIPTIONS.CONVERSATION_NOT_FOUND,
508
+ category: 'expected',
509
+ fatal: true,
510
+ },
511
+ 4029: {
512
+ errorDescription: ERROR_DESCRIPTIONS.START_RECORDING_FAILED,
513
+ category: 'expected',
514
+ fatal: true,
515
+ },
516
+ 4030: {
517
+ errorDescription: ERROR_DESCRIPTIONS.RECORDING_IN_PROGRESS_FAILED,
518
+ category: 'expected',
519
+ fatal: true,
520
+ },
521
+ 4032: {
522
+ errorDescription: ERROR_DESCRIPTIONS.CAMERA_PERMISSION_DENIED,
523
+ category: 'expected',
524
+ fatal: true,
525
+ },
526
+ 4036: {
527
+ errorDescription: ERROR_DESCRIPTIONS.REQUIRE_WEBEX_LOGIN,
528
+ category: 'expected',
529
+ fatal: true,
530
+ },
531
+ 5000: {
532
+ errorDescription: ERROR_DESCRIPTIONS.SIP_CALLEE_BUSY,
533
+ category: 'expected',
534
+ fatal: true,
535
+ },
536
+ 5001: {
537
+ errorDescription: ERROR_DESCRIPTIONS.SIP_CALLEE_NOT_FOUND,
538
+ category: 'expected',
539
+ fatal: true,
540
+ },
541
+
542
+ // Webex App API Error Codes
543
+ 4100: {
544
+ errorDescription: ERROR_DESCRIPTIONS.MEETING_INFO_LOOKUP_ERROR,
545
+ category: 'signaling',
546
+ fatal: true,
547
+ },
548
+ 3003: {
549
+ errorDescription: ERROR_DESCRIPTIONS.CALL_FULL_ADD_GUEST,
550
+ category: 'expected',
551
+ fatal: false,
552
+ },
553
+ 4101: {
554
+ errorDescription: ERROR_DESCRIPTIONS.USER_NOT_ALLOWED_ACCESS_MEETING,
555
+ category: 'expected',
556
+ fatal: true,
557
+ },
558
+ 4102: {
559
+ errorDescription: ERROR_DESCRIPTIONS.USER_NEEDS_ACTIVATION,
560
+ category: 'expected',
561
+ fatal: true,
562
+ },
563
+ 4103: {
564
+ errorDescription: ERROR_DESCRIPTIONS.SIGN_UP_INVALID_EMAIL,
565
+ category: 'expected',
566
+ fatal: true,
567
+ },
568
+ 2729: {
569
+ errorDescription: ERROR_DESCRIPTIONS.NO_MEDIA_FOUND,
570
+ category: 'expected',
571
+ fatal: false,
572
+ },
573
+ 9999: {
574
+ errorDescription: ERROR_DESCRIPTIONS.UNKNOWN_ERROR,
575
+ category: 'other',
576
+ fatal: true,
577
+ },
578
+ };
579
+
580
+ export const CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND = 'js_sdk_call_diagnostic_event_failed_to_send';
package/src/config.js CHANGED
@@ -21,3 +21,22 @@ export default {
21
21
  batcherRetryPlateau: 32000,
22
22
  },
23
23
  };
24
+
25
+ export const OS_NAME = {
26
+ WINDOWS: 'windows',
27
+ MAC: 'mac',
28
+ IOS: 'ios',
29
+ ANDROID: 'android',
30
+ CHROME: 'chrome',
31
+ LINUX: 'linux',
32
+ OTHERS: 'other',
33
+ };
34
+
35
+ export const OSMap = {
36
+ 'Chrome OS': OS_NAME.CHROME,
37
+ macOS: OS_NAME.MAC,
38
+ Windows: OS_NAME.WINDOWS,
39
+ iOS: OS_NAME.IOS,
40
+ Android: OS_NAME.ANDROID,
41
+ Linux: OS_NAME.LINUX,
42
+ };
package/src/index.ts ADDED
@@ -0,0 +1,43 @@
1
+ /*!
2
+ * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
+ */
4
+
5
+ import '@webex/internal-plugin-device';
6
+
7
+ import {registerInternalPlugin} from '@webex/webex-core';
8
+
9
+ import Metrics from './metrics';
10
+ import config from './config';
11
+ import NewMetrics from './new-metrics';
12
+ import * as Utils from './utils';
13
+ import {
14
+ ClientEvent,
15
+ ClientEventLeaveReason,
16
+ SubmitBehavioralEvent,
17
+ SubmitClientEvent,
18
+ SubmitInternalEvent,
19
+ SubmitOperationalEvent,
20
+ SubmitMQE,
21
+ } from './metrics.types';
22
+ import * as CALL_DIAGNOSTIC_CONFIG from './call-diagnostic/config';
23
+ import * as CallDiagnosticUtils from './call-diagnostic/call-diagnostic-metrics.util';
24
+
25
+ registerInternalPlugin('metrics', Metrics, {
26
+ config,
27
+ });
28
+
29
+ registerInternalPlugin('newMetrics', NewMetrics, {
30
+ config,
31
+ });
32
+
33
+ export {default, getOSNameInternal} from './metrics';
34
+ export {config, CALL_DIAGNOSTIC_CONFIG, NewMetrics, Utils, CallDiagnosticUtils};
35
+ export type {
36
+ ClientEvent,
37
+ ClientEventLeaveReason,
38
+ SubmitBehavioralEvent,
39
+ SubmitClientEvent,
40
+ SubmitInternalEvent,
41
+ SubmitMQE,
42
+ SubmitOperationalEvent,
43
+ };