@webex/plugin-meetings 3.5.0-wxcc.1 → 3.6.0

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 (201) hide show
  1. package/dist/annotation/annotation.types.d.ts +42 -0
  2. package/dist/annotation/constants.d.ts +31 -0
  3. package/dist/annotation/index.d.ts +117 -0
  4. package/dist/breakouts/breakout.d.ts +8 -0
  5. package/dist/breakouts/breakout.js +1 -1
  6. package/dist/breakouts/collection.d.ts +5 -0
  7. package/dist/breakouts/edit-lock-error.d.ts +15 -0
  8. package/dist/breakouts/events.d.ts +8 -0
  9. package/dist/breakouts/index.d.ts +5 -0
  10. package/dist/breakouts/index.js +1 -1
  11. package/dist/breakouts/request.d.ts +22 -0
  12. package/dist/breakouts/utils.d.ts +15 -0
  13. package/dist/common/browser-detection.d.ts +9 -0
  14. package/dist/common/collection.d.ts +48 -0
  15. package/dist/common/config.d.ts +2 -0
  16. package/dist/common/errors/captcha-error.d.ts +15 -0
  17. package/dist/common/errors/intent-to-join.d.ts +16 -0
  18. package/dist/common/errors/join-meeting.d.ts +17 -0
  19. package/dist/common/errors/media.d.ts +15 -0
  20. package/dist/common/errors/no-meeting-info.d.ts +14 -0
  21. package/dist/common/errors/parameter.d.ts +15 -0
  22. package/dist/common/errors/password-error.d.ts +15 -0
  23. package/dist/common/errors/permission.d.ts +14 -0
  24. package/dist/common/errors/reclaim-host-role-error.js +149 -0
  25. package/dist/common/errors/reclaim-host-role-error.js.map +1 -0
  26. package/dist/common/errors/reclaim-host-role-errors.d.ts +60 -0
  27. package/dist/common/errors/reconnection-in-progress.d.ts +9 -0
  28. package/dist/common/errors/reconnection-in-progress.js +33 -0
  29. package/dist/common/errors/reconnection-in-progress.js.map +1 -0
  30. package/dist/common/errors/reconnection.d.ts +15 -0
  31. package/dist/common/errors/stats.d.ts +15 -0
  32. package/dist/common/errors/webex-errors.d.ts +93 -0
  33. package/dist/common/errors/webex-meetings-error.d.ts +20 -0
  34. package/dist/common/events/events-scope.d.ts +17 -0
  35. package/dist/common/events/events.d.ts +12 -0
  36. package/dist/common/events/trigger-proxy.d.ts +2 -0
  37. package/dist/common/events/util.d.ts +2 -0
  38. package/dist/common/logs/logger-config.d.ts +2 -0
  39. package/dist/common/logs/logger-proxy.d.ts +2 -0
  40. package/dist/common/logs/request.d.ts +36 -0
  41. package/dist/common/queue.d.ts +34 -0
  42. package/dist/config.d.ts +72 -0
  43. package/dist/config.js +3 -1
  44. package/dist/config.js.map +1 -1
  45. package/dist/constants.d.ts +1088 -0
  46. package/dist/constants.js +1 -0
  47. package/dist/constants.js.map +1 -1
  48. package/dist/controls-options-manager/constants.d.ts +4 -0
  49. package/dist/controls-options-manager/enums.d.ts +15 -0
  50. package/dist/controls-options-manager/index.d.ts +136 -0
  51. package/dist/controls-options-manager/types.d.ts +43 -0
  52. package/dist/controls-options-manager/util.d.ts +1 -0
  53. package/dist/index.d.ts +7 -0
  54. package/dist/interceptors/index.d.ts +2 -0
  55. package/dist/interceptors/locusRetry.d.ts +27 -0
  56. package/dist/interpretation/collection.d.ts +5 -0
  57. package/dist/interpretation/index.d.ts +5 -0
  58. package/dist/interpretation/index.js +1 -1
  59. package/dist/interpretation/siLanguage.d.ts +5 -0
  60. package/dist/interpretation/siLanguage.js +1 -1
  61. package/dist/locus-info/controlsUtils.d.ts +2 -0
  62. package/dist/locus-info/embeddedAppsUtils.d.ts +2 -0
  63. package/dist/locus-info/fullState.d.ts +2 -0
  64. package/dist/locus-info/hostUtils.d.ts +2 -0
  65. package/dist/locus-info/index.d.ts +322 -0
  66. package/dist/locus-info/infoUtils.d.ts +2 -0
  67. package/dist/locus-info/mediaSharesUtils.d.ts +2 -0
  68. package/dist/locus-info/parser.d.ts +272 -0
  69. package/dist/locus-info/selfUtils.d.ts +2 -0
  70. package/dist/media/index.d.ts +34 -0
  71. package/dist/media/index.js +3 -1
  72. package/dist/media/index.js.map +1 -1
  73. package/dist/media/properties.d.ts +93 -0
  74. package/dist/media/util.d.ts +2 -0
  75. package/dist/mediaQualityMetrics/config.d.ts +241 -0
  76. package/dist/mediaQualityMetrics/config.js +502 -0
  77. package/dist/mediaQualityMetrics/config.js.map +1 -0
  78. package/dist/meeting/effectsState.js +260 -0
  79. package/dist/meeting/effectsState.js.map +1 -0
  80. package/dist/meeting/in-meeting-actions.d.ts +167 -0
  81. package/dist/meeting/in-meeting-actions.js +3 -1
  82. package/dist/meeting/in-meeting-actions.js.map +1 -1
  83. package/dist/meeting/index.d.ts +1825 -0
  84. package/dist/meeting/index.js +39 -4
  85. package/dist/meeting/index.js.map +1 -1
  86. package/dist/meeting/locusMediaRequest.d.ts +74 -0
  87. package/dist/meeting/muteState.d.ts +178 -0
  88. package/dist/meeting/request.d.ts +295 -0
  89. package/dist/meeting/request.type.d.ts +11 -0
  90. package/dist/meeting/state.d.ts +9 -0
  91. package/dist/meeting/util.d.ts +119 -0
  92. package/dist/meeting/util.js +5 -8
  93. package/dist/meeting/util.js.map +1 -1
  94. package/dist/meeting/voicea-meeting.d.ts +16 -0
  95. package/dist/meeting-info/collection.d.ts +20 -0
  96. package/dist/meeting-info/index.d.ts +69 -0
  97. package/dist/meeting-info/meeting-info-v2.d.ts +123 -0
  98. package/dist/meeting-info/request.d.ts +22 -0
  99. package/dist/meeting-info/util.d.ts +2 -0
  100. package/dist/meeting-info/utilv2.d.ts +2 -0
  101. package/dist/meetings/collection.d.ts +40 -0
  102. package/dist/meetings/index.d.ts +390 -0
  103. package/dist/meetings/index.js +79 -26
  104. package/dist/meetings/index.js.map +1 -1
  105. package/dist/meetings/meetings.types.d.ts +4 -0
  106. package/dist/meetings/request.d.ts +27 -0
  107. package/dist/meetings/util.d.ts +18 -0
  108. package/dist/member/index.d.ts +160 -0
  109. package/dist/member/member.types.js +17 -0
  110. package/dist/member/member.types.js.map +1 -0
  111. package/dist/member/types.d.ts +32 -0
  112. package/dist/member/util.d.ts +2 -0
  113. package/dist/members/collection.d.ts +29 -0
  114. package/dist/members/index.d.ts +353 -0
  115. package/dist/members/request.d.ts +114 -0
  116. package/dist/members/types.d.ts +25 -0
  117. package/dist/members/util.d.ts +215 -0
  118. package/dist/metrics/config.js +276 -0
  119. package/dist/metrics/config.js.map +1 -0
  120. package/dist/metrics/constants.d.ts +70 -0
  121. package/dist/metrics/index.d.ts +45 -0
  122. package/dist/multistream/mediaRequestManager.d.ts +119 -0
  123. package/dist/multistream/receiveSlot.d.ts +68 -0
  124. package/dist/multistream/receiveSlotManager.d.ts +56 -0
  125. package/dist/multistream/remoteMedia.d.ts +72 -0
  126. package/dist/multistream/remoteMediaGroup.d.ts +49 -0
  127. package/dist/multistream/remoteMediaManager.d.ts +300 -0
  128. package/dist/multistream/sendSlotManager.d.ts +69 -0
  129. package/dist/networkQualityMonitor/index.d.ts +70 -0
  130. package/dist/networkQualityMonitor/index.js +13 -19
  131. package/dist/networkQualityMonitor/index.js.map +1 -1
  132. package/dist/peer-connection-manager/index.js +671 -0
  133. package/dist/peer-connection-manager/index.js.map +1 -0
  134. package/dist/peer-connection-manager/util.js +109 -0
  135. package/dist/peer-connection-manager/util.js.map +1 -0
  136. package/dist/personal-meeting-room/index.d.ts +47 -0
  137. package/dist/personal-meeting-room/request.d.ts +14 -0
  138. package/dist/personal-meeting-room/util.d.ts +2 -0
  139. package/dist/reachability/clusterReachability.d.ts +109 -0
  140. package/dist/reachability/index.d.ts +105 -0
  141. package/dist/reachability/request.d.ts +39 -0
  142. package/dist/reachability/util.d.ts +8 -0
  143. package/dist/reactions/constants.d.ts +3 -0
  144. package/dist/reactions/reactions.d.ts +4 -0
  145. package/dist/reactions/reactions.type.d.ts +52 -0
  146. package/dist/reconnection-manager/index.d.ts +136 -0
  147. package/dist/recording-controller/enums.d.ts +7 -0
  148. package/dist/recording-controller/index.d.ts +207 -0
  149. package/dist/recording-controller/util.d.ts +14 -0
  150. package/dist/roap/collection.js +62 -0
  151. package/dist/roap/collection.js.map +1 -0
  152. package/dist/roap/handler.js +275 -0
  153. package/dist/roap/handler.js.map +1 -0
  154. package/dist/roap/index.d.ts +86 -0
  155. package/dist/roap/request.d.ts +39 -0
  156. package/dist/roap/state.js +126 -0
  157. package/dist/roap/state.js.map +1 -0
  158. package/dist/roap/turnDiscovery.d.ts +155 -0
  159. package/dist/roap/util.js +75 -0
  160. package/dist/roap/util.js.map +1 -0
  161. package/dist/rtcMetrics/constants.d.ts +4 -0
  162. package/dist/rtcMetrics/index.d.ts +61 -0
  163. package/dist/statsAnalyzer/global.d.ts +36 -0
  164. package/dist/statsAnalyzer/global.js +126 -0
  165. package/dist/statsAnalyzer/global.js.map +1 -0
  166. package/dist/statsAnalyzer/index.d.ts +217 -0
  167. package/dist/statsAnalyzer/index.js +1013 -0
  168. package/dist/statsAnalyzer/index.js.map +1 -0
  169. package/dist/statsAnalyzer/mqaUtil.d.ts +48 -0
  170. package/dist/statsAnalyzer/mqaUtil.js +179 -0
  171. package/dist/statsAnalyzer/mqaUtil.js.map +1 -0
  172. package/dist/transcription/index.d.ts +64 -0
  173. package/dist/types/common/errors/reconnection-in-progress.d.ts +9 -0
  174. package/dist/types/config.d.ts +1 -0
  175. package/dist/types/constants.d.ts +2 -1
  176. package/dist/types/mediaQualityMetrics/config.d.ts +241 -0
  177. package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
  178. package/dist/types/meeting/index.d.ts +11 -0
  179. package/dist/types/meetings/index.d.ts +34 -2
  180. package/dist/types/statsAnalyzer/global.d.ts +36 -0
  181. package/dist/types/statsAnalyzer/index.d.ts +217 -0
  182. package/dist/types/statsAnalyzer/mqaUtil.d.ts +48 -0
  183. package/dist/webinar/collection.d.ts +16 -0
  184. package/dist/webinar/index.d.ts +5 -0
  185. package/dist/webinar/index.js +1 -1
  186. package/package.json +22 -22
  187. package/src/config.ts +2 -0
  188. package/src/constants.ts +1 -0
  189. package/src/media/index.ts +4 -1
  190. package/src/meeting/in-meeting-actions.ts +3 -0
  191. package/src/meeting/index.ts +42 -2
  192. package/src/meeting/util.ts +21 -29
  193. package/src/meetings/index.ts +107 -37
  194. package/test/unit/spec/media/index.ts +4 -0
  195. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
  196. package/test/unit/spec/meeting/index.js +58 -17
  197. package/test/unit/spec/meeting/utils.js +34 -84
  198. package/test/unit/spec/meetings/index.js +112 -13
  199. package/src/rtcMetrics/constants.ts +0 -3
  200. package/src/rtcMetrics/index.ts +0 -186
  201. package/test/unit/spec/rtcMetrics/index.ts +0 -154
