@webex/plugin-meetings 3.11.0 → 3.12.0-llmrefactor.2

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 (294) hide show
  1. package/AGENTS.md +9 -0
  2. package/dist/aiEnableRequest/index.js +197 -0
  3. package/dist/aiEnableRequest/index.js.map +1 -0
  4. package/dist/aiEnableRequest/utils.js +36 -0
  5. package/dist/aiEnableRequest/utils.js.map +1 -0
  6. package/dist/annotation/index.js +60 -15
  7. package/dist/annotation/index.js.map +1 -1
  8. package/dist/breakouts/breakout.js +8 -3
  9. package/dist/breakouts/breakout.js.map +1 -1
  10. package/dist/breakouts/events.js +29 -14
  11. package/dist/breakouts/events.js.map +1 -1
  12. package/dist/breakouts/index.js +128 -7
  13. package/dist/breakouts/index.js.map +1 -1
  14. package/dist/common/errors/webex-errors.js +49 -5
  15. package/dist/common/errors/webex-errors.js.map +1 -1
  16. package/dist/config.js +8 -3
  17. package/dist/config.js.map +1 -1
  18. package/dist/constants.js +60 -11
  19. package/dist/constants.js.map +1 -1
  20. package/dist/controls-options-manager/constants.js +11 -1
  21. package/dist/controls-options-manager/constants.js.map +1 -1
  22. package/dist/controls-options-manager/index.js +67 -29
  23. package/dist/controls-options-manager/index.js.map +1 -1
  24. package/dist/controls-options-manager/util.js +91 -0
  25. package/dist/controls-options-manager/util.js.map +1 -1
  26. package/dist/hashTree/constants.js +16 -2
  27. package/dist/hashTree/constants.js.map +1 -1
  28. package/dist/hashTree/hashTree.js +18 -0
  29. package/dist/hashTree/hashTree.js.map +1 -1
  30. package/dist/hashTree/hashTreeParser.js +1655 -538
  31. package/dist/hashTree/hashTreeParser.js.map +1 -1
  32. package/dist/hashTree/types.js +4 -2
  33. package/dist/hashTree/types.js.map +1 -1
  34. package/dist/hashTree/utils.js +52 -0
  35. package/dist/hashTree/utils.js.map +1 -1
  36. package/dist/index.js +18 -2
  37. package/dist/index.js.map +1 -1
  38. package/dist/interceptors/constant.js +12 -0
  39. package/dist/interceptors/constant.js.map +1 -0
  40. package/dist/interceptors/dataChannelAuthToken.js +332 -0
  41. package/dist/interceptors/dataChannelAuthToken.js.map +1 -0
  42. package/dist/interceptors/index.js +7 -0
  43. package/dist/interceptors/index.js.map +1 -1
  44. package/dist/interceptors/locusRetry.js +23 -8
  45. package/dist/interceptors/locusRetry.js.map +1 -1
  46. package/dist/interceptors/utils.js +27 -0
  47. package/dist/interceptors/utils.js.map +1 -0
  48. package/dist/interpretation/index.js +11 -2
  49. package/dist/interpretation/index.js.map +1 -1
  50. package/dist/interpretation/interpretation.types.js +7 -0
  51. package/dist/interpretation/interpretation.types.js.map +1 -0
  52. package/dist/interpretation/siLanguage.js +1 -1
  53. package/dist/locus-info/controlsUtils.js +9 -4
  54. package/dist/locus-info/controlsUtils.js.map +1 -1
  55. package/dist/locus-info/index.js +914 -212
  56. package/dist/locus-info/index.js.map +1 -1
  57. package/dist/locus-info/infoUtils.js +36 -5
  58. package/dist/locus-info/infoUtils.js.map +1 -1
  59. package/dist/locus-info/selfUtils.js +1 -0
  60. package/dist/locus-info/selfUtils.js.map +1 -1
  61. package/dist/locus-info/types.js +19 -0
  62. package/dist/locus-info/types.js.map +1 -1
  63. package/dist/media/MediaConnectionAwaiter.js +72 -3
  64. package/dist/media/MediaConnectionAwaiter.js.map +1 -1
  65. package/dist/media/index.js +8 -2
  66. package/dist/media/index.js.map +1 -1
  67. package/dist/media/properties.js +8 -7
  68. package/dist/media/properties.js.map +1 -1
  69. package/dist/meeting/in-meeting-actions.js +11 -1
  70. package/dist/meeting/in-meeting-actions.js.map +1 -1
  71. package/dist/meeting/index.js +2287 -1118
  72. package/dist/meeting/index.js.map +1 -1
  73. package/dist/meeting/locusMediaRequest.js +229 -82
  74. package/dist/meeting/locusMediaRequest.js.map +1 -1
  75. package/dist/meeting/muteState.js +10 -1
  76. package/dist/meeting/muteState.js.map +1 -1
  77. package/dist/meeting/request.js +55 -2
  78. package/dist/meeting/request.js.map +1 -1
  79. package/dist/meeting/request.type.js.map +1 -1
  80. package/dist/meeting/util.js +168 -5
  81. package/dist/meeting/util.js.map +1 -1
  82. package/dist/meeting-info/meeting-info-v2.js +2 -2
  83. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  84. package/dist/meetings/index.js +369 -162
  85. package/dist/meetings/index.js.map +1 -1
  86. package/dist/meetings/meetings.types.js +6 -1
  87. package/dist/meetings/meetings.types.js.map +1 -1
  88. package/dist/meetings/request.js +39 -0
  89. package/dist/meetings/request.js.map +1 -1
  90. package/dist/meetings/util.js +116 -18
  91. package/dist/meetings/util.js.map +1 -1
  92. package/dist/member/index.js +20 -0
  93. package/dist/member/index.js.map +1 -1
  94. package/dist/member/types.js.map +1 -1
  95. package/dist/member/util.js +40 -0
  96. package/dist/member/util.js.map +1 -1
  97. package/dist/members/index.js +101 -43
  98. package/dist/members/index.js.map +1 -1
  99. package/dist/members/util.js +8 -1
  100. package/dist/members/util.js.map +1 -1
  101. package/dist/metrics/constants.js +12 -1
  102. package/dist/metrics/constants.js.map +1 -1
  103. package/dist/multistream/codec/constants.js +63 -0
  104. package/dist/multistream/codec/constants.js.map +1 -0
  105. package/dist/multistream/mediaRequestManager.js +64 -68
  106. package/dist/multistream/mediaRequestManager.js.map +1 -1
  107. package/dist/multistream/receiveSlot.js +9 -0
  108. package/dist/multistream/receiveSlot.js.map +1 -1
  109. package/dist/multistream/remoteMediaManager.js +11 -0
  110. package/dist/multistream/remoteMediaManager.js.map +1 -1
  111. package/dist/multistream/sendSlotManager.js +116 -2
  112. package/dist/multistream/sendSlotManager.js.map +1 -1
  113. package/dist/reachability/clusterReachability.js.map +1 -1
  114. package/dist/reachability/index.js +139 -93
  115. package/dist/reachability/index.js.map +1 -1
  116. package/dist/reachability/reachability.types.js +2 -0
  117. package/dist/reachability/reachability.types.js.map +1 -1
  118. package/dist/reachability/util.js +45 -0
  119. package/dist/reachability/util.js.map +1 -1
  120. package/dist/reactions/reactions.type.js.map +1 -1
  121. package/dist/reconnection-manager/index.js +0 -1
  122. package/dist/reconnection-manager/index.js.map +1 -1
  123. package/dist/recording-controller/index.js +1 -3
  124. package/dist/recording-controller/index.js.map +1 -1
  125. package/dist/roap/turnDiscovery.js +8 -1
  126. package/dist/roap/turnDiscovery.js.map +1 -1
  127. package/dist/types/aiEnableRequest/index.d.ts +5 -0
  128. package/dist/types/aiEnableRequest/utils.d.ts +2 -0
  129. package/dist/types/annotation/index.d.ts +19 -0
  130. package/dist/types/common/errors/webex-errors.d.ts +32 -2
  131. package/dist/types/config.d.ts +6 -2
  132. package/dist/types/constants.d.ts +35 -1
  133. package/dist/types/controls-options-manager/constants.d.ts +6 -1
  134. package/dist/types/controls-options-manager/index.d.ts +16 -0
  135. package/dist/types/hashTree/constants.d.ts +3 -0
  136. package/dist/types/hashTree/hashTree.d.ts +7 -0
  137. package/dist/types/hashTree/hashTreeParser.d.ts +315 -30
  138. package/dist/types/hashTree/types.d.ts +3 -0
  139. package/dist/types/hashTree/utils.d.ts +24 -0
  140. package/dist/types/index.d.ts +4 -0
  141. package/dist/types/interceptors/constant.d.ts +5 -0
  142. package/dist/types/interceptors/dataChannelAuthToken.d.ts +43 -0
  143. package/dist/types/interceptors/index.d.ts +2 -1
  144. package/dist/types/interceptors/locusRetry.d.ts +4 -4
  145. package/dist/types/interceptors/utils.d.ts +1 -0
  146. package/dist/types/interpretation/interpretation.types.d.ts +10 -0
  147. package/dist/types/locus-info/index.d.ts +126 -15
  148. package/dist/types/locus-info/infoUtils.d.ts +8 -0
  149. package/dist/types/locus-info/types.d.ts +28 -1
  150. package/dist/types/media/MediaConnectionAwaiter.d.ts +20 -2
  151. package/dist/types/media/properties.d.ts +8 -3
  152. package/dist/types/meeting/in-meeting-actions.d.ts +10 -0
  153. package/dist/types/meeting/index.d.ts +271 -16
  154. package/dist/types/meeting/locusMediaRequest.d.ts +12 -0
  155. package/dist/types/meeting/request.d.ts +17 -1
  156. package/dist/types/meeting/request.type.d.ts +5 -0
  157. package/dist/types/meeting/util.d.ts +40 -0
  158. package/dist/types/meetings/index.d.ts +42 -20
  159. package/dist/types/meetings/meetings.types.d.ts +15 -0
  160. package/dist/types/meetings/request.d.ts +14 -0
  161. package/dist/types/member/index.d.ts +2 -0
  162. package/dist/types/member/types.d.ts +1 -0
  163. package/dist/types/member/util.d.ts +14 -0
  164. package/dist/types/members/index.d.ts +15 -2
  165. package/dist/types/members/util.d.ts +1 -5
  166. package/dist/types/metrics/constants.d.ts +11 -0
  167. package/dist/types/multistream/codec/constants.d.ts +7 -0
  168. package/dist/types/multistream/mediaRequestManager.d.ts +20 -26
  169. package/dist/types/multistream/sendSlotManager.d.ts +23 -1
  170. package/dist/types/reachability/clusterReachability.d.ts +3 -3
  171. package/dist/types/reachability/index.d.ts +10 -3
  172. package/dist/types/reachability/reachability.types.d.ts +7 -0
  173. package/dist/types/reachability/util.d.ts +17 -0
  174. package/dist/types/reactions/reactions.type.d.ts +4 -0
  175. package/dist/types/webinar/utils.d.ts +6 -0
  176. package/dist/webinar/index.js +612 -165
  177. package/dist/webinar/index.js.map +1 -1
  178. package/dist/webinar/utils.js +25 -0
  179. package/dist/webinar/utils.js.map +1 -0
  180. package/package.json +24 -23
  181. package/src/aiEnableRequest/README.md +84 -0
  182. package/src/aiEnableRequest/index.ts +186 -0
  183. package/src/aiEnableRequest/utils.ts +25 -0
  184. package/src/annotation/index.ts +67 -15
  185. package/src/breakouts/breakout.ts +3 -1
  186. package/src/breakouts/events.ts +33 -11
  187. package/src/breakouts/index.ts +145 -3
  188. package/src/common/errors/webex-errors.ts +50 -3
  189. package/src/config.ts +6 -2
  190. package/src/constants.ts +49 -3
  191. package/src/controls-options-manager/constants.ts +14 -1
  192. package/src/controls-options-manager/index.ts +87 -28
  193. package/src/controls-options-manager/util.ts +81 -1
  194. package/src/hashTree/constants.ts +17 -0
  195. package/src/hashTree/hashTree.ts +17 -0
  196. package/src/hashTree/hashTreeParser.ts +1482 -361
  197. package/src/hashTree/types.ts +4 -0
  198. package/src/hashTree/utils.ts +45 -0
  199. package/src/index.ts +14 -1
  200. package/src/interceptors/constant.ts +6 -0
  201. package/src/interceptors/dataChannelAuthToken.ts +217 -0
  202. package/src/interceptors/index.ts +2 -1
  203. package/src/interceptors/locusRetry.ts +25 -4
  204. package/src/interceptors/utils.ts +16 -0
  205. package/src/interpretation/index.ts +29 -11
  206. package/src/interpretation/interpretation.types.ts +11 -0
  207. package/src/locus-info/controlsUtils.ts +14 -1
  208. package/src/locus-info/index.ts +976 -203
  209. package/src/locus-info/infoUtils.ts +41 -6
  210. package/src/locus-info/selfUtils.ts +1 -0
  211. package/src/locus-info/types.ts +33 -1
  212. package/src/media/MediaConnectionAwaiter.ts +62 -5
  213. package/src/media/index.ts +10 -1
  214. package/src/media/properties.ts +11 -4
  215. package/src/meeting/in-meeting-actions.ts +20 -0
  216. package/src/meeting/index.ts +1258 -222
  217. package/src/meeting/locusMediaRequest.ts +106 -6
  218. package/src/meeting/muteState.ts +10 -1
  219. package/src/meeting/request.ts +53 -0
  220. package/src/meeting/request.type.ts +6 -0
  221. package/src/meeting/util.ts +207 -7
  222. package/src/meeting-info/meeting-info-v2.ts +4 -2
  223. package/src/meetings/index.ts +319 -117
  224. package/src/meetings/meetings.types.ts +19 -0
  225. package/src/meetings/request.ts +43 -0
  226. package/src/meetings/util.ts +117 -4
  227. package/src/member/index.ts +20 -0
  228. package/src/member/types.ts +1 -0
  229. package/src/member/util.ts +41 -0
  230. package/src/members/index.ts +70 -7
  231. package/src/members/util.ts +12 -4
  232. package/src/metrics/constants.ts +12 -0
  233. package/src/multistream/codec/constants.ts +58 -0
  234. package/src/multistream/mediaRequestManager.ts +117 -76
  235. package/src/multistream/receiveSlot.ts +18 -0
  236. package/src/multistream/remoteMediaManager.ts +13 -0
  237. package/src/multistream/sendSlotManager.ts +97 -3
  238. package/src/reachability/clusterReachability.ts +3 -2
  239. package/src/reachability/index.ts +56 -16
  240. package/src/reachability/reachability.types.ts +11 -0
  241. package/src/reachability/util.ts +36 -0
  242. package/src/reactions/reactions.type.ts +4 -0
  243. package/src/reconnection-manager/index.ts +0 -1
  244. package/src/recording-controller/index.ts +1 -2
  245. package/src/roap/turnDiscovery.ts +9 -1
  246. package/src/webinar/index.ts +416 -12
  247. package/src/webinar/utils.ts +16 -0
  248. package/test/unit/spec/aiEnableRequest/index.ts +1067 -0
  249. package/test/unit/spec/aiEnableRequest/utils.ts +130 -0
  250. package/test/unit/spec/annotation/index.ts +228 -134
  251. package/test/unit/spec/breakouts/breakout.ts +9 -3
  252. package/test/unit/spec/breakouts/events.ts +120 -2
  253. package/test/unit/spec/breakouts/index.ts +331 -15
  254. package/test/unit/spec/common/errors/webex-errors.ts +78 -0
  255. package/test/unit/spec/controls-options-manager/index.js +244 -29
  256. package/test/unit/spec/controls-options-manager/util.js +165 -0
  257. package/test/unit/spec/hashTree/hashTree.ts +66 -0
  258. package/test/unit/spec/hashTree/hashTreeParser.ts +4528 -171
  259. package/test/unit/spec/hashTree/utils.ts +125 -1
  260. package/test/unit/spec/interceptors/dataChannelAuthToken.ts +388 -0
  261. package/test/unit/spec/interceptors/locusRetry.ts +205 -4
  262. package/test/unit/spec/interceptors/utils.ts +75 -0
  263. package/test/unit/spec/interpretation/index.ts +26 -4
  264. package/test/unit/spec/locus-info/controlsUtils.js +200 -56
  265. package/test/unit/spec/locus-info/index.js +1861 -149
  266. package/test/unit/spec/locus-info/infoUtils.js +184 -1
  267. package/test/unit/spec/media/MediaConnectionAwaiter.ts +96 -1
  268. package/test/unit/spec/media/index.ts +92 -0
  269. package/test/unit/spec/media/properties.ts +35 -26
  270. package/test/unit/spec/meeting/in-meeting-actions.ts +12 -2
  271. package/test/unit/spec/meeting/index.js +3694 -450
  272. package/test/unit/spec/meeting/locusMediaRequest.ts +406 -4
  273. package/test/unit/spec/meeting/muteState.js +81 -0
  274. package/test/unit/spec/meeting/request.js +82 -0
  275. package/test/unit/spec/meeting/utils.js +595 -27
  276. package/test/unit/spec/meeting-info/meetinginfov2.js +19 -10
  277. package/test/unit/spec/meetings/index.js +1138 -86
  278. package/test/unit/spec/meetings/request.js +141 -0
  279. package/test/unit/spec/meetings/utils.js +402 -51
  280. package/test/unit/spec/member/index.js +35 -4
  281. package/test/unit/spec/member/util.js +154 -27
  282. package/test/unit/spec/members/index.js +216 -0
  283. package/test/unit/spec/members/request.js +37 -1
  284. package/test/unit/spec/members/utils.js +63 -0
  285. package/test/unit/spec/multistream/mediaRequestManager.ts +503 -122
  286. package/test/unit/spec/multistream/remoteMediaManager.ts +30 -0
  287. package/test/unit/spec/multistream/sendSlotManager.ts +135 -36
  288. package/test/unit/spec/reachability/index.ts +151 -46
  289. package/test/unit/spec/reachability/util.ts +31 -0
  290. package/test/unit/spec/reconnection-manager/index.js +4 -8
  291. package/test/unit/spec/recording-controller/index.js +9 -8
  292. package/test/unit/spec/roap/turnDiscovery.ts +20 -0
  293. package/test/unit/spec/webinar/index.ts +1087 -167
  294. package/test/unit/spec/webinar/utils.ts +39 -0
@@ -6,6 +6,7 @@ _Object$defineProperty(exports, "__esModule", {
6
6
  value: true
7
7
  });
8
8
  exports.default = void 0;
9
+ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
9
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
10
11
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
11
12
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
@@ -15,6 +16,8 @@ var _lodash = require("lodash");
15
16
  var _constants = require("../constants");
16
17
  var _collection = _interopRequireDefault(require("./collection"));
17
18
  var _loggerProxy = _interopRequireDefault(require("../common/logs/logger-proxy"));
19
+ var _util = _interopRequireDefault(require("../meeting/util"));
20
+ var _utils = require("./utils");
18
21
  /*!
19
22
  * Copyright (c) 2015-2023 Cisco Systems, Inc. See LICENSE file.
20
23
  */
@@ -42,6 +45,26 @@ var Webinar = _webexCore.WebexPlugin.extend({
42
45
  // practice session enabled
43
46
  meetingId: 'string'
44
47
  },
48
+ /**
49
+ * LLM channel for practice session, owned by this webinar instance.
50
+ * @private
51
+ * @type {LLMChannel|undefined}
52
+ */
53
+ _practiceSessionLLMChannel: undefined,
54
+ /**
55
+ * Pending practice session datachannel token, saved from join response.
56
+ * Used when creating the practice session LLM channel.
57
+ * @private
58
+ * @type {string|undefined}
59
+ */
60
+ _pendingPracticeSessionDatachannelToken: undefined,
61
+ /**
62
+ * Calls this to clean up listeners
63
+ * @returns {void}
64
+ */
65
+ cleanUp: function cleanUp() {
66
+ this.cleanupPSDataChannel();
67
+ },
45
68
  /**
46
69
  * Update the current locus url of the webinar
47
70
  * @param {string} locusUrl
@@ -90,6 +113,31 @@ var Webinar = _webexCore.WebexPlugin.extend({
90
113
  isDemoted: isDemoted
91
114
  };
92
115
  },
116
+ /**
117
+ * Resolves the meeting associated with this webinar instance, guarded against the
118
+ * meetingId pointer drifting onto an unrelated transient meeting (e.g. an inbound
119
+ * 1:1 call) that may exist in the meeting collection. Returns the meeting only when
120
+ * its locusUrl matches this webinar's tracked locusUrl. Returns undefined (with a
121
+ * warning) when the meeting cannot be resolved or when the webinar's locusUrl has
122
+ * not been initialized yet — callers must treat this as "no owned meeting" rather
123
+ * than fall through to an unvalidated lookup.
124
+ * @returns {object|undefined}
125
+ */
126
+ getValidatedWebinarMeeting: function getValidatedWebinarMeeting() {
127
+ var meeting = this.webex.meetings.getMeetingByType(_constants._ID_, this.meetingId);
128
+ if (!meeting) {
129
+ return undefined;
130
+ }
131
+ if (!this.locusUrl) {
132
+ _loggerProxy.default.logger.warn("Webinar:index#getValidatedWebinarMeeting --> skipping; webinar locusUrl is not yet initialized for meetingId ".concat(this.meetingId));
133
+ return undefined;
134
+ }
135
+ if (meeting.locusUrl !== this.locusUrl) {
136
+ _loggerProxy.default.logger.warn("Webinar:index#getValidatedWebinarMeeting --> skipping; meeting ".concat(this.meetingId, " locusUrl ").concat(meeting.locusUrl, " does not match webinar locusUrl ").concat(this.locusUrl));
137
+ return undefined;
138
+ }
139
+ return meeting;
140
+ },
93
141
  /**
94
142
  * should join practice session data channel or not
95
143
  * @param {Object} {isPromoted: boolean, isDemoted: boolean}} Role transition states
@@ -98,17 +146,14 @@ var Webinar = _webexCore.WebexPlugin.extend({
98
146
  updateStatusByRole: function updateStatusByRole(_ref) {
99
147
  var isPromoted = _ref.isPromoted,
100
148
  isDemoted = _ref.isDemoted;
101
- var meeting = this.webex.meetings.getMeetingByType(_constants._ID_, this.meetingId);
149
+ var meeting = this.getValidatedWebinarMeeting();
102
150
  if (isDemoted && (meeting === null || meeting === void 0 ? void 0 : meeting.shareStatus) === _constants.SHARE_STATUS.WHITEBOARD_SHARE_ACTIVE || isPromoted) {
103
151
  var _meeting$locusInfo, _meeting$locusInfo2;
104
152
  // attendees in webinar should subscribe streaming for whiteboard sharing
105
153
  // while panelist still need subscribe native mode so trigger force update here
106
154
  meeting === null || meeting === void 0 ? void 0 : (_meeting$locusInfo = meeting.locusInfo) === null || _meeting$locusInfo === void 0 ? void 0 : _meeting$locusInfo.updateMediaShares(meeting === null || meeting === void 0 ? void 0 : (_meeting$locusInfo2 = meeting.locusInfo) === null || _meeting$locusInfo2 === void 0 ? void 0 : _meeting$locusInfo2.mediaShares, true);
107
155
  }
108
- if (this.practiceSessionEnabled) {
109
- // may need change data channel in practice session
110
- meeting === null || meeting === void 0 ? void 0 : meeting.updateLLMConnection();
111
- }
156
+ this.updatePSDataChannel();
112
157
  },
113
158
  /**
114
159
  * should join practice session data channel or not
@@ -117,12 +162,347 @@ var Webinar = _webexCore.WebexPlugin.extend({
117
162
  isJoinPracticeSessionDataChannel: function isJoinPracticeSessionDataChannel() {
118
163
  return this.selfIsPanelist && this.practiceSessionEnabled;
119
164
  },
165
+ /**
166
+ * Returns the practice session LLM channel binding, if connected.
167
+ * @returns {string|undefined}
168
+ */
169
+ getPracticeSessionBinding: function getPracticeSessionBinding() {
170
+ var _this$_practiceSessio;
171
+ return (_this$_practiceSessio = this._practiceSessionLLMChannel) === null || _this$_practiceSessio === void 0 ? void 0 : _this$_practiceSessio.getBinding();
172
+ },
173
+ /**
174
+ * Returns whether the practice session LLM channel is connected.
175
+ * @returns {boolean}
176
+ */
177
+ isPracticeSessionLLMChannelConnected: function isPracticeSessionLLMChannelConnected() {
178
+ var _this$_practiceSessio2, _this$_practiceSessio3;
179
+ return (_this$_practiceSessio2 = (_this$_practiceSessio3 = this._practiceSessionLLMChannel) === null || _this$_practiceSessio3 === void 0 ? void 0 : _this$_practiceSessio3.isConnected()) !== null && _this$_practiceSessio2 !== void 0 ? _this$_practiceSessio2 : false;
180
+ },
181
+ /**
182
+ * Returns the practice session LLM channel's locus URL, if available.
183
+ * @returns {string|undefined}
184
+ */
185
+ getPracticeSessionLocusUrl: function getPracticeSessionLocusUrl() {
186
+ var _this$_practiceSessio4;
187
+ return (_this$_practiceSessio4 = this._practiceSessionLLMChannel) === null || _this$_practiceSessio4 === void 0 ? void 0 : _this$_practiceSessio4.getLocusUrl();
188
+ },
189
+ /**
190
+ * Stores the practice session datachannel token for later use when
191
+ * creating the practice session LLM channel.
192
+ * @param {string} token - The datachannel token to store
193
+ * @returns {void}
194
+ */
195
+ setPracticeSessionDatachannelToken: function setPracticeSessionDatachannelToken(token) {
196
+ this._pendingPracticeSessionDatachannelToken = token;
197
+ },
198
+ /**
199
+ * Disconnects the practice session LLM channel and cleans up listeners.
200
+ * @returns {Promise<void>}
201
+ */
202
+ cleanupPSDataChannel: function cleanupPSDataChannel() {
203
+ var _this = this;
204
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
205
+ var _meeting$llmChannel, _meeting, meeting, _this$_practiceSessio5, _this$_practiceSessio6, _this$_practiceSessio7, _t;
206
+ return _regenerator.default.wrap(function (_context) {
207
+ while (1) switch (_context.prev = _context.next) {
208
+ case 0:
209
+ // Remove pending online listener if any
210
+ if (_this._pendingOnlineListener) {
211
+ _meeting = _this.getValidatedWebinarMeeting();
212
+ _meeting === null || _meeting === void 0 ? void 0 : (_meeting$llmChannel = _meeting.llmChannel) === null || _meeting$llmChannel === void 0 ? void 0 : _meeting$llmChannel.off('online', _this._pendingOnlineListener);
213
+ _this._pendingOnlineListener = null;
214
+ }
215
+
216
+ // Switch voicea back to main meeting LLM channel before disconnecting PS channel
217
+ meeting = _this.getValidatedWebinarMeeting();
218
+ if (!(meeting !== null && meeting !== void 0 && meeting.voiceaChannel && meeting !== null && meeting !== void 0 && meeting.llmChannel)) {
219
+ _context.next = 1;
220
+ break;
221
+ }
222
+ _context.next = 1;
223
+ return meeting.voiceaChannel.switchLLMChannel(meeting.llmChannel);
224
+ case 1:
225
+ if (_this._practiceSessionLLMChannel) {
226
+ _context.next = 2;
227
+ break;
228
+ }
229
+ return _context.abrupt("return");
230
+ case 2:
231
+ _context.prev = 2;
232
+ _context.next = 3;
233
+ return _this._practiceSessionLLMChannel.disconnect({
234
+ code: 3050,
235
+ reason: 'done (permanent)'
236
+ });
237
+ case 3:
238
+ _context.next = 5;
239
+ break;
240
+ case 4:
241
+ _context.prev = 4;
242
+ _t = _context["catch"](2);
243
+ _loggerProxy.default.logger.error('Webinar:index#cleanupPSDataChannel --> Failed to disconnect practice session LLM channel', _t);
244
+ throw _t;
245
+ case 5:
246
+ _context.prev = 5;
247
+ // Remove listeners from the channel
248
+ if (meeting) {
249
+ (_this$_practiceSessio5 = _this._practiceSessionLLMChannel) === null || _this$_practiceSessio5 === void 0 ? void 0 : _this$_practiceSessio5.off('event:relay.event', meeting.processRelayEvent);
250
+ (_this$_practiceSessio6 = _this._practiceSessionLLMChannel) === null || _this$_practiceSessio6 === void 0 ? void 0 : _this$_practiceSessio6.off(_constants.LOCUS_LLM_EVENT, meeting.processLocusLLMEvent);
251
+ (_this$_practiceSessio7 = _this._practiceSessionLLMChannel) === null || _this$_practiceSessio7 === void 0 ? void 0 : _this$_practiceSessio7.off('online', meeting.handleLLMOnline);
252
+
253
+ // Switch annotation back to the meeting's default channel
254
+ if (meeting.llmChannel) {
255
+ meeting.annotation.registerChannel(meeting.llmChannel);
256
+ }
257
+ }
258
+ _this._practiceSessionLLMChannel = undefined;
259
+ return _context.finish(5);
260
+ case 6:
261
+ case "end":
262
+ return _context.stop();
263
+ }
264
+ }, _callee, null, [[2, 4, 5, 6]]);
265
+ }))();
266
+ },
267
+ /**
268
+ * Ensures practice-session token exists before registering the practice LLM channel.
269
+ * Caller is responsible for passing a meeting that has already been resolved via
270
+ * getValidatedWebinarMeeting() — this method does not re-validate ownership.
271
+ * @param {object} meeting
272
+ * @returns {Promise<string|undefined>}
273
+ */
274
+ ensurePracticeSessionDatachannelToken: function ensurePracticeSessionDatachannelToken(meeting) {
275
+ var _this2 = this;
276
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
277
+ var _this2$_practiceSessi, _this2$_practiceSessi2;
278
+ var isDataChannelTokenEnabled, cachedToken, _refreshResponse$body, refreshResponse, _ref2, datachannelToken, _t2;
279
+ return _regenerator.default.wrap(function (_context2) {
280
+ while (1) switch (_context2.prev = _context2.next) {
281
+ case 0:
282
+ _context2.next = 1;
283
+ return _this2.webex.internal.llm.isDataChannelTokenEnabled();
284
+ case 1:
285
+ isDataChannelTokenEnabled = _context2.sent;
286
+ if (isDataChannelTokenEnabled) {
287
+ _context2.next = 2;
288
+ break;
289
+ }
290
+ return _context2.abrupt("return", undefined);
291
+ case 2:
292
+ // Check for cached token on the channel or pending token
293
+ cachedToken = (_this2$_practiceSessi = (_this2$_practiceSessi2 = _this2._practiceSessionLLMChannel) === null || _this2$_practiceSessi2 === void 0 ? void 0 : _this2$_practiceSessi2.getDatachannelToken()) !== null && _this2$_practiceSessi !== void 0 ? _this2$_practiceSessi : _this2._pendingPracticeSessionDatachannelToken;
294
+ if (!cachedToken) {
295
+ _context2.next = 3;
296
+ break;
297
+ }
298
+ return _context2.abrupt("return", cachedToken);
299
+ case 3:
300
+ _context2.prev = 3;
301
+ _context2.next = 4;
302
+ return meeting.refreshDataChannelToken();
303
+ case 4:
304
+ refreshResponse = _context2.sent;
305
+ _ref2 = (_refreshResponse$body = refreshResponse === null || refreshResponse === void 0 ? void 0 : refreshResponse.body) !== null && _refreshResponse$body !== void 0 ? _refreshResponse$body : {}, datachannelToken = _ref2.datachannelToken;
306
+ if (datachannelToken) {
307
+ _context2.next = 5;
308
+ break;
309
+ }
310
+ return _context2.abrupt("return", undefined);
311
+ case 5:
312
+ // Store token on the channel if it exists, otherwise save for later
313
+ if (_this2._practiceSessionLLMChannel) {
314
+ _this2._practiceSessionLLMChannel.setDatachannelToken(datachannelToken);
315
+ } else {
316
+ _this2._pendingPracticeSessionDatachannelToken = datachannelToken;
317
+ }
318
+ return _context2.abrupt("return", datachannelToken);
319
+ case 6:
320
+ _context2.prev = 6;
321
+ _t2 = _context2["catch"](3);
322
+ _loggerProxy.default.logger.warn("Webinar:index#ensurePracticeSessionDatachannelToken --> failed to proactively refresh practice-session token: ".concat((_t2 === null || _t2 === void 0 ? void 0 : _t2.message) || String(_t2)));
323
+ return _context2.abrupt("return", undefined);
324
+ case 7:
325
+ case "end":
326
+ return _context2.stop();
327
+ }
328
+ }, _callee2, null, [[3, 6]]);
329
+ }))();
330
+ },
331
+ /**
332
+ * Connects practice session LLM channel. Creates a new channel if needed.
333
+ * Will disconnect if the meeting has ended or is no longer in practice session mode.
334
+ * Waits for the main LLM channel to be connected before connecting practice session.
335
+ * @returns {Promise}
336
+ */
337
+ updatePSDataChannel: function updatePSDataChannel() {
338
+ var _this3 = this;
339
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
340
+ var _this3$_practiceSessi, _meeting$llmChannel3, _this3$_pendingPracti, _this3$_practiceSessi2;
341
+ var invocationSequence, meeting, isPracticeSession, _ref3, _ref3$url, url, _ref3$info, _ref3$info2, _ref3$info2$practiceS, practiceSessionDatachannelUrl, _onDefaultSessionConnected, practiceSessionDatachannelToken, refreshedToken, latestPracticeSessionDatachannelUrl, isStillPracticeSession, psChannel;
342
+ return _regenerator.default.wrap(function (_context4) {
343
+ while (1) switch (_context4.prev = _context4.next) {
344
+ case 0:
345
+ _this3._updatePSDataChannelSequence = (_this3._updatePSDataChannelSequence || 0) + 1;
346
+ invocationSequence = _this3._updatePSDataChannelSequence;
347
+ meeting = _this3.getValidatedWebinarMeeting();
348
+ isPracticeSession = (meeting === null || meeting === void 0 ? void 0 : meeting.isJoined()) && _this3.isJoinPracticeSessionDataChannel();
349
+ if (isPracticeSession) {
350
+ _context4.next = 2;
351
+ break;
352
+ }
353
+ _context4.next = 1;
354
+ return _this3.cleanupPSDataChannel();
355
+ case 1:
356
+ return _context4.abrupt("return", undefined);
357
+ case 2:
358
+ // @ts-ignore - Fix type
359
+ _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;
360
+ if (practiceSessionDatachannelUrl) {
361
+ _context4.next = 3;
362
+ break;
363
+ }
364
+ return _context4.abrupt("return", undefined);
365
+ case 3:
366
+ if (!((_this3$_practiceSessi = _this3._practiceSessionLLMChannel) !== null && _this3$_practiceSessi !== void 0 && _this3$_practiceSessi.isConnected())) {
367
+ _context4.next = 5;
368
+ break;
369
+ }
370
+ if (!(url === _this3._practiceSessionLLMChannel.getLocusUrl() && practiceSessionDatachannelUrl === _this3._practiceSessionLLMChannel.getDatachannelUrl())) {
371
+ _context4.next = 4;
372
+ break;
373
+ }
374
+ return _context4.abrupt("return", undefined);
375
+ case 4:
376
+ _context4.next = 5;
377
+ return _this3.cleanupPSDataChannel();
378
+ case 5:
379
+ // Ensure the default session LLM channel is connected before connecting the practice session.
380
+ // Subscribe before checking isConnected() to avoid a race where the 'online' event fires
381
+ // between the check and the subscription — the channel does not replay missed events.
382
+ if (!_this3._pendingOnlineListener && meeting !== null && meeting !== void 0 && meeting.llmChannel) {
383
+ _onDefaultSessionConnected = function onDefaultSessionConnected() {
384
+ var _meeting$llmChannel2;
385
+ _this3._pendingOnlineListener = null;
386
+ (_meeting$llmChannel2 = meeting.llmChannel) === null || _meeting$llmChannel2 === void 0 ? void 0 : _meeting$llmChannel2.off('online', _onDefaultSessionConnected);
387
+ _this3.updatePSDataChannel();
388
+ };
389
+ _this3._pendingOnlineListener = _onDefaultSessionConnected;
390
+ meeting.llmChannel.on('online', _onDefaultSessionConnected);
391
+ }
392
+ if (meeting !== null && meeting !== void 0 && (_meeting$llmChannel3 = meeting.llmChannel) !== null && _meeting$llmChannel3 !== void 0 && _meeting$llmChannel3.isConnected()) {
393
+ _context4.next = 6;
394
+ break;
395
+ }
396
+ _loggerProxy.default.logger.info('Webinar:index#updatePSDataChannel --> default session not yet connected, deferring practice session connect.');
397
+ return _context4.abrupt("return", undefined);
398
+ case 6:
399
+ // Default session is already connected — cancel the pending listener and proceed
400
+ if (_this3._pendingOnlineListener) {
401
+ meeting.llmChannel.off('online', _this3._pendingOnlineListener);
402
+ _this3._pendingOnlineListener = null;
403
+ }
404
+
405
+ // Get token from pending or refresh if needed
406
+ practiceSessionDatachannelToken = (_this3$_pendingPracti = _this3._pendingPracticeSessionDatachannelToken) !== null && _this3$_pendingPracti !== void 0 ? _this3$_pendingPracti : (_this3$_practiceSessi2 = _this3._practiceSessionLLMChannel) === null || _this3$_practiceSessi2 === void 0 ? void 0 : _this3$_practiceSessi2.getDatachannelToken();
407
+ _context4.next = 7;
408
+ return _this3.ensurePracticeSessionDatachannelToken(meeting);
409
+ case 7:
410
+ refreshedToken = _context4.sent;
411
+ latestPracticeSessionDatachannelUrl = (0, _lodash.get)(meeting, 'locusInfo.info.practiceSessionDatachannelUrl');
412
+ isStillPracticeSession = (meeting === null || meeting === void 0 ? void 0 : meeting.isJoined()) && _this3.isJoinPracticeSessionDataChannel(); // Skip stale invocations after async refresh to avoid reconnecting a session
413
+ // that was already updated/cleaned by a newer state transition.
414
+ if (!(invocationSequence !== _this3._updatePSDataChannelSequence || !isStillPracticeSession || !latestPracticeSessionDatachannelUrl || latestPracticeSessionDatachannelUrl !== practiceSessionDatachannelUrl)) {
415
+ _context4.next = 8;
416
+ break;
417
+ }
418
+ return _context4.abrupt("return", undefined);
419
+ case 8:
420
+ if (refreshedToken) {
421
+ practiceSessionDatachannelToken = refreshedToken;
422
+ }
423
+
424
+ // Create a new practice session LLM channel
425
+ // @ts-ignore - Fix type
426
+ psChannel = _this3.webex.internal.llm.createChannel();
427
+ _this3._practiceSessionLLMChannel = psChannel;
428
+
429
+ // Set up refresh handler before registration
430
+ psChannel.setRefreshHandler(function () {
431
+ return meeting.refreshDataChannelToken();
432
+ });
433
+
434
+ // If we have a pending token, store it on the channel
435
+ if (_this3._pendingPracticeSessionDatachannelToken) {
436
+ psChannel.setDatachannelToken(_this3._pendingPracticeSessionDatachannelToken);
437
+ _this3._pendingPracticeSessionDatachannelToken = undefined;
438
+ }
439
+ return _context4.abrupt("return", psChannel.registerAndConnect(url, practiceSessionDatachannelUrl, practiceSessionDatachannelToken).then(/*#__PURE__*/function () {
440
+ var _ref4 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(registerAndConnectResult) {
441
+ return _regenerator.default.wrap(function (_context3) {
442
+ while (1) switch (_context3.prev = _context3.next) {
443
+ case 0:
444
+ if (!(_this3._practiceSessionLLMChannel !== psChannel)) {
445
+ _context3.next = 1;
446
+ break;
447
+ }
448
+ psChannel.disconnect({
449
+ code: 3050,
450
+ reason: 'replaced'
451
+ }).catch(function () {});
452
+ return _context3.abrupt("return", undefined);
453
+ case 1:
454
+ // Register event listeners on the practice session channel
455
+ psChannel.off('event:relay.event', meeting.processRelayEvent);
456
+ psChannel.on('event:relay.event', meeting.processRelayEvent);
457
+ psChannel.off(_constants.LOCUS_LLM_EVENT, meeting.processLocusLLMEvent);
458
+ psChannel.on(_constants.LOCUS_LLM_EVENT, meeting.processLocusLLMEvent);
459
+ psChannel.off('online', meeting.handleLLMOnline);
460
+ psChannel.on('online', meeting.handleLLMOnline);
461
+
462
+ // Switch annotation to practice session channel
463
+ meeting.annotation.registerChannel(psChannel);
464
+
465
+ // Switch meeting's voicea channel to use the PS LLM connection
466
+ // This preserves caption state and re-announces automatically
467
+ if (!meeting.voiceaChannel) {
468
+ _context3.next = 2;
469
+ break;
470
+ }
471
+ _context3.next = 2;
472
+ return meeting.voiceaChannel.switchLLMChannel(psChannel);
473
+ case 2:
474
+ _loggerProxy.default.logger.info('Webinar:index#updatePSDataChannel --> enabled to receive relay events for practice session!');
475
+ return _context3.abrupt("return", _promise.default.resolve(registerAndConnectResult));
476
+ case 3:
477
+ case "end":
478
+ return _context3.stop();
479
+ }
480
+ }, _callee3);
481
+ }));
482
+ return function (_x) {
483
+ return _ref4.apply(this, arguments);
484
+ };
485
+ }()).catch(function (error) {
486
+ // Clean up the channel on failure, but only if it's still the current one
487
+ if (_this3._practiceSessionLLMChannel === psChannel) {
488
+ _this3._practiceSessionLLMChannel = undefined;
489
+ }
490
+ throw error;
491
+ }));
492
+ case 9:
493
+ case "end":
494
+ return _context4.stop();
495
+ }
496
+ }, _callee4);
497
+ }))();
498
+ },
120
499
  /**
121
500
  * start or stop practice session for webinar
122
501
  * @param {boolean} enabled
123
502
  * @returns {Promise}
124
503
  */
125
504
  setPracticeSessionState: function setPracticeSessionState(enabled) {
505
+ var meeting = this.getValidatedWebinarMeeting();
126
506
  return this.request({
127
507
  method: _constants.HTTP_VERBS.PATCH,
128
508
  uri: "".concat(this.locusUrl, "/controls"),
@@ -131,6 +511,9 @@ var Webinar = _webexCore.WebexPlugin.extend({
131
511
  enabled: enabled
132
512
  }
133
513
  }
514
+ }).then(function (response) {
515
+ _util.default.updateLocusFromApiResponse(meeting, response);
516
+ return response;
134
517
  }).catch(function (error) {
135
518
  _loggerProxy.default.logger.error('Meeting:webinar#setPracticeSessionState failed', error);
136
519
  throw error;
@@ -143,6 +526,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
143
526
  */
144
527
  updatePracticeSessionStatus: function updatePracticeSessionStatus(payload) {
145
528
  this.set('practiceSessionEnabled', !!(payload !== null && payload !== void 0 && payload.enabled));
529
+ this.updatePSDataChannel().then(function () {});
146
530
  },
147
531
  /**
148
532
  * start webcast mode for webinar
@@ -151,33 +535,33 @@ var Webinar = _webexCore.WebexPlugin.extend({
151
535
  * @returns {Promise}
152
536
  */
153
537
  startWebcast: function startWebcast(meeting, layout) {
154
- var _this = this;
155
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
156
- var _t, _t2, _t3, _t4, _t5, _t6, _t7, _t8;
157
- return _regenerator.default.wrap(function (_context) {
158
- while (1) switch (_context.prev = _context.next) {
538
+ var _this4 = this;
539
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
540
+ var _t3, _t4, _t5, _t6, _t7, _t8, _t9, _t0;
541
+ return _regenerator.default.wrap(function (_context5) {
542
+ while (1) switch (_context5.prev = _context5.next) {
159
543
  case 0:
160
544
  if (meeting) {
161
- _context.next = 1;
545
+ _context5.next = 1;
162
546
  break;
163
547
  }
164
548
  _loggerProxy.default.logger.error("Meeting:webinar#startWebcast failed --> meeting parameter : ".concat(meeting));
165
549
  throw new Error('Meeting parameter does not meet expectations');
166
550
  case 1:
167
- _t = _this;
168
- _t2 = _constants.HTTP_VERBS.PUT;
169
- _t3 = "".concat(_this.webcastInstanceUrl, "/streaming");
170
- _t4 = _defineProperty2.default;
171
- _context.next = 2;
172
- return _this.webex.credentials.getUserToken();
551
+ _t3 = _this4;
552
+ _t4 = _constants.HTTP_VERBS.PUT;
553
+ _t5 = "".concat(_this4.webcastInstanceUrl, "/streaming");
554
+ _t6 = _defineProperty2.default;
555
+ _context5.next = 2;
556
+ return _this4.webex.credentials.getUserToken();
173
557
  case 2:
174
- _t5 = _context.sent;
175
- _t6 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
176
- _t7 = _t4({
177
- authorization: _t5,
178
- trackingId: _t6
558
+ _t7 = _context5.sent;
559
+ _t8 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
560
+ _t9 = _t6({
561
+ authorization: _t7,
562
+ trackingId: _t8
179
563
  }, _constants.HEADERS.CONTENT_TYPE, _constants.HEADERS.CONTENT_TYPE_VALUE.APPLICATION_JSON);
180
- _t8 = {
564
+ _t0 = {
181
565
  action: 'start',
182
566
  meetingInfo: {
183
567
  locusId: meeting.locusId,
@@ -185,20 +569,20 @@ var Webinar = _webexCore.WebexPlugin.extend({
185
569
  },
186
570
  layout: layout
187
571
  };
188
- return _context.abrupt("return", _t.request.call(_t, {
189
- method: _t2,
190
- uri: _t3,
191
- headers: _t7,
192
- body: _t8
572
+ return _context5.abrupt("return", _t3.request.call(_t3, {
573
+ method: _t4,
574
+ uri: _t5,
575
+ headers: _t9,
576
+ body: _t0
193
577
  }).catch(function (error) {
194
578
  _loggerProxy.default.logger.error('Meeting:webinar#startWebcast failed', error);
195
579
  throw error;
196
580
  }));
197
581
  case 3:
198
582
  case "end":
199
- return _context.stop();
583
+ return _context5.stop();
200
584
  }
201
- }, _callee);
585
+ }, _callee5);
202
586
  }))();
203
587
  },
204
588
  /**
@@ -206,42 +590,42 @@ var Webinar = _webexCore.WebexPlugin.extend({
206
590
  * @returns {Promise}
207
591
  */
208
592
  stopWebcast: function stopWebcast() {
209
- var _this2 = this;
210
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
211
- var _t9, _t0, _t1, _t10, _t11, _t12, _t13, _t14;
212
- return _regenerator.default.wrap(function (_context2) {
213
- while (1) switch (_context2.prev = _context2.next) {
593
+ var _this5 = this;
594
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
595
+ var _t1, _t10, _t11, _t12, _t13, _t14, _t15, _t16;
596
+ return _regenerator.default.wrap(function (_context6) {
597
+ while (1) switch (_context6.prev = _context6.next) {
214
598
  case 0:
215
- _t9 = _this2;
216
- _t0 = _constants.HTTP_VERBS.PUT;
217
- _t1 = "".concat(_this2.webcastInstanceUrl, "/streaming");
218
- _t10 = _defineProperty2.default;
219
- _context2.next = 1;
220
- return _this2.webex.credentials.getUserToken();
599
+ _t1 = _this5;
600
+ _t10 = _constants.HTTP_VERBS.PUT;
601
+ _t11 = "".concat(_this5.webcastInstanceUrl, "/streaming");
602
+ _t12 = _defineProperty2.default;
603
+ _context6.next = 1;
604
+ return _this5.webex.credentials.getUserToken();
221
605
  case 1:
222
- _t11 = _context2.sent;
223
- _t12 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
224
- _t13 = _t10({
225
- authorization: _t11,
226
- trackingId: _t12
606
+ _t13 = _context6.sent;
607
+ _t14 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
608
+ _t15 = _t12({
609
+ authorization: _t13,
610
+ trackingId: _t14
227
611
  }, _constants.HEADERS.CONTENT_TYPE, _constants.HEADERS.CONTENT_TYPE_VALUE.APPLICATION_JSON);
228
- _t14 = {
612
+ _t16 = {
229
613
  action: 'stop'
230
614
  };
231
- return _context2.abrupt("return", _t9.request.call(_t9, {
232
- method: _t0,
233
- uri: _t1,
234
- headers: _t13,
235
- body: _t14
615
+ return _context6.abrupt("return", _t1.request.call(_t1, {
616
+ method: _t10,
617
+ uri: _t11,
618
+ headers: _t15,
619
+ body: _t16
236
620
  }).catch(function (error) {
237
621
  _loggerProxy.default.logger.error('Meeting:webinar#stopWebcast failed', error);
238
622
  throw error;
239
623
  }));
240
624
  case 2:
241
625
  case "end":
242
- return _context2.stop();
626
+ return _context6.stop();
243
627
  }
244
- }, _callee2);
628
+ }, _callee6);
245
629
  }))();
246
630
  },
247
631
  /**
@@ -249,123 +633,122 @@ var Webinar = _webexCore.WebexPlugin.extend({
249
633
  * @returns {Promise}
250
634
  */
251
635
  queryWebcastLayout: function queryWebcastLayout() {
252
- var _this3 = this;
253
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
254
- var _t15, _t16, _t17, _t18, _t19, _t20;
255
- return _regenerator.default.wrap(function (_context3) {
256
- while (1) switch (_context3.prev = _context3.next) {
636
+ var _this6 = this;
637
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
638
+ var _t17, _t18, _t19, _t20, _t21, _t22;
639
+ return _regenerator.default.wrap(function (_context7) {
640
+ while (1) switch (_context7.prev = _context7.next) {
257
641
  case 0:
258
- _t15 = _this3;
259
- _t16 = _constants.HTTP_VERBS.GET;
260
- _t17 = "".concat(_this3.webcastInstanceUrl, "/layout");
261
- _context3.next = 1;
262
- return _this3.webex.credentials.getUserToken();
642
+ _t17 = _this6;
643
+ _t18 = _constants.HTTP_VERBS.GET;
644
+ _t19 = "".concat(_this6.webcastInstanceUrl, "/layout");
645
+ _context7.next = 1;
646
+ return _this6.webex.credentials.getUserToken();
263
647
  case 1:
264
- _t18 = _context3.sent;
265
- _t19 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
266
- _t20 = {
267
- authorization: _t18,
268
- trackingId: _t19
648
+ _t20 = _context7.sent;
649
+ _t21 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
650
+ _t22 = {
651
+ authorization: _t20,
652
+ trackingId: _t21
269
653
  };
270
- return _context3.abrupt("return", _t15.request.call(_t15, {
271
- method: _t16,
272
- uri: _t17,
273
- headers: _t20
654
+ return _context7.abrupt("return", _t17.request.call(_t17, {
655
+ method: _t18,
656
+ uri: _t19,
657
+ headers: _t22
274
658
  }).catch(function (error) {
275
659
  _loggerProxy.default.logger.error('Meeting:webinar#queryWebcastLayout failed', error);
276
660
  throw error;
277
661
  }));
278
662
  case 2:
279
663
  case "end":
280
- return _context3.stop();
664
+ return _context7.stop();
281
665
  }
282
- }, _callee3);
666
+ }, _callee7);
283
667
  }))();
284
668
  },
285
669
  /**
286
- * update webcast layout for webinar
670
+ * Update webcast ayout for webinar
287
671
  * @param {object} layout
288
672
  * @returns {Promise}
289
673
  */
290
674
  updateWebcastLayout: function updateWebcastLayout(layout) {
291
- var _this4 = this;
292
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
293
- var _t21, _t22, _t23, _t24, _t25, _t26, _t27, _t28;
294
- return _regenerator.default.wrap(function (_context4) {
295
- while (1) switch (_context4.prev = _context4.next) {
675
+ var _this7 = this;
676
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
677
+ var _t23, _t24, _t25, _t26, _t27, _t28, _t29, _t30;
678
+ return _regenerator.default.wrap(function (_context8) {
679
+ while (1) switch (_context8.prev = _context8.next) {
296
680
  case 0:
297
- _t21 = _this4;
298
- _t22 = _constants.HTTP_VERBS.PUT;
299
- _t23 = "".concat(_this4.webcastInstanceUrl, "/layout");
300
- _t24 = _defineProperty2.default;
301
- _context4.next = 1;
302
- return _this4.webex.credentials.getUserToken();
681
+ _t23 = _this7;
682
+ _t24 = _constants.HTTP_VERBS.PUT;
683
+ _t25 = "".concat(_this7.webcastInstanceUrl, "/layout");
684
+ _t26 = _defineProperty2.default;
685
+ _context8.next = 1;
686
+ return _this7.webex.credentials.getUserToken();
303
687
  case 1:
304
- _t25 = _context4.sent;
305
- _t26 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
306
- _t27 = _t24({
307
- authorization: _t25,
308
- trackingId: _t26
688
+ _t27 = _context8.sent;
689
+ _t28 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
690
+ _t29 = _t26({
691
+ authorization: _t27,
692
+ trackingId: _t28
309
693
  }, _constants.HEADERS.CONTENT_TYPE, _constants.HEADERS.CONTENT_TYPE_VALUE.APPLICATION_JSON);
310
- _t28 = {
694
+ _t30 = {
311
695
  videoLayout: layout.videoLayout,
312
696
  contentLayout: layout.contentLayout,
313
697
  syncStageLayout: layout.syncStageLayout,
314
698
  syncStageInMeeting: layout.syncStageInMeeting
315
699
  };
316
- return _context4.abrupt("return", _t21.request.call(_t21, {
317
- method: _t22,
318
- uri: _t23,
319
- headers: _t27,
320
- body: _t28
700
+ return _context8.abrupt("return", _t23.request.call(_t23, {
701
+ method: _t24,
702
+ uri: _t25,
703
+ headers: _t29,
704
+ body: _t30
321
705
  }).catch(function (error) {
322
706
  _loggerProxy.default.logger.error('Meeting:webinar#updateWebcastLayout failed', error);
323
707
  throw error;
324
708
  }));
325
709
  case 2:
326
710
  case "end":
327
- return _context4.stop();
711
+ return _context8.stop();
328
712
  }
329
- }, _callee4);
713
+ }, _callee8);
330
714
  }))();
331
715
  },
332
716
  /**
333
717
  * view all webcast attendees
334
- * @param {string} queryString
335
718
  * @returns {Promise}
336
719
  */
337
720
  viewAllWebcastAttendees: function viewAllWebcastAttendees() {
338
- var _this5 = this;
339
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
340
- var _t29, _t30, _t31, _t32, _t33, _t34;
341
- return _regenerator.default.wrap(function (_context5) {
342
- while (1) switch (_context5.prev = _context5.next) {
721
+ var _this8 = this;
722
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
723
+ var _t31, _t32, _t33, _t34, _t35, _t36;
724
+ return _regenerator.default.wrap(function (_context9) {
725
+ while (1) switch (_context9.prev = _context9.next) {
343
726
  case 0:
344
- _t29 = _this5;
345
- _t30 = _constants.HTTP_VERBS.GET;
346
- _t31 = "".concat(_this5.webcastInstanceUrl, "/attendees");
347
- _context5.next = 1;
348
- return _this5.webex.credentials.getUserToken();
727
+ _t31 = _this8;
728
+ _t32 = _constants.HTTP_VERBS.GET;
729
+ _t33 = "".concat(_this8.webcastInstanceUrl, "/attendees");
730
+ _context9.next = 1;
731
+ return _this8.webex.credentials.getUserToken();
349
732
  case 1:
350
- _t32 = _context5.sent;
351
- _t33 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
352
- _t34 = {
353
- authorization: _t32,
354
- trackingId: _t33
733
+ _t34 = _context9.sent;
734
+ _t35 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
735
+ _t36 = {
736
+ authorization: _t34,
737
+ trackingId: _t35
355
738
  };
356
- return _context5.abrupt("return", _t29.request.call(_t29, {
357
- method: _t30,
358
- uri: _t31,
359
- headers: _t34
739
+ return _context9.abrupt("return", _t31.request.call(_t31, {
740
+ method: _t32,
741
+ uri: _t33,
742
+ headers: _t36
360
743
  }).catch(function (error) {
361
744
  _loggerProxy.default.logger.error('Meeting:webinar#viewAllWebcastAttendees failed', error);
362
745
  throw error;
363
746
  }));
364
747
  case 2:
365
748
  case "end":
366
- return _context5.stop();
749
+ return _context9.stop();
367
750
  }
368
- }, _callee5);
751
+ }, _callee9);
369
752
  }))();
370
753
  },
371
754
  /**
@@ -375,38 +758,38 @@ var Webinar = _webexCore.WebexPlugin.extend({
375
758
  */
376
759
  searchWebcastAttendees: function searchWebcastAttendees() {
377
760
  var _arguments = arguments,
378
- _this6 = this;
379
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
380
- var queryString, _t35, _t36, _t37, _t38, _t39, _t40;
381
- return _regenerator.default.wrap(function (_context6) {
382
- while (1) switch (_context6.prev = _context6.next) {
761
+ _this9 = this;
762
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
763
+ var queryString, _t37, _t38, _t39, _t40, _t41, _t42;
764
+ return _regenerator.default.wrap(function (_context0) {
765
+ while (1) switch (_context0.prev = _context0.next) {
383
766
  case 0:
384
767
  queryString = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : '';
385
- _t35 = _this6;
386
- _t36 = _constants.HTTP_VERBS.GET;
387
- _t37 = "".concat(_this6.webcastInstanceUrl, "/attendees?keyword=").concat(encodeURIComponent(queryString));
388
- _context6.next = 1;
389
- return _this6.webex.credentials.getUserToken();
768
+ _t37 = _this9;
769
+ _t38 = _constants.HTTP_VERBS.GET;
770
+ _t39 = "".concat(_this9.webcastInstanceUrl, "/attendees?keyword=").concat(encodeURIComponent(queryString));
771
+ _context0.next = 1;
772
+ return _this9.webex.credentials.getUserToken();
390
773
  case 1:
391
- _t38 = _context6.sent;
392
- _t39 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
393
- _t40 = {
394
- authorization: _t38,
395
- trackingId: _t39
774
+ _t40 = _context0.sent;
775
+ _t41 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
776
+ _t42 = {
777
+ authorization: _t40,
778
+ trackingId: _t41
396
779
  };
397
- return _context6.abrupt("return", _t35.request.call(_t35, {
398
- method: _t36,
399
- uri: _t37,
400
- headers: _t40
780
+ return _context0.abrupt("return", _t37.request.call(_t37, {
781
+ method: _t38,
782
+ uri: _t39,
783
+ headers: _t42
401
784
  }).catch(function (error) {
402
785
  _loggerProxy.default.logger.error('Meeting:webinar#searchWebcastAttendees failed', error);
403
786
  throw error;
404
787
  }));
405
788
  case 2:
406
789
  case "end":
407
- return _context6.stop();
790
+ return _context0.stop();
408
791
  }
409
- }, _callee6);
792
+ }, _callee0);
410
793
  }))();
411
794
  },
412
795
  /**
@@ -415,40 +798,104 @@ var Webinar = _webexCore.WebexPlugin.extend({
415
798
  * @returns {Promise}
416
799
  */
417
800
  expelWebcastAttendee: function expelWebcastAttendee(participantId) {
418
- var _this7 = this;
419
- return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
420
- var _t41, _t42, _t43, _t44, _t45, _t46;
421
- return _regenerator.default.wrap(function (_context7) {
422
- while (1) switch (_context7.prev = _context7.next) {
801
+ var _this0 = this;
802
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
803
+ var _t43, _t44, _t45, _t46, _t47, _t48;
804
+ return _regenerator.default.wrap(function (_context1) {
805
+ while (1) switch (_context1.prev = _context1.next) {
423
806
  case 0:
424
- _t41 = _this7;
425
- _t42 = _constants.HTTP_VERBS.DELETE;
426
- _t43 = "".concat(_this7.webcastInstanceUrl, "/attendees/").concat(participantId);
427
- _context7.next = 1;
428
- return _this7.webex.credentials.getUserToken();
807
+ _t43 = _this0;
808
+ _t44 = _constants.HTTP_VERBS.DELETE;
809
+ _t45 = "".concat(_this0.webcastInstanceUrl, "/attendees/").concat(participantId);
810
+ _context1.next = 1;
811
+ return _this0.webex.credentials.getUserToken();
429
812
  case 1:
430
- _t44 = _context7.sent;
431
- _t45 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
432
- _t46 = {
433
- authorization: _t44,
434
- trackingId: _t45
813
+ _t46 = _context1.sent;
814
+ _t47 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
815
+ _t48 = {
816
+ authorization: _t46,
817
+ trackingId: _t47
435
818
  };
436
- return _context7.abrupt("return", _t41.request.call(_t41, {
437
- method: _t42,
438
- uri: _t43,
439
- headers: _t46
819
+ return _context1.abrupt("return", _t43.request.call(_t43, {
820
+ method: _t44,
821
+ uri: _t45,
822
+ headers: _t48
440
823
  }).catch(function (error) {
441
824
  _loggerProxy.default.logger.error('Meeting:webinar#expelWebcastAttendee failed', error);
442
825
  throw error;
443
826
  }));
444
827
  case 2:
445
828
  case "end":
446
- return _context7.stop();
829
+ return _context1.stop();
447
830
  }
448
- }, _callee7);
831
+ }, _callee1);
832
+ }))();
833
+ },
834
+ /**
835
+ * search large scale webinar attendees
836
+ * @param {object} payload
837
+ * @param {string} payload.queryString
838
+ * @param {number} payload.limit
839
+ * @param {string} payload.next
840
+ * @returns {Promise}
841
+ */
842
+ searchLargeScaleWebinarAttendees: function searchLargeScaleWebinarAttendees(payload) {
843
+ var _this1 = this;
844
+ return (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
845
+ var _payload$limit, _meeting$locusInfo3, _meeting$locusInfo3$l, _meeting$locusInfo3$l2, _meeting$locusInfo3$l3;
846
+ var meeting, rawParams, attendeeSearchUrl, _t49, _t50, _t51, _t52, _t53, _t54;
847
+ return _regenerator.default.wrap(function (_context10) {
848
+ while (1) switch (_context10.prev = _context10.next) {
849
+ case 0:
850
+ meeting = _this1.getValidatedWebinarMeeting();
851
+ if (meeting) {
852
+ _context10.next = 1;
853
+ break;
854
+ }
855
+ _loggerProxy.default.logger.error('Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> webinar meeting could not be validated');
856
+ throw new Error('Meeting:webinar5k#Webinar meeting is not resolvable for the current locus');
857
+ case 1:
858
+ rawParams = {
859
+ search_text: payload === null || payload === void 0 ? void 0 : payload.queryString,
860
+ 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,
861
+ next: payload === null || payload === void 0 ? void 0 : payload.next
862
+ };
863
+ 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;
864
+ if (attendeeSearchUrl) {
865
+ _context10.next = 2;
866
+ break;
867
+ }
868
+ _loggerProxy.default.logger.error('Meeting:webinar5k#searchLargeScaleWebinarAttendees failed --> attendee search url unavailable');
869
+ throw new Error('Meeting:webinar5k#Attendee search url is not available');
870
+ case 2:
871
+ _t49 = _this1;
872
+ _t50 = _constants.HTTP_VERBS.GET;
873
+ _t51 = "".concat(attendeeSearchUrl, "?").concat(new URLSearchParams((0, _utils.sanitizeParams)(rawParams)).toString());
874
+ _context10.next = 3;
875
+ return _this1.webex.credentials.getUserToken();
876
+ case 3:
877
+ _t52 = _context10.sent;
878
+ _t53 = "".concat(_webexCore.config.trackingIdPrefix, "_").concat(_uuid.default.v4().toString());
879
+ _t54 = {
880
+ authorization: _t52,
881
+ trackingId: _t53
882
+ };
883
+ return _context10.abrupt("return", _t49.request.call(_t49, {
884
+ method: _t50,
885
+ uri: _t51,
886
+ headers: _t54
887
+ }).catch(function (error) {
888
+ _loggerProxy.default.logger.error('Meeting:webinar5k#searchLargeScaleWebinarAttendees failed', error);
889
+ throw error;
890
+ }));
891
+ case 4:
892
+ case "end":
893
+ return _context10.stop();
894
+ }
895
+ }, _callee10);
449
896
  }))();
450
897
  },
451
- version: "0.0.0"
898
+ version: "3.12.0-llmrefactor.2"
452
899
  });
453
900
  var _default = exports.default = Webinar;
454
901
  //# sourceMappingURL=index.js.map