@webex/plugin-meetings 3.12.0-next.6 → 3.12.0-next.61

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 (158) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +15 -2
  3. package/dist/aiEnableRequest/index.js.map +1 -1
  4. package/dist/breakouts/breakout.js +8 -3
  5. package/dist/breakouts/breakout.js.map +1 -1
  6. package/dist/breakouts/index.js +26 -2
  7. package/dist/breakouts/index.js.map +1 -1
  8. package/dist/config.js +2 -0
  9. package/dist/config.js.map +1 -1
  10. package/dist/constants.js +6 -3
  11. package/dist/constants.js.map +1 -1
  12. package/dist/controls-options-manager/constants.js +11 -1
  13. package/dist/controls-options-manager/constants.js.map +1 -1
  14. package/dist/controls-options-manager/index.js +38 -24
  15. package/dist/controls-options-manager/index.js.map +1 -1
  16. package/dist/controls-options-manager/util.js +91 -0
  17. package/dist/controls-options-manager/util.js.map +1 -1
  18. package/dist/hashTree/constants.js +10 -1
  19. package/dist/hashTree/constants.js.map +1 -1
  20. package/dist/hashTree/hashTreeParser.js +716 -370
  21. package/dist/hashTree/hashTreeParser.js.map +1 -1
  22. package/dist/hashTree/utils.js +22 -0
  23. package/dist/hashTree/utils.js.map +1 -1
  24. package/dist/index.js +7 -0
  25. package/dist/index.js.map +1 -1
  26. package/dist/interceptors/locusRetry.js +23 -8
  27. package/dist/interceptors/locusRetry.js.map +1 -1
  28. package/dist/interpretation/index.js +10 -1
  29. package/dist/interpretation/index.js.map +1 -1
  30. package/dist/interpretation/siLanguage.js +1 -1
  31. package/dist/locus-info/controlsUtils.js +4 -1
  32. package/dist/locus-info/controlsUtils.js.map +1 -1
  33. package/dist/locus-info/index.js +289 -87
  34. package/dist/locus-info/index.js.map +1 -1
  35. package/dist/locus-info/types.js +19 -0
  36. package/dist/locus-info/types.js.map +1 -1
  37. package/dist/media/index.js +3 -1
  38. package/dist/media/index.js.map +1 -1
  39. package/dist/media/properties.js +1 -0
  40. package/dist/media/properties.js.map +1 -1
  41. package/dist/meeting/in-meeting-actions.js +3 -1
  42. package/dist/meeting/in-meeting-actions.js.map +1 -1
  43. package/dist/meeting/index.js +907 -535
  44. package/dist/meeting/index.js.map +1 -1
  45. package/dist/meeting/util.js +19 -2
  46. package/dist/meeting/util.js.map +1 -1
  47. package/dist/meetings/index.js +231 -78
  48. package/dist/meetings/index.js.map +1 -1
  49. package/dist/meetings/meetings.types.js +6 -1
  50. package/dist/meetings/meetings.types.js.map +1 -1
  51. package/dist/meetings/request.js +39 -0
  52. package/dist/meetings/request.js.map +1 -1
  53. package/dist/meetings/util.js +79 -5
  54. package/dist/meetings/util.js.map +1 -1
  55. package/dist/member/index.js +10 -0
  56. package/dist/member/index.js.map +1 -1
  57. package/dist/member/types.js.map +1 -1
  58. package/dist/member/util.js +3 -0
  59. package/dist/member/util.js.map +1 -1
  60. package/dist/metrics/constants.js +4 -1
  61. package/dist/metrics/constants.js.map +1 -1
  62. package/dist/multistream/codec/constants.js +63 -0
  63. package/dist/multistream/codec/constants.js.map +1 -0
  64. package/dist/multistream/mediaRequestManager.js +62 -15
  65. package/dist/multistream/mediaRequestManager.js.map +1 -1
  66. package/dist/multistream/receiveSlot.js +9 -0
  67. package/dist/multistream/receiveSlot.js.map +1 -1
  68. package/dist/reactions/reactions.type.js.map +1 -1
  69. package/dist/recording-controller/index.js +1 -3
  70. package/dist/recording-controller/index.js.map +1 -1
  71. package/dist/types/config.d.ts +2 -0
  72. package/dist/types/constants.d.ts +2 -0
  73. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  74. package/dist/types/controls-options-manager/index.d.ts +10 -0
  75. package/dist/types/hashTree/constants.d.ts +1 -0
  76. package/dist/types/hashTree/hashTreeParser.d.ts +92 -16
  77. package/dist/types/hashTree/utils.d.ts +11 -0
  78. package/dist/types/index.d.ts +2 -0
  79. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  80. package/dist/types/locus-info/index.d.ts +46 -6
  81. package/dist/types/locus-info/types.d.ts +21 -1
  82. package/dist/types/media/properties.d.ts +1 -0
  83. package/dist/types/meeting/in-meeting-actions.d.ts +2 -0
  84. package/dist/types/meeting/index.d.ts +87 -3
  85. package/dist/types/meeting/util.d.ts +8 -0
  86. package/dist/types/meetings/index.d.ts +30 -2
  87. package/dist/types/meetings/meetings.types.d.ts +15 -0
  88. package/dist/types/meetings/request.d.ts +14 -0
  89. package/dist/types/member/index.d.ts +1 -0
  90. package/dist/types/member/types.d.ts +1 -0
  91. package/dist/types/member/util.d.ts +1 -0
  92. package/dist/types/metrics/constants.d.ts +3 -0
  93. package/dist/types/multistream/codec/constants.d.ts +7 -0
  94. package/dist/types/multistream/mediaRequestManager.d.ts +22 -5
  95. package/dist/types/reactions/reactions.type.d.ts +3 -0
  96. package/dist/webinar/index.js +361 -235
  97. package/dist/webinar/index.js.map +1 -1
  98. package/package.json +22 -22
  99. package/src/aiEnableRequest/index.ts +16 -0
  100. package/src/breakouts/breakout.ts +3 -1
  101. package/src/breakouts/index.ts +31 -0
  102. package/src/config.ts +2 -0
  103. package/src/constants.ts +5 -1
  104. package/src/controls-options-manager/constants.ts +14 -1
  105. package/src/controls-options-manager/index.ts +47 -24
  106. package/src/controls-options-manager/util.ts +81 -1
  107. package/src/hashTree/constants.ts +9 -0
  108. package/src/hashTree/hashTreeParser.ts +429 -183
  109. package/src/hashTree/utils.ts +17 -0
  110. package/src/index.ts +5 -0
  111. package/src/interceptors/locusRetry.ts +25 -4
  112. package/src/interpretation/index.ts +25 -8
  113. package/src/locus-info/controlsUtils.ts +3 -1
  114. package/src/locus-info/index.ts +291 -97
  115. package/src/locus-info/types.ts +25 -1
  116. package/src/media/index.ts +3 -0
  117. package/src/media/properties.ts +1 -0
  118. package/src/meeting/in-meeting-actions.ts +4 -0
  119. package/src/meeting/index.ts +388 -33
  120. package/src/meeting/util.ts +20 -2
  121. package/src/meetings/index.ts +134 -44
  122. package/src/meetings/meetings.types.ts +19 -0
  123. package/src/meetings/request.ts +43 -0
  124. package/src/meetings/util.ts +97 -1
  125. package/src/member/index.ts +10 -0
  126. package/src/member/types.ts +1 -0
  127. package/src/member/util.ts +3 -0
  128. package/src/metrics/constants.ts +3 -0
  129. package/src/multistream/codec/constants.ts +58 -0
  130. package/src/multistream/mediaRequestManager.ts +119 -28
  131. package/src/multistream/receiveSlot.ts +18 -0
  132. package/src/reactions/reactions.type.ts +3 -0
  133. package/src/recording-controller/index.ts +1 -2
  134. package/src/webinar/index.ts +162 -21
  135. package/test/unit/spec/aiEnableRequest/index.ts +86 -0
  136. package/test/unit/spec/breakouts/breakout.ts +9 -3
  137. package/test/unit/spec/breakouts/index.ts +49 -0
  138. package/test/unit/spec/controls-options-manager/index.js +140 -29
  139. package/test/unit/spec/controls-options-manager/util.js +165 -0
  140. package/test/unit/spec/hashTree/hashTreeParser.ts +1508 -149
  141. package/test/unit/spec/hashTree/utils.ts +88 -1
  142. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  143. package/test/unit/spec/interpretation/index.ts +26 -4
  144. package/test/unit/spec/locus-info/controlsUtils.js +172 -57
  145. package/test/unit/spec/locus-info/index.js +475 -81
  146. package/test/unit/spec/media/index.ts +31 -0
  147. package/test/unit/spec/meeting/in-meeting-actions.ts +2 -0
  148. package/test/unit/spec/meeting/index.js +1131 -49
  149. package/test/unit/spec/meeting/muteState.js +3 -0
  150. package/test/unit/spec/meeting/utils.js +33 -0
  151. package/test/unit/spec/meetings/index.js +360 -10
  152. package/test/unit/spec/meetings/request.js +141 -0
  153. package/test/unit/spec/meetings/utils.js +189 -0
  154. package/test/unit/spec/member/index.js +7 -0
  155. package/test/unit/spec/member/util.js +24 -0
  156. package/test/unit/spec/multistream/mediaRequestManager.ts +501 -37
  157. package/test/unit/spec/recording-controller/index.js +9 -8
  158. package/test/unit/spec/webinar/index.ts +141 -16
@@ -17,6 +17,7 @@ var _internalPluginLlm = require("@webex/internal-plugin-llm");
17
17
  var _constants = require("../constants");
18
18
  var _collection = _interopRequireDefault(require("./collection"));
19
19
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
20
+ var _util = _interopRequireDefault(require("../meeting/util"));
20
21
  var _utils = require("./utils");
21
22
  /*!
22
23
  * Copyright (c) 2015-2023 Cisco Systems, Inc. See LICENSE file.
@@ -100,6 +101,31 @@ var Webinar = _webexCore.WebexPlugin.extend({
100
101
  isDemoted: isDemoted
101
102
  };
102
103
  },
104
+ /**
105
+ * Resolves the meeting associated with this webinar instance, guarded against the
106
+ * meetingId pointer drifting onto an unrelated transient meeting (e.g. an inbound
107
+ * 1:1 call) that may exist in the meeting collection. Returns the meeting only when
108
+ * its locusUrl matches this webinar's tracked locusUrl. Returns undefined (with a
109
+ * warning) when the meeting cannot be resolved or when the webinar's locusUrl has
110
+ * not been initialized yet — callers must treat this as "no owned meeting" rather
111
+ * than fall through to an unvalidated lookup.
112
+ * @returns {object|undefined}
113
+ */
114
+ getValidatedWebinarMeeting: function getValidatedWebinarMeeting() {
115
+ var meeting = this.webex.meetings.getMeetingByType(_constants._ID_, this.meetingId);
116
+ if (!meeting) {
117
+ return undefined;
118
+ }
119
+ if (!this.locusUrl) {
120
+ _loggerProxy.default.logger.warn("Webinar:index#getValidatedWebinarMeeting --> skipping; webinar locusUrl is not yet initialized for meetingId ".concat(this.meetingId));
121
+ return undefined;
122
+ }
123
+ if (meeting.locusUrl !== this.locusUrl) {
124
+ _loggerProxy.default.logger.warn("Webinar:index#getValidatedWebinarMeeting --> skipping; meeting ".concat(this.meetingId, " locusUrl ").concat(meeting.locusUrl, " does not match webinar locusUrl ").concat(this.locusUrl));
125
+ return undefined;
126
+ }
127
+ return meeting;
128
+ },
103
129
  /**
104
130
  * should join practice session data channel or not
105
131
  * @param {Object} {isPromoted: boolean, isDemoted: boolean}} Role transition states
@@ -108,7 +134,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
108
134
  updateStatusByRole: function updateStatusByRole(_ref) {
109
135
  var isPromoted = _ref.isPromoted,
110
136
  isDemoted = _ref.isDemoted;
111
- var meeting = this.webex.meetings.getMeetingByType(_constants._ID_, this.meetingId);
137
+ var meeting = this.getValidatedWebinarMeeting();
112
138
  if (isDemoted && (meeting === null || meeting === void 0 ? void 0 : meeting.shareStatus) === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE || isPromoted) {
113
139
  var _meeting$locusInfo, _meeting$locusInfo2;
114
140
  // attendees in webinar should subscribe streaming for whiteboard sharing
@@ -126,12 +152,14 @@ var Webinar = _webexCore.WebexPlugin.extend({
126
152
  },
127
153
  /**
128
154
  * Disconnects the practice session data channel and removes its relay listener.
155
+ * The listener reference removed here is the exact callback captured at subscribe
156
+ * time (see updatePSDataChannel) so that cleanup is correct even if the underlying
157
+ * meeting can no longer be resolved (e.g. locusUrl mismatch).
129
158
  * @returns {Promise<void>}
130
159
  */
131
160
  cleanupPSDataChannel: function cleanupPSDataChannel() {
132
161
  var _this = this;
133
162
  return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
134
- var meeting;
135
163
  return _regenerator.default.wrap(function (_context) {
136
164
  while (1) switch (_context.prev = _context.next) {
137
165
  case 0:
@@ -140,15 +168,19 @@ var Webinar = _webexCore.WebexPlugin.extend({
140
168
  _this.webex.internal.llm.off('online', _this._pendingOnlineListener);
141
169
  _this._pendingOnlineListener = null;
142
170
  }
143
- meeting = _this.webex.meetings.getMeetingByType(_constants._ID_, _this.meetingId); // @ts-ignore - Fix type
171
+
172
+ // @ts-ignore - Fix type
144
173
  _context.next = 1;
145
174
  return _this.webex.internal.llm.disconnectLLM({
146
175
  code: 3050,
147
176
  reason: 'done (permanent)'
148
177
  }, _constants.LLM_PRACTICE_SESSION);
149
178
  case 1:
150
- // @ts-ignore - Fix type
151
- _this.webex.internal.llm.off("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), meeting === null || meeting === void 0 ? void 0 : meeting.processRelayEvent);
179
+ if (_this._practiceSessionRelayListener) {
180
+ // @ts-ignore - Fix type
181
+ _this.webex.internal.llm.off("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), _this._practiceSessionRelayListener);
182
+ _this._practiceSessionRelayListener = null;
183
+ }
152
184
  case 2:
153
185
  case "end":
154
186
  return _context.stop();
@@ -157,107 +189,190 @@ var Webinar = _webexCore.WebexPlugin.extend({
157
189
  }))();
158
190
  },
159
191
  /**
160
- * Connects to low latency mercury and reconnects if the address has changed
161
- * It will also disconnect if called when the meeting has ended
162
- * @returns {Promise}
192
+ * Ensures practice-session token exists before registering the practice LLM channel.
193
+ * Caller is responsible for passing a meeting that has already been resolved via
194
+ * getValidatedWebinarMeeting() — this method does not re-validate ownership.
195
+ * @param {object} meeting
196
+ * @returns {Promise<string|undefined>}
163
197
  */
164
- updatePSDataChannel: function updatePSDataChannel() {
198
+ ensurePracticeSessionDatachannelToken: function ensurePracticeSessionDatachannelToken(meeting) {
165
199
  var _this2 = this;
166
200
  return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
167
- var meeting, isPracticeSession, _ref2, _ref2$url, url, _ref2$info, _ref2$info2, _ref2$info2$practiceS, practiceSessionDatachannelUrl, practiceSessionDatachannelToken, isCaptionBoxOn, _onDefaultSessionConnected;
201
+ var isDataChannelTokenEnabled, cachedToken, _refreshResponse$body, refreshResponse, _ref2, datachannelToken, dataChannelTokenType, _t;
168
202
  return _regenerator.default.wrap(function (_context2) {
169
203
  while (1) switch (_context2.prev = _context2.next) {
170
204
  case 0:
171
- meeting = _this2.webex.meetings.getMeetingByType(_constants._ID_, _this2.meetingId);
172
- isPracticeSession = (meeting === null || meeting === void 0 ? void 0 : meeting.isJoined()) && _this2.isJoinPracticeSessionDataChannel();
173
- if (isPracticeSession) {
205
+ _context2.next = 1;
206
+ return _this2.webex.internal.llm.isDataChannelTokenEnabled();
207
+ case 1:
208
+ isDataChannelTokenEnabled = _context2.sent;
209
+ if (isDataChannelTokenEnabled) {
174
210
  _context2.next = 2;
175
211
  break;
176
212
  }
177
- _context2.next = 1;
178
- return _this2.cleanupPSDataChannel();
179
- case 1:
180
213
  return _context2.abrupt("return", undefined);
181
214
  case 2:
182
- // @ts-ignore - Fix type
183
- _ref2 = (meeting === null || meeting === void 0 ? void 0 : meeting.locusInfo) || {}, _ref2$url = _ref2.url, url = _ref2$url === void 0 ? undefined : _ref2$url, _ref2$info = _ref2.info, _ref2$info2 = _ref2$info === void 0 ? {} : _ref2$info, _ref2$info2$practiceS = _ref2$info2.practiceSessionDatachannelUrl, practiceSessionDatachannelUrl = _ref2$info2$practiceS === void 0 ? undefined : _ref2$info2$practiceS; // @ts-ignore
184
- practiceSessionDatachannelToken = _this2.webex.internal.llm.getDatachannelToken(_internalPluginLlm.DataChannelTokenType.PracticeSession);
185
- isCaptionBoxOn = _this2.webex.internal.voicea.getIsCaptionBoxOn();
186
- if (practiceSessionDatachannelUrl) {
215
+ // @ts-ignore
216
+ cachedToken = _this2.webex.internal.llm.getDatachannelToken(_internalPluginLlm.DataChannelTokenType.PracticeSession);
217
+ if (!cachedToken) {
187
218
  _context2.next = 3;
188
219
  break;
189
220
  }
190
- return _context2.abrupt("return", undefined);
221
+ return _context2.abrupt("return", cachedToken);
191
222
  case 3:
192
- if (!_this2.webex.internal.llm.isConnected(_constants.LLM_PRACTICE_SESSION)) {
223
+ _context2.prev = 3;
224
+ _context2.next = 4;
225
+ return meeting.refreshDataChannelToken();
226
+ case 4:
227
+ refreshResponse = _context2.sent;
228
+ _ref2 = (_refreshResponse$body = refreshResponse === null || refreshResponse === void 0 ? void 0 : refreshResponse.body) !== null && _refreshResponse$body !== void 0 ? _refreshResponse$body : {}, datachannelToken = _ref2.datachannelToken, dataChannelTokenType = _ref2.dataChannelTokenType;
229
+ if (datachannelToken) {
193
230
  _context2.next = 5;
194
231
  break;
195
232
  }
233
+ return _context2.abrupt("return", undefined);
234
+ case 5:
235
+ // @ts-ignore
236
+ _this2.webex.internal.llm.setDatachannelToken(datachannelToken, dataChannelTokenType || _internalPluginLlm.DataChannelTokenType.PracticeSession);
237
+ return _context2.abrupt("return", datachannelToken);
238
+ case 6:
239
+ _context2.prev = 6;
240
+ _t = _context2["catch"](3);
241
+ _loggerProxy.default.logger.warn("Webinar:index#ensurePracticeSessionDatachannelToken --> failed to proactively refresh practice-session token: ".concat((_t === null || _t === void 0 ? void 0 : _t.message) || String(_t)));
242
+ return _context2.abrupt("return", undefined);
243
+ case 7:
244
+ case "end":
245
+ return _context2.stop();
246
+ }
247
+ }, _callee2, null, [[3, 6]]);
248
+ }))();
249
+ },
250
+ /**
251
+ * Connects to low latency mercury and reconnects if the address has changed
252
+ * It will also disconnect if called when the meeting has ended
253
+ * @returns {Promise}
254
+ */
255
+ updatePSDataChannel: function updatePSDataChannel() {
256
+ var _this3 = this;
257
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
258
+ var invocationSequence, meeting, isPracticeSession, _ref3, _ref3$url, url, _ref3$info, _ref3$info2, _ref3$info2$practiceS, practiceSessionDatachannelUrl, practiceSessionDatachannelToken, isCaptionBoxOn, _onDefaultSessionConnected, refreshedPracticeSessionToken, latestPracticeSessionDatachannelUrl, isStillPracticeSession;
259
+ return _regenerator.default.wrap(function (_context3) {
260
+ while (1) switch (_context3.prev = _context3.next) {
261
+ case 0:
262
+ _this3._updatePSDataChannelSequence = (_this3._updatePSDataChannelSequence || 0) + 1;
263
+ invocationSequence = _this3._updatePSDataChannelSequence;
264
+ meeting = _this3.getValidatedWebinarMeeting();
265
+ isPracticeSession = (meeting === null || meeting === void 0 ? void 0 : meeting.isJoined()) && _this3.isJoinPracticeSessionDataChannel();
266
+ if (isPracticeSession) {
267
+ _context3.next = 2;
268
+ break;
269
+ }
270
+ _context3.next = 1;
271
+ return _this3.cleanupPSDataChannel();
272
+ case 1:
273
+ return _context3.abrupt("return", undefined);
274
+ case 2:
275
+ // @ts-ignore - Fix type
276
+ _ref3 = (meeting === null || meeting === void 0 ? void 0 : meeting.locusInfo) || {}, _ref3$url = _ref3.url, url = _ref3$url === void 0 ? undefined : _ref3$url, _ref3$info = _ref3.info, _ref3$info2 = _ref3$info === void 0 ? {} : _ref3$info, _ref3$info2$practiceS = _ref3$info2.practiceSessionDatachannelUrl, practiceSessionDatachannelUrl = _ref3$info2$practiceS === void 0 ? undefined : _ref3$info2$practiceS; // @ts-ignore
277
+ practiceSessionDatachannelToken = _this3.webex.internal.llm.getDatachannelToken(_internalPluginLlm.DataChannelTokenType.PracticeSession);
278
+ isCaptionBoxOn = _this3.webex.internal.voicea.getIsCaptionBoxOn();
279
+ if (practiceSessionDatachannelUrl) {
280
+ _context3.next = 3;
281
+ break;
282
+ }
283
+ return _context3.abrupt("return", undefined);
284
+ case 3:
285
+ if (!_this3.webex.internal.llm.isConnected(_constants.LLM_PRACTICE_SESSION)) {
286
+ _context3.next = 5;
287
+ break;
288
+ }
196
289
  if (!(
197
290
  // @ts-ignore - Fix type
198
- url === _this2.webex.internal.llm.getLocusUrl(_constants.LLM_PRACTICE_SESSION) &&
291
+ url === _this3.webex.internal.llm.getLocusUrl(_constants.LLM_PRACTICE_SESSION) &&
199
292
  // @ts-ignore - Fix type
200
- practiceSessionDatachannelUrl === _this2.webex.internal.llm.getDatachannelUrl(_constants.LLM_PRACTICE_SESSION))) {
201
- _context2.next = 4;
293
+ practiceSessionDatachannelUrl === _this3.webex.internal.llm.getDatachannelUrl(_constants.LLM_PRACTICE_SESSION))) {
294
+ _context3.next = 4;
202
295
  break;
203
296
  }
204
- return _context2.abrupt("return", undefined);
297
+ return _context3.abrupt("return", undefined);
205
298
  case 4:
206
- _context2.next = 5;
207
- return _this2.cleanupPSDataChannel();
299
+ _context3.next = 5;
300
+ return _this3.cleanupPSDataChannel();
208
301
  case 5:
209
302
  // Ensure the default session data channel is connected before connecting the practice session.
210
303
  // Subscribe before checking isConnected() to avoid a race where the 'online' event fires
211
304
  // between the check and the subscription — Mercury does not replay missed events.
212
- if (!_this2._pendingOnlineListener) {
305
+ if (!_this3._pendingOnlineListener) {
213
306
  _onDefaultSessionConnected = function onDefaultSessionConnected() {
214
- _this2._pendingOnlineListener = null;
307
+ _this3._pendingOnlineListener = null;
215
308
  // @ts-ignore - Fix type
216
- _this2.webex.internal.llm.off('online', _onDefaultSessionConnected);
217
- _this2.updatePSDataChannel();
309
+ _this3.webex.internal.llm.off('online', _onDefaultSessionConnected);
310
+ _this3.updatePSDataChannel();
218
311
  };
219
- _this2._pendingOnlineListener = _onDefaultSessionConnected;
312
+ _this3._pendingOnlineListener = _onDefaultSessionConnected;
220
313
  // @ts-ignore - Fix type
221
- _this2.webex.internal.llm.on('online', _onDefaultSessionConnected);
314
+ _this3.webex.internal.llm.on('online', _onDefaultSessionConnected);
222
315
  }
223
316
 
224
317
  // @ts-ignore - Fix type
225
- if (_this2.webex.internal.llm.isConnected()) {
226
- _context2.next = 6;
318
+ if (_this3.webex.internal.llm.isConnected()) {
319
+ _context3.next = 6;
227
320
  break;
228
321
  }
229
322
  _loggerProxy.default.logger.info('Webinar:index#updatePSDataChannel --> default session not yet connected, deferring practice session connect.');
230
- return _context2.abrupt("return", undefined);
323
+ return _context3.abrupt("return", undefined);
231
324
  case 6:
232
325
  // Default session is already connected — cancel the pending listener and proceed
233
- if (_this2._pendingOnlineListener) {
326
+ if (_this3._pendingOnlineListener) {
234
327
  // @ts-ignore - Fix type
235
- _this2.webex.internal.llm.off('online', _this2._pendingOnlineListener);
236
- _this2._pendingOnlineListener = null;
328
+ _this3.webex.internal.llm.off('online', _this3._pendingOnlineListener);
329
+ _this3._pendingOnlineListener = null;
330
+ }
331
+ _context3.next = 7;
332
+ return _this3.ensurePracticeSessionDatachannelToken(meeting);
333
+ case 7:
334
+ refreshedPracticeSessionToken = _context3.sent;
335
+ latestPracticeSessionDatachannelUrl = (0, _lodash.get)(meeting, 'locusInfo.info.practiceSessionDatachannelUrl');
336
+ isStillPracticeSession = (meeting === null || meeting === void 0 ? void 0 : meeting.isJoined()) && _this3.isJoinPracticeSessionDataChannel(); // Skip stale invocations after async refresh to avoid reconnecting a session
337
+ // that was already updated/cleaned by a newer state transition.
338
+ if (!(invocationSequence !== _this3._updatePSDataChannelSequence || !isStillPracticeSession || !latestPracticeSessionDatachannelUrl || latestPracticeSessionDatachannelUrl !== practiceSessionDatachannelUrl)) {
339
+ _context3.next = 8;
340
+ break;
341
+ }
342
+ return _context3.abrupt("return", undefined);
343
+ case 8:
344
+ if (refreshedPracticeSessionToken) {
345
+ practiceSessionDatachannelToken = refreshedPracticeSessionToken;
237
346
  }
238
347
 
239
348
  // @ts-ignore - Fix type
240
- return _context2.abrupt("return", _this2.webex.internal.llm.registerAndConnect(url, practiceSessionDatachannelUrl, practiceSessionDatachannelToken, _constants.LLM_PRACTICE_SESSION).then(function (registerAndConnectResult) {
241
- var _this2$webex$internal, _this2$webex$internal2;
242
- // @ts-ignore - Fix type
243
- _this2.webex.internal.llm.off("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), meeting === null || meeting === void 0 ? void 0 : meeting.processRelayEvent);
349
+ return _context3.abrupt("return", _this3.webex.internal.llm.registerAndConnect(url, practiceSessionDatachannelUrl, practiceSessionDatachannelToken, _constants.LLM_PRACTICE_SESSION).then(function (registerAndConnectResult) {
350
+ var _this3$webex$internal, _this3$webex$internal2;
351
+ // Track the exact listener reference so cleanupPSDataChannel can
352
+ // unsubscribe deterministically, even if the meeting can no longer
353
+ // be resolved at cleanup time.
354
+ if (_this3._practiceSessionRelayListener) {
355
+ // @ts-ignore - Fix type
356
+ _this3.webex.internal.llm.off("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), _this3._practiceSessionRelayListener);
357
+ }
358
+ _this3._practiceSessionRelayListener = meeting === null || meeting === void 0 ? void 0 : meeting.processRelayEvent;
244
359
  // @ts-ignore - Fix type
245
- _this2.webex.internal.llm.on("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), meeting === null || meeting === void 0 ? void 0 : meeting.processRelayEvent);
360
+ _this3.webex.internal.llm.on("event:relay.event:".concat(_constants.LLM_PRACTICE_SESSION), _this3._practiceSessionRelayListener);
246
361
  // @ts-ignore - Fix type
247
- (_this2$webex$internal = _this2.webex.internal.voicea) === null || _this2$webex$internal === void 0 ? void 0 : (_this2$webex$internal2 = _this2$webex$internal.announce) === null || _this2$webex$internal2 === void 0 ? void 0 : _this2$webex$internal2.call(_this2$webex$internal);
362
+ (_this3$webex$internal = _this3.webex.internal.voicea) === null || _this3$webex$internal === void 0 ? void 0 : (_this3$webex$internal2 = _this3$webex$internal.announce) === null || _this3$webex$internal2 === void 0 ? void 0 : _this3$webex$internal2.call(_this3$webex$internal);
248
363
  if (isCaptionBoxOn) {
249
- _this2.webex.internal.voicea.updateSubchannelSubscriptions({
364
+ _this3.webex.internal.voicea.updateSubchannelSubscriptions({
250
365
  subscribe: ['transcription']
251
366
  });
252
367
  }
253
368
  _loggerProxy.default.logger.info("Webinar:index#updatePSDataChannel --> enabled to receive relay events for default session for ".concat(_constants.LLM_PRACTICE_SESSION, "!"));
254
369
  return _promise.default.resolve(registerAndConnectResult);
255
370
  }));
256
- case 7:
371
+ case 9:
257
372
  case "end":
258
- return _context2.stop();
373
+ return _context3.stop();
259
374
  }
260
- }, _callee2);
375
+ }, _callee3);
261
376
  }))();
262
377
  },
263
378
  /**
@@ -266,6 +381,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
266
381
  * @returns {Promise}
267
382
  */
268
383
  setPracticeSessionState: function setPracticeSessionState(enabled) {
384
+ var meeting = this.getValidatedWebinarMeeting();
269
385
  return this.request({
270
386
  method: _constants.HTTP_VERBS.PATCH,
271
387
  uri: "".concat(this.locusUrl, "/controls"),
@@ -274,6 +390,9 @@ var Webinar = _webexCore.WebexPlugin.extend({
274
390
  enabled: enabled
275
391
  }
276
392
  }
393
+ }).then(function (response) {
394
+ _util.default.updateLocusFromApiResponse(meeting, response);
395
+ return response;
277
396
  }).catch(function (error) {
278
397
  _loggerProxy.default.logger.error('Meeting:webinar#setPracticeSessionState failed', error);
279
398
  throw error;
@@ -295,33 +414,33 @@ var Webinar = _webexCore.WebexPlugin.extend({
295
414
  * @returns {Promise}
296
415
  */
297
416
  startWebcast: function startWebcast(meeting, layout) {
298
- var _this3 = this;
299
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
300
- var _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8;
301
- return _regenerator.default.wrap(function (_context3) {
302
- while (1) switch (_context3.prev = _context3.next) {
417
+ var _this4 = this;
418
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
419
+ var _t2, _t3, _t4, _t5, _t6, _t7, _t8, _t9;
420
+ return _regenerator.default.wrap(function (_context4) {
421
+ while (1) switch (_context4.prev = _context4.next) {
303
422
  case 0:
304
423
  if (meeting) {
305
- _context3.next = 1;
424
+ _context4.next = 1;
306
425
  break;
307
426
  }
308
427
  _loggerProxy.default.logger.error("Meeting:webinar#startWebcast failed --> meeting parameter : ".concat(meeting));
309
428
  throw new Error('Meeting parameter does not meet expectations');
310
429
  case 1:
311
- _t = _this3;
312
- _t2 = _constants.HTTP_VERBS.PUT;
313
- _t3 = "".concat(_this3.webcastInstanceUrl, "/streaming");
314
- _t4 = _defineProperty2.default;
315
- _context3.next = 2;
316
- return _this3.webex.credentials.getUserToken();
430
+ _t2 = _this4;
431
+ _t3 = _constants.HTTP_VERBS.PUT;
432
+ _t4 = "".concat(_this4.webcastInstanceUrl, "/streaming");
433
+ _t5 = _defineProperty2.default;
434
+ _context4.next = 2;
435
+ return _this4.webex.credentials.getUserToken();
317
436
  case 2:
318
- _t5 = _context3.sent;
319
- _t6 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
320
- _t7 = _t4({
321
- authorization: _t5,
322
- trackingId: _t6
437
+ _t6 = _context4.sent;
438
+ _t7 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
439
+ _t8 = _t5({
440
+ authorization: _t6,
441
+ trackingId: _t7
323
442
  }, _constants.HEADERS.CONTENT_TYPE, _constants.HEADERS.CONTENT_TYPE_VALUE.APPLICATION_JSON);
324
- _t8 = {
443
+ _t9 = {
325
444
  action: 'start',
326
445
  meetingInfo: {
327
446
  locusId: meeting.locusId,
@@ -329,20 +448,20 @@ var Webinar = _webexCore.WebexPlugin.extend({
329
448
  },
330
449
  layout: layout
331
450
  };
332
- return _context3.abrupt("return", _t.request.call(_t, {
333
- method: _t2,
334
- uri: _t3,
335
- headers: _t7,
336
- body: _t8
451
+ return _context4.abrupt("return", _t2.request.call(_t2, {
452
+ method: _t3,
453
+ uri: _t4,
454
+ headers: _t8,
455
+ body: _t9
337
456
  }).catch(function (error) {
338
457
  _loggerProxy.default.logger.error('Meeting:webinar#startWebcast failed', error);
339
458
  throw error;
340
459
  }));
341
460
  case 3:
342
461
  case "end":
343
- return _context3.stop();
462
+ return _context4.stop();
344
463
  }
345
- }, _callee3);
464
+ }, _callee4);
346
465
  }))();
347
466
  },
348
467
  /**
@@ -350,42 +469,42 @@ var Webinar = _webexCore.WebexPlugin.extend({
350
469
  * @returns {Promise}
351
470
  */
352
471
  stopWebcast: function stopWebcast() {
353
- var _this4 = this;
354
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
355
- var _t9, _t0, _t1, _t10, _t11, _t12, _t13, _t14;
356
- return _regenerator.default.wrap(function (_context4) {
357
- while (1) switch (_context4.prev = _context4.next) {
472
+ var _this5 = this;
473
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
474
+ var _t0, _t1, _t10, _t11, _t12, _t13, _t14, _t15;
475
+ return _regenerator.default.wrap(function (_context5) {
476
+ while (1) switch (_context5.prev = _context5.next) {
358
477
  case 0:
359
- _t9 = _this4;
360
- _t0 = _constants.HTTP_VERBS.PUT;
361
- _t1 = "".concat(_this4.webcastInstanceUrl, "/streaming");
362
- _t10 = _defineProperty2.default;
363
- _context4.next = 1;
364
- return _this4.webex.credentials.getUserToken();
478
+ _t0 = _this5;
479
+ _t1 = _constants.HTTP_VERBS.PUT;
480
+ _t10 = "".concat(_this5.webcastInstanceUrl, "/streaming");
481
+ _t11 = _defineProperty2.default;
482
+ _context5.next = 1;
483
+ return _this5.webex.credentials.getUserToken();
365
484
  case 1:
366
- _t11 = _context4.sent;
367
- _t12 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
368
- _t13 = _t10({
369
- authorization: _t11,
370
- trackingId: _t12
485
+ _t12 = _context5.sent;
486
+ _t13 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
487
+ _t14 = _t11({
488
+ authorization: _t12,
489
+ trackingId: _t13
371
490
  }, _constants.HEADERS.CONTENT_TYPE, _constants.HEADERS.CONTENT_TYPE_VALUE.APPLICATION_JSON);
372
- _t14 = {
491
+ _t15 = {
373
492
  action: 'stop'
374
493
  };
375
- return _context4.abrupt("return", _t9.request.call(_t9, {
376
- method: _t0,
377
- uri: _t1,
378
- headers: _t13,
379
- body: _t14
494
+ return _context5.abrupt("return", _t0.request.call(_t0, {
495
+ method: _t1,
496
+ uri: _t10,
497
+ headers: _t14,
498
+ body: _t15
380
499
  }).catch(function (error) {
381
500
  _loggerProxy.default.logger.error('Meeting:webinar#stopWebcast failed', error);
382
501
  throw error;
383
502
  }));
384
503
  case 2:
385
504
  case "end":
386
- return _context4.stop();
505
+ return _context5.stop();
387
506
  }
388
- }, _callee4);
507
+ }, _callee5);
389
508
  }))();
390
509
  },
391
510
  /**
@@ -393,37 +512,37 @@ var Webinar = _webexCore.WebexPlugin.extend({
393
512
  * @returns {Promise}
394
513
  */
395
514
  queryWebcastLayout: function queryWebcastLayout() {
396
- var _this5 = this;
397
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
398
- var _t15, _t16, _t17, _t18, _t19, _t20;
399
- return _regenerator.default.wrap(function (_context5) {
400
- while (1) switch (_context5.prev = _context5.next) {
515
+ var _this6 = this;
516
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
517
+ var _t16, _t17, _t18, _t19, _t20, _t21;
518
+ return _regenerator.default.wrap(function (_context6) {
519
+ while (1) switch (_context6.prev = _context6.next) {
401
520
  case 0:
402
- _t15 = _this5;
403
- _t16 = _constants.HTTP_VERBS.GET;
404
- _t17 = "".concat(_this5.webcastInstanceUrl, "/layout");
405
- _context5.next = 1;
406
- return _this5.webex.credentials.getUserToken();
521
+ _t16 = _this6;
522
+ _t17 = _constants.HTTP_VERBS.GET;
523
+ _t18 = "".concat(_this6.webcastInstanceUrl, "/layout");
524
+ _context6.next = 1;
525
+ return _this6.webex.credentials.getUserToken();
407
526
  case 1:
408
- _t18 = _context5.sent;
409
- _t19 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
410
- _t20 = {
411
- authorization: _t18,
412
- trackingId: _t19
527
+ _t19 = _context6.sent;
528
+ _t20 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
529
+ _t21 = {
530
+ authorization: _t19,
531
+ trackingId: _t20
413
532
  };
414
- return _context5.abrupt("return", _t15.request.call(_t15, {
415
- method: _t16,
416
- uri: _t17,
417
- headers: _t20
533
+ return _context6.abrupt("return", _t16.request.call(_t16, {
534
+ method: _t17,
535
+ uri: _t18,
536
+ headers: _t21
418
537
  }).catch(function (error) {
419
538
  _loggerProxy.default.logger.error('Meeting:webinar#queryWebcastLayout failed', error);
420
539
  throw error;
421
540
  }));
422
541
  case 2:
423
542
  case "end":
424
- return _context5.stop();
543
+ return _context6.stop();
425
544
  }
426
- }, _callee5);
545
+ }, _callee6);
427
546
  }))();
428
547
  },
429
548
  /**
@@ -432,45 +551,45 @@ var Webinar = _webexCore.WebexPlugin.extend({
432
551
  * @returns {Promise}
433
552
  */
434
553
  updateWebcastLayout: function updateWebcastLayout(layout) {
435
- var _this6 = this;
436
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
437
- var _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28;
438
- return _regenerator.default.wrap(function (_context6) {
439
- while (1) switch (_context6.prev = _context6.next) {
554
+ var _this7 = this;
555
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
556
+ var _t22, _t23, _t24, _t25, _t26, _t27, _t28, _t29;
557
+ return _regenerator.default.wrap(function (_context7) {
558
+ while (1) switch (_context7.prev = _context7.next) {
440
559
  case 0:
441
- _t21 = _this6;
442
- _t22 = _constants.HTTP_VERBS.PUT;
443
- _t23 = "".concat(_this6.webcastInstanceUrl, "/layout");
444
- _t24 = _defineProperty2.default;
445
- _context6.next = 1;
446
- return _this6.webex.credentials.getUserToken();
560
+ _t22 = _this7;
561
+ _t23 = _constants.HTTP_VERBS.PUT;
562
+ _t24 = "".concat(_this7.webcastInstanceUrl, "/layout");
563
+ _t25 = _defineProperty2.default;
564
+ _context7.next = 1;
565
+ return _this7.webex.credentials.getUserToken();
447
566
  case 1:
448
- _t25 = _context6.sent;
449
- _t26 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
450
- _t27 = _t24({
451
- authorization: _t25,
452
- trackingId: _t26
567
+ _t26 = _context7.sent;
568
+ _t27 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
569
+ _t28 = _t25({
570
+ authorization: _t26,
571
+ trackingId: _t27
453
572
  }, _constants.HEADERS.CONTENT_TYPE, _constants.HEADERS.CONTENT_TYPE_VALUE.APPLICATION_JSON);
454
- _t28 = {
573
+ _t29 = {
455
574
  videoLayout: layout.videoLayout,
456
575
  contentLayout: layout.contentLayout,
457
576
  syncStageLayout: layout.syncStageLayout,
458
577
  syncStageInMeeting: layout.syncStageInMeeting
459
578
  };
460
- return _context6.abrupt("return", _t21.request.call(_t21, {
461
- method: _t22,
462
- uri: _t23,
463
- headers: _t27,
464
- body: _t28
579
+ return _context7.abrupt("return", _t22.request.call(_t22, {
580
+ method: _t23,
581
+ uri: _t24,
582
+ headers: _t28,
583
+ body: _t29
465
584
  }).catch(function (error) {
466
585
  _loggerProxy.default.logger.error('Meeting:webinar#updateWebcastLayout failed', error);
467
586
  throw error;
468
587
  }));
469
588
  case 2:
470
589
  case "end":
471
- return _context6.stop();
590
+ return _context7.stop();
472
591
  }
473
- }, _callee6);
592
+ }, _callee7);
474
593
  }))();
475
594
  },
476
595
  /**
@@ -478,37 +597,37 @@ var Webinar = _webexCore.WebexPlugin.extend({
478
597
  * @returns {Promise}
479
598
  */
480
599
  viewAllWebcastAttendees: function viewAllWebcastAttendees() {
481
- var _this7 = this;
482
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
483
- var _t29, _t30, _t31, _t32, _t33, _t34;
484
- return _regenerator.default.wrap(function (_context7) {
485
- while (1) switch (_context7.prev = _context7.next) {
600
+ var _this8 = this;
601
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
602
+ var _t30, _t31, _t32, _t33, _t34, _t35;
603
+ return _regenerator.default.wrap(function (_context8) {
604
+ while (1) switch (_context8.prev = _context8.next) {
486
605
  case 0:
487
- _t29 = _this7;
488
- _t30 = _constants.HTTP_VERBS.GET;
489
- _t31 = "".concat(_this7.webcastInstanceUrl, "/attendees");
490
- _context7.next = 1;
491
- return _this7.webex.credentials.getUserToken();
606
+ _t30 = _this8;
607
+ _t31 = _constants.HTTP_VERBS.GET;
608
+ _t32 = "".concat(_this8.webcastInstanceUrl, "/attendees");
609
+ _context8.next = 1;
610
+ return _this8.webex.credentials.getUserToken();
492
611
  case 1:
493
- _t32 = _context7.sent;
494
- _t33 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
495
- _t34 = {
496
- authorization: _t32,
497
- trackingId: _t33
612
+ _t33 = _context8.sent;
613
+ _t34 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
614
+ _t35 = {
615
+ authorization: _t33,
616
+ trackingId: _t34
498
617
  };
499
- return _context7.abrupt("return", _t29.request.call(_t29, {
500
- method: _t30,
501
- uri: _t31,
502
- headers: _t34
618
+ return _context8.abrupt("return", _t30.request.call(_t30, {
619
+ method: _t31,
620
+ uri: _t32,
621
+ headers: _t35
503
622
  }).catch(function (error) {
504
623
  _loggerProxy.default.logger.error('Meeting:webinar#viewAllWebcastAttendees failed', error);
505
624
  throw error;
506
625
  }));
507
626
  case 2:
508
627
  case "end":
509
- return _context7.stop();
628
+ return _context8.stop();
510
629
  }
511
- }, _callee7);
630
+ }, _callee8);
512
631
  }))();
513
632
  },
514
633
  /**
@@ -518,38 +637,38 @@ var Webinar = _webexCore.WebexPlugin.extend({
518
637
  */
519
638
  searchWebcastAttendees: function searchWebcastAttendees() {
520
639
  var _arguments = arguments,
521
- _this8 = this;
522
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
523
- var queryString, _t35, _t36, _t37, _t38, _t39, _t40;
524
- return _regenerator.default.wrap(function (_context8) {
525
- while (1) switch (_context8.prev = _context8.next) {
640
+ _this9 = this;
641
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
642
+ var queryString, _t36, _t37, _t38, _t39, _t40, _t41;
643
+ return _regenerator.default.wrap(function (_context9) {
644
+ while (1) switch (_context9.prev = _context9.next) {
526
645
  case 0:
527
646
  queryString = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : '';
528
- _t35 = _this8;
529
- _t36 = _constants.HTTP_VERBS.GET;
530
- _t37 = "".concat(_this8.webcastInstanceUrl, "/attendees?keyword=").concat(encodeURIComponent(queryString));
531
- _context8.next = 1;
532
- return _this8.webex.credentials.getUserToken();
647
+ _t36 = _this9;
648
+ _t37 = _constants.HTTP_VERBS.GET;
649
+ _t38 = "".concat(_this9.webcastInstanceUrl, "/attendees?keyword=").concat(encodeURIComponent(queryString));
650
+ _context9.next = 1;
651
+ return _this9.webex.credentials.getUserToken();
533
652
  case 1:
534
- _t38 = _context8.sent;
535
- _t39 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
536
- _t40 = {
537
- authorization: _t38,
538
- trackingId: _t39
653
+ _t39 = _context9.sent;
654
+ _t40 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
655
+ _t41 = {
656
+ authorization: _t39,
657
+ trackingId: _t40
539
658
  };
540
- return _context8.abrupt("return", _t35.request.call(_t35, {
541
- method: _t36,
542
- uri: _t37,
543
- headers: _t40
659
+ return _context9.abrupt("return", _t36.request.call(_t36, {
660
+ method: _t37,
661
+ uri: _t38,
662
+ headers: _t41
544
663
  }).catch(function (error) {
545
664
  _loggerProxy.default.logger.error('Meeting:webinar#searchWebcastAttendees failed', error);
546
665
  throw error;
547
666
  }));
548
667
  case 2:
549
668
  case "end":
550
- return _context8.stop();
669
+ return _context9.stop();
551
670
  }
552
- }, _callee8);
671
+ }, _callee9);
553
672
  }))();
554
673
  },
555
674
  /**
@@ -558,37 +677,37 @@ var Webinar = _webexCore.WebexPlugin.extend({
558
677
  * @returns {Promise}
559
678
  */
560
679
  expelWebcastAttendee: function expelWebcastAttendee(participantId) {
561
- var _this9 = this;
562
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
563
- var _t41, _t42, _t43, _t44, _t45, _t46;
564
- return _regenerator.default.wrap(function (_context9) {
565
- while (1) switch (_context9.prev = _context9.next) {
680
+ var _this0 = this;
681
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
682
+ var _t42, _t43, _t44, _t45, _t46, _t47;
683
+ return _regenerator.default.wrap(function (_context0) {
684
+ while (1) switch (_context0.prev = _context0.next) {
566
685
  case 0:
567
- _t41 = _this9;
568
- _t42 = _constants.HTTP_VERBS.DELETE;
569
- _t43 = "".concat(_this9.webcastInstanceUrl, "/attendees/").concat(participantId);
570
- _context9.next = 1;
571
- return _this9.webex.credentials.getUserToken();
686
+ _t42 = _this0;
687
+ _t43 = _constants.HTTP_VERBS.DELETE;
688
+ _t44 = "".concat(_this0.webcastInstanceUrl, "/attendees/").concat(participantId);
689
+ _context0.next = 1;
690
+ return _this0.webex.credentials.getUserToken();
572
691
  case 1:
573
- _t44 = _context9.sent;
574
- _t45 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
575
- _t46 = {
576
- authorization: _t44,
577
- trackingId: _t45
692
+ _t45 = _context0.sent;
693
+ _t46 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
694
+ _t47 = {
695
+ authorization: _t45,
696
+ trackingId: _t46
578
697
  };
579
- return _context9.abrupt("return", _t41.request.call(_t41, {
580
- method: _t42,
581
- uri: _t43,
582
- headers: _t46
698
+ return _context0.abrupt("return", _t42.request.call(_t42, {
699
+ method: _t43,
700
+ uri: _t44,
701
+ headers: _t47
583
702
  }).catch(function (error) {
584
703
  _loggerProxy.default.logger.error('Meeting:webinar#expelWebcastAttendee failed', error);
585
704
  throw error;
586
705
  }));
587
706
  case 2:
588
707
  case "end":
589
- return _context9.stop();
708
+ return _context0.stop();
590
709
  }
591
- }, _callee9);
710
+ }, _callee0);
592
711
  }))();
593
712
  },
594
713
  /**
@@ -600,14 +719,21 @@ var Webinar = _webexCore.WebexPlugin.extend({
600
719
  * @returns {Promise}
601
720
  */
602
721
  searchLargeScaleWebinarAttendees: function searchLargeScaleWebinarAttendees(payload) {
603
- var _this0 = this;
604
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
722
+ var _this1 = this;
723
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
605
724
  var _payload$limit, _meeting$locusInfo3, _meeting$locusInfo3$l, _meeting$locusInfo3$l2, _meeting$locusInfo3$l3;
606
- var meeting, rawParams, attendeeSearchUrl, _t47, _t48, _t49, _t50, _t51, _t52;
607
- return _regenerator.default.wrap(function (_context0) {
608
- while (1) switch (_context0.prev = _context0.next) {
725
+ var meeting, rawParams, attendeeSearchUrl, _t48, _t49, _t50, _t51, _t52, _t53;
726
+ return _regenerator.default.wrap(function (_context1) {
727
+ while (1) switch (_context1.prev = _context1.next) {
609
728
  case 0:
610
- meeting = _this0.webex.meetings.getMeetingByType(_constants._ID_, _this0.meetingId);
729
+ meeting = _this1.getValidatedWebinarMeeting();
730
+ if (meeting) {
731
+ _context1.next = 1;
732
+ break;
733
+ }
734
+ _loggerProxy.default.logger.error('Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> webinar meeting could not be validated');
735
+ throw new Error('Meeting:webinar5k#Webinar meeting is not resolvable for the current locus');
736
+ case 1:
611
737
  rawParams = {
612
738
  search_text: payload === null || payload === void 0 ? void 0 : payload.queryString,
613
739
  limit: (_payload$limit = payload === null || payload === void 0 ? void 0 : payload.limit) !== null && _payload$limit !== void 0 ? _payload$limit : _constants.DEFAULT_LARGE_SCALE_WEBINAR_ATTENDEE_SEARCH_LIMIT,
@@ -615,40 +741,40 @@ var Webinar = _webexCore.WebexPlugin.extend({
615
741
  };
616
742
  attendeeSearchUrl = meeting === null || meeting === void 0 ? void 0 : (_meeting$locusInfo3 = meeting.locusInfo) === null || _meeting$locusInfo3 === void 0 ? void 0 : (_meeting$locusInfo3$l = _meeting$locusInfo3.links) === null || _meeting$locusInfo3$l === void 0 ? void 0 : (_meeting$locusInfo3$l2 = _meeting$locusInfo3$l.resources) === null || _meeting$locusInfo3$l2 === void 0 ? void 0 : (_meeting$locusInfo3$l3 = _meeting$locusInfo3$l2.attendeeSearch) === null || _meeting$locusInfo3$l3 === void 0 ? void 0 : _meeting$locusInfo3$l3.url;
617
743
  if (attendeeSearchUrl) {
618
- _context0.next = 1;
744
+ _context1.next = 2;
619
745
  break;
620
746
  }
621
- _loggerProxy.default.logger.error("Meeting:webinar5k#searchLargeScaleWebinarAttendees failed");
747
+ _loggerProxy.default.logger.error('Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> attendee search url unavailable');
622
748
  throw new Error('Meeting:webinar5k#Attendee search url is not available');
623
- case 1:
624
- _t47 = _this0;
625
- _t48 = _constants.HTTP_VERBS.GET;
626
- _t49 = "".concat(attendeeSearchUrl, "?").concat(new URLSearchParams((0, _utils.sanitizeParams)(rawParams)).toString());
627
- _context0.next = 2;
628
- return _this0.webex.credentials.getUserToken();
629
749
  case 2:
630
- _t50 = _context0.sent;
631
- _t51 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
632
- _t52 = {
633
- authorization: _t50,
634
- trackingId: _t51
750
+ _t48 = _this1;
751
+ _t49 = _constants.HTTP_VERBS.GET;
752
+ _t50 = "".concat(attendeeSearchUrl, "?").concat(new URLSearchParams((0, _utils.sanitizeParams)(rawParams)).toString());
753
+ _context1.next = 3;
754
+ return _this1.webex.credentials.getUserToken();
755
+ case 3:
756
+ _t51 = _context1.sent;
757
+ _t52 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
758
+ _t53 = {
759
+ authorization: _t51,
760
+ trackingId: _t52
635
761
  };
636
- return _context0.abrupt("return", _t47.request.call(_t47, {
637
- method: _t48,
638
- uri: _t49,
639
- headers: _t52
762
+ return _context1.abrupt("return", _t48.request.call(_t48, {
763
+ method: _t49,
764
+ uri: _t50,
765
+ headers: _t53
640
766
  }).catch(function (error) {
641
767
  _loggerProxy.default.logger.error('Meeting:webinar5k#searchLargeScaleWebinarAttendees failed', error);
642
768
  throw error;
643
769
  }));
644
- case 3:
770
+ case 4:
645
771
  case "end":
646
- return _context0.stop();
772
+ return _context1.stop();
647
773
  }
648
- }, _callee0);
774
+ }, _callee1);
649
775
  }))();
650
776
  },
651
- version: "3.12.0-next.6"
777
+ version: "3.12.0-next.61"
652
778
  });
653
779
  var _default = exports.default = Webinar;
654
780
  //# sourceMappingURL=index.js.map