@@ -0,0 +1,390 @@
1
+ import '@webex/internal-plugin-mercury';
2
+ import '@webex/internal-plugin-conversation';
3
+ import '@webex/internal-plugin-metrics';
4
+ import { WebexPlugin } from '@webex/webex-core';
5
+ import * as mediaHelpersModule from '@webex/media-helpers';
6
+ import 'webrtc-adapter';
7
+ import { CallStateForMetrics } from '../meeting';
8
+ import Reachability from '../reachability';
9
+ import { INoiseReductionEffect, IVirtualBackgroundEffect } from './meetings.types';
10
+ /**
11
+ * Meetings Ready Event
12
+ * Emitted when the meetings instance on webex is ready
13
+ * @event meetings:ready
14
+ * @instance
15
+ * @memberof Meetings
16
+ */
17
+ /**
18
+ * Meetings Network Disconnected Event
19
+ * Emitted when the meetings instance is disconnected from
20
+ * the internal mercury server
21
+ * @event network:disconnected
22
+ * @instance
23
+ * @memberof Meetings
24
+ */
25
+ /**
26
+ * Meetings Registered Event
27
+ * Emitted when the meetings instance has been registered and listening
28
+ * @event meetings:registered
29
+ * @instance
30
+ * @memberof Meetings
31
+ */
32
+ /**
33
+ * Meeting Removed Event
34
+ * Emitted when a meeting was removed from the cache of meetings
35
+ * @event meeting:removed
36
+ * @instance
37
+ * @type {Object}
38
+ * @property {String} meetingId the removed meeting
39
+ * @property {Object} response the server response
40
+ * @property {String} type what type of meeting it was
41
+ * @memberof Meetings
42
+ */
43
+ /**
44
+ * Meeting Added Event
45
+ * Emitted when a meeting was added to the cache of meetings
46
+ * @event meeting:added
47
+ * @instance
48
+ * @type {Object}
49
+ * @property {String} meetingId the added meeting
50
+ * @property {String} type what type of meeting it was
51
+ * @memberof Meetings
52
+ */
53
+ /**
54
+ * Maintain a cache of meetings and sync with services.
55
+ * @class
56
+ */
57
+ export default class Meetings extends WebexPlugin {
58
+ loggerRequest: any;
59
+ media: any;
60
+ meetingCollection: any;
61
+ personalMeetingRoom: any;
62
+ preferredWebexSite: any;
63
+ reachability: Reachability;
64
+ registered: any;
65
+ request: any;
66
+ geoHintInfo: any;
67
+ meetingInfo: any;
68
+ mediaHelpers: any;
69
+ breakoutLocusForHandleLater: any;
70
+ namespace: string;
71
+ /**
72
+ * Initializes the Meetings Plugin
73
+ * @constructor
74
+ * @public
75
+ * @memberof Meetings
76
+ */
77
+ constructor(...args: any[]);
78
+ /**
79
+ * check whether you need to handle this main session's locus data or not
80
+ * @param {Object} meeting current meeting data
81
+ * @param {Object} newLocus new locus data
82
+ * @returns {boolean}
83
+ * @private
84
+ * @memberof Meetings
85
+ */
86
+ private isNeedHandleMainLocus;
87
+ /**
88
+ * check whether you need to handle this locus data or not
89
+ * @param {Object} meeting old locus data
90
+ * @param {Object} newLocus new locus data
91
+ * @returns {boolean}
92
+ * @private
93
+ * @memberof Meetings
94
+ */
95
+ private isNeedHandleLocusDTO;
96
+ /**
97
+ * get corresponding meeting object by locus data
98
+ * @param {Object} data a locus event
99
+ * @param {String} data.locusUrl
100
+ * @param {Object} data.locus
101
+ * @returns {Object}
102
+ * @private
103
+ * @memberof Meetings
104
+ */
105
+ getCorrespondingMeetingByLocus(data: any): any;
106
+ /**
107
+ * handle locus events and takes meeting actions with them as they come in
108
+ * @param {Object} data a locus event
109
+ * @param {String} data.locusUrl
110
+ * @param {Object} data.locus
111
+ * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
112
+ * @param {String} data.eventType
113
+ * @returns {undefined}
114
+ * @private
115
+ * @memberof Meetings
116
+ */
117
+ private handleLocusEvent;
118
+ /**
119
+ * handles locus events through mercury that are not roap
120
+ * @param {Object} envelope
121
+ * @param {Object} envelope.data
122
+ * @param {String} envelope.data.eventType
123
+ * @returns {undefined}
124
+ * @private
125
+ * @memberof Meetings
126
+ */
127
+ private handleLocusMercury;
128
+ /**
129
+ * handles mecury offline event
130
+ * @returns {undefined}
131
+ * @private
132
+ * @memberof Meetings
133
+ */
134
+ private handleMercuryOffline;
135
+ /**
136
+ * registers for locus and roap mercury events
137
+ * @returns {undefined}
138
+ * @private
139
+ * @memberof Meetings
140
+ */
141
+ private listenForEvents;
142
+ /**
143
+ * stops listening for locus and roap mercury events
144
+ * @returns {undefined}
145
+ * @private
146
+ * @memberof Meetings
147
+ */
148
+ private stopListeningForEvents;
149
+ /**
150
+ * @returns {undefined}
151
+ * @private
152
+ * @memberof Meetings
153
+ */
154
+ private onReady;
155
+ /**
156
+ * API to toggle unified meetings
157
+ * @param {Boolean} changeState
158
+ * @private
159
+ * @memberof Meetings
160
+ * @returns {undefined}
161
+ */
162
+ private _toggleUnifiedMeetings;
163
+ /**
164
+ * API to toggle starting adhoc meeting
165
+ * @param {Boolean} changeState
166
+ * @private
167
+ * @memberof Meetings
168
+ * @returns {undefined}
169
+ */
170
+ private _toggleAdhocMeetings;
171
+ /**
172
+ * API to toggle TCP reachability, needs to be called before webex.meetings.register()
173
+ * @param {Boolean} newValue
174
+ * @private
175
+ * @memberof Meetings
176
+ * @returns {undefined}
177
+ */
178
+ private _toggleTcpReachability;
179
+ /**
180
+ * Explicitly sets up the meetings plugin by registering
181
+ * the device, connecting to mercury, and listening for locus events.
182
+ *
183
+ * @returns {Promise}
184
+ * @public
185
+ * @memberof Meetings
186
+ */
187
+ register(): Promise<void>;
188
+ /**
189
+ * Explicitly tears down the meetings plugin by deregistering
190
+ * the device, disconnecting from mercury, and stops listening to locus events
191
+ *
192
+ * @returns {Promise}
193
+ * @public
194
+ * @memberof Meetings
195
+ */
196
+ unregister(): any;
197
+ /**
198
+ * Creates a noise reduction effect
199
+ *
200
+ * @param {INoiseReductionEffect} options optional custom effect options
201
+ * @returns {Promise<effect>} noise reduction effect.
202
+ * @public
203
+ * @memberof Meetings
204
+ */
205
+ createNoiseReductionEffect: (options?: INoiseReductionEffect) => Promise<mediaHelpersModule.NoiseReductionEffect>;
206
+ /**
207
+ * Creates a virtual background effect
208
+ *
209
+ * @param {IVirtualBackgroundEffect} options optional custom effect options
210
+ * @returns {Promise<effect>} virtual background effect.
211
+ * @public
212
+ * @memberof Meetings
213
+ */
214
+ createVirtualBackgroundEffect: (options?: IVirtualBackgroundEffect) => Promise<mediaHelpersModule.VirtualBackgroundEffect>;
215
+ /**
216
+ * Uploads logs to the webex services for tracking
217
+ * @param {Object} [options={}]
218
+ * @param {String} [options.callStart] Call Start Time
219
+ * @param {String} [options.feedbackId] ID used for tracking
220
+ * @param {String} [options.locusId]
221
+ * @param {String} [options.correlationId]
222
+ * @param {String} [options.meetingId] webex meeting ID
223
+ * @param {String} [options.userId] userId
224
+ * @param {String} [options.orgId] org id
225
+ * @returns {String} feedback ID logs were submitted under
226
+ */
227
+ uploadLogs(options?: {
228
+ autoupload?: boolean;
229
+ callStart?: string;
230
+ feedbackId?: string;
231
+ locussessionid?: string;
232
+ locusId?: string;
233
+ correlationId?: string;
234
+ meetingId?: string;
235
+ userId?: string;
236
+ orgId?: string;
237
+ }): any;
238
+ /**
239
+ * gets the reachability instance for Meetings
240
+ * @returns {Reachability}
241
+ * @public
242
+ * @memberof Meetings
243
+ */
244
+ getReachability(): Reachability;
245
+ /**
246
+ * initializes and starts gathering reachability for Meetings
247
+ * @returns {Promise}
248
+ * @public
249
+ * @memberof Meetings
250
+ */
251
+ startReachability(): Promise<import("../reachability").ReachabilityResults>;
252
+ /**
253
+ * Get geoHint for info for meetings
254
+ * @returns {Promise}
255
+ * @private
256
+ * @memberof Meetings
257
+ */
258
+ getGeoHint(): any;
259
+ /**
260
+ * Fetch user preferred webex site information
261
+ * This also has other infomation about the user
262
+ * @returns {Promise}
263
+ * @private
264
+ * @memberof Meetings
265
+ */
266
+ fetchUserPreferredWebexSite(): any;
267
+ /**
268
+ * gets the personal meeting room instance, for saved PMR values for this user
269
+ * @returns {PersonalMeetingRoom}
270
+ * @public
271
+ * @memberof Meetings
272
+ */
273
+ getPersonalMeetingRoom(): any;
274
+ /**
275
+ * @param {Meeting} meeting
276
+ * @param {Object} reason
277
+ * @param {String} type
278
+ * @returns {Undefined}
279
+ * @private
280
+ * @memberof Meetings
281
+ */
282
+ private destroy;
283
+ /**
284
+ * Create a meeting or return an existing meeting.
285
+ *
286
+ * When meeting info passed it should be complete, e.g.: fetched after password or captcha provided
287
+ *
288
+ * @param {string} destination - sipURL, phonenumber, or locus object}
289
+ * @param {string} [type] - the optional specified type, such as locusId
290
+ * @param {Boolean} useRandomDelayForInfo - whether a random delay should be added to fetching meeting info
291
+ * @param {Object} infoExtraParams extra parameters to be provided when fetching meeting info
292
+ * @param {string} correlationId - the optional specified correlationId (callStateForMetrics.correlationId can be provided instead)
293
+ * @param {Boolean} failOnMissingMeetingInfo - whether to throw an error if meeting info fails to fetch (for calls that are not 1:1 or content share)
294
+ * @param {CallStateForMetrics} callStateForMetrics - information about call state for metrics
295
+ * @param {Object} [meetingInfo] - Pre-fetched complete meeting info
296
+ * @param {String} [meetingLookupUrl] - meeting info prefetch url
297
+ * @returns {Promise<Meeting>} A new Meeting.
298
+ * @public
299
+ * @memberof Meetings
300
+ */
301
+ create(destination: string, type?: string, useRandomDelayForInfo?: boolean, infoExtraParams?: {}, correlationId?: string, failOnMissingMeetingInfo?: boolean, callStateForMetrics?: CallStateForMetrics, meetingInfo?: any, meetingLookupUrl?: any): any;
302
+ /**
303
+ * Create meeting
304
+ *
305
+ * When meeting info passed it should be complete, e.g.: fetched after password or captcha provided
306
+ *
307
+ * @param {String} destination see create()
308
+ * @param {String} type see create()
309
+ * @param {Boolean} useRandomDelayForInfo whether a random delay should be added to fetching meeting info
310
+ * @param {Object} infoExtraParams extra parameters to be provided when fetching meeting info
311
+ * @param {CallStateForMetrics} callStateForMetrics - information about call state for metrics
312
+ * @param {Boolean} failOnMissingMeetingInfo - whether to throw an error if meeting info fails to fetch (for calls that are not 1:1 or content share)
313
+ * @param {Object} [meetingInfo] - Pre-fetched complete meeting info
314
+ * @param {String} [meetingLookupUrl] - meeting info prefetch url
315
+ * @returns {Promise} a new meeting instance complete with meeting info and destination
316
+ * @private
317
+ * @memberof Meetings
318
+ */
319
+ private createMeeting;
320
+ /**
321
+ * get a specifc meeting given it's type matched to the value, i.e., locus url
322
+ * @param {String} type
323
+ * @param {Object} value
324
+ * @returns {Meeting}
325
+ * @public
326
+ * @memberof Meetings
327
+ */
328
+ getMeetingByType(type: string, value: object): any;
329
+ /**
330
+ * Get all meetings.
331
+ * @param {object} options
332
+ * @param {object} options.startDate - get meetings after this start date
333
+ * @param {object} options.endDate - get meetings before this end date
334
+ * @returns {Object} All currently active meetings.
335
+ * @public
336
+ * @memberof Meetings
337
+ */
338
+ getAllMeetings(options?: {
339
+ startDate: object;
340
+ endDate: object;
341
+ }): any;
342
+ /**
343
+ * Syncs all the meetings from server. Does nothing and returns immediately if unverified guest.
344
+ * @param {boolean} keepOnlyLocusMeetings - whether the sync should keep only locus meetings or any other meeting in meetingCollection
345
+ * @returns {Promise<void>}
346
+ * @public
347
+ * @memberof Meetings
348
+ */
349
+ syncMeetings({ keepOnlyLocusMeetings }?: {
350
+ keepOnlyLocusMeetings?: boolean;
351
+ }): Promise<void>;
352
+ /**
353
+ * sort out locus array for initial creating
354
+ * @param {Array} loci original locus array
355
+ * @returns {undefined}
356
+ * @public
357
+ * @memberof Meetings
358
+ */
359
+ sortLocusArrayToUpdate(loci: any[]): any[];
360
+ /**
361
+ * check breakout locus which waiting for main locus's meeting to be created, then handle the breakout locus
362
+ * @param {Object} newCreatedLocus the locus which just create meeting object of it
363
+ * @returns {undefined}
364
+ * @public
365
+ * @memberof Meetings
366
+ */
367
+ checkHandleBreakoutLocus(newCreatedLocus: any): void;
368
+ /**
369
+ * Get all scheduled meetings.
370
+ * @param {object} options
371
+ * @param {object} options.startDate - get meetings after this start date
372
+ * @param {object} options.endDate - get meetings before this end date
373
+ * @returns {Object} All scheduled meetings.
374
+ * @memberof Meetings
375
+ */
376
+ getScheduledMeetings(): any;
377
+ /**
378
+ * Get the logger instance for plugin-meetings
379
+ * @returns {Logger}
380
+ */
381
+ getLogger(): any;
382
+ /**
383
+ * Returns the first meeting it finds that has the webrtc media connection created.
384
+ * Useful for debugging in the console.
385
+ *
386
+ * @private
387
+ * @returns {Meeting} Meeting object that has a webrtc media connection, else undefined
388
+ */
389
+ getActiveWebrtcMeeting(): any;
390
+ }
@@ -14,6 +14,7 @@ _Object$defineProperty(exports, "__esModule", {
14
14
  value: true
15
15
  });
