@webex/plugin-meetings 3.0.0-beta.13 → 3.0.0-beta.15

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 (252) hide show
  1. package/UPGRADING.md +9 -9
  2. package/browsers.js +19 -24
  3. package/dist/common/browser-detection.js +1 -0
  4. package/dist/common/browser-detection.js.map +1 -1
  5. package/dist/common/collection.js.map +1 -1
  6. package/dist/common/errors/captcha-error.js +5 -5
  7. package/dist/common/errors/captcha-error.js.map +1 -1
  8. package/dist/common/errors/intent-to-join.js +5 -5
  9. package/dist/common/errors/intent-to-join.js.map +1 -1
  10. package/dist/common/errors/join-meeting.js +6 -6
  11. package/dist/common/errors/join-meeting.js.map +1 -1
  12. package/dist/common/errors/media.js +5 -5
  13. package/dist/common/errors/media.js.map +1 -1
  14. package/dist/common/errors/parameter.js +5 -5
  15. package/dist/common/errors/parameter.js.map +1 -1
  16. package/dist/common/errors/password-error.js +5 -5
  17. package/dist/common/errors/password-error.js.map +1 -1
  18. package/dist/common/errors/permission.js +4 -4
  19. package/dist/common/errors/permission.js.map +1 -1
  20. package/dist/common/errors/reconnection.js +5 -5
  21. package/dist/common/errors/reconnection.js.map +1 -1
  22. package/dist/common/errors/stats.js +5 -5
  23. package/dist/common/errors/stats.js.map +1 -1
  24. package/dist/common/errors/webex-errors.js.map +1 -1
  25. package/dist/common/errors/webex-meetings-error.js.map +1 -1
  26. package/dist/common/events/events-scope.js.map +1 -1
  27. package/dist/common/events/events.js.map +1 -1
  28. package/dist/common/events/trigger-proxy.js.map +1 -1
  29. package/dist/common/events/util.js.map +1 -1
  30. package/dist/common/logs/logger-proxy.js.map +1 -1
  31. package/dist/common/logs/request.js.map +1 -1
  32. package/dist/config.js.map +1 -1
  33. package/dist/constants.js.map +1 -1
  34. package/dist/index.js.map +1 -1
  35. package/dist/locus-info/controlsUtils.js.map +1 -1
  36. package/dist/locus-info/fullState.js.map +1 -1
  37. package/dist/locus-info/hostUtils.js.map +1 -1
  38. package/dist/locus-info/index.js +11 -8
  39. package/dist/locus-info/index.js.map +1 -1
  40. package/dist/locus-info/infoUtils.js.map +1 -1
  41. package/dist/locus-info/mediaSharesUtils.js.map +1 -1
  42. package/dist/locus-info/parser.js +2 -1
  43. package/dist/locus-info/parser.js.map +1 -1
  44. package/dist/locus-info/selfUtils.js +2 -1
  45. package/dist/locus-info/selfUtils.js.map +1 -1
  46. package/dist/media/index.js.map +1 -1
  47. package/dist/media/internal-media-core-wrapper.js.map +1 -1
  48. package/dist/media/properties.js.map +1 -1
  49. package/dist/media/util.js +1 -1
  50. package/dist/media/util.js.map +1 -1
  51. package/dist/mediaQualityMetrics/config.js.map +1 -1
  52. package/dist/meeting/effectsState.js +1 -1
  53. package/dist/meeting/effectsState.js.map +1 -1
  54. package/dist/meeting/in-meeting-actions.js.map +1 -1
  55. package/dist/meeting/index.js +118 -89
  56. package/dist/meeting/index.js.map +1 -1
  57. package/dist/meeting/muteState.js +1 -1
  58. package/dist/meeting/muteState.js.map +1 -1
  59. package/dist/meeting/request.js +25 -0
  60. package/dist/meeting/request.js.map +1 -1
  61. package/dist/meeting/request.type.js +8 -0
  62. package/dist/meeting/request.type.js.map +1 -0
  63. package/dist/meeting/state.js +5 -5
  64. package/dist/meeting/state.js.map +1 -1
  65. package/dist/meeting/util.js.map +1 -1
  66. package/dist/meeting-info/collection.js.map +1 -1
  67. package/dist/meeting-info/index.js +2 -2
  68. package/dist/meeting-info/index.js.map +1 -1
  69. package/dist/meeting-info/meeting-info-v2.js +48 -48
  70. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  71. package/dist/meeting-info/request.js.map +1 -1
  72. package/dist/meeting-info/util.js.map +1 -1
  73. package/dist/meeting-info/utilv2.js +1 -1
  74. package/dist/meeting-info/utilv2.js.map +1 -1
  75. package/dist/meetings/collection.js.map +1 -1
  76. package/dist/meetings/index.js +251 -250
  77. package/dist/meetings/index.js.map +1 -1
  78. package/dist/meetings/request.js +2 -2
  79. package/dist/meetings/request.js.map +1 -1
  80. package/dist/meetings/util.js +14 -14
  81. package/dist/meetings/util.js.map +1 -1
  82. package/dist/member/index.js +31 -31
  83. package/dist/member/index.js.map +1 -1
  84. package/dist/member/util.js.map +1 -1
  85. package/dist/members/collection.js.map +1 -1
  86. package/dist/members/index.js +43 -43
  87. package/dist/members/index.js.map +1 -1
  88. package/dist/members/request.js.map +1 -1
  89. package/dist/members/util.js.map +1 -1
  90. package/dist/metrics/config.js.map +1 -1
  91. package/dist/metrics/constants.js.map +1 -1
  92. package/dist/metrics/index.js +23 -20
  93. package/dist/metrics/index.js.map +1 -1
  94. package/dist/multistream/multistreamMedia.js +2 -1
  95. package/dist/multistream/multistreamMedia.js.map +1 -1
  96. package/dist/multistream/receiveSlot.js.map +1 -1
  97. package/dist/multistream/receiveSlotManager.js +2 -0
  98. package/dist/multistream/receiveSlotManager.js.map +1 -1
  99. package/dist/multistream/remoteMedia.js.map +1 -1
  100. package/dist/multistream/remoteMediaGroup.js.map +1 -1
  101. package/dist/multistream/remoteMediaManager.js.map +1 -1
  102. package/dist/networkQualityMonitor/index.js +8 -8
  103. package/dist/networkQualityMonitor/index.js.map +1 -1
  104. package/dist/personal-meeting-room/index.js +7 -7
  105. package/dist/personal-meeting-room/index.js.map +1 -1
  106. package/dist/personal-meeting-room/request.js.map +1 -1
  107. package/dist/personal-meeting-room/util.js.map +1 -1
  108. package/dist/reachability/index.js.map +1 -1
  109. package/dist/reachability/request.js.map +1 -1
  110. package/dist/reactions/reactions.js.map +1 -1
  111. package/dist/reactions/reactions.type.js +3 -1
  112. package/dist/reactions/reactions.type.js.map +1 -1
  113. package/dist/reconnection-manager/index.js +4 -4
  114. package/dist/reconnection-manager/index.js.map +1 -1
  115. package/dist/roap/index.js +5 -5
  116. package/dist/roap/index.js.map +1 -1
  117. package/dist/roap/request.js.map +1 -1
  118. package/dist/roap/turnDiscovery.js.map +1 -1
  119. package/dist/statsAnalyzer/global.js.map +1 -1
  120. package/dist/statsAnalyzer/index.js.map +1 -1
  121. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  122. package/dist/transcription/index.js +4 -1
  123. package/dist/transcription/index.js.map +1 -1
  124. package/internal-README.md +7 -6
  125. package/package.json +18 -18
  126. package/src/common/browser-detection.ts +9 -6
  127. package/src/common/collection.ts +3 -1
  128. package/src/common/errors/captcha-error.ts +6 -6
  129. package/src/common/errors/intent-to-join.ts +6 -6
  130. package/src/common/errors/join-meeting.ts +12 -8
  131. package/src/common/errors/media.ts +6 -6
  132. package/src/common/errors/parameter.ts +9 -6
  133. package/src/common/errors/password-error.ts +6 -6
  134. package/src/common/errors/permission.ts +5 -5
  135. package/src/common/errors/reconnection.ts +6 -6
  136. package/src/common/errors/stats.ts +6 -6
  137. package/src/common/errors/webex-errors.ts +7 -5
  138. package/src/common/errors/webex-meetings-error.ts +1 -1
  139. package/src/common/events/events-scope.ts +5 -1
  140. package/src/common/events/events.ts +5 -1
  141. package/src/common/events/trigger-proxy.ts +8 -3
  142. package/src/common/events/util.ts +1 -2
  143. package/src/common/logs/logger-proxy.ts +21 -10
  144. package/src/common/logs/request.ts +11 -8
  145. package/src/config.ts +11 -11
  146. package/src/constants.ts +1 -1
  147. package/src/index.js +1 -1
  148. package/src/locus-info/controlsUtils.ts +34 -24
  149. package/src/locus-info/fullState.ts +15 -11
  150. package/src/locus-info/hostUtils.ts +4 -3
  151. package/src/locus-info/index.ts +25 -34
  152. package/src/locus-info/infoUtils.ts +12 -4
  153. package/src/locus-info/mediaSharesUtils.ts +4 -4
  154. package/src/locus-info/parser.ts +45 -68
  155. package/src/locus-info/selfUtils.ts +106 -57
  156. package/src/media/index.ts +123 -135
  157. package/src/media/internal-media-core-wrapper.ts +2 -2
  158. package/src/media/properties.ts +30 -20
  159. package/src/media/util.ts +1 -1
  160. package/src/mediaQualityMetrics/config.ts +46 -46
  161. package/src/meeting/effectsState.ts +35 -35
  162. package/src/meeting/in-meeting-actions.ts +7 -3
  163. package/src/meeting/index.ts +1576 -1291
  164. package/src/meeting/muteState.ts +62 -31
  165. package/src/meeting/request.ts +174 -113
  166. package/src/meeting/request.type.ts +11 -0
  167. package/src/meeting/state.ts +45 -30
  168. package/src/meeting/util.ts +101 -70
  169. package/src/meeting-info/collection.ts +2 -1
  170. package/src/meeting-info/index.ts +32 -30
  171. package/src/meeting-info/meeting-info-v2.ts +106 -108
  172. package/src/meeting-info/request.ts +9 -3
  173. package/src/meeting-info/util.ts +54 -46
  174. package/src/meeting-info/utilv2.ts +59 -53
  175. package/src/meetings/collection.ts +1 -1
  176. package/src/meetings/index.ts +512 -440
  177. package/src/meetings/request.ts +26 -24
  178. package/src/meetings/util.ts +29 -29
  179. package/src/member/index.ts +55 -49
  180. package/src/member/util.ts +26 -13
  181. package/src/members/collection.ts +0 -1
  182. package/src/members/index.ts +182 -126
  183. package/src/members/request.ts +46 -14
  184. package/src/members/util.ts +44 -42
  185. package/src/metrics/config.ts +254 -81
  186. package/src/metrics/constants.ts +0 -2
  187. package/src/metrics/index.ts +84 -71
  188. package/src/multistream/multistreamMedia.ts +1 -0
  189. package/src/multistream/receiveSlot.ts +1 -0
  190. package/src/multistream/receiveSlotManager.ts +1 -0
  191. package/src/multistream/remoteMedia.ts +1 -1
  192. package/src/multistream/remoteMediaGroup.ts +2 -1
  193. package/src/multistream/remoteMediaManager.ts +3 -0
  194. package/src/networkQualityMonitor/index.ts +20 -23
  195. package/src/personal-meeting-room/index.ts +12 -16
  196. package/src/personal-meeting-room/request.ts +10 -3
  197. package/src/personal-meeting-room/util.ts +3 -3
  198. package/src/reachability/index.ts +61 -59
  199. package/src/reachability/request.ts +36 -32
  200. package/src/reactions/reactions.ts +4 -4
  201. package/src/reactions/reactions.type.ts +4 -3
  202. package/src/reconnection-manager/index.ts +139 -84
  203. package/src/roap/index.ts +46 -38
  204. package/src/roap/request.ts +44 -31
  205. package/src/roap/turnDiscovery.ts +59 -30
  206. package/src/statsAnalyzer/global.ts +30 -33
  207. package/src/statsAnalyzer/index.ts +432 -175
  208. package/src/statsAnalyzer/mqaUtil.ts +178 -72
  209. package/src/transcription/index.ts +34 -32
  210. package/test/integration/spec/journey.js +663 -462
  211. package/test/integration/spec/space-meeting.js +318 -203
  212. package/test/integration/spec/transcription.js +6 -7
  213. package/test/unit/spec/common/browser-detection.js +9 -28
  214. package/test/unit/spec/fixture/locus.js +92 -90
  215. package/test/unit/spec/locus-info/controlsUtils.js +5 -5
  216. package/test/unit/spec/locus-info/embeddedAppsUtils.js +8 -6
  217. package/test/unit/spec/locus-info/index.js +1 -2
  218. package/test/unit/spec/locus-info/infoUtils.js +26 -33
  219. package/test/unit/spec/locus-info/lib/BasicSeqCmp.json +88 -430
  220. package/test/unit/spec/locus-info/lib/SeqCmp.json +513 -685
  221. package/test/unit/spec/locus-info/parser.js +3 -9
  222. package/test/unit/spec/locus-info/selfConstant.js +72 -103
  223. package/test/unit/spec/locus-info/selfUtils.js +21 -12
  224. package/test/unit/spec/meeting/effectsState.js +36 -46
  225. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -3
  226. package/test/unit/spec/meeting/index.js +1342 -684
  227. package/test/unit/spec/meeting/muteState.js +42 -33
  228. package/test/unit/spec/meeting/request.js +75 -45
  229. package/test/unit/spec/meeting/utils.js +78 -53
  230. package/test/unit/spec/meeting-info/meetinginfov2.js +100 -73
  231. package/test/unit/spec/meeting-info/request.js +7 -9
  232. package/test/unit/spec/meeting-info/util.js +11 -12
  233. package/test/unit/spec/meeting-info/utilv2.js +110 -74
  234. package/test/unit/spec/meetings/collection.js +1 -1
  235. package/test/unit/spec/meetings/index.js +438 -257
  236. package/test/unit/spec/meetings/utils.js +14 -12
  237. package/test/unit/spec/member/index.js +0 -1
  238. package/test/unit/spec/member/util.js +5 -6
  239. package/test/unit/spec/members/index.js +104 -54
  240. package/test/unit/spec/members/request.js +29 -20
  241. package/test/unit/spec/members/utils.js +8 -5
  242. package/test/unit/spec/metrics/index.js +16 -21
  243. package/test/unit/spec/networkQualityMonitor/index.js +21 -15
  244. package/test/unit/spec/personal-meeting-room/personal-meeting-room.js +2 -7
  245. package/test/unit/spec/reachability/index.ts +9 -11
  246. package/test/unit/spec/reconnection-manager/index.js +16 -18
  247. package/test/unit/spec/roap/turnDiscovery.ts +22 -19
  248. package/test/unit/spec/stats-analyzer/index.js +25 -20
  249. package/test/utils/cmr.js +44 -42
  250. package/test/utils/testUtils.js +83 -74
  251. package/test/utils/webex-config.js +18 -18
  252. package/test/utils/webex-test-users.js +53 -50
@@ -1,3 +1,5 @@
1
+ /* eslint no-shadow: ["error", { "allow": ["eventType"] }] */
2
+
1
3
  import '@webex/internal-plugin-mercury';
2
4
  import '@webex/internal-plugin-conversation';
3
5
  // @ts-ignore
@@ -37,7 +39,7 @@ import {
37
39
  _ID_,
38
40
  MEETING_REMOVED_REASON,
39
41
  _CONVERSATION_URL_,
40
- CONVERSATION_URL
42
+ CONVERSATION_URL,
41
43
  } from '../constants';
42
44
  import BEHAVIORAL_METRICS from '../metrics/constants';
43
45
  import MeetingInfo from '../meeting-info';
@@ -45,7 +47,7 @@ import MeetingInfoV2 from '../meeting-info/meeting-info-v2';
45
47
  import Meeting from '../meeting';
46
48
  import PersonalMeetingRoom from '../personal-meeting-room';
47
49
  import Reachability from '../reachability';
48
- import Request from '../meetings/request';
50
+ import Request from './request';
49
51
  import PasswordError from '../common/errors/password-error';
50
52
  import CaptchaError from '../common/errors/captcha-error';
51
53
 
@@ -80,21 +82,21 @@ class MediaLogger {
80
82
  }
81
83
  }
82
84
  /**
83
- * Meetings Ready Event
84
- * Emitted when the meetings instance on webex is ready
85
- * @event meetings:ready
86
- * @instance
87
- * @memberof Meetings
88
- */
85
+ * Meetings Ready Event
86
+ * Emitted when the meetings instance on webex is ready
87
+ * @event meetings:ready
88
+ * @instance
89
+ * @memberof Meetings
90
+ */
89
91
 
90
92
  /**
91
- * Meetings Network Disconnected Event
92
- * Emitted when the meetings instance is disconnected from
93
- * the internal mercury server
94
- * @event network:disconnected
95
- * @instance
96
- * @memberof Meetings
97
- */
93
+ * Meetings Network Disconnected Event
94
+ * Emitted when the meetings instance is disconnected from
95
+ * the internal mercury server
96
+ * @event network:disconnected
97
+ * @instance
98
+ * @memberof Meetings
99
+ */
98
100
 
99
101
  /**
100
102
  * Meetings Registered Event
@@ -105,32 +107,32 @@ class MediaLogger {
105
107
  */
106
108
 
107
109
  /**
108
- * Meeting Removed Event
109
- * Emitted when a meeting was removed from the cache of meetings
110
- * @event meeting:removed
111
- * @instance
112
- * @type {Object}
113
- * @property {String} meetingId the removed meeting
114
- * @property {Object} response the server response
115
- * @property {String} type what type of meeting it was
116
- * @memberof Meetings
117
- */
110
+ * Meeting Removed Event
111
+ * Emitted when a meeting was removed from the cache of meetings
112
+ * @event meeting:removed
113
+ * @instance
114
+ * @type {Object}
115
+ * @property {String} meetingId the removed meeting
116
+ * @property {Object} response the server response
117
+ * @property {String} type what type of meeting it was
118
+ * @memberof Meetings
119
+ */
118
120
 
119
121
  /**
120
- * Meeting Added Event
121
- * Emitted when a meeting was added to the cache of meetings
122
- * @event meeting:added
123
- * @instance
124
- * @type {Object}
125
- * @property {String} meetingId the added meeting
126
- * @property {String} type what type of meeting it was
127
- * @memberof Meetings
128
- */
122
+ * Meeting Added Event
123
+ * Emitted when a meeting was added to the cache of meetings
124
+ * @event meeting:added
125
+ * @instance
126
+ * @type {Object}
127
+ * @property {String} meetingId the added meeting
128
+ * @property {String} type what type of meeting it was
129
+ * @memberof Meetings
130
+ */
129
131
 
130
132
  /**
131
- * Maintain a cache of meetings and sync with services.
132
- * @class
133
- */
133
+ * Maintain a cache of meetings and sync with services.
134
+ * @class
135
+ */
134
136
  export default class Meetings extends WebexPlugin {
135
137
  loggerRequest: any;
136
138
  media: any;
@@ -146,114 +148,128 @@ export default class Meetings extends WebexPlugin {
146
148
  namespace = MEETINGS;
147
149
 
148
150
  /**
149
- * Initializes the Meetings Plugin
150
- * @constructor
151
- * @public
152
- * @memberof Meetings
153
- */
151
+ * Initializes the Meetings Plugin
152
+ * @constructor
153
+ * @public
154
+ * @memberof Meetings
155
+ */
154
156
  constructor(...args) {
155
157
  super(...args);
156
158
 
157
159
  /**
158
- * The Meetings request to interact with server
159
- * @instance
160
- * @type {Object}
161
- * @private
162
- * @memberof Meetings
163
- */
160
+ * The Meetings request to interact with server
161
+ * @instance
162
+ * @type {Object}
163
+ * @private
164
+ * @memberof Meetings
165
+ */
164
166
  // @ts-ignore
165
167
  this.request = new Request({}, {parent: this.webex});
166
168
  /**
167
- * Log upload request helper
168
- * @instance
169
- * @type {Object}
170
- * @private
171
- * @memberof Meetings
172
- */
169
+ * Log upload request helper
170
+ * @instance
171
+ * @type {Object}
172
+ * @private
173
+ * @memberof Meetings
174
+ */
173
175
  // @ts-ignore
174
176
  this.loggerRequest = new LoggerRequest({webex: this.webex});
175
177
  this.meetingCollection = new MeetingCollection();
176
178
  /**
177
- * The PersonalMeetingRoom object to interact with server
178
- * @instance
179
- * @type {Object}
180
- * @public
181
- * @memberof Meetings
182
- */
179
+ * The PersonalMeetingRoom object to interact with server
180
+ * @instance
181
+ * @type {Object}
182
+ * @public
183
+ * @memberof Meetings
184
+ */
183
185
  this.personalMeetingRoom = null;
184
186
  /**
185
- * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called
186
- * starts as null
187
- * @instance
188
- * @type {Object}
189
- * @private
190
- * @memberof Meetings
191
- */
187
+ * The Reachability object to interact with server, starts as null until {@link Meeting#setReachability} is called
188
+ * starts as null
189
+ * @instance
190
+ * @type {Object}
191
+ * @private
192
+ * @memberof Meetings
193
+ */
192
194
  this.reachability = null;
193
195
 
194
196
  /**
195
- * If the meetings plugin has been registered and listening via {@link Meetings#register}
196
- * @instance
197
- * @type {Boolean}
198
- * @public
199
- * @memberof Meetings
200
- */
197
+ * If the meetings plugin has been registered and listening via {@link Meetings#register}
198
+ * @instance
199
+ * @type {Boolean}
200
+ * @public
201
+ * @memberof Meetings
202
+ */
201
203
  this.registered = false;
202
204
 
203
205
  /**
204
- * This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}
205
- * @instance
206
- * @type {String}
207
- * @private
208
- * @memberof Meetings
209
- */
206
+ * This values indicates the preferred webex site the user will start there meeting, getsits value from {@link Meetings#register}
207
+ * @instance
208
+ * @type {String}
209
+ * @private
210
+ * @memberof Meetings
211
+ */
210
212
  this.preferredWebexSite = '';
211
213
 
212
214
  /**
213
- * The public interface for the internal Media util files. These are helpful to expose outside the context
214
- * of a meeting so that a user can access media without creating a meeting instance.
215
- * @instance
216
- * @type {Object}
217
- * @private
218
- * @memberof Meetings
219
- */
215
+ * The public interface for the internal Media util files. These are helpful to expose outside the context
216
+ * of a meeting so that a user can access media without creating a meeting instance.
217
+ * @instance
218
+ * @type {Object}
219
+ * @private
220
+ * @memberof Meetings
221
+ */
220
222
  this.media = {
221
223
  getUserMedia: Media.getUserMedia,
222
- getSupportedDevice: Media.getSupportedDevice
224
+ getSupportedDevice: Media.getSupportedDevice,
223
225
  };
224
226
 
225
227
  this.onReady();
226
228
  }
227
229
 
228
230
  /**
229
- * handle locus events and takes meeting actions with them as they come in
230
- * @param {Object} data a locus event
231
- * @param {String} data.locusUrl
232
- * @param {Object} data.locus
233
- * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
234
- * @param {String} data.eventType
235
- * @returns {undefined}
236
- * @private
237
- * @memberof Meetings
238
- */
239
- private handleLocusEvent(data: { locusUrl: string; locus: any }, useRandomDelayForInfo: boolean = false) {
231
+ * handle locus events and takes meeting actions with them as they come in
232
+ * @param {Object} data a locus event
233
+ * @param {String} data.locusUrl
234
+ * @param {Object} data.locus
235
+ * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
236
+ * @param {String} data.eventType
237
+ * @returns {undefined}
238
+ * @private
239
+ * @memberof Meetings
240
+ */
241
+ private handleLocusEvent(data: {locusUrl: string; locus: any}, useRandomDelayForInfo = false) {
240
242
  let meeting = null;
241
243
 
242
244
  // getting meeting by correlationId. This will happen for the new event
243
245
  // Either the locus
244
246
  // TODO : Add check for the callBack Address
245
- meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locusUrl) ||
246
- // @ts-ignore
247
- this.meetingCollection.getByKey(CORRELATION_ID, MeetingsUtil.checkForCorrelationId(this.webex.internal.device.url, data.locus)) ||
248
- this.meetingCollection.getByKey(SIP_URI, data.locus.self && data.locus.self.callbackInfo && data.locus.self.callbackInfo.callbackAddress) ||
249
- (data.locus.info?.isUnifiedSpaceMeeting ? undefined : this.meetingCollection.getByKey(CONVERSATION_URL, data.locus.conversationUrl));
247
+ meeting =
248
+ this.meetingCollection.getByKey(LOCUS_URL, data.locusUrl) ||
249
+ // @ts-ignore
250
+ this.meetingCollection.getByKey(
251
+ CORRELATION_ID,
252
+ MeetingsUtil.checkForCorrelationId(this.webex.internal.device.url, data.locus)
253
+ ) ||
254
+ this.meetingCollection.getByKey(
255
+ SIP_URI,
256
+ data.locus.self &&
257
+ data.locus.self.callbackInfo &&
258
+ data.locus.self.callbackInfo.callbackAddress
259
+ ) ||
260
+ (data.locus.info?.isUnifiedSpaceMeeting
261
+ ? undefined
262
+ : this.meetingCollection.getByKey(CONVERSATION_URL, data.locus.conversationUrl));
250
263
 
251
264
  // Special case when locus has got replaced, This only happend once if a replace locus exists
252
265
  // https://sqbu-github.cisco.com/WebExSquared/locus/wiki/Locus-changing-mid-call
253
266
 
254
267
  if (!meeting && data.locus?.replaces?.length > 0) {
255
268
  // Always the last element in the replace is the active one
256
- meeting = this.meetingCollection.getByKey(LOCUS_URL, data.locus.replaces[data.locus.replaces.length - 1].locusUrl);
269
+ meeting = this.meetingCollection.getByKey(
270
+ LOCUS_URL,
271
+ data.locus.replaces[data.locus.replaces.length - 1].locusUrl
272
+ );
257
273
  }
258
274
 
259
275
  if (!meeting) {
@@ -276,73 +292,92 @@ export default class Meetings extends WebexPlugin {
276
292
  // };
277
293
  // rather then locus object change to locus url
278
294
 
279
- if (data.locus && data.locus.fullState && data.locus.fullState.state === LOCUS.STATE.INACTIVE) {
295
+ if (
296
+ data.locus &&
297
+ data.locus.fullState &&
298
+ data.locus.fullState.state === LOCUS.STATE.INACTIVE
299
+ ) {
280
300
  // just ignore the event as its already ended and not active
281
- LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
301
+ LoggerProxy.logger.warn(
302
+ 'Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.'
303
+ );
282
304
 
283
305
  return;
284
306
  }
285
307
 
286
-
287
308
  // When its wireless share or guest and user leaves the meeting we dont have to keep the meeting object
288
309
  // Any future events will be neglected
289
310
 
290
- if (data.locus && data.locus.self && (data.locus.self.state === _LEFT_ && data.locus.self.removed === true)) {
311
+ if (
312
+ data.locus &&
313
+ data.locus.self &&
314
+ data.locus.self.state === _LEFT_ &&
315
+ data.locus.self.removed === true
316
+ ) {
291
317
  // just ignore the event as its already ended and not active
292
- LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.');
318
+ LoggerProxy.logger.warn(
319
+ 'Meetings:index#handleLocusEvent --> Locus event received for meeting, after it was ended.'
320
+ );
293
321
 
294
322
  return;
295
323
  }
296
324
 
297
- this.create(data.locus, _LOCUS_ID_, useRandomDelayForInfo).then((newMeeting) => {
298
- meeting = newMeeting;
325
+ this.create(data.locus, _LOCUS_ID_, useRandomDelayForInfo)
326
+ .then((newMeeting) => {
327
+ meeting = newMeeting;
299
328
 
300
- // It's a new meeting so initialize the locus data
301
- meeting.locusInfo.initialSetup(data.locus);
302
- }).catch((e) => {
303
- console.log(e);
304
- })
329
+ // It's a new meeting so initialize the locus data
330
+ meeting.locusInfo.initialSetup(data.locus);
331
+ })
332
+ .catch((e) => {
333
+ LoggerProxy.logger.error(e);
334
+ })
305
335
  .finally(() => {
306
336
  // There will be cases where locus event comes in gets created and deleted because its a 1:1 and meeting gets deleted
307
337
  // because the other user left so before sending 'added' event make sure it exists in the collection
308
338
 
309
339
  if (this.getMeetingByType(_ID_, meeting.id)) {
310
- Metrics.postEvent({event: eventType.REMOTE_STARTED, meeting, data: {trigger: trigger.MERCURY_EVENT}});
340
+ Metrics.postEvent({
341
+ event: eventType.REMOTE_STARTED,
342
+ meeting,
343
+ data: {trigger: trigger.MERCURY_EVENT},
344
+ });
311
345
  Trigger.trigger(
312
346
  this,
313
347
  {
314
348
  file: 'meetings',
315
- function: 'handleLocusEvent'
349
+ function: 'handleLocusEvent',
316
350
  },
317
351
  EVENT_TRIGGERS.MEETING_ADDED,
318
352
  {
319
353
  meeting,
320
- type: meeting.type === _MEETING_ ? _JOIN_ : _INCOMING_
354
+ type: meeting.type === _MEETING_ ? _JOIN_ : _INCOMING_,
321
355
  }
322
356
  );
323
- }
324
- else {
357
+ } else {
325
358
  // Meeting got added but was not found in the collection. It might have got destroyed
326
- LoggerProxy.logger.warn('Meetings:index#handleLocusEvent --> Created and destroyed meeting object before sending an event');
359
+ LoggerProxy.logger.warn(
360
+ 'Meetings:index#handleLocusEvent --> Created and destroyed meeting object before sending an event'
361
+ );
327
362
  }
328
363
  });
329
- }
330
- else {
364
+ } else {
331
365
  meeting.locusInfo.parse(meeting, data);
332
366
  }
333
367
  }
334
368
 
335
369
  /**
336
- * handles locus events through mercury that are not roap
337
- * @param {Object} envelope
338
- * @param {Object} envelope.data
339
- * @param {String} envelope.data.eventType
340
- * @returns {undefined}
341
- * @private
342
- * @memberof Meetings
343
- */
344
- private handleLocusMercury(envelope: { data: any }) {
370
+ * handles locus events through mercury that are not roap
371
+ * @param {Object} envelope
372
+ * @param {Object} envelope.data
373
+ * @param {String} envelope.data.eventType
374
+ * @returns {undefined}
375
+ * @private
376
+ * @memberof Meetings
377
+ */
378
+ private handleLocusMercury(envelope: {data: any}) {
345
379
  const {data} = envelope;
380
+ // eslint-disable-next-line @typescript-eslint/no-shadow
346
381
  const {eventType} = data;
347
382
 
348
383
  if (eventType && eventType !== LOCUSEVENT.MESSAGE_ROAP) {
@@ -350,31 +385,29 @@ export default class Meetings extends WebexPlugin {
350
385
  }
351
386
  }
352
387
 
353
-
354
388
  /**
355
- * handles mecury offline event
356
- * @returns {undefined}
357
- * @private
358
- * @memberof Meetings
359
- */
389
+ * handles mecury offline event
390
+ * @returns {undefined}
391
+ * @private
392
+ * @memberof Meetings
393
+ */
360
394
  private handleMercuryOffline() {
361
395
  Trigger.trigger(
362
396
  this,
363
397
  {
364
398
  file: 'meetings/index',
365
- function: 'handleMercuryOffline'
399
+ function: 'handleMercuryOffline',
366
400
  },
367
- EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED,
401
+ EVENT_TRIGGERS.MEETINGS_NETWORK_DISCONNECTED
368
402
  );
369
403
  }
370
404
 
371
-
372
405
  /**
373
- * registers for locus and roap mercury events
374
- * @returns {undefined}
375
- * @private
376
- * @memberof Meetings
377
- */
406
+ * registers for locus and roap mercury events
407
+ * @returns {undefined}
408
+ * @private
409
+ * @memberof Meetings
410
+ */
378
411
  private listenForEvents() {
379
412
  // @ts-ignore
380
413
  this.webex.internal.mercury.on(LOCUSEVENT.LOCUS_MERCURY, (envelope) => {
@@ -397,11 +430,11 @@ export default class Meetings extends WebexPlugin {
397
430
  }
398
431
 
399
432
  /**
400
- * stops listening for locus and roap mercury events
401
- * @returns {undefined}
402
- * @private
403
- * @memberof Meetings
404
- */
433
+ * stops listening for locus and roap mercury events
434
+ * @returns {undefined}
435
+ * @private
436
+ * @memberof Meetings
437
+ */
405
438
  private stopListeningForEvents() {
406
439
  // @ts-ignore
407
440
  this.webex.internal.mercury.off(LOCUSEVENT.LOCUS_MERCURY);
@@ -412,10 +445,10 @@ export default class Meetings extends WebexPlugin {
412
445
  }
413
446
 
414
447
  /**
415
- * @returns {undefined}
416
- * @private
417
- * @memberof Meetings
418
- */
448
+ * @returns {undefined}
449
+ * @private
450
+ * @memberof Meetings
451
+ */
419
452
  private onReady() {
420
453
  // @ts-ignore
421
454
  this.webex.once(READY, () => {
@@ -437,15 +470,20 @@ export default class Meetings extends WebexPlugin {
437
470
  * @memberof Meetings
438
471
  */
439
472
  // @ts-ignore
440
- this.meetingInfo = this.config.experimental.enableUnifiedMeetings ? new MeetingInfoV2(this.webex) : new MeetingInfo(this.webex);
473
+ this.meetingInfo = this.config.experimental.enableUnifiedMeetings
474
+ ? new MeetingInfoV2(this.webex)
475
+ : new MeetingInfo(this.webex);
441
476
  // @ts-ignore
442
- this.personalMeetingRoom = new PersonalMeetingRoom({meetingInfo: this.meetingInfo}, {parent: this.webex});
477
+ this.personalMeetingRoom = new PersonalMeetingRoom(
478
+ {meetingInfo: this.meetingInfo},
479
+ {parent: this.webex}
480
+ );
443
481
 
444
482
  Trigger.trigger(
445
483
  this,
446
484
  {
447
485
  file: 'meetings',
448
- function: 'onReady'
486
+ function: 'onReady',
449
487
  },
450
488
  EVENT_TRIGGERS.MEETINGS_READY
451
489
  );
@@ -457,12 +495,12 @@ export default class Meetings extends WebexPlugin {
457
495
  }
458
496
 
459
497
  /**
460
- * API to toggle unified meetings
461
- * @param {Boolean} changeState
462
- * @private
463
- * @memberof Meetings
464
- * @returns {undefined}
465
- */
498
+ * API to toggle unified meetings
499
+ * @param {Boolean} changeState
500
+ * @private
501
+ * @memberof Meetings
502
+ * @returns {undefined}
503
+ */
466
504
  private _toggleUnifiedMeetings(changeState: boolean) {
467
505
  if (typeof changeState !== 'boolean') {
468
506
  return;
@@ -477,12 +515,12 @@ export default class Meetings extends WebexPlugin {
477
515
  }
478
516
 
479
517
  /**
480
- * API to enable or disable TURN discovery
481
- * @param {Boolean} enable
482
- * @private
483
- * @memberof Meetings
484
- * @returns {undefined}
485
- */
518
+ * API to enable or disable TURN discovery
519
+ * @param {Boolean} enable
520
+ * @private
521
+ * @memberof Meetings
522
+ * @returns {undefined}
523
+ */
486
524
  private _toggleTurnDiscovery(enable: boolean) {
487
525
  if (typeof enable !== 'boolean') {
488
526
  return;
@@ -492,12 +530,12 @@ export default class Meetings extends WebexPlugin {
492
530
  }
493
531
 
494
532
  /**
495
- * API to toggle starting adhoc meeting
496
- * @param {Boolean} changeState
497
- * @private
498
- * @memberof Meetings
499
- * @returns {undefined}
500
- */
533
+ * API to toggle starting adhoc meeting
534
+ * @param {Boolean} changeState
535
+ * @private
536
+ * @memberof Meetings
537
+ * @returns {undefined}
538
+ */
501
539
  private _toggleAdhocMeetings(changeState: boolean) {
502
540
  if (typeof changeState !== 'boolean') {
503
541
  return;
@@ -510,24 +548,27 @@ export default class Meetings extends WebexPlugin {
510
548
  }
511
549
 
512
550
  /**
513
- * Explicitly sets up the meetings plugin by registering
514
- * the device, connecting to mercury, and listening for locus events.
515
- *
516
- * @returns {Promise}
517
- * @public
518
- * @memberof Meetings
519
- */
551
+ * Explicitly sets up the meetings plugin by registering
552
+ * the device, connecting to mercury, and listening for locus events.
553
+ *
554
+ * @returns {Promise}
555
+ * @public
556
+ * @memberof Meetings
557
+ */
520
558
  public register() {
521
559
  // @ts-ignore
522
560
  if (!this.webex.canAuthorize) {
523
- LoggerProxy.logger.error('Meetings:index#register --> ERROR, Unable to register, SDK cannot authorize');
561
+ LoggerProxy.logger.error(
562
+ 'Meetings:index#register --> ERROR, Unable to register, SDK cannot authorize'
563
+ );
524
564
 
525
565
  return Promise.reject(new Error('SDK cannot authorize'));
526
566
  }
527
567
 
528
-
529
568
  if (this.registered) {
530
- LoggerProxy.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');
569
+ LoggerProxy.logger.info(
570
+ 'Meetings:index#register --> INFO, Meetings plugin already registered'
571
+ );
531
572
 
532
573
  return Promise.resolve();
533
574
  }
@@ -539,53 +580,58 @@ export default class Meetings extends WebexPlugin {
539
580
  LoggerProxy.logger.error(`Meetings:index#register --> GDM error, ${error.message}`);
540
581
  }),
541
582
  // @ts-ignore
542
- this.webex.internal.device.register()
543
- // @ts-ignore
544
- .then(() => LoggerProxy.logger.info(`Meetings:index#register --> INFO, Device registered ${this.webex.internal.device.url}`))
583
+ this.webex.internal.device
584
+ .register()
585
+ // @ts-ignore
586
+ .then(() =>
587
+ LoggerProxy.logger.info(
588
+ `Meetings:index#register --> INFO, Device registered ${this.webex.internal.device.url}`
589
+ )
590
+ )
545
591
  // @ts-ignore
546
592
  .then(() => this.webex.internal.mercury.connect()),
547
- MeetingsUtil.checkH264Support.call(this)
548
- ]).then(() => {
549
- this.listenForEvents();
550
- Trigger.trigger(
551
- this,
552
- {
553
- file: 'meetings',
554
- function: 'register'
555
- },
556
- EVENT_TRIGGERS.MEETINGS_REGISTERED
557
- );
558
- this.registered = true;
559
- Metrics.sendBehavioralMetric(
560
- BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_SUCCESS,
561
- );
562
- })
563
- .catch((error) => {
564
- LoggerProxy.logger.error(`Meetings:index#register --> ERROR, Unable to register, ${error.message}`);
565
-
566
- Metrics.sendBehavioralMetric(
567
- BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_FAILED,
593
+ MeetingsUtil.checkH264Support.call(this),
594
+ ])
595
+ .then(() => {
596
+ this.listenForEvents();
597
+ Trigger.trigger(
598
+ this,
568
599
  {
569
- reason: error.message,
570
- stack: error.stack
571
- }
600
+ file: 'meetings',
601
+ function: 'register',
602
+ },
603
+ EVENT_TRIGGERS.MEETINGS_REGISTERED
604
+ );
605
+ this.registered = true;
606
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_SUCCESS);
607
+ })
608
+ .catch((error) => {
609
+ LoggerProxy.logger.error(
610
+ `Meetings:index#register --> ERROR, Unable to register, ${error.message}`
572
611
  );
573
612
 
613
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.MEETINGS_REGISTRATION_FAILED, {
614
+ reason: error.message,
615
+ stack: error.stack,
616
+ });
617
+
574
618
  return Promise.reject(error);
575
619
  });
576
620
  }
577
621
 
578
622
  /**
579
- * Explicitly tears down the meetings plugin by deregistering
580
- * the device, disconnecting from mercury, and stops listening to locus events
581
- *
582
- * @returns {Promise}
583
- * @public
584
- * @memberof Meetings
585
- */
623
+ * Explicitly tears down the meetings plugin by deregistering
624
+ * the device, disconnecting from mercury, and stops listening to locus events
625
+ *
626
+ * @returns {Promise}
627
+ * @public
628
+ * @memberof Meetings
629
+ */
586
630
  unregister() {
587
631
  if (!this.registered) {
588
- LoggerProxy.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');
632
+ LoggerProxy.logger.info(
633
+ 'Meetings:index#unregister --> INFO, Meetings plugin already unregistered'
634
+ );
589
635
 
590
636
  return Promise.resolve();
591
637
  }
@@ -593,34 +639,37 @@ export default class Meetings extends WebexPlugin {
593
639
  this.stopListeningForEvents();
594
640
 
595
641
  // @ts-ignore
596
- return this.webex.internal.mercury.disconnect()
597
- // @ts-ignore
598
- .then(() => this.webex.internal.device.unregister())
599
- .then(() => {
600
- Trigger.trigger(
601
- this,
602
- {
603
- file: 'meetings',
604
- function: 'unregister'
605
- },
606
- EVENT_TRIGGERS.MEETINGS_UNREGISTERED
607
- );
608
- this.registered = false;
609
- });
642
+ return (
643
+ this.webex.internal.mercury
644
+ .disconnect()
645
+ // @ts-ignore
646
+ .then(() => this.webex.internal.device.unregister())
647
+ .then(() => {
648
+ Trigger.trigger(
649
+ this,
650
+ {
651
+ file: 'meetings',
652
+ function: 'unregister',
653
+ },
654
+ EVENT_TRIGGERS.MEETINGS_UNREGISTERED
655
+ );
656
+ this.registered = false;
657
+ })
658
+ );
610
659
  }
611
660
 
612
661
  /**
613
- * Uploads logs to the webex services for tracking
614
- * @param {Object} [options={}]
615
- * @param {String} [options.callStart] Call Start Time
616
- * @param {String} [options.feedbackId] ID used for tracking
617
- * @param {String} [options.locusId]
618
- * @param {String} [options.correlationId]
619
- * @param {String} [options.meetingId] webex meeting ID
620
- * @param {String} [options.userId] userId
621
- * @param {String} [options.orgId] org id
622
- * @returns {String} feedback ID logs were submitted under
623
- */
662
+ * Uploads logs to the webex services for tracking
663
+ * @param {Object} [options={}]
664
+ * @param {String} [options.callStart] Call Start Time
665
+ * @param {String} [options.feedbackId] ID used for tracking
666
+ * @param {String} [options.locusId]
667
+ * @param {String} [options.correlationId]
668
+ * @param {String} [options.meetingId] webex meeting ID
669
+ * @param {String} [options.userId] userId
670
+ * @param {String} [options.orgId] org id
671
+ * @returns {String} feedback ID logs were submitted under
672
+ */
624
673
  uploadLogs(
625
674
  options: {
626
675
  callStart?: string;
@@ -634,79 +683,83 @@ export default class Meetings extends WebexPlugin {
634
683
  ) {
635
684
  LoggerProxy.logger.info('Meetings:index#uploadLogs --> uploading logs');
636
685
 
637
- return this.loggerRequest.uploadLogs(options)
686
+ return this.loggerRequest
687
+ .uploadLogs(options)
638
688
  .then((uploadResult) => {
639
- LoggerProxy.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);
689
+ LoggerProxy.logger.info(
690
+ 'Meetings:index#uploadLogs --> Upload logs for meeting completed.',
691
+ uploadResult
692
+ );
640
693
  Trigger.trigger(
641
694
  this,
642
695
  {
643
696
  file: 'meetings',
644
- function: 'uploadLogs'
697
+ function: 'uploadLogs',
645
698
  },
646
699
  EVENT_TRIGGERS.MEETING_LOG_UPLOAD_SUCCESS,
647
700
  {
648
701
  meetingId: options.meetingId,
649
- details: uploadResult
702
+ details: uploadResult,
650
703
  }
651
704
  );
652
705
 
653
706
  return uploadResult;
654
707
  })
655
708
  .catch((uploadError) => {
656
- LoggerProxy.logger.error('Meetings:index#uploadLogs --> Unable to upload logs for meeting', uploadError);
709
+ LoggerProxy.logger.error(
710
+ 'Meetings:index#uploadLogs --> Unable to upload logs for meeting',
711
+ uploadError
712
+ );
657
713
  Trigger.trigger(
658
714
  this,
659
715
  {
660
716
  file: 'meetings',
661
- function: 'uploadLogs'
717
+ function: 'uploadLogs',
662
718
  },
663
719
  EVENT_TRIGGERS.MEETING_LOG_UPLOAD_FAILURE,
664
720
  {
665
721
  meetingId: options.meetingId,
666
- reason: uploadError
722
+ reason: uploadError,
667
723
  }
668
724
  );
669
725
 
670
- Metrics.sendBehavioralMetric(
671
- BEHAVIORAL_METRICS.UPLOAD_LOGS_FAILURE,
672
- {
673
- // @ts-ignore - seems like typo
674
- meetingId: options.meetingsId,
675
- reason: uploadError.message,
676
- stack: uploadError.stack,
677
- code: uploadError.code
678
- }
679
- );
726
+ Metrics.sendBehavioralMetric(BEHAVIORAL_METRICS.UPLOAD_LOGS_FAILURE, {
727
+ // @ts-ignore - seems like typo
728
+ meetingId: options.meetingsId,
729
+ reason: uploadError.message,
730
+ stack: uploadError.stack,
731
+ code: uploadError.code,
732
+ });
680
733
  });
681
734
  }
682
735
 
683
736
  /**
684
- * initializes the reachability instance for Meetings
685
- * @returns {undefined}
686
- * @public
687
- * @memberof Meetings
688
- */
737
+ * initializes the reachability instance for Meetings
738
+ * @returns {undefined}
739
+ * @public
740
+ * @memberof Meetings
741
+ */
689
742
  setReachability() {
690
743
  // @ts-ignore
691
744
  this.reachability = new Reachability(this.webex);
692
745
  }
693
746
 
694
747
  /**
695
- * gets the reachability instance for Meetings
696
- * @returns {Reachability}
697
- * @public
698
- * @memberof Meetings
699
- */
748
+ * gets the reachability instance for Meetings
749
+ * @returns {Reachability}
750
+ * @public
751
+ * @memberof Meetings
752
+ */
700
753
  getReachability() {
701
754
  return this.reachability;
702
755
  }
703
756
 
704
757
  /**
705
- * initializes and starts gathering reachability for Meetings
706
- * @returns {Promise}
707
- * @public
708
- * @memberof Meetings
709
- */
758
+ * initializes and starts gathering reachability for Meetings
759
+ * @returns {Promise}
760
+ * @public
761
+ * @memberof Meetings
762
+ */
710
763
  startReachability() {
711
764
  if (!this.reachability) {
712
765
  this.setReachability();
@@ -716,11 +769,11 @@ export default class Meetings extends WebexPlugin {
716
769
  }
717
770
 
718
771
  /**
719
- * Get geoHint for info for meetings
720
- * @returns {Promise}
721
- * @private
722
- * @memberof Meetings
723
- */
772
+ * Get geoHint for info for meetings
773
+ * @returns {Promise}
774
+ * @private
775
+ * @memberof Meetings
776
+ */
724
777
  getGeoHint() {
725
778
  return this.request.fetchGeoHint().then((res) => {
726
779
  this.geoHintInfo = res;
@@ -728,12 +781,12 @@ export default class Meetings extends WebexPlugin {
728
781
  }
729
782
 
730
783
  /**
731
- * Fetch user preferred webex site information
732
- * This also has other infomation about the user
733
- * @returns {Promise}
734
- * @private
735
- * @memberof Meetings
736
- */
784
+ * Fetch user preferred webex site information
785
+ * This also has other infomation about the user
786
+ * @returns {Promise}
787
+ * @private
788
+ * @memberof Meetings
789
+ */
737
790
  fetchUserPreferredWebexSite() {
738
791
  return this.request.getMeetingPreferences().then((res) => {
739
792
  if (res) {
@@ -743,24 +796,24 @@ export default class Meetings extends WebexPlugin {
743
796
  }
744
797
 
745
798
  /**
746
- * gets the personal meeting room instance, for saved PMR values for this user
747
- * @returns {PersonalMeetingRoom}
748
- * @public
749
- * @memberof Meetings
750
- */
799
+ * gets the personal meeting room instance, for saved PMR values for this user
800
+ * @returns {PersonalMeetingRoom}
801
+ * @public
802
+ * @memberof Meetings
803
+ */
751
804
 
752
805
  getPersonalMeetingRoom() {
753
806
  return this.personalMeetingRoom;
754
807
  }
755
808
 
756
809
  /**
757
- * @param {Meeting} meeting
758
- * @param {Object} reason
759
- * @param {String} type
760
- * @returns {Undefined}
761
- * @private
762
- * @memberof Meetings
763
- */
810
+ * @param {Meeting} meeting
811
+ * @param {Object} reason
812
+ * @param {String} type
813
+ * @returns {Undefined}
814
+ * @private
815
+ * @memberof Meetings
816
+ */
764
817
  private destroy(meeting: Meeting, reason: object) {
765
818
  MeetingUtil.cleanUp(meeting);
766
819
  this.meetingCollection.delete(meeting.id);
@@ -768,123 +821,133 @@ export default class Meetings extends WebexPlugin {
768
821
  this,
769
822
  {
770
823
  file: 'meetings',
771
- function: 'destroy'
824
+ function: 'destroy',
772
825
  },
773
826
  EVENT_TRIGGERS.MEETING_REMOVED,
774
827
  {
775
828
  meetingId: meeting.id,
776
- reason
829
+ reason,
777
830
  }
778
831
  );
779
832
  }
780
833
 
781
834
  /**
782
- * Create a meeting.
783
- * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}
784
- * @param {string} [type] - the optional specified type, such as locusId
785
- * @param {Boolean} useRandomDelayForInfo - whether a random delay should be added to fetching meeting info
786
- * @returns {Promise<Meeting>} A new Meeting.
787
- * @public
788
- * @memberof Meetings
789
- */
790
- public create(destination: string, type: string = null, useRandomDelayForInfo: boolean = false) {
835
+ * Create a meeting.
836
+ * @param {string} destination - sipURL, spaceId, phonenumber, or locus object}
837
+ * @param {string} [type] - the optional specified type, such as locusId
838
+ * @param {Boolean} useRandomDelayForInfo - whether a random delay should be added to fetching meeting info
839
+ * @returns {Promise<Meeting>} A new Meeting.
840
+ * @public
841
+ * @memberof Meetings
842
+ */
843
+ public create(destination: string, type: string = null, useRandomDelayForInfo = false) {
791
844
  // TODO: type should be from a dictionary
792
845
 
793
846
  // Validate meeting information based on the provided destination and
794
847
  // type. This must be performed prior to determining if the meeting is
795
848
  // found in the collection, as we mutate the destination for hydra person
796
849
  // id values.
797
- return this.meetingInfo.fetchInfoOptions(destination, type)
798
- // Catch a failure to fetch info options.
799
- .catch((error) => {
800
- LoggerProxy.logger.info(`Meetings:index#create --> INFO, unable to determine info options: ${error.message}`);
801
- })
802
- .then((options: any = {}) => {
803
- // Normalize the destination.
804
- const targetDest = options.destination || destination;
805
-
806
- // check for the conversation URL then sip Url
807
- let meeting = null;
808
-
809
- if (type === _CONVERSATION_URL_ || options.type === _CONVERSATION_URL_) {
810
- const foundMeeting = this.meetingCollection.getByKey(CONVERSATION_URL, targetDest);
811
-
812
- if (foundMeeting) {
813
- const foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting;
814
-
815
- // If the found meeting is not a calendar meeting, return that meeting.
816
- // This allows for the creation of instant-meetings when calendar meetings are present.
817
- if (foundMeetingIsNotCalendarMeeting) {
818
- meeting = foundMeeting;
850
+ return (
851
+ this.meetingInfo
852
+ .fetchInfoOptions(destination, type)
853
+ // Catch a failure to fetch info options.
854
+ .catch((error) => {
855
+ LoggerProxy.logger.info(
856
+ `Meetings:index#create --> INFO, unable to determine info options: ${error.message}`
857
+ );
858
+ })
859
+ .then((options: any = {}) => {
860
+ // Normalize the destination.
861
+ const targetDest = options.destination || destination;
862
+
863
+ // check for the conversation URL then sip Url
864
+ let meeting = null;
865
+
866
+ if (type === _CONVERSATION_URL_ || options.type === _CONVERSATION_URL_) {
867
+ const foundMeeting = this.meetingCollection.getByKey(CONVERSATION_URL, targetDest);
868
+
869
+ if (foundMeeting) {
870
+ const foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting;
871
+
872
+ // If the found meeting is not a calendar meeting, return that meeting.
873
+ // This allows for the creation of instant-meetings when calendar meetings are present.
874
+ if (foundMeetingIsNotCalendarMeeting) {
875
+ meeting = foundMeeting;
876
+ }
819
877
  }
820
878
  }
821
- }
822
879
 
823
- // Attempt to collect the meeting if it exists.
824
- if (!meeting) {
825
- meeting = this.meetingCollection.getByKey(SIP_URI, targetDest);
826
- }
880
+ // Attempt to collect the meeting if it exists.
881
+ if (!meeting) {
882
+ meeting = this.meetingCollection.getByKey(SIP_URI, targetDest);
883
+ }
827
884
 
828
- // Validate if a meeting was found.
829
- if (!meeting) {
830
- // Create a meeting based on the normalized destination and type.
831
- return this.createMeeting(targetDest, type, useRandomDelayForInfo)
832
- .then((createdMeeting: any) => {
833
- // If the meeting was successfully created.
834
- if (createdMeeting && createdMeeting.on) {
835
- // Create a destruction event for the meeting.
836
- createdMeeting.on(EVENTS.DESTROY_MEETING, (payload) => {
837
- // @ts-ignore
838
- if (this.config.autoUploadLogs) {
839
- this.uploadLogs({
840
- callStart: createdMeeting.locusInfo?.fullState?.lastActive,
841
- correlationId: createdMeeting.correlationId,
842
- feedbackId: createdMeeting.correlationId,
843
- locusId: createdMeeting.locusId,
844
- meetingId: createdMeeting.locusInfo?.info?.webExMeetingId
845
- }).then(() => this.destroy(createdMeeting, payload.reason));
846
- }
847
- else {
848
- this.destroy(createdMeeting, payload.reason);
849
- }
850
- });
851
-
852
- createdMeeting.on(EVENTS.REQUEST_UPLOAD_LOGS, (meetingInstance) => {
853
- // @ts-ignore
854
- if (this.config.autoUploadLogs) {
855
- this.uploadLogs({
856
- callStart: meetingInstance?.locusInfo?.fullState?.lastActive,
857
- correlationId: meetingInstance.correlationId,
858
- feedbackId: meetingInstance.correlationId,
859
- locusId: meetingInstance.locusId,
860
- meetingId: meetingInstance.locusInfo?.info?.webExMeetingId
861
- });
862
- }
863
- });
885
+ // Validate if a meeting was found.
886
+ if (!meeting) {
887
+ // Create a meeting based on the normalized destination and type.
888
+ return this.createMeeting(targetDest, type, useRandomDelayForInfo).then(
889
+ (createdMeeting: any) => {
890
+ // If the meeting was successfully created.
891
+ if (createdMeeting && createdMeeting.on) {
892
+ // Create a destruction event for the meeting.
893
+ createdMeeting.on(EVENTS.DESTROY_MEETING, (payload) => {
894
+ // @ts-ignore
895
+ if (this.config.autoUploadLogs) {
896
+ this.uploadLogs({
897
+ callStart: createdMeeting.locusInfo?.fullState?.lastActive,
898
+ correlationId: createdMeeting.correlationId,
899
+ feedbackId: createdMeeting.correlationId,
900
+ locusId: createdMeeting.locusId,
901
+ meetingId: createdMeeting.locusInfo?.info?.webExMeetingId,
902
+ }).then(() => this.destroy(createdMeeting, payload.reason));
903
+ } else {
904
+ this.destroy(createdMeeting, payload.reason);
905
+ }
906
+ });
907
+
908
+ createdMeeting.on(EVENTS.REQUEST_UPLOAD_LOGS, (meetingInstance) => {
909
+ // @ts-ignore
910
+ if (this.config.autoUploadLogs) {
911
+ this.uploadLogs({
912
+ callStart: meetingInstance?.locusInfo?.fullState?.lastActive,
913
+ correlationId: meetingInstance.correlationId,
914
+ feedbackId: meetingInstance.correlationId,
915
+ locusId: meetingInstance.locusId,
916
+ meetingId: meetingInstance.locusInfo?.info?.webExMeetingId,
917
+ });
918
+ }
919
+ });
920
+ } else {
921
+ LoggerProxy.logger.error(
922
+ `Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ${meeting}`
923
+ );
924
+ }
925
+
926
+ // Return the newly created meeting.
927
+ return Promise.resolve(createdMeeting);
864
928
  }
865
- else {
866
- LoggerProxy.logger.error(`Meetings:index#create --> ERROR, meeting does not have on method, will not be destroyed, meeting cleanup impossible for meeting: ${meeting}`);
867
- }
868
-
869
- // Return the newly created meeting.
870
- return Promise.resolve(createdMeeting);
871
- });
872
- }
929
+ );
930
+ }
873
931
 
874
- // Return the existing meeting.
875
- return Promise.resolve(meeting);
876
- });
932
+ // Return the existing meeting.
933
+ return Promise.resolve(meeting);
934
+ })
935
+ );
877
936
  }
878
937
 
879
938
  /**
880
- * @param {String} destination see create()
881
- * @param {String} type see create()
882
- * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
883
- * @returns {Promise} a new meeting instance complete with meeting info and destination
884
- * @private
885
- * @memberof Meetings
886
- */
887
- private async createMeeting(destination: any, type: string = null, useRandomDelayForInfo: boolean = false) {
939
+ * @param {String} destination see create()
940
+ * @param {String} type see create()
941
+ * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
942
+ * @returns {Promise} a new meeting instance complete with meeting info and destination
943
+ * @private
944
+ * @memberof Meetings
945
+ */
946
+ private async createMeeting(
947
+ destination: any,
948
+ type: string = null,
949
+ useRandomDelayForInfo = false
950
+ ) {
888
951
  const meeting = new Meeting(
889
952
  {
890
953
  // @ts-ignore
@@ -900,7 +963,7 @@ export default class Meetings extends WebexPlugin {
900
963
  },
901
964
  {
902
965
  // @ts-ignore
903
- parent: this.webex
966
+ parent: this.webex,
904
967
  }
905
968
  );
906
969
 
@@ -918,7 +981,10 @@ export default class Meetings extends WebexPlugin {
918
981
  const startTimeDate = new Date(startTime);
919
982
  const startTimeDatestamp = startTimeDate.getTime();
920
983
  const timeToStart = startTimeDatestamp - Date.now();
921
- const maxWaitingTime = Math.max(Math.min(timeToStart, MAX_RANDOM_DELAY_FOR_MEETING_INFO), 0);
984
+ const maxWaitingTime = Math.max(
985
+ Math.min(timeToStart, MAX_RANDOM_DELAY_FOR_MEETING_INFO),
986
+ 0
987
+ );
922
988
 
923
989
  waitingTime = Math.round(Math.random() * maxWaitingTime);
924
990
  }
@@ -927,22 +993,28 @@ export default class Meetings extends WebexPlugin {
927
993
  const {enableUnifiedMeetings} = this.config.experimental;
928
994
 
929
995
  if (enableUnifiedMeetings && !isMeetingActive && useRandomDelayForInfo && waitingTime > 0) {
930
- meeting.fetchMeetingInfoTimeoutId = setTimeout(() => meeting.fetchMeetingInfo({}), waitingTime);
996
+ meeting.fetchMeetingInfoTimeoutId = setTimeout(
997
+ () => meeting.fetchMeetingInfo({}),
998
+ waitingTime
999
+ );
931
1000
  meeting.parseMeetingInfo(undefined, destination);
932
- }
933
- else {
1001
+ } else {
934
1002
  await meeting.fetchMeetingInfo({});
935
1003
  }
936
- }
937
- catch (err) {
1004
+ } catch (err) {
938
1005
  if (!(err instanceof CaptchaError) && !(err instanceof PasswordError)) {
939
1006
  // if there is no meeting info we assume its a 1:1 call or wireless share
940
- LoggerProxy.logger.info(`Meetings:index#createMeeting --> Info Unable to fetch meeting info for ${destination}.`);
941
- LoggerProxy.logger.info('Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share');
1007
+ LoggerProxy.logger.info(
1008
+ `Meetings:index#createMeeting --> Info Unable to fetch meeting info for ${destination}.`
1009
+ );
1010
+ LoggerProxy.logger.info(
1011
+ 'Meetings:index#createMeeting --> Info assuming this destination is a 1:1 or wireless share'
1012
+ );
942
1013
  }
943
- LoggerProxy.logger.debug(`Meetings:index#createMeeting --> Debug ${err} fetching /meetingInfo for creation.`);
944
- }
945
- finally {
1014
+ LoggerProxy.logger.debug(
1015
+ `Meetings:index#createMeeting --> Debug ${err} fetching /meetingInfo for creation.`
1016
+ );
1017
+ } finally {
946
1018
  // For type LOCUS_ID we need to parse the locus object to get the information
947
1019
  // about the caller and callee
948
1020
  // Meeting Added event will be created in `handleLocusEvent`
@@ -960,12 +1032,12 @@ export default class Meetings extends WebexPlugin {
960
1032
  this,
961
1033
  {
962
1034
  file: 'meetings',
963
- function: 'createMeeting'
1035
+ function: 'createMeeting',
964
1036
  },
965
1037
  EVENT_TRIGGERS.MEETING_ADDED,
966
1038
  {
967
1039
  meeting,
968
- type: meetingAddedType
1040
+ type: meetingAddedType,
969
1041
  }
970
1042
  );
971
1043
  }
@@ -993,26 +1065,26 @@ export default class Meetings extends WebexPlugin {
993
1065
  }
994
1066
 
995
1067
  /**
996
- * get a specifc meeting given it's type matched to the value, i.e., locus url
997
- * @param {String} type
998
- * @param {Object} value
999
- * @returns {Meeting}
1000
- * @public
1001
- * @memberof Meetings
1002
- */
1068
+ * get a specifc meeting given it's type matched to the value, i.e., locus url
1069
+ * @param {String} type
1070
+ * @param {Object} value
1071
+ * @returns {Meeting}
1072
+ * @public
1073
+ * @memberof Meetings
1074
+ */
1003
1075
  public getMeetingByType(type: string, value: object) {
1004
1076
  return this.meetingCollection.getByKey(type, value);
1005
1077
  }
1006
1078
 
1007
1079
  /**
1008
- * Get all meetings.
1009
- * @param {object} options
1010
- * @param {object} options.startDate - get meetings after this start date
1011
- * @param {object} options.endDate - get meetings before this end date
1012
- * @returns {Object} All currently active meetings.
1013
- * @public
1014
- * @memberof Meetings
1015
- */
1080
+ * Get all meetings.
1081
+ * @param {object} options
1082
+ * @param {object} options.startDate - get meetings after this start date
1083
+ * @param {object} options.endDate - get meetings before this end date
1084
+ * @returns {Object} All currently active meetings.
1085
+ * @public
1086
+ * @memberof Meetings
1087
+ */
1016
1088
  public getAllMeetings(
1017
1089
  options: {
1018
1090
  startDate: object;
@@ -1025,11 +1097,11 @@ export default class Meetings extends WebexPlugin {
1025
1097
  }
1026
1098
 
1027
1099
  /**
1028
- * syncs all the meeting from server
1029
- * @returns {undefined}
1030
- * @public
1031
- * @memberof Meetings
1032
- */
1100
+ * syncs all the meeting from server
1101
+ * @returns {undefined}
1102
+ * @public
1103
+ * @memberof Meetings
1104
+ */
1033
1105
  public syncMeetings() {
1034
1106
  return this.request.getActiveMeetings().then((locusArray) => {
1035
1107
  const activeLocusUrl = [];
@@ -1039,7 +1111,7 @@ export default class Meetings extends WebexPlugin {
1039
1111
  activeLocusUrl.push(locus.url);
1040
1112
  this.handleLocusEvent({
1041
1113
  locus,
1042
- locusUrl: locus.url
1114
+ locusUrl: locus.url,
1043
1115
  });
1044
1116
  });
1045
1117
  }
@@ -1061,21 +1133,21 @@ export default class Meetings extends WebexPlugin {
1061
1133
  }
1062
1134
 
1063
1135
  /**
1064
- * Get all scheduled meetings.
1065
- * @param {object} options
1066
- * @param {object} options.startDate - get meetings after this start date
1067
- * @param {object} options.endDate - get meetings before this end date
1068
- * @returns {Object} All scheduled meetings.
1069
- * @memberof Meetings
1070
- */
1136
+ * Get all scheduled meetings.
1137
+ * @param {object} options
1138
+ * @param {object} options.startDate - get meetings after this start date
1139
+ * @param {object} options.endDate - get meetings before this end date
1140
+ * @returns {Object} All scheduled meetings.
1141
+ * @memberof Meetings
1142
+ */
1071
1143
  getScheduledMeetings() {
1072
1144
  return this.meetingCollection.getAll({scheduled: true});
1073
1145
  }
1074
1146
 
1075
1147
  /**
1076
- * Get the logger instance for plugin-meetings
1077
- * @returns {Logger}
1078
- */
1148
+ * Get the logger instance for plugin-meetings
1149
+ * @returns {Logger}
1150
+ */
1079
1151
  getLogger() {
1080
1152
  return LoggerProxy.get();
1081
1153
  }