@webex/plugin-meetings 3.0.0-beta.162 → 3.0.0-beta.164

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 (64) hide show
  1. package/dist/breakouts/breakout.js +7 -3
  2. package/dist/breakouts/breakout.js.map +1 -1
  3. package/dist/breakouts/events.js +31 -29
  4. package/dist/breakouts/events.js.map +1 -1
  5. package/dist/breakouts/index.js +4 -2
  6. package/dist/breakouts/index.js.map +1 -1
  7. package/dist/constants.js +2 -4
  8. package/dist/constants.js.map +1 -1
  9. package/dist/interpretation/index.js +1 -1
  10. package/dist/interpretation/siLanguage.js +1 -1
  11. package/dist/locus-info/index.js +33 -17
  12. package/dist/locus-info/index.js.map +1 -1
  13. package/dist/meeting/index.js +699 -682
  14. package/dist/meeting/index.js.map +1 -1
  15. package/dist/meeting/util.js +47 -25
  16. package/dist/meeting/util.js.map +1 -1
  17. package/dist/meeting-info/index.js +48 -7
  18. package/dist/meeting-info/index.js.map +1 -1
  19. package/dist/meeting-info/meeting-info-v2.js +24 -10
  20. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  21. package/dist/meetings/index.js +12 -9
  22. package/dist/meetings/index.js.map +1 -1
  23. package/dist/metrics/index.js +1 -487
  24. package/dist/metrics/index.js.map +1 -1
  25. package/dist/reconnection-manager/index.js +27 -17
  26. package/dist/reconnection-manager/index.js.map +1 -1
  27. package/dist/roap/request.js +20 -14
  28. package/dist/roap/request.js.map +1 -1
  29. package/dist/types/breakouts/events.d.ts +7 -1
  30. package/dist/types/constants.d.ts +0 -1
  31. package/dist/types/meeting/index.d.ts +31 -133
  32. package/dist/types/meeting-info/index.d.ts +6 -1
  33. package/dist/types/meetings/index.d.ts +1 -0
  34. package/dist/types/metrics/index.d.ts +4 -128
  35. package/package.json +19 -19
  36. package/src/breakouts/breakout.ts +10 -2
  37. package/src/breakouts/events.ts +51 -32
  38. package/src/breakouts/index.ts +9 -5
  39. package/src/constants.ts +0 -2
  40. package/src/locus-info/index.ts +35 -17
  41. package/src/meeting/index.ts +474 -536
  42. package/src/meeting/util.ts +42 -19
  43. package/src/meeting-info/index.ts +54 -8
  44. package/src/meeting-info/meeting-info-v2.ts +24 -9
  45. package/src/meetings/index.ts +11 -6
  46. package/src/metrics/index.ts +1 -506
  47. package/src/reconnection-manager/index.ts +27 -17
  48. package/src/roap/request.ts +21 -9
  49. package/test/unit/spec/breakouts/breakout.ts +4 -2
  50. package/test/unit/spec/breakouts/events.ts +24 -18
  51. package/test/unit/spec/locus-info/index.js +112 -0
  52. package/test/unit/spec/meeting/index.js +178 -145
  53. package/test/unit/spec/meeting/utils.js +93 -7
  54. package/test/unit/spec/meeting-info/index.js +181 -0
  55. package/test/unit/spec/meeting-info/meetinginfov2.js +68 -68
  56. package/test/unit/spec/meetings/index.js +35 -55
  57. package/test/unit/spec/metrics/index.js +1 -148
  58. package/test/unit/spec/reconnection-manager/index.js +51 -2
  59. package/test/unit/spec/roap/index.ts +8 -2
  60. package/test/unit/spec/roap/request.ts +43 -5
  61. package/dist/metrics/config.js +0 -335
  62. package/dist/metrics/config.js.map +0 -1
  63. package/dist/types/metrics/config.d.ts +0 -195
  64. package/src/metrics/config.ts +0 -534
@@ -1,9 +1,6 @@
1
1
  import {LocalCameraTrack, LocalMicrophoneTrack} from '@webex/media-helpers';
2
-
3
2
  import {cloneDeep} from 'lodash';
4
3
  import {MeetingNotActiveError, UserNotJoinedError} from '../common/errors/webex-errors';
5
- import Metrics from '../metrics';
6
- import {eventType, trigger} from '../metrics/config';
7
4
  import LoggerProxy from '../common/logs/logger-proxy';
8
5
  import {
9
6
  INTENT_TO_JOIN,
@@ -43,6 +40,7 @@ const MeetingUtil = {
43
40
  },
44
41
 
45
42
  remoteUpdateAudioVideo: (meeting, audioMuted?: boolean, videoMuted?: boolean) => {
43
+ const webex = meeting.getWebexObject();
46
44
  if (!meeting) {
47
45
  return Promise.reject(new ParameterError('You need a meeting object.'));
48
46
  }
@@ -55,7 +53,11 @@ const MeetingUtil = {
55
53
  );
56
54
  }
57
55
 
58
- Metrics.postEvent({event: eventType.MEDIA_REQUEST, meeting});
56
+ // @ts-ignore
57
+ webex.internal.newMetrics.submitClientEvent({
58
+ name: 'client.locus.media.request',
59
+ options: {meetingId: meeting.id},
60
+ });
59
61
 
60
62
  return meeting.locusMediaRequest
61
63
  .send({
@@ -69,7 +71,11 @@ const MeetingUtil = {
69
71
  },
70
72
  })
71
73
  .then((response) => {
72
- Metrics.postEvent({event: eventType.MEDIA_RESPONSE, meeting});
74
+ // @ts-ignore
75
+ webex.internal.newMetrics.submitClientEvent({
76
+ name: 'client.locus.media.response',
77
+ options: {meetingId: meeting.id},
78
+ });
73
79
 
74
80
  return response?.body?.locus;
75
81
  });
@@ -85,8 +91,13 @@ const MeetingUtil = {
85
91
  if (!meeting) {
86
92
  return Promise.reject(new ParameterError('You need a meeting object.'));
87
93
  }
94
+ const webex = meeting.getWebexObject();
88
95
 
89
- Metrics.postEvent({event: eventType.LOCUS_JOIN_REQUEST, meeting});
96
+ // @ts-ignore
97
+ webex.internal.newMetrics.submitClientEvent({
98
+ name: 'client.locus.join.request',
99
+ options: {meetingId: meeting.id},
100
+ });
90
101
 
91
102
  // eslint-disable-next-line no-warning-comments
92
103
  // TODO: check if the meeting is in JOINING state
@@ -112,14 +123,18 @@ const MeetingUtil = {
112
123
  liveAnnotationSupported: options.liveAnnotationSupported,
113
124
  })
114
125
  .then((res) => {
115
- Metrics.postEvent({
116
- event: eventType.LOCUS_JOIN_RESPONSE,
117
- meeting,
118
- data: {
119
- trigger: trigger.LOCI_UPDATE,
120
- locus: res.body.locus,
126
+ // @ts-ignore
127
+ webex.internal.newMetrics.submitClientEvent({
128
+ name: 'client.locus.join.response',
129
+ payload: {
130
+ trigger: 'loci-update',
131
+ identifiers: {
132
+ trackingId: res.headers.trackingid,
133
+ },
134
+ },
135
+ options: {
136
+ meetingId: meeting.id,
121
137
  mediaConnections: res.body.mediaConnections,
122
- trackingId: res.headers.trackingid,
123
138
  },
124
139
  });
125
140
 
@@ -232,6 +247,8 @@ const MeetingUtil = {
232
247
  (currentMediaStatus.audio || currentMediaStatus.video || currentMediaStatus.share),
233
248
 
234
249
  joinMeetingOptions: (meeting, options: any = {}) => {
250
+ const webex = meeting.getWebexObject();
251
+
235
252
  meeting.resourceId = meeting.resourceId || options.resourceId;
236
253
 
237
254
  if (meeting.requiredCaptcha) {
@@ -242,9 +259,12 @@ const MeetingUtil = {
242
259
  }
243
260
 
244
261
  if (options.pin) {
245
- Metrics.postEvent({
246
- event: eventType.PIN_COLLECTED,
247
- meeting,
262
+ // @ts-ignore
263
+ webex.internal.newMetrics.submitClientEvent({
264
+ name: 'client.pin.collected',
265
+ options: {
266
+ meetingId: meeting.id,
267
+ },
248
268
  });
249
269
  }
250
270
 
@@ -258,9 +278,12 @@ const MeetingUtil = {
258
278
  .catch((err) => {
259
279
  // joining a claimed PMR that is not my own, scenario B
260
280
  if (MeetingUtil.isPinOrGuest(err)) {
261
- Metrics.postEvent({
262
- event: eventType.PIN_PROMPT,
263
- meeting,
281
+ // @ts-ignore
282
+ webex.internal.newMetrics.submitClientEvent({
283
+ name: 'client.pin.prompt',
284
+ options: {
285
+ meetingId: meeting.id,
286
+ },
264
287
  });
265
288
 
266
289
  // request host pin or non host for unclaimed PMR, start of Scenario C
@@ -70,10 +70,22 @@ export default class MeetingInfo {
70
70
  * @private
71
71
  * @memberof MeetingInfo
72
72
  */
73
- private requestFetchInfo(options: object) {
73
+ private requestFetchInfo(options: any) {
74
+ const {meetingId} = options;
75
+ if (meetingId) {
76
+ this.webex.internal.newMetrics.submitInternalEvent({
77
+ name: 'internal.client.meetinginfo.request',
78
+ });
79
+ }
80
+
74
81
  return this.meetingInfoRequest
75
82
  .fetchMeetingInfo(options)
76
83
  .then((info) => {
84
+ if (meetingId) {
85
+ this.webex.internal.newMetrics.submitInternalEvent({
86
+ name: 'internal.client.meetinginfo.response',
87
+ });
88
+ }
77
89
  if (info && info.body) {
78
90
  this.setMeetingInfo(info.body.sipMeetingUri || info.body.meetingLink, info.body);
79
91
  }
@@ -84,6 +96,21 @@ export default class MeetingInfo {
84
96
  LoggerProxy.logger.error(
85
97
  `Meeting-info:index#requestFetchInfo --> ${error} fetch meetingInfo`
86
98
  );
99
+ this.webex.internal.newMetrics.submitInternalEvent({
100
+ name: 'internal.client.meetinginfo.response',
101
+ });
102
+ this.webex.internal.newMetrics.submitClientEvent({
103
+ name: 'client.meetinginfo.response',
104
+ payload: {
105
+ identifiers: {
106
+ meetingLookupUrl: error?.url,
107
+ },
108
+ },
109
+ options: {
110
+ meetingId,
111
+ rawError: error,
112
+ },
113
+ });
87
114
 
88
115
  return Promise.reject(error);
89
116
  });
@@ -105,6 +132,7 @@ export default class MeetingInfo {
105
132
  });
106
133
  }
107
134
 
135
+ // eslint-disable-next-line valid-jsdoc
108
136
  /**
109
137
  * Fetches meeting info from the server
110
138
  * @param {String} destination one of many different types of destinations to look up info for
@@ -113,21 +141,39 @@ export default class MeetingInfo {
113
141
  * @public
114
142
  * @memberof MeetingInfo
115
143
  */
116
- public fetchMeetingInfo(destination: string, type: string = null) {
144
+ public fetchMeetingInfo(
145
+ destination: string,
146
+ type: string = null,
147
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
148
+ password: string = null,
149
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
150
+ captchaInfo: {
151
+ code: string;
152
+ id: string;
153
+ } = null,
154
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
155
+ installedOrgID = null,
156
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
157
+ locusId = null,
158
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
159
+ extraParams: object = {},
160
+ options: {meetingId?: string} = {}
161
+ ) {
117
162
  if (type === _PERSONAL_ROOM_ && !destination) {
118
163
  destination = this.webex.internal.device.userId;
119
164
  }
120
165
 
121
166
  return this.fetchInfoOptions(MeetingInfoUtil.extractDestination(destination, type), type).then(
122
- (options) =>
167
+ (infoOptions) =>
123
168
  // fetch meeting info
124
- this.requestFetchInfo(options).catch((error) => {
169
+ this.requestFetchInfo({...infoOptions, meetingId: options.meetingId}).catch((error) => {
125
170
  // if it failed the first time as meeting link
126
- if (options.type === _MEETING_LINK_) {
171
+ if (infoOptions.type === _MEETING_LINK_) {
127
172
  // convert the meeting link to sip URI and retry
128
- return this.requestFetchInfo(
129
- this.fetchInfoOptions(MeetingInfoUtil.convertLinkToSip(destination), _SIP_URI_)
130
- );
173
+ return this.requestFetchInfo({
174
+ ...this.fetchInfoOptions(MeetingInfoUtil.convertLinkToSip(destination), _SIP_URI_),
175
+ meetingId: options.meetingId,
176
+ });
131
177
  }
132
178
 
133
179
  return Promise.reject(error);
@@ -6,7 +6,6 @@ import {
6
6
  DEFAULT_MEETING_INFO_REQUEST_BODY,
7
7
  } from '../constants';
8
8
  import Metrics from '../metrics';
9
- import {eventType} from '../metrics/config';
10
9
  import BEHAVIORAL_METRICS from '../metrics/constants';
11
10
 
12
11
  import MeetingInfoUtil from './utilv2';
@@ -19,7 +18,6 @@ const ADHOC_MEETING_DEFAULT_ERROR =
19
18
  'Failed starting the adhoc meeting, Please contact support team ';
20
19
  const CAPTCHA_ERROR_REQUIRES_PASSWORD_CODES = [423005, 423006];
21
20
  const POLICY_ERROR_CODES = [403049, 403104, 403103, 403048, 403102, 403101];
22
-
23
21
  /**
24
22
  * Error to indicate that wbxappapi requires a password
25
23
  */
@@ -338,22 +336,39 @@ export default class MeetingInfoV2 {
338
336
  requestOptions.resource = 'meetingInfo';
339
337
  }
340
338
 
339
+ if (meetingId) {
340
+ this.webex.internal.newMetrics.submitInternalEvent({
341
+ name: 'internal.client.meetinginfo.request',
342
+ });
343
+ }
344
+
341
345
  return this.webex
342
346
  .request(requestOptions)
343
347
  .then((response) => {
348
+ if (meetingId) {
349
+ this.webex.internal.newMetrics.submitInternalEvent({
350
+ name: 'internal.client.meetinginfo.response',
351
+ });
352
+ }
344
353
  Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.FETCH_MEETING_INFO_V1_SUCCESS);
345
354
 
346
355
  return response;
347
356
  })
348
357
  .catch((err) => {
349
358
  if (meetingId) {
350
- const parsedError = Metrics.parseWebexApiError(err, true);
351
- Metrics.postEvent({
352
- event: eventType.MEETING_INFO_RESPONSE,
353
- meetingId,
354
- data: {
355
- errors: parsedError ? [parsedError] : undefined,
356
- meetingLookupUrl: err?.url,
359
+ this.webex.internal.newMetrics.submitInternalEvent({
360
+ name: 'internal.client.meetinginfo.response',
361
+ });
362
+ this.webex.internal.newMetrics.submitClientEvent({
363
+ name: 'client.meetinginfo.response',
364
+ payload: {
365
+ identifiers: {
366
+ meetingLookupUrl: err?.url,
367
+ },
368
+ },
369
+ options: {
370
+ meetingId,
371
+ rawError: err,
357
372
  },
358
373
  });
359
374
  }
@@ -2,6 +2,7 @@
2
2
 
3
3
  import '@webex/internal-plugin-mercury';
4
4
  import '@webex/internal-plugin-conversation';
5
+ import '@webex/internal-plugin-metrics';
5
6
  // @ts-ignore
6
7
  import {WebexPlugin} from '@webex/webex-core';
7
8
  import {setLogger} from '@webex/internal-media-core';
@@ -11,7 +12,6 @@ import * as mediaHelpersModule from '@webex/media-helpers';
11
12
  import 'webrtc-adapter';
12
13
 
13
14
  import Metrics from '../metrics';
14
- import {trigger, eventType} from '../metrics/config';
15
15
  import LoggerConfig from '../common/logs/logger-config';
16
16
  import StaticConfig from '../common/config';
17
17
  import LoggerProxy from '../common/logs/logger-proxy';
@@ -492,10 +492,15 @@ export default class Meetings extends WebexPlugin {
492
492
  // because the other user left so before sending 'added' event make sure it exists in the collection
493
493
 
494
494
  if (this.getMeetingByType(_ID_, meeting.id)) {
495
- Metrics.postEvent({
496
- event: eventType.REMOTE_STARTED,
497
- meeting,
498
- data: {trigger: trigger.MERCURY_EVENT},
495
+ // @ts-ignore
496
+ this.webex.internal.newMetrics.submitClientEvent({
497
+ name: 'client.call.remote-started',
498
+ payload: {
499
+ trigger: 'mercury-event',
500
+ },
501
+ options: {
502
+ meetingId: meeting.id,
503
+ },
499
504
  });
500
505
  Trigger.trigger(
501
506
  this,
@@ -648,7 +653,7 @@ export default class Meetings extends WebexPlugin {
648
653
 
649
654
  MeetingsUtil.checkH264Support({disableNotifications: true});
650
655
  // @ts-ignore
651
- Metrics.initialSetup(this.meetingCollection, this.webex);
656
+ Metrics.initialSetup(this.webex);
652
657
  });
653
658
  }
654
659