16
16
  exports.default = void 0;
17
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
17
18
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
18
19
  var _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
19
20
  var _keys = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/keys"));
@@ -28,6 +29,7 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
28
29
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
29
30
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
30
31
  var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
32
+ var _lodash = require("lodash");
31
33
  require("@webex/internal-plugin-mercury");
32
34
  require("@webex/internal-plugin-conversation");
33
35
  require("@webex/internal-plugin-metrics");
@@ -152,6 +154,10 @@ var MediaLogger = /*#__PURE__*/function () {
152
154
  * @property {String} type what type of meeting it was
153
155
  * @memberof Meetings
154
156
  */
157
+ /**
158
+ * Object containing only the most basic information about a meeting.
159
+ * This is the information that is kept even after the meeting is deleted from the MeetingCollection
160
+ */
155
161
  /**
156
162
  * Maintain a cache of meetings and sync with services.
157
163
  * @class
@@ -185,6 +191,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
185
191
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "loggerRequest", void 0);
186
192
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "media", void 0);
187
193
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingCollection", void 0);
194
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deletedMeetings", void 0);
188
195
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "personalMeetingRoom", void 0);
189
196
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "preferredWebexSite", void 0);
190
197
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "reachability", void 0);
@@ -278,6 +285,8 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
278
285
  webex: _this.webex
279
286
  });
280
287
  _this.meetingCollection = new _collection.default();
288
+ _this.deletedMeetings = new _map.default();
289
+
281
290
  /**
282
291
  * The PersonalMeetingRoom object to interact with server
283
292
  * @instance
@@ -771,13 +780,14 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
771
780
  * Explicitly sets up the meetings plugin by registering
772
781
  * the device, connecting to mercury, and listening for locus events.
773
782
  *
783
+ * @param {DeviceRegistrationOptions} [deviceRegistrationOptions] - The options for registering the device (optional)
774
784
  * @returns {Promise}
775
785
  * @public
776
786
  * @memberof Meetings
777
787
  */
778
788
  }, {
779
789
  key: "register",
780
- value: function register() {
790
+ value: function register(deviceRegistrationOptions) {
781
791
  var _this5 = this;
782
792
  // @ts-ignore
783
793
  if (!this.webex.canAuthorize) {
@@ -792,7 +802,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
792
802
  _loggerProxy.default.logger.error("Meetings:index#register --> GDM error, ".concat(error.message));
793
803
  }),
794
804
  // @ts-ignore
795
- this.webex.internal.device.register()
805
+ this.webex.internal.device.register(deviceRegistrationOptions)
796
806
  // @ts-ignore
797
807
  .then(function () {
798
808
  return _loggerProxy.default.logger.info( // @ts-ignore
@@ -950,29 +960,36 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
950
960
  key: "fetchUserPreferredWebexSite",
951
961
  value: function fetchUserPreferredWebexSite() {
952
962
  var _this9 = this;
953
- return this.request.getMeetingPreferences().then(function (res) {
954
- if (res) {
955
- var preferredWebexSite = _util2.default.parseDefaultSiteFromMeetingPreferences(res);
956
- _this9.preferredWebexSite = preferredWebexSite;
957
- // @ts-ignore
958
- _this9.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
959
- }
960
-
961
- // fall back to getting the preferred site from the user information
962
- if (!_this9.preferredWebexSite) {
963
- // @ts-ignore
964
- return _this9.webex.internal.user.get().then(function (user) {
965
- var _user$userPreferences, _user$userPreferences2;
966
- var preferredWebexSite = user === null || user === void 0 ? void 0 : (_user$userPreferences = user.userPreferences) === null || _user$userPreferences === void 0 ? void 0 : (_user$userPreferences2 = _user$userPreferences.userPreferencesItems) === null || _user$userPreferences2 === void 0 ? void 0 : _user$userPreferences2.preferredWebExSite;
967
- if (preferredWebexSite) {
963
+ // @ts-ignore
964
+ return this.webex.people._getMe().then(function (me) {
965
+ var isGuestUser = me.type === 'appuser';
966
+ if (!isGuestUser) {
967
+ return _this9.request.getMeetingPreferences().then(function (res) {
968
+ if (res) {
969
+ var preferredWebexSite = _util2.default.parseDefaultSiteFromMeetingPreferences(res);
968
970
  _this9.preferredWebexSite = preferredWebexSite;
969
971
  // @ts-ignore
970
972
  _this9.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
971
- } else {
972
- throw new Error('site not found');
973
973
  }
974
- }).catch(function () {
975
- _loggerProxy.default.logger.error('Failed to fetch preferred site from user - no site will be set');
974
+
975
+ // fall back to getting the preferred site from the user information
976
+ if (!_this9.preferredWebexSite) {
977
+ // @ts-ignore
978
+ return _this9.webex.internal.user.get().then(function (user) {
979
+ var _user$userPreferences, _user$userPreferences2;
980
+ var preferredWebexSite = user === null || user === void 0 ? void 0 : (_user$userPreferences = user.userPreferences) === null || _user$userPreferences === void 0 ? void 0 : (_user$userPreferences2 = _user$userPreferences.userPreferencesItems) === null || _user$userPreferences2 === void 0 ? void 0 : _user$userPreferences2.preferredWebExSite;
981
+ if (preferredWebexSite) {
982
+ _this9.preferredWebexSite = preferredWebexSite;
983
+ // @ts-ignore
984
+ _this9.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
985
+ } else {
986
+ throw new Error('site not found');
987
+ }
988
+ }).catch(function () {
989
+ _loggerProxy.default.logger.error('Failed to fetch preferred site from user - no site will be set');
990
+ });
991
+ }
992
+ return _promise.default.resolve();
976
993
  });
977
994
  }
978
995
  return _promise.default.resolve();
@@ -991,6 +1008,19 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
991
1008
  return this.personalMeetingRoom;
992
1009
  }
993
1010
 
1011
+ /**
1012
+ * Returns basic information about a meeting that exists or
1013
+ * used to exist in the MeetingCollection
1014
+ *
1015
+ * @param {string} meetingId
1016
+ * @returns {BasicMeetingInformation|undefined}
1017
+ */
1018
+ }, {
1019
+ key: "getBasicMeetingInformation",
1020
+ value: function getBasicMeetingInformation(meetingId) {
1021
+ return this.meetingCollection.get(meetingId) || this.deletedMeetings.get(meetingId);
1022
+ }
1023
+
994
1024
  /**
995
1025
  * @param {Meeting} meeting
996
1026
  * @param {Object} reason
@@ -1002,7 +1032,26 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1002
1032
  }, {
1003
1033
  key: "destroy",
1004
1034
  value: function destroy(meeting, reason) {
1035
+ var _meeting$locusInfo, _meeting$locusInfo2, _meeting$locusInfo2$f, _meeting$locusInfo3, _meeting$locusInfo3$f;
1005
1036
  _util.default.cleanUp(meeting);
1037
+ // keep some basic info about the deleted meeting forever
1038
+ this.deletedMeetings.set(meeting.id, {
1039
+ id: meeting.id,
1040
+ allowMediaInLobby: meeting.allowMediaInLobby,
1041
+ correlationId: meeting.correlationId,
1042
+ sessionCorrelationId: meeting.sessionCorrelationId,
1043
+ environment: meeting.environment,
1044
+ locusUrl: meeting.locusUrl,
1045
+ meetingInfo: (0, _lodash.cloneDeep)(meeting.meetingInfo),
1046
+ locusInfo: {
1047
+ // locusInfo can be quite big, so keep just the minimal info
1048
+ url: (_meeting$locusInfo = meeting.locusInfo) === null || _meeting$locusInfo === void 0 ? void 0 : _meeting$locusInfo.url,
1049
+ fullState: {
1050
+ lastActive: (_meeting$locusInfo2 = meeting.locusInfo) === null || _meeting$locusInfo2 === void 0 ? void 0 : (_meeting$locusInfo2$f = _meeting$locusInfo2.fullState) === null || _meeting$locusInfo2$f === void 0 ? void 0 : _meeting$locusInfo2$f.lastActive,
1051
+ sessionId: (_meeting$locusInfo3 = meeting.locusInfo) === null || _meeting$locusInfo3 === void 0 ? void 0 : (_meeting$locusInfo3$f = _meeting$locusInfo3.fullState) === null || _meeting$locusInfo3$f === void 0 ? void 0 : _meeting$locusInfo3$f.sessionId
1052
+ }
1053
+ }
1054
+ });
1006
1055
  this.meetingCollection.delete(meeting.id);
1007
1056
  _triggerProxy.default.trigger(this, {
1008
1057
  file: 'meetings',
@@ -1027,6 +1076,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1027
1076
  * @param {CallStateForMetrics} callStateForMetrics - information about call state for metrics
1028
1077
  * @param {Object} [meetingInfo] - Pre-fetched complete meeting info
1029
1078
  * @param {String} [meetingLookupUrl] - meeting info prefetch url
1079
+ * @param {string} sessionCorrelationId - the optional specified sessionCorrelationId (callStateForMetrics.sessionCorrelationId) can be provided instead
1030
1080
  * @returns {Promise<Meeting>} A new Meeting.
1031
1081
  * @public
1032
1082
  * @memberof Meetings
@@ -1043,6 +1093,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1043
1093
  var callStateForMetrics = arguments.length > 6 && arguments[6] !== undefined ? arguments[6] : undefined;
1044
1094
  var meetingInfo = arguments.length > 7 && arguments[7] !== undefined ? arguments[7] : undefined;
1045
1095
  var meetingLookupUrl = arguments.length > 8 && arguments[8] !== undefined ? arguments[8] : undefined;
1096
+ var sessionCorrelationId = arguments.length > 9 && arguments[9] !== undefined ? arguments[9] : undefined;
1046
1097
  // Validate meeting information based on the provided destination and
1047
1098
  // type. This must be performed prior to determining if the meeting is
1048
1099
  // found in the collection, as we mutate the destination for hydra person
@@ -1053,6 +1104,11 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1053
1104
  correlationId: correlationId
1054
1105
  });
1055
1106
  }
1107
+ if (sessionCorrelationId) {
1108
+ callStateForMetrics = _objectSpread(_objectSpread({}, callStateForMetrics || {}), {}, {
1109
+ sessionCorrelationId: sessionCorrelationId
1110
+ });
1111
+ }
1056
1112
  return this.meetingInfo.fetchInfoOptions(destination, type)
1057
1113
  // Catch a failure to fetch info options.
1058
1114
  .catch(function (error) {
@@ -1104,12 +1160,9 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1104
1160
  locusId: createdMeeting.locusId,
1105
1161
  meetingId: (_createdMeeting$locus5 = createdMeeting.locusInfo) === null || _createdMeeting$locus5 === void 0 ? void 0 : (_createdMeeting$locus6 = _createdMeeting$locus5.info) === null || _createdMeeting$locus6 === void 0 ? void 0 : _createdMeeting$locus6.webExMeetingId,
1106
1162
  autoupload: true
1107
- }).then(function () {
1108
- return _this10.destroy(createdMeeting, payload.reason);
1109
1163
  });
1110
- } else {
1111
- _this10.destroy(createdMeeting, payload.reason);
1112
1164
  }
1165
+ _this10.destroy(createdMeeting, payload.reason);
1113
1166
  });
1114
1167
  createdMeeting.on(_constants.EVENTS.REQUEST_UPLOAD_LOGS, function (meetingInstance) {
1115
1168
  // @ts-ignore
@@ -1134,7 +1187,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1134
1187
  return _promise.default.resolve(createdMeeting);
1135
1188
  });
1136
1189
  }
1137
- meeting.setCallStateForMetrics(callStateForMetrics);
1190
+ meeting.updateCallStateForMetrics(callStateForMetrics);
1138
1191
 
1139
1192
  // Return the existing meeting.
1140
1193
  return _promise.default.resolve(meeting);