@webex/plugin-meetings 2.36.1 → 2.37.1

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