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

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
@@ -60,3 +60,20 @@ export const deleteNestedObjectsWithHtMeta = (
60
60
  }
61
61
  }
62
62
  };
63
+
64
+ /**
65
+ * Reorders items so that those matching the given priority list come first (in priority order),
66
+ * followed by everything else in their original order.
67
+ *
68
+ * @param {Array<T>} items - The items to reorder
69
+ * @param {string[]} priority - Ordered list of names that should come first
70
+ * @returns {Array<T>} A new array with prioritized items first
71
+ */
72
+ export function sortByInitPriority<T extends {name: string}>(items: T[], priority: string[]): T[] {
73
+ const prioritized = priority
74
+ .map((name) => items.find((item) => item.name === name))
75
+ .filter(Boolean) as T[];
76
+ const rest = items.filter((item) => !priority.includes(item.name));
77
+
78
+ return [...prioritized, ...rest];
79
+ }
package/src/index.ts CHANGED
@@ -65,6 +65,11 @@ export * as REACTIONS from './reactions/reactions';
65
65
  export * as sdkAnnotationTypes from './annotation/annotation.types';
66
66
  export * as MeetingInfoV2 from './meeting-info/meeting-info-v2';
67
67
  export {type Reaction} from './reactions/reactions.type';
68
+ export {SitePreferenceSelectOption} from './meetings/meetings.types';
69
+ export type {
70
+ FetchSitePreferencesMeViaSiteOptions,
71
+ SitePreferencesResponse,
72
+ } from './meetings/meetings.types';
68
73
 
69
74
  export {
70
75
  CaptchaError,
@@ -18,12 +18,33 @@ export default class LocusRetryStatusInterceptor extends Interceptor {
18
18
  }
19
19
 
20
20
  /**
21
- * Handle response errors
22
- * @param {Object} options
23
- * @param {WebexHttpError} reason
24
- * @returns {Promise<WebexHttpError>}
21
+ * Check whether a URI is a Locus /hashtree or /sync endpoint.
22
+ * @param {string} uri
23
+ * @returns {boolean}
25
24
  */
25
+ private static isLocusHashtreeOrSync(uri: string): boolean {
26
+ try {
27
+ const {pathname} = new URL(uri);
28
+
29
+ return (
30
+ pathname.includes('/locus/') &&
31
+ (pathname.endsWith('/hashtree') || pathname.endsWith('/sync'))
32
+ );
33
+ } catch {
34
+ return false;
35
+ }
36
+ }
37
+
26
38
  onResponseError(options, reason) {
39
+ // Don't retry /hashtree or /sync calls for 429 or any 5xx — during a sync storm retries
40
+ // make things worse. The normal sync timers will handle recovery for these endpoints.
41
+ if (
42
+ (reason.statusCode === 429 || reason.statusCode >= 500) &&
43
+ LocusRetryStatusInterceptor.isLocusHashtreeOrSync(options.uri)
44
+ ) {
45
+ return Promise.reject(reason);
46
+ }
47
+
27
48
  if ((reason.statusCode === 503 || reason.statusCode === 429) && options.uri.includes('locus')) {
28
49
  const hasRetriedLocusRequest = rateLimitExpiryTime.get(this);
29
50
  const retryAfterTime = options.headers['retry-after'] || 2000;
@@ -4,6 +4,7 @@
4
4
  import {WebexPlugin} from '@webex/webex-core';
5
5
  import LoggerProxy from '../common/logs/logger-proxy';
6
6
  import {HTTP_VERBS, INTERPRETATION, LOCUSEVENT, MEETINGS} from '../constants';
7
+ import MeetingUtil from '../meeting/util';
7
8
 
8
9
  import SILanguageCollection from './collection';
9
10
 
@@ -183,6 +184,8 @@ const SimultaneousInterpretation = WebexPlugin.extend({
183
184
  * @returns {Promise}
184
185
  */
185
186
  updateInterpreters(interpreters) {
187
+ const meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);
188
+
186
189
  return this.request({
187
190
  method: HTTP_VERBS.PATCH,
188
191
  uri: `${this.locusUrl}/controls`,
@@ -191,10 +194,16 @@ const SimultaneousInterpretation = WebexPlugin.extend({
191
194
  interpreters,
192
195
  },
193
196
  },
194
- }).catch((error) => {
195
- LoggerProxy.logger.error('Meeting:interpretation#updateInterpreters failed', error);
196
- throw error;
197
- });
197
+ })
198
+ .then((response) => {
199
+ MeetingUtil.updateLocusFromApiResponse(meeting, response);
200
+
201
+ return response;
202
+ })
203
+ .catch((error) => {
204
+ LoggerProxy.logger.error('Meeting:interpretation#updateInterpreters failed', error);
205
+ throw error;
206
+ });
198
207
  },
199
208
  /**
200
209
  * Change direction of interpretation for an interpreter participant
@@ -209,6 +218,8 @@ const SimultaneousInterpretation = WebexPlugin.extend({
209
218
  return Promise.reject(new Error('Missing self participant id'));
210
219
  }
211
220
 
221
+ const meeting = this.webex.meetings.meetingCollection.getByKey('locusUrl', this.locusUrl);
222
+
212
223
  return this.request({
213
224
  method: HTTP_VERBS.PATCH,
214
225
  uri: `${this.locusUrl}/participant/${this.selfParticipantId}/controls`,
@@ -220,10 +231,16 @@ const SimultaneousInterpretation = WebexPlugin.extend({
220
231
  order: this.order,
221
232
  },
222
233
  },
223
- }).catch((error) => {
224
- LoggerProxy.logger.error('Meeting:interpretation#changeDirection failed', error);
225
- throw error;
226
- });
234
+ })
235
+ .then((response) => {
236
+ MeetingUtil.updateLocusFromApiResponse(meeting, response);
237
+
238
+ return response;
239
+ })
240
+ .catch((error) => {
241
+ LoggerProxy.logger.error('Meeting:interpretation#changeDirection failed', error);
242
+ throw error;
243
+ });
227
244
  },
228
245
  /**
229
246
  * Sets up a listener for handoff requests from mercury
@@ -26,7 +26,9 @@ ControlsUtils.parse = (controls: any) => {
26
26
  modifiedBy: ControlsUtils.getId(controls),
27
27
  paused: controls.record.paused ? controls.record.paused : false,
28
28
  recording: controls.record.recording,
29
- lastModified: controls.record.meta.lastModified,
29
+ lastModified: controls.record.meta?.lastModified,
30
+ modifiedByServiceAppName: controls.record.meta?.modifiedByServiceAppName,
31
+ modifiedByServiceAppId: controls.record.meta?.modifiedByServiceAppId,
30
32
  };
31
33
  }
32
34