@webex/plugin-meetings 3.8.0 → 3.8.1-next.10
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.
- package/README.md +26 -13
- package/dist/breakouts/breakout.js +1 -1
- package/dist/breakouts/index.js +70 -6
- package/dist/breakouts/index.js.map +1 -1
- package/dist/common/errors/webex-errors.js +12 -2
- package/dist/common/errors/webex-errors.js.map +1 -1
- package/dist/config.js +5 -1
- package/dist/config.js.map +1 -1
- package/dist/constants.js +28 -123
- package/dist/constants.js.map +1 -1
- package/dist/controls-options-manager/enums.js +3 -0
- package/dist/controls-options-manager/enums.js.map +1 -1
- package/dist/controls-options-manager/types.js.map +1 -1
- package/dist/controls-options-manager/util.js +78 -0
- package/dist/controls-options-manager/util.js.map +1 -1
- package/dist/interpretation/index.js +4 -4
- package/dist/interpretation/index.js.map +1 -1
- package/dist/interpretation/siLanguage.js +1 -1
- package/dist/locus-info/controlsUtils.js +37 -11
- package/dist/locus-info/controlsUtils.js.map +1 -1
- package/dist/locus-info/index.js +92 -12
- package/dist/locus-info/index.js.map +1 -1
- package/dist/locus-info/selfUtils.js +432 -418
- package/dist/locus-info/selfUtils.js.map +1 -1
- package/dist/media/index.js +17 -17
- package/dist/media/index.js.map +1 -1
- package/dist/media/properties.js +94 -6
- package/dist/media/properties.js.map +1 -1
- package/dist/meeting/brbState.js +9 -2
- package/dist/meeting/brbState.js.map +1 -1
- package/dist/meeting/in-meeting-actions.js +21 -1
- package/dist/meeting/in-meeting-actions.js.map +1 -1
- package/dist/meeting/index.js +678 -344
- package/dist/meeting/index.js.map +1 -1
- package/dist/meeting/locusMediaRequest.js +21 -22
- package/dist/meeting/locusMediaRequest.js.map +1 -1
- package/dist/meeting/muteState.js +4 -4
- package/dist/meeting/muteState.js.map +1 -1
- package/dist/meeting/request.js +30 -0
- package/dist/meeting/request.js.map +1 -1
- package/dist/meeting/request.type.js.map +1 -1
- package/dist/meeting/util.js +13 -2
- package/dist/meeting/util.js.map +1 -1
- package/dist/meeting-info/meeting-info-v2.js +373 -68
- package/dist/meeting-info/meeting-info-v2.js.map +1 -1
- package/dist/meeting-info/utilv2.js +5 -1
- package/dist/meeting-info/utilv2.js.map +1 -1
- package/dist/meetings/index.js +136 -1
- package/dist/meetings/index.js.map +1 -1
- package/dist/meetings/util.js +14 -0
- package/dist/meetings/util.js.map +1 -1
- package/dist/member/index.js +55 -9
- package/dist/member/index.js.map +1 -1
- package/dist/member/types.js +3 -0
- package/dist/member/types.js.map +1 -1
- package/dist/member/util.js +335 -353
- package/dist/member/util.js.map +1 -1
- package/dist/members/collection.js.map +1 -1
- package/dist/members/index.js +137 -29
- package/dist/members/index.js.map +1 -1
- package/dist/members/request.js +38 -0
- package/dist/members/request.js.map +1 -1
- package/dist/members/util.js +36 -1
- package/dist/members/util.js.map +1 -1
- package/dist/metrics/constants.js +10 -0
- package/dist/metrics/constants.js.map +1 -1
- package/dist/multistream/remoteMediaManager.js +40 -8
- package/dist/multistream/remoteMediaManager.js.map +1 -1
- package/dist/reachability/clusterReachability.js +63 -27
- package/dist/reachability/clusterReachability.js.map +1 -1
- package/dist/reachability/index.js +107 -47
- package/dist/reachability/index.js.map +1 -1
- package/dist/reachability/reachability.types.js +14 -0
- package/dist/reachability/reachability.types.js.map +1 -1
- package/dist/reachability/request.js +19 -3
- package/dist/reachability/request.js.map +1 -1
- package/dist/reconnection-manager/index.js +2 -2
- package/dist/reconnection-manager/index.js.map +1 -1
- package/dist/recording-controller/util.js +5 -5
- package/dist/recording-controller/util.js.map +1 -1
- package/dist/roap/index.js.map +1 -1
- package/dist/roap/turnDiscovery.js +45 -27
- package/dist/roap/turnDiscovery.js.map +1 -1
- package/dist/roap/types.js +17 -0
- package/dist/roap/types.js.map +1 -0
- package/dist/types/common/errors/webex-errors.d.ts +7 -1
- package/dist/types/config.d.ts +3 -0
- package/dist/types/constants.d.ts +20 -85
- package/dist/types/controls-options-manager/enums.d.ts +4 -1
- package/dist/types/controls-options-manager/types.d.ts +10 -1
- package/dist/types/locus-info/index.d.ts +3 -3
- package/dist/types/locus-info/selfUtils.d.ts +216 -1
- package/dist/types/media/properties.d.ts +15 -0
- package/dist/types/meeting/in-meeting-actions.d.ts +20 -0
- package/dist/types/meeting/index.d.ts +65 -1
- package/dist/types/meeting/muteState.d.ts +0 -1
- package/dist/types/meeting/request.d.ts +12 -1
- package/dist/types/meeting/request.type.d.ts +6 -0
- package/dist/types/meeting/util.d.ts +3 -1
- package/dist/types/meeting-info/meeting-info-v2.d.ts +82 -1
- package/dist/types/meetings/index.d.ts +57 -0
- package/dist/types/member/index.d.ts +21 -6
- package/dist/types/member/types.d.ts +73 -14
- package/dist/types/member/util.d.ts +156 -1
- package/dist/types/members/collection.d.ts +6 -5
- package/dist/types/members/index.d.ts +32 -43
- package/dist/types/members/request.d.ts +26 -0
- package/dist/types/members/util.d.ts +27 -0
- package/dist/types/metrics/constants.d.ts +10 -0
- package/dist/types/multistream/remoteMediaManager.d.ts +10 -1
- package/dist/types/reachability/clusterReachability.d.ts +15 -7
- package/dist/types/reachability/index.d.ts +10 -1
- package/dist/types/reachability/reachability.types.d.ts +5 -0
- package/dist/types/roap/index.d.ts +3 -2
- package/dist/types/roap/turnDiscovery.d.ts +5 -17
- package/dist/types/roap/types.d.ts +16 -0
- package/dist/webinar/index.js +2 -2
- package/dist/webinar/index.js.map +1 -1
- package/package.json +24 -23
- package/src/breakouts/index.ts +69 -0
- package/src/common/errors/webex-errors.ts +8 -1
- package/src/config.ts +3 -0
- package/src/constants.ts +30 -90
- package/src/controls-options-manager/enums.ts +3 -0
- package/src/controls-options-manager/types.ts +16 -1
- package/src/controls-options-manager/util.ts +93 -0
- package/src/interpretation/index.ts +3 -3
- package/src/locus-info/controlsUtils.ts +59 -14
- package/src/locus-info/index.ts +97 -13
- package/src/locus-info/selfUtils.ts +496 -442
- package/src/media/index.ts +23 -21
- package/src/media/properties.ts +96 -0
- package/src/meeting/brbState.ts +11 -2
- package/src/meeting/in-meeting-actions.ts +40 -0
- package/src/meeting/index.ts +470 -105
- package/src/meeting/locusMediaRequest.ts +27 -22
- package/src/meeting/muteState.ts +4 -4
- package/src/meeting/request.ts +36 -1
- package/src/meeting/request.type.ts +7 -0
- package/src/meeting/util.ts +11 -2
- package/src/meeting-info/meeting-info-v2.ts +254 -8
- package/src/meeting-info/utilv2.ts +5 -0
- package/src/meetings/index.ts +148 -1
- package/src/meetings/util.ts +18 -0
- package/src/member/index.ts +68 -22
- package/src/member/types.ts +82 -16
- package/src/member/util.ts +357 -350
- package/src/members/collection.ts +4 -3
- package/src/members/index.ts +137 -18
- package/src/members/request.ts +44 -0
- package/src/members/util.ts +43 -1
- package/src/metrics/constants.ts +10 -0
- package/src/multistream/remoteMediaManager.ts +32 -10
- package/src/reachability/clusterReachability.ts +73 -26
- package/src/reachability/index.ts +62 -1
- package/src/reachability/reachability.types.ts +6 -0
- package/src/reachability/request.ts +7 -0
- package/src/reconnection-manager/index.ts +2 -2
- package/src/recording-controller/util.ts +17 -13
- package/src/roap/index.ts +3 -7
- package/src/roap/turnDiscovery.ts +34 -39
- package/src/roap/types.ts +23 -0
- package/src/webinar/index.ts +1 -1
- package/test/unit/spec/breakouts/index.ts +167 -95
- package/test/unit/spec/controls-options-manager/util.js +178 -0
- package/test/unit/spec/interpretation/index.ts +39 -1
- package/test/unit/spec/locus-info/controlsUtils.js +155 -9
- package/test/unit/spec/locus-info/index.js +209 -73
- package/test/unit/spec/locus-info/selfUtils.js +98 -24
- package/test/unit/spec/media/index.ts +150 -18
- package/test/unit/spec/media/properties.ts +130 -0
- package/test/unit/spec/meeting/brbState.ts +40 -2
- package/test/unit/spec/meeting/in-meeting-actions.ts +23 -4
- package/test/unit/spec/meeting/index.js +804 -139
- package/test/unit/spec/meeting/locusMediaRequest.ts +95 -87
- package/test/unit/spec/meeting/muteState.js +73 -2
- package/test/unit/spec/meeting/request.js +32 -1
- package/test/unit/spec/meeting/utils.js +119 -18
- package/test/unit/spec/meeting-info/meetinginfov2.js +484 -114
- package/test/unit/spec/meeting-info/utilv2.js +19 -0
- package/test/unit/spec/meetings/index.js +146 -2
- package/test/unit/spec/member/index.js +7 -0
- package/test/unit/spec/member/util.js +24 -0
- package/test/unit/spec/members/index.js +304 -78
- package/test/unit/spec/members/request.js +68 -22
- package/test/unit/spec/members/utils.js +75 -0
- package/test/unit/spec/multistream/remoteMediaManager.ts +397 -118
- package/test/unit/spec/reachability/clusterReachability.ts +88 -56
- package/test/unit/spec/reachability/index.ts +97 -0
- package/test/unit/spec/reachability/request.js +47 -2
- package/test/unit/spec/reconnection-manager/index.js +4 -4
- package/test/unit/spec/roap/turnDiscovery.ts +110 -28
- package/test/unit/spec/webinar/index.ts +5 -0
- package/dist/annotation/annotation.types.d.ts +0 -42
- package/dist/annotation/constants.d.ts +0 -31
- package/dist/annotation/index.d.ts +0 -117
- package/dist/breakouts/breakout.d.ts +0 -8
- package/dist/breakouts/collection.d.ts +0 -5
- package/dist/breakouts/edit-lock-error.d.ts +0 -15
- package/dist/breakouts/events.d.ts +0 -8
- package/dist/breakouts/index.d.ts +0 -5
- package/dist/breakouts/request.d.ts +0 -22
- package/dist/breakouts/utils.d.ts +0 -15
- package/dist/common/browser-detection.d.ts +0 -9
- package/dist/common/collection.d.ts +0 -48
- package/dist/common/config.d.ts +0 -2
- package/dist/common/errors/captcha-error.d.ts +0 -15
- package/dist/common/errors/intent-to-join.d.ts +0 -16
- package/dist/common/errors/join-meeting.d.ts +0 -17
- package/dist/common/errors/media.d.ts +0 -15
- package/dist/common/errors/no-meeting-info.d.ts +0 -14
- package/dist/common/errors/parameter.d.ts +0 -15
- package/dist/common/errors/password-error.d.ts +0 -15
- package/dist/common/errors/permission.d.ts +0 -14
- package/dist/common/errors/reclaim-host-role-error.js +0 -149
- package/dist/common/errors/reclaim-host-role-error.js.map +0 -1
- package/dist/common/errors/reclaim-host-role-errors.d.ts +0 -60
- package/dist/common/errors/reconnection-in-progress.d.ts +0 -9
- package/dist/common/errors/reconnection-in-progress.js +0 -33
- package/dist/common/errors/reconnection-in-progress.js.map +0 -1
- package/dist/common/errors/reconnection.d.ts +0 -15
- package/dist/common/errors/stats.d.ts +0 -15
- package/dist/common/errors/webex-errors.d.ts +0 -93
- package/dist/common/errors/webex-meetings-error.d.ts +0 -20
- package/dist/common/events/events-scope.d.ts +0 -17
- package/dist/common/events/events.d.ts +0 -12
- package/dist/common/events/trigger-proxy.d.ts +0 -2
- package/dist/common/events/util.d.ts +0 -2
- package/dist/common/logs/logger-config.d.ts +0 -2
- package/dist/common/logs/logger-proxy.d.ts +0 -2
- package/dist/common/logs/request.d.ts +0 -36
- package/dist/common/queue.d.ts +0 -34
- package/dist/config.d.ts +0 -72
- package/dist/constants.d.ts +0 -1088
- package/dist/controls-options-manager/constants.d.ts +0 -4
- package/dist/controls-options-manager/enums.d.ts +0 -15
- package/dist/controls-options-manager/index.d.ts +0 -136
- package/dist/controls-options-manager/types.d.ts +0 -43
- package/dist/controls-options-manager/util.d.ts +0 -1
- package/dist/index.d.ts +0 -7
- package/dist/interceptors/index.d.ts +0 -2
- package/dist/interceptors/locusRetry.d.ts +0 -27
- package/dist/interpretation/collection.d.ts +0 -5
- package/dist/interpretation/index.d.ts +0 -5
- package/dist/interpretation/siLanguage.d.ts +0 -5
- package/dist/locus-info/controlsUtils.d.ts +0 -2
- package/dist/locus-info/embeddedAppsUtils.d.ts +0 -2
- package/dist/locus-info/fullState.d.ts +0 -2
- package/dist/locus-info/hostUtils.d.ts +0 -2
- package/dist/locus-info/index.d.ts +0 -322
- package/dist/locus-info/infoUtils.d.ts +0 -2
- package/dist/locus-info/mediaSharesUtils.d.ts +0 -2
- package/dist/locus-info/parser.d.ts +0 -272
- package/dist/locus-info/selfUtils.d.ts +0 -2
- package/dist/media/index.d.ts +0 -34
- package/dist/media/properties.d.ts +0 -93
- package/dist/media/util.d.ts +0 -2
- package/dist/mediaQualityMetrics/config.d.ts +0 -241
- package/dist/mediaQualityMetrics/config.js +0 -502
- package/dist/mediaQualityMetrics/config.js.map +0 -1
- package/dist/meeting/effectsState.js +0 -260
- package/dist/meeting/effectsState.js.map +0 -1
- package/dist/meeting/in-meeting-actions.d.ts +0 -167
- package/dist/meeting/index.d.ts +0 -1825
- package/dist/meeting/locusMediaRequest.d.ts +0 -74
- package/dist/meeting/muteState.d.ts +0 -178
- package/dist/meeting/request.d.ts +0 -295
- package/dist/meeting/request.type.d.ts +0 -11
- package/dist/meeting/state.d.ts +0 -9
- package/dist/meeting/util.d.ts +0 -119
- package/dist/meeting/voicea-meeting.d.ts +0 -16
- package/dist/meeting-info/collection.d.ts +0 -20
- package/dist/meeting-info/index.d.ts +0 -69
- package/dist/meeting-info/meeting-info-v2.d.ts +0 -123
- package/dist/meeting-info/request.d.ts +0 -22
- package/dist/meeting-info/util.d.ts +0 -2
- package/dist/meeting-info/utilv2.d.ts +0 -2
- package/dist/meetings/collection.d.ts +0 -40
- package/dist/meetings/index.d.ts +0 -390
- package/dist/meetings/meetings.types.d.ts +0 -4
- package/dist/meetings/request.d.ts +0 -27
- package/dist/meetings/util.d.ts +0 -18
- package/dist/member/index.d.ts +0 -160
- package/dist/member/member.types.js +0 -17
- package/dist/member/member.types.js.map +0 -1
- package/dist/member/types.d.ts +0 -32
- package/dist/member/util.d.ts +0 -2
- package/dist/members/collection.d.ts +0 -29
- package/dist/members/index.d.ts +0 -353
- package/dist/members/request.d.ts +0 -114
- package/dist/members/types.d.ts +0 -25
- package/dist/members/util.d.ts +0 -215
- package/dist/metrics/config.js +0 -276
- package/dist/metrics/config.js.map +0 -1
- package/dist/metrics/constants.d.ts +0 -70
- package/dist/metrics/index.d.ts +0 -45
- package/dist/multistream/mediaRequestManager.d.ts +0 -119
- package/dist/multistream/receiveSlot.d.ts +0 -68
- package/dist/multistream/receiveSlotManager.d.ts +0 -56
- package/dist/multistream/remoteMedia.d.ts +0 -72
- package/dist/multistream/remoteMediaGroup.d.ts +0 -49
- package/dist/multistream/remoteMediaManager.d.ts +0 -300
- package/dist/multistream/sendSlotManager.d.ts +0 -69
- package/dist/networkQualityMonitor/index.d.ts +0 -70
- package/dist/networkQualityMonitor/index.js +0 -221
- package/dist/networkQualityMonitor/index.js.map +0 -1
- package/dist/peer-connection-manager/index.js +0 -671
- package/dist/peer-connection-manager/index.js.map +0 -1
- package/dist/peer-connection-manager/util.js +0 -109
- package/dist/peer-connection-manager/util.js.map +0 -1
- package/dist/personal-meeting-room/index.d.ts +0 -47
- package/dist/personal-meeting-room/request.d.ts +0 -14
- package/dist/personal-meeting-room/util.d.ts +0 -2
- package/dist/reachability/clusterReachability.d.ts +0 -109
- package/dist/reachability/index.d.ts +0 -105
- package/dist/reachability/request.d.ts +0 -39
- package/dist/reachability/util.d.ts +0 -8
- package/dist/reactions/constants.d.ts +0 -3
- package/dist/reactions/reactions.d.ts +0 -4
- package/dist/reactions/reactions.type.d.ts +0 -52
- package/dist/reconnection-manager/index.d.ts +0 -136
- package/dist/recording-controller/enums.d.ts +0 -7
- package/dist/recording-controller/index.d.ts +0 -207
- package/dist/recording-controller/util.d.ts +0 -14
- package/dist/roap/collection.js +0 -62
- package/dist/roap/collection.js.map +0 -1
- package/dist/roap/handler.js +0 -275
- package/dist/roap/handler.js.map +0 -1
- package/dist/roap/index.d.ts +0 -86
- package/dist/roap/request.d.ts +0 -39
- package/dist/roap/state.js +0 -126
- package/dist/roap/state.js.map +0 -1
- package/dist/roap/turnDiscovery.d.ts +0 -155
- package/dist/roap/util.js +0 -75
- package/dist/roap/util.js.map +0 -1
- package/dist/rtcMetrics/constants.d.ts +0 -4
- package/dist/rtcMetrics/constants.js +0 -11
- package/dist/rtcMetrics/constants.js.map +0 -1
- package/dist/rtcMetrics/index.d.ts +0 -61
- package/dist/rtcMetrics/index.js +0 -197
- package/dist/rtcMetrics/index.js.map +0 -1
- package/dist/statsAnalyzer/global.d.ts +0 -36
- package/dist/statsAnalyzer/global.js +0 -126
- package/dist/statsAnalyzer/global.js.map +0 -1
- package/dist/statsAnalyzer/index.d.ts +0 -217
- package/dist/statsAnalyzer/index.js +0 -1013
- package/dist/statsAnalyzer/index.js.map +0 -1
- package/dist/statsAnalyzer/mqaUtil.d.ts +0 -48
- package/dist/statsAnalyzer/mqaUtil.js +0 -179
- package/dist/statsAnalyzer/mqaUtil.js.map +0 -1
- package/dist/transcription/index.d.ts +0 -64
- package/dist/types/common/errors/reconnection-in-progress.d.ts +0 -9
- package/dist/types/mediaQualityMetrics/config.d.ts +0 -241
- package/dist/types/networkQualityMonitor/index.d.ts +0 -70
- package/dist/types/rtcMetrics/constants.d.ts +0 -4
- package/dist/types/rtcMetrics/index.d.ts +0 -71
- package/dist/types/statsAnalyzer/global.d.ts +0 -36
- package/dist/types/statsAnalyzer/index.d.ts +0 -217
- package/dist/types/statsAnalyzer/mqaUtil.d.ts +0 -48
- package/dist/webinar/collection.d.ts +0 -16
- package/dist/webinar/index.d.ts +0 -5
@@ -287,6 +287,75 @@ var Utils = /*#__PURE__*/function () {
|
|
287
287
|
});
|
288
288
|
}
|
289
289
|
|
290
|
+
/**
|
291
|
+
* Validate if a annotation-scoped control is allowed to be sent to the service.
|
292
|
+
*
|
293
|
+
* @param {ControlConfig<AnnotationProperties>} control - Annotation control config to validate
|
294
|
+
* @param {Array<string>} displayHints - All available hints
|
295
|
+
* @returns {boolean} - True if all of the actions are allowed.
|
296
|
+
*/
|
297
|
+
}, {
|
298
|
+
key: "canUpdateAnnotation",
|
299
|
+
value: function canUpdateAnnotation(control, displayHints) {
|
300
|
+
var requiredHints = [];
|
301
|
+
if (control.properties.enabled === true) {
|
302
|
+
requiredHints.push(_constants.DISPLAY_HINTS.ENABLE_ANNOTATION_MEETING_OPTION);
|
303
|
+
}
|
304
|
+
if (control.properties.enabled === false) {
|
305
|
+
requiredHints.push(_constants.DISPLAY_HINTS.DISABLE_ANNOTATION_MEETING_OPTION);
|
306
|
+
}
|
307
|
+
return Utils.hasHints({
|
308
|
+
requiredHints: requiredHints,
|
309
|
+
displayHints: displayHints
|
310
|
+
});
|
311
|
+
}
|
312
|
+
|
313
|
+
/**
|
314
|
+
* Validate if a rdc-scoped control is allowed to be sent to the service.
|
315
|
+
*
|
316
|
+
* @param {ControlConfig<RemoteDesktopControlProperties>} control - Remote Desktop Control config to validate
|
317
|
+
* @param {Array<string>} displayHints - All available hints
|
318
|
+
* @returns {boolean} - True if all of the actions are allowed.
|
319
|
+
*/
|
320
|
+
}, {
|
321
|
+
key: "canUpdateRemoteDesktopControl",
|
322
|
+
value: function canUpdateRemoteDesktopControl(control, displayHints) {
|
323
|
+
var requiredHints = [];
|
324
|
+
if (control.properties.enabled === true) {
|
325
|
+
requiredHints.push(_constants.DISPLAY_HINTS.ENABLE_RDC_MEETING_OPTION);
|
326
|
+
}
|
327
|
+
if (control.properties.enabled === false) {
|
328
|
+
requiredHints.push(_constants.DISPLAY_HINTS.DISABLE_RDC_MEETING_OPTION);
|
329
|
+
}
|
330
|
+
return Utils.hasHints({
|
331
|
+
requiredHints: requiredHints,
|
332
|
+
displayHints: displayHints
|
333
|
+
});
|
334
|
+
}
|
335
|
+
|
336
|
+
/**
|
337
|
+
* Validate if a pollingQA-scoped control is allowed to be sent to the service.
|
338
|
+
*
|
339
|
+
* @param {ControlConfig<PollingQAProperties>} control - Polling QA config to validate
|
340
|
+
* @param {Array<string>} displayHints - All available hints
|
341
|
+
* @returns {boolean} - True if all of the actions are allowed.
|
342
|
+
*/
|
343
|
+
}, {
|
344
|
+
key: "canUpdatePollingQA",
|
345
|
+
value: function canUpdatePollingQA(control, displayHints) {
|
346
|
+
var requiredHints = [];
|
347
|
+
if (control.properties.enabled === true) {
|
348
|
+
requiredHints.push(_constants.DISPLAY_HINTS.ENABLE_ATTENDEE_START_POLLING_QA);
|
349
|
+
}
|
350
|
+
if (control.properties.enabled === false) {
|
351
|
+
requiredHints.push(_constants.DISPLAY_HINTS.DISABLE_ATTENDEE_START_POLLING_QA);
|
352
|
+
}
|
353
|
+
return Utils.hasHints({
|
354
|
+
requiredHints: requiredHints,
|
355
|
+
displayHints: displayHints
|
356
|
+
});
|
357
|
+
}
|
358
|
+
|
290
359
|
/**
|
291
360
|
* Validate that a control can be sent to the service based on the provided
|
292
361
|
* display hints.
|
@@ -318,6 +387,15 @@ var Utils = /*#__PURE__*/function () {
|
|
318
387
|
case _enums.Control.viewTheParticipantList:
|
319
388
|
determinant = Utils.canUpdateViewTheParticipantsList(control, displayHints);
|
320
389
|
break;
|
390
|
+
case _enums.Control.annotation:
|
391
|
+
determinant = Utils.canUpdateAnnotation(control, displayHints);
|
392
|
+
break;
|
393
|
+
case _enums.Control.rdc:
|
394
|
+
determinant = Utils.canUpdateRemoteDesktopControl(control, displayHints);
|
395
|
+
break;
|
396
|
+
case _enums.Control.pollingQA:
|
397
|
+
determinant = Utils.canUpdatePollingQA(control, displayHints);
|
398
|
+
break;
|
321
399
|
default:
|
322
400
|
determinant = false;
|
323
401
|
}
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_constants","require","_enums","Utils","_classCallCheck2","default","_createClass2","key","value","canSetMuteOnEntry","displayHints","includes","DISPLAY_HINTS","ENABLE_MUTE_ON_ENTRY","canSetDisallowUnmute","ENABLE_HARD_MUTE","canUnsetMuteOnEntry","DISABLE_MUTE_ON_ENTRY","canUnsetDisallowUnmute","DISABLE_HARD_MUTE","canSetMuted","MUTE_ALL","canUnsetMuted","UNMUTE_ALL","hasHints","config","requiredHints","every","hint","hasPolicies","requiredPolicies","_config$policies","policies","canUpdateAudio","control","properties","muted","push","disallowUnmute","muteOnEntry","canUpdateRaiseHand","enabled","ENABLE_RAISE_HAND","DISABLE_RAISE_HAND","canUpdateReactions","showDisplayNameWithReactions","undefined","ENABLE_SHOW_DISPLAY_NAME","DISABLE_SHOW_DISPLAY_NAME","ENABLE_REACTIONS","DISABLE_REACTIONS","canUpdateShareControl","SHARE_CONTROL","canUpdateViewTheParticipantsList","ENABLE_VIEW_THE_PARTICIPANT_LIST","DISABLE_VIEW_THE_PARTICIPANT_LIST","panelistEnabled","ENABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST","DISABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST","attendeeCount","ENABLE_SHOW_ATTENDEE_COUNT","DISABLE_SHOW_ATTENDEE_COUNT","canUpdateVideo","ENABLE_VIDEO","DISABLE_VIDEO","canUpdate","determinant","scope","Control","audio","raiseHand","reactions","shareControl","video","viewTheParticipantList","_default","exports"],"sources":["util.ts"],"sourcesContent":["import {DISPLAY_HINTS} from '../constants';\nimport {Control} from './enums';\nimport {\n ControlConfig,\n AudioProperties,\n RaiseHandProperties,\n ReactionsProperties,\n ViewTheParticipantListProperties,\n VideoProperties,\n} from './types';\n\n/**\n * The Controls Options Manager utilities\n *\n * @internal\n */\nclass Utils {\n /**\n * Validate if enabling mute on entry can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetMuteOnEntry(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY);\n }\n\n /**\n * Validate if allowing unmuting can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetDisallowUnmute(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.ENABLE_HARD_MUTE);\n }\n\n /**\n * Validate if disabling mute on entry can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetMuteOnEntry(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY);\n }\n\n /**\n * Validate if enabling muting can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetDisallowUnmute(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.DISABLE_HARD_MUTE);\n }\n\n /**\n * Validate if muting all can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetMuted(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.MUTE_ALL);\n }\n\n /**\n * Validate if unmuting all can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetMuted(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.UNMUTE_ALL);\n }\n\n /**\n * Validate an array of hints are allowed based on a full collection of hints.\n *\n * @param {Object} config - Configuration Object.\n * @param {Array<string>} config.requiredHints - Hints required for validation.\n * @param {Array<string>} config.displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static hasHints(config: {requiredHints: Array<string>; displayHints: Array<string>}) {\n const {requiredHints, displayHints} = config;\n\n return requiredHints.every((hint) => displayHints.includes(hint));\n }\n\n /**\n * Validate that the self policy object contains the required policies.\n *\n * @param {Object} config - Configuration Object.\n * @param {Array<string>} config.requiredPolicies - Policies required for validation.\n * @param {Array<string>} config.policies - All available policies.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static hasPolicies(config: {requiredPolicies: Array<string>; policies: Array<string>}) {\n const {requiredPolicies, policies = {}} = config;\n\n return requiredPolicies.every((hint) => policies[hint]);\n }\n\n /**\n * Validate if an audio-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<AudioProperties>} control - Audio control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateAudio(\n control: ControlConfig<AudioProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.muted === true) {\n requiredHints.push(DISPLAY_HINTS.MUTE_ALL);\n }\n if (control.properties.muted === false) {\n requiredHints.push(DISPLAY_HINTS.UNMUTE_ALL);\n }\n if (control.properties.disallowUnmute === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_HARD_MUTE);\n }\n if (control.properties.disallowUnmute === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_HARD_MUTE);\n }\n if (control.properties.muteOnEntry === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY);\n }\n if (control.properties.muteOnEntry === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n public static canUpdateRaiseHand(\n control: ControlConfig<RaiseHandProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_RAISE_HAND);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_RAISE_HAND);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if an reactions-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<ReactionsProperties>} control - Reaction control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateReactions(\n control: ControlConfig<ReactionsProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n // This additional if statement avoids the display hint discrepency due to\n // the service blocking partial requests with this property only.\n if (control.properties.showDisplayNameWithReactions !== undefined) {\n if (control.properties.showDisplayNameWithReactions === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_SHOW_DISPLAY_NAME);\n }\n if (control.properties.showDisplayNameWithReactions === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_SHOW_DISPLAY_NAME);\n }\n } else {\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_REACTIONS);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_REACTIONS);\n }\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if an share-control-scoped control is allowed to be sent to the service.\n *\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateShareControl(displayHints: Array<string>) {\n return Utils.hasHints({requiredHints: [DISPLAY_HINTS.SHARE_CONTROL], displayHints});\n }\n\n /**\n * Validate if an view-the-participants-list-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<ViewTheParticipantListProperties>} control - View Participants List control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateViewTheParticipantsList(\n control: ControlConfig<ViewTheParticipantListProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST);\n }\n if (control.properties.panelistEnabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST);\n }\n if (control.properties.panelistEnabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST);\n }\n if (control.properties.attendeeCount === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_SHOW_ATTENDEE_COUNT);\n }\n if (control.properties.attendeeCount === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_SHOW_ATTENDEE_COUNT);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a video-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<VideoProperties>} control - Video control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateVideo(\n control: ControlConfig<VideoProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIDEO);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIDEO);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate that a control can be sent to the service based on the provided\n * display hints.\n *\n * @param {ControlConfig} control - Control to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdate(control: ControlConfig, displayHints: Array<string>) {\n let determinant: boolean;\n\n switch (control.scope) {\n case Control.audio:\n determinant = Utils.canUpdateAudio(control as ControlConfig<AudioProperties>, displayHints);\n break;\n\n case Control.raiseHand:\n determinant = Utils.canUpdateRaiseHand(\n control as ControlConfig<RaiseHandProperties>,\n displayHints\n );\n break;\n\n case Control.reactions:\n determinant = Utils.canUpdateReactions(\n control as ControlConfig<ReactionsProperties>,\n displayHints\n );\n break;\n\n case Control.shareControl:\n determinant = Utils.canUpdateShareControl(displayHints);\n break;\n\n case Control.video:\n determinant = Utils.canUpdateVideo(control as ControlConfig<VideoProperties>, displayHints);\n break;\n\n case Control.viewTheParticipantList:\n determinant = Utils.canUpdateViewTheParticipantsList(\n control as ControlConfig<ViewTheParticipantListProperties>,\n displayHints\n );\n break;\n\n default:\n determinant = false;\n }\n\n return determinant;\n }\n}\n\nexport default Utils;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAUA;AACA;AACA;AACA;AACA;AAJA,IAKME,KAAK;EAAA,SAAAA,MAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAF,KAAA;EAAA;EAAA,IAAAG,aAAA,CAAAD,OAAA,EAAAF,KAAA;IAAAI,GAAA;IAAAC,KAAA;IACT;AACF;AACA;AACA;AACA;AACA;IACE,SAAAC,kBAAgCC,YAA2B,EAAW;MACpE,OAAOA,YAAY,CAACC,QAAQ,CAACC,wBAAa,CAACC,oBAAoB,CAAC;IAClE;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAAN,GAAA;IAAAC,KAAA,EAMA,SAAAM,q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D,KAAK,CAACyC,kBAAkB,CACpCV,OAAO,EACPxB,YACF,CAAC;UACD;QAEF,KAAK0D,cAAO,CAACI,YAAY;UACvBN,WAAW,GAAG/D,KAAK,CAACgD,qBAAqB,CAACzC,YAAY,CAAC;UACvD;QAEF,KAAK0D,cAAO,CAACK,KAAK;UAChBP,WAAW,GAAG/D,KAAK,CAAC2D,cAAc,CAAC5B,OAAO,EAAoCxB,YAAY,CAAC;UAC3F;QAEF,KAAK0D,cAAO,CAACM,sBAAsB;UACjCR,WAAW,GAAG/D,KAAK,CAACkD,gCAAgC,CAClDnB,OAAO,EACPxB,YACF,CAAC;UACD;QAEF;UACEwD,WAAW,GAAG,KAAK;MACvB;MAEA,OAAOA,WAAW;IACpB;EAAC;EAAA,OAAA/D,KAAA;AAAA;AAAA,IAAAwE,QAAA,GAAAC,OAAA,CAAAvE,OAAA,GAGYF,KAAK"}
|
1
|
+
{"version":3,"names":["_constants","require","_enums","Utils","_classCallCheck2","default","_createClass2","key","value","canSetMuteOnEntry","displayHints","includes","DISPLAY_HINTS","ENABLE_MUTE_ON_ENTRY","canSetDisallowUnmute","ENABLE_HARD_MUTE","canUnsetMuteOnEntry","DISABLE_MUTE_ON_ENTRY","canUnsetDisallowUnmute","DISABLE_HARD_MUTE","canSetMuted","MUTE_ALL","canUnsetMuted","UNMUTE_ALL","hasHints","config","requiredHints","every","hint","hasPolicies","requiredPolicies","_config$policies","policies","canUpdateAudio","control","properties","muted","push","disallowUnmute","muteOnEntry","canUpdateRaiseHand","enabled","ENABLE_RAISE_HAND","DISABLE_RAISE_HAND","canUpdateReactions","showDisplayNameWithReactions","undefined","ENABLE_SHOW_DISPLAY_NAME","DISABLE_SHOW_DISPLAY_NAME","ENABLE_REACTIONS","DISABLE_REACTIONS","canUpdateShareControl","SHARE_CONTROL","canUpdateViewTheParticipantsList","ENABLE_VIEW_THE_PARTICIPANT_LIST","DISABLE_VIEW_THE_PARTICIPANT_LIST","panelistEnabled","ENABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST","DISABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST","attendeeCount","ENABLE_SHOW_ATTENDEE_COUNT","DISABLE_SHOW_ATTENDEE_COUNT","canUpdateVideo","ENABLE_VIDEO","DISABLE_VIDEO","canUpdateAnnotation","ENABLE_ANNOTATION_MEETING_OPTION","DISABLE_ANNOTATION_MEETING_OPTION","canUpdateRemoteDesktopControl","ENABLE_RDC_MEETING_OPTION","DISABLE_RDC_MEETING_OPTION","canUpdatePollingQA","ENABLE_ATTENDEE_START_POLLING_QA","DISABLE_ATTENDEE_START_POLLING_QA","canUpdate","determinant","scope","Control","audio","raiseHand","reactions","shareControl","video","viewTheParticipantList","annotation","rdc","pollingQA","_default","exports"],"sources":["util.ts"],"sourcesContent":["import {DISPLAY_HINTS} from '../constants';\nimport {Control} from './enums';\nimport {\n ControlConfig,\n AudioProperties,\n RaiseHandProperties,\n ReactionsProperties,\n ViewTheParticipantListProperties,\n VideoProperties,\n type RemoteDesktopControlProperties,\n type AnnotationProperties,\n type PollingQAProperties,\n} from './types';\n\n/**\n * The Controls Options Manager utilities\n *\n * @internal\n */\nclass Utils {\n /**\n * Validate if enabling mute on entry can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetMuteOnEntry(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY);\n }\n\n /**\n * Validate if allowing unmuting can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetDisallowUnmute(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.ENABLE_HARD_MUTE);\n }\n\n /**\n * Validate if disabling mute on entry can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetMuteOnEntry(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY);\n }\n\n /**\n * Validate if enabling muting can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetDisallowUnmute(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.DISABLE_HARD_MUTE);\n }\n\n /**\n * Validate if muting all can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canSetMuted(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.MUTE_ALL);\n }\n\n /**\n * Validate if unmuting all can be set.\n *\n * @param {Array<string>} displayHints - Display Hints to use when validating.\n * @returns {boolean} - True if the action is allowed.\n */\n public static canUnsetMuted(displayHints: Array<string>): boolean {\n return displayHints.includes(DISPLAY_HINTS.UNMUTE_ALL);\n }\n\n /**\n * Validate an array of hints are allowed based on a full collection of hints.\n *\n * @param {Object} config - Configuration Object.\n * @param {Array<string>} config.requiredHints - Hints required for validation.\n * @param {Array<string>} config.displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static hasHints(config: {requiredHints: Array<string>; displayHints: Array<string>}) {\n const {requiredHints, displayHints} = config;\n\n return requiredHints.every((hint) => displayHints.includes(hint));\n }\n\n /**\n * Validate that the self policy object contains the required policies.\n *\n * @param {Object} config - Configuration Object.\n * @param {Array<string>} config.requiredPolicies - Policies required for validation.\n * @param {Array<string>} config.policies - All available policies.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static hasPolicies(config: {requiredPolicies: Array<string>; policies: Array<string>}) {\n const {requiredPolicies, policies = {}} = config;\n\n return requiredPolicies.every((hint) => policies[hint]);\n }\n\n /**\n * Validate if an audio-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<AudioProperties>} control - Audio control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateAudio(\n control: ControlConfig<AudioProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.muted === true) {\n requiredHints.push(DISPLAY_HINTS.MUTE_ALL);\n }\n if (control.properties.muted === false) {\n requiredHints.push(DISPLAY_HINTS.UNMUTE_ALL);\n }\n if (control.properties.disallowUnmute === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_HARD_MUTE);\n }\n if (control.properties.disallowUnmute === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_HARD_MUTE);\n }\n if (control.properties.muteOnEntry === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_MUTE_ON_ENTRY);\n }\n if (control.properties.muteOnEntry === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_MUTE_ON_ENTRY);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n public static canUpdateRaiseHand(\n control: ControlConfig<RaiseHandProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_RAISE_HAND);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_RAISE_HAND);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if an reactions-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<ReactionsProperties>} control - Reaction control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateReactions(\n control: ControlConfig<ReactionsProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n // This additional if statement avoids the display hint discrepency due to\n // the service blocking partial requests with this property only.\n if (control.properties.showDisplayNameWithReactions !== undefined) {\n if (control.properties.showDisplayNameWithReactions === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_SHOW_DISPLAY_NAME);\n }\n if (control.properties.showDisplayNameWithReactions === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_SHOW_DISPLAY_NAME);\n }\n } else {\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_REACTIONS);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_REACTIONS);\n }\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if an share-control-scoped control is allowed to be sent to the service.\n *\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateShareControl(displayHints: Array<string>) {\n return Utils.hasHints({requiredHints: [DISPLAY_HINTS.SHARE_CONTROL], displayHints});\n }\n\n /**\n * Validate if an view-the-participants-list-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<ViewTheParticipantListProperties>} control - View Participants List control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateViewTheParticipantsList(\n control: ControlConfig<ViewTheParticipantListProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST);\n }\n if (control.properties.panelistEnabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST);\n }\n if (control.properties.panelistEnabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIEW_THE_PARTICIPANT_LIST_PANELIST);\n }\n if (control.properties.attendeeCount === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_SHOW_ATTENDEE_COUNT);\n }\n if (control.properties.attendeeCount === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_SHOW_ATTENDEE_COUNT);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a video-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<VideoProperties>} control - Video control config to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateVideo(\n control: ControlConfig<VideoProperties>,\n displayHints: Array<string>\n ) {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_VIDEO);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_VIDEO);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a annotation-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<AnnotationProperties>} control - Annotation control config to validate\n * @param {Array<string>} displayHints - All available hints\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateAnnotation(\n control: ControlConfig<AnnotationProperties>,\n displayHints: Array<string>\n ): boolean {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_ANNOTATION_MEETING_OPTION);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_ANNOTATION_MEETING_OPTION);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a rdc-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<RemoteDesktopControlProperties>} control - Remote Desktop Control config to validate\n * @param {Array<string>} displayHints - All available hints\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdateRemoteDesktopControl(\n control: ControlConfig<RemoteDesktopControlProperties>,\n displayHints: Array<string>\n ): boolean {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_RDC_MEETING_OPTION);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_RDC_MEETING_OPTION);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate if a pollingQA-scoped control is allowed to be sent to the service.\n *\n * @param {ControlConfig<PollingQAProperties>} control - Polling QA config to validate\n * @param {Array<string>} displayHints - All available hints\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdatePollingQA(\n control: ControlConfig<PollingQAProperties>,\n displayHints: Array<string>\n ): boolean {\n const requiredHints = [];\n\n if (control.properties.enabled === true) {\n requiredHints.push(DISPLAY_HINTS.ENABLE_ATTENDEE_START_POLLING_QA);\n }\n if (control.properties.enabled === false) {\n requiredHints.push(DISPLAY_HINTS.DISABLE_ATTENDEE_START_POLLING_QA);\n }\n\n return Utils.hasHints({requiredHints, displayHints});\n }\n\n /**\n * Validate that a control can be sent to the service based on the provided\n * display hints.\n *\n * @param {ControlConfig} control - Control to validate.\n * @param {Array<string>} displayHints - All available hints.\n * @returns {boolean} - True if all of the actions are allowed.\n */\n public static canUpdate(control: ControlConfig, displayHints: Array<string>) {\n let determinant: boolean;\n\n switch (control.scope) {\n case Control.audio:\n determinant = Utils.canUpdateAudio(control as ControlConfig<AudioProperties>, displayHints);\n break;\n\n case Control.raiseHand:\n determinant = Utils.canUpdateRaiseHand(\n control as ControlConfig<RaiseHandProperties>,\n displayHints\n );\n break;\n\n case Control.reactions:\n determinant = Utils.canUpdateReactions(\n control as ControlConfig<ReactionsProperties>,\n displayHints\n );\n break;\n\n case Control.shareControl:\n determinant = Utils.canUpdateShareControl(displayHints);\n break;\n\n case Control.video:\n determinant = Utils.canUpdateVideo(control as ControlConfig<VideoProperties>, displayHints);\n break;\n\n case Control.viewTheParticipantList:\n determinant = Utils.canUpdateViewTheParticipantsList(\n control as ControlConfig<ViewTheParticipantListProperties>,\n displayHints\n );\n break;\n\n case Control.annotation:\n determinant = Utils.canUpdateAnnotation(\n control as ControlConfig<AnnotationProperties>,\n displayHints\n );\n break;\n\n case Control.rdc:\n determinant = Utils.canUpdateRemoteDesktopControl(\n control as ControlConfig<RemoteDesktopControlProperties>,\n displayHints\n );\n break;\n\n case Control.pollingQA:\n determinant = Utils.canUpdatePollingQA(\n control as ControlConfig<PollingQAProperties>,\n displayHints\n );\n break;\n\n default:\n determinant = false;\n }\n\n return determinant;\n }\n}\n\nexport default Utils;\n"],"mappings":";;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,MAAA,GAAAD,OAAA;AAaA;AACA;AACA;AACA;AACA;AAJA,IAKME,KAAK;EAAA,SAAAA,MAAA;IAAA,IAAAC,gBAAA,CAAAC,OAAA,QAAAF,KAAA;EAAA;EAAA,IAAAG,aAAA,CAAAD,OAAA,EAAAF,KAAA;IAAAI,GAAA;IAAAC,KAAA;IACT;AACF;AACA;AACA;AACA;AACA;IACE,SAAAC,kBAAgCC,YAA2B,EAAW;MACpE,OAAOA,YAAY,CAACC,QAAQ,CAACC,wBAAa,CAACC,oBAAoB,CAAC;IAClE;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAAN,GAAA;IAAAC,KAAA,EAMA,SAAAM,qBAAmCJ,YAA2B,EAAW;MACvE,OAAOA,YAAY,CAACC,QAAQ,CAACC,wBAAa,CAACG,gBAAgB,CAAC;IAC9D;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAAR,GAAA;IAAAC,KAAA,EAMA,SAAAQ,oBAAkCN,YAA2B,EAAW;MACtE,OAAOA,YAAY,CAACC,QAAQ,CAACC,wBAAa,CAACK,qBAAqB,CAAC;IACnE;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAAV,GAAA;IAAAC,KAAA,EAMA,SAAAU,uBAAqCR,YAA2B,EAAW;MACzE,OAAOA,YAAY,CAACC,QAAQ,CAACC,wBAAa,CAACO,iBAAiB,CAAC;IAC/D;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAAZ,GAAA;IAAAC,KAAA,EAMA,SAAAY,YAA0BV,YAA2B,EAAW;MAC9D,OAAOA,YAAY,CAACC,QAAQ,CAACC,wBAAa,CAACS,QAAQ,CAAC;IACtD;;IAEA;AACF;AACA;AACA;AACA;AACA;EALE;IAAAd,GAAA;IAAAC,KAAA,EA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,CAACkD,gCAAgC,CAClDnB,OAAO,EACPxB,YACF,CAAC;UACD;QAEF,KAAKmE,cAAO,CAACO,UAAU;UACrBT,WAAW,GAAGxE,KAAK,CAAC8D,mBAAmB,CACrC/B,OAAO,EACPxB,YACF,CAAC;UACD;QAEF,KAAKmE,cAAO,CAACQ,GAAG;UACdV,WAAW,GAAGxE,KAAK,CAACiE,6BAA6B,CAC/ClC,OAAO,EACPxB,YACF,CAAC;UACD;QAEF,KAAKmE,cAAO,CAACS,SAAS;UACpBX,WAAW,GAAGxE,KAAK,CAACoE,kBAAkB,CACpCrC,OAAO,EACPxB,YACF,CAAC;UACD;QAEF;UACEiE,WAAW,GAAG,KAAK;MACvB;MAEA,OAAOA,WAAW;IACpB;EAAC;EAAA,OAAAxE,KAAA;AAAA;AAAA,IAAAoF,QAAA,GAAAC,OAAA,CAAAnF,OAAA,GAGYF,KAAK"}
|
@@ -56,13 +56,13 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
56
56
|
derived: {
|
57
57
|
shouldQuerySupportLanguages: {
|
58
58
|
cache: false,
|
59
|
-
deps: ['canManageInterpreters', 'hostSIEnabled'],
|
59
|
+
deps: ['canManageInterpreters', 'hostSIEnabled', 'locusUrl'],
|
60
60
|
/**
|
61
61
|
* Returns should query support languages or not
|
62
62
|
* @returns {boolean}
|
63
63
|
*/
|
64
64
|
fn: function fn() {
|
65
|
-
return !!(this.canManageInterpreters && this.hostSIEnabled);
|
65
|
+
return !!(this.canManageInterpreters && this.hostSIEnabled && this.locusUrl);
|
66
66
|
}
|
67
67
|
}
|
68
68
|
},
|
@@ -73,7 +73,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
73
73
|
initialize: function initialize() {
|
74
74
|
var _this = this;
|
75
75
|
this.listenTo(this, 'change:shouldQuerySupportLanguages', function () {
|
76
|
-
if (_this.
|
76
|
+
if (_this.shouldQuerySupportLanguages && !_this.supportLanguages) {
|
77
77
|
_this.querySupportLanguages();
|
78
78
|
}
|
79
79
|
});
|
@@ -373,7 +373,7 @@ var SimultaneousInterpretation = _webexCore.WebexPlugin.extend({
|
|
373
373
|
throw error;
|
374
374
|
});
|
375
375
|
},
|
376
|
-
version: "3.8.
|
376
|
+
version: "3.8.1-next.10"
|
377
377
|
});
|
378
378
|
var _default = exports.default = SimultaneousInterpretation;
|
379
379
|
//# sourceMappingURL=index.js.map
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"names":["_webexCore","require","_loggerProxy","_interopRequireDefault","_constants","_collection","SimultaneousInterpretation","WebexPlugin","extend","namespace","MEETINGS","collections","siLanguages","SILanguageCollection","props","locusUrl","approvalUrl","originalLanguage","sourceLanguage","targetLanguage","receiveLanguage","order","isActive","selfParticipantId","canManageInterpreters","supportLanguages","meetingSIEnabled","hostSIEnabled","selfIsInterpreter","derived","shouldQuerySupportLanguages","cache","deps","fn","initialize","_this","listenTo","querySupportLanguages","listenToHandoffRequests","cleanUp","stopListening","locusUrlUpdate","set","approvalUrlUpdate","updateCanManageInterpreters","updateHostSIEnabled","updateMeetingSIEnabled","updateInterpretation","interpretation","updateSelfInterpretation","_ref","preTargetLanguage","_ref2","getTargetLanguageCode","_this$siLanguages$get","get","languageCode","_this2","request","method","HTTP_VERBS","GET","uri","concat","then","result","_result$body","body","trigger","INTERPRETATION","EVENTS","SUPPORT_LANGUAGES_UPDATE","catch","error","LoggerProxy","logger","getInterpreters","updateInterpreters","interpreters","PATCH","changeDirection","_promise","default","reject","Error","_this3","webex","internal","mercury","event","_event$data","_event$data$approval","data","approval","resourceType","RESOURCE_TYPE","_receivers$","_event$data$approval2","receivers","initiator","actionType","url","receiverId","participantId","isReceiver","senderId","isSender","HANDOFF_REQUESTS_ARRIVED","handoffInterpreter","POST","ACTION_TYPE","OFFERED","requestHandoff","REQUESTED","acceptRequest","PUT","ACCEPTED","declineRequest","DECLINED","version","_default","exports"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2023 Cisco Systems, Inc. See LICENSE file.\n */\nimport {WebexPlugin} from '@webex/webex-core';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {HTTP_VERBS, INTERPRETATION, MEETINGS} from '../constants';\n\nimport SILanguageCollection from './collection';\n\n/**\n * @class SimultaneousInterpretation\n */\nconst SimultaneousInterpretation = WebexPlugin.extend({\n namespace: MEETINGS,\n collections: {\n siLanguages: SILanguageCollection,\n },\n\n props: {\n locusUrl: 'string', // appears current meeting's locus url\n approvalUrl: 'string', // appears current meeting's approval url for handoff between interpreters\n originalLanguage: 'string', // appears current meeting's original language\n sourceLanguage: 'string', // appears self interpreter's source language\n targetLanguage: 'string', // appears self interpreter's target language\n receiveLanguage: 'string', // appears self's receive language\n order: 'number', // appears the order of self as interpreter\n isActive: 'boolean', // appears self is interpreter and is active\n selfParticipantId: 'string', // appears the self participant id\n canManageInterpreters: 'boolean', // appears the ability to manage interpreters\n supportLanguages: 'array', // appears the support languages\n meetingSIEnabled: 'boolean', // appears the meeting support SI feature\n hostSIEnabled: 'boolean', // appears the meeting host/interpreter feature of SI enabled\n selfIsInterpreter: 'boolean', // current user is interpreter or not\n },\n derived: {\n shouldQuerySupportLanguages: {\n cache: false,\n deps: ['canManageInterpreters', 'hostSIEnabled'],\n /**\n * Returns should query support languages or not\n * @returns {boolean}\n */\n fn() {\n return !!(this.canManageInterpreters && this.hostSIEnabled);\n },\n },\n },\n /**\n * initialize for interpretation\n * @returns {void}\n */\n initialize() {\n this.listenTo(this, 'change:shouldQuerySupportLanguages', () => {\n if (this.canManageInterpreters && !this.supportLanguages) {\n this.querySupportLanguages();\n }\n });\n this.listenToHandoffRequests();\n },\n\n /**\n * Calls this to clean up listeners\n * @returns {void}\n */\n cleanUp() {\n this.stopListening();\n },\n /**\n * Update the current locus url of the meeting\n * @param {string} locusUrl // locus url\n * @returns {void}\n */\n locusUrlUpdate(locusUrl) {\n this.set('locusUrl', locusUrl);\n },\n /**\n * Update the approval url for handoff\n * @param {string} approvalUrl // approval url\n * @returns {void}\n */\n approvalUrlUpdate(approvalUrl) {\n this.set('approvalUrl', approvalUrl);\n },\n /**\n * Update whether self has capability to manage interpreters (only host can manage it)\n * @param {boolean} canManageInterpreters\n * @returns {void}\n */\n updateCanManageInterpreters(canManageInterpreters) {\n this.set('canManageInterpreters', canManageInterpreters);\n },\n /**\n * Update whether the meeting's host si is enabled or not\n * @param {boolean} hostSIEnabled\n * @returns {void}\n */\n updateHostSIEnabled(hostSIEnabled) {\n this.set('hostSIEnabled', hostSIEnabled);\n },\n\n /**\n * Update whether the meeting support SI feature or not from meeting info\n * @param {boolean} meetingSIEnabled\n * @param {boolean} selfIsInterpreter\n * @returns {void}\n */\n updateMeetingSIEnabled(meetingSIEnabled: boolean, selfIsInterpreter): void {\n this.set('meetingSIEnabled', meetingSIEnabled);\n this.set('selfIsInterpreter', selfIsInterpreter);\n },\n\n /**\n * Update the interpretation languages channels which user can choose to subscribe\n * @param {Object} interpretation\n * @returns {void}\n */\n updateInterpretation(interpretation) {\n this.siLanguages.set(interpretation?.siLanguages || []);\n },\n /**\n * Update self's interpretation information (self is interpreter)\n * @param {Object} interpretation\n * @param {String} selfParticipantId\n * @returns {bool} is target language changed\n */\n updateSelfInterpretation({interpretation, selfParticipantId}) {\n const preTargetLanguage = this.targetLanguage;\n const {originalLanguage, sourceLanguage, order, isActive, targetLanguage, receiveLanguage} =\n interpretation || {};\n this.set({originalLanguage, sourceLanguage, order, isActive, targetLanguage, receiveLanguage});\n this.set('selfParticipantId', selfParticipantId);\n this.set('selfIsInterpreter', !!targetLanguage);\n\n return !!(preTargetLanguage !== targetLanguage);\n },\n\n /**\n * Get the language code of the interpreter target language\n * @returns {number}\n */\n getTargetLanguageCode() {\n if (this.selfIsInterpreter) {\n return this.siLanguages.get(this.targetLanguage)?.languageCode;\n }\n\n return 0;\n },\n\n /**\n * query interpretation languages\n * @returns {Promise}\n */\n querySupportLanguages() {\n return this.request({\n method: HTTP_VERBS.GET,\n uri: `${this.locusUrl}/languages/interpretation`,\n })\n .then((result) => {\n this.set('supportLanguages', result.body?.siLanguages);\n this.trigger(INTERPRETATION.EVENTS.SUPPORT_LANGUAGES_UPDATE);\n })\n .catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#querySupportLanguages failed', error);\n throw error;\n });\n },\n /**\n * get interpreters of the meeting\n * @returns {Promise}\n */\n getInterpreters() {\n return this.request({\n method: HTTP_VERBS.GET,\n uri: `${this.locusUrl}/interpretation/interpreters`,\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#getInterpreters failed', error);\n throw error;\n });\n },\n /**\n * update interpreters of the meeting\n * @param {Array} interpreters\n * @returns {Promise}\n */\n updateInterpreters(interpreters) {\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri: `${this.locusUrl}/controls`,\n body: {\n interpretation: {\n interpreters,\n },\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#updateInterpreters failed', error);\n throw error;\n });\n },\n /**\n * Change direction of interpretation for an interpreter participant\n * @returns {Promise}\n */\n changeDirection() {\n if (!this.sourceLanguage || !this.targetLanguage) {\n return Promise.reject(new Error('Missing sourceLanguage or targetLanguage'));\n }\n\n if (!this.selfParticipantId) {\n return Promise.reject(new Error('Missing self participant id'));\n }\n\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri: `${this.locusUrl}/participant/${this.selfParticipantId}/controls`,\n body: {\n interpretation: {\n sourceLanguage: this.targetLanguage,\n targetLanguage: this.sourceLanguage,\n isActive: this.isActive,\n order: this.order,\n },\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#changeDirection failed', error);\n throw error;\n });\n },\n /**\n * Sets up a listener for handoff requests from mercury\n * @returns {void}\n */\n listenToHandoffRequests() {\n this.listenTo(this.webex.internal.mercury, 'event:locus.approval_request', (event) => {\n if (event?.data?.approval?.resourceType === INTERPRETATION.RESOURCE_TYPE) {\n const {receivers, initiator, actionType, url} = event.data.approval;\n const receiverId = receivers?.[0]?.participantId;\n const isReceiver = !!receiverId && receiverId === this.selfParticipantId;\n const senderId = initiator?.participantId;\n const isSender = !!senderId && senderId === this.selfParticipantId;\n if (!isReceiver && !isSender) {\n return;\n }\n this.trigger(INTERPRETATION.EVENTS.HANDOFF_REQUESTS_ARRIVED, {\n actionType,\n isReceiver,\n isSender,\n senderId,\n receiverId,\n url,\n });\n }\n });\n },\n /**\n * handoff the active interpreter role to another interpreter in same group, only the interpreter is allowed to call this api\n * @param {string} participantId the participant id you want to hand off\n * @returns {Promise}\n */\n handoffInterpreter(participantId) {\n if (!participantId) {\n return Promise.reject(new Error('Missing target participant id'));\n }\n if (!this.approvalUrl) {\n return Promise.reject(new Error('Missing approval url'));\n }\n\n return this.request({\n method: HTTP_VERBS.POST,\n uri: this.approvalUrl,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.OFFERED,\n resourceType: INTERPRETATION.RESOURCE_TYPE,\n receivers: [\n {\n participantId,\n },\n ],\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#handoffInterpreter failed', error);\n throw error;\n });\n },\n /**\n * the in-active interpreter request to hand off the active role to self\n * @returns {Promise}\n */\n requestHandoff() {\n if (!this.approvalUrl) {\n return Promise.reject(new Error('Missing approval url'));\n }\n\n return this.request({\n method: HTTP_VERBS.POST,\n uri: this.approvalUrl,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.REQUESTED,\n resourceType: INTERPRETATION.RESOURCE_TYPE,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#requestHandoff failed', error);\n throw error;\n });\n },\n /**\n * accept the request of handoff\n * @param {String} url the url get from last approval event\n * @returns {Promise}\n */\n acceptRequest(url) {\n if (!url) {\n return Promise.reject(new Error('Missing the url to accept'));\n }\n\n return this.request({\n method: HTTP_VERBS.PUT,\n uri: url,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.ACCEPTED,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#acceptRequest failed', error);\n throw error;\n });\n },\n /**\n * decline the request of handoff\n * @param {String} url the url get from last approval event\n * @returns {Promise}\n */\n declineRequest(url) {\n if (!url) {\n return Promise.reject(new Error('Missing the url to decline'));\n }\n\n return this.request({\n method: HTTP_VERBS.PUT,\n uri: url,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.DECLINED,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#declineRequest failed', error);\n throw error;\n });\n },\n});\n\nexport default SimultaneousInterpretation;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AAPA;AACA;AACA;;AAOA;AACA;AACA;AACA,IAAMK,0BAA0B,GAAGC,sBAAW,CAACC,MAAM,CAAC;EACpDC,SAAS,EAAEC,mBAAQ;EACnBC,WAAW,EAAE;IACXC,WAAW,EAAEC;EACf,CAAC;EAEDC,KAAK,EAAE;IACLC,QAAQ,EAAE,QAAQ;IAAE;IACpBC,WAAW,EAAE,QAAQ;IAAE;IACvBC,gBAAgB,EAAE,QAAQ;IAAE;IAC5BC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,eAAe,EAAE,QAAQ;IAAE;IAC3BC,KAAK,EAAE,QAAQ;IAAE;IACjBC,QAAQ,EAAE,SAAS;IAAE;IACrBC,iBAAiB,EAAE,QAAQ;IAAE;IAC7BC,qBAAqB,EAAE,SAAS;IAAE;IAClCC,gBAAgB,EAAE,OAAO;IAAE;IAC3BC,gBAAgB,EAAE,SAAS;IAAE;IAC7BC,aAAa,EAAE,SAAS;IAAE;IAC1BC,iBAAiB,EAAE,SAAS,CAAE;EAChC,CAAC;;EACDC,OAAO,EAAE;IACPC,2BAA2B,EAAE;MAC3BC,KAAK,EAAE,KAAK;MACZC,IAAI,EAAE,CAAC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AG,EAAE;IAClB,IAAI,CAACA,GAAG,EAAE;MACR,OAAOpB,QAAA,CAAAC,OAAA,CAAQC,MAAM,CAAC,IAAIC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChE;IAEA,OAAO,IAAI,CAAC1B,OAAO,CAAC;MAClBC,MAAM,EAAEC,qBAAU,CAACuD,GAAG;MACtBrD,GAAG,EAAEuC,GAAG;MACRlC,IAAI,EAAE;QACJiC,UAAU,EAAE/B,yBAAc,CAACyC,WAAW,CAACQ;MACzC;IACF,CAAC,CAAC,CAAC9C,KAAK,CAAC,UAACC,KAAK,EAAK;MAClBC,oBAAW,CAACC,MAAM,CAACF,KAAK,CAAC,8CAA8C,EAAEA,KAAK,CAAC;MAC/E,MAAMA,KAAK;IACb,CAAC,CAAC;EACJ,CAAC;EAAA8C,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvC,OAAA,GAEY5E,0BAA0B"}
|
1
|
+
{"version":3,"names":["_webexCore","require","_loggerProxy","_interopRequireDefault","_constants","_collection","SimultaneousInterpretation","WebexPlugin","extend","namespace","MEETINGS","collections","siLanguages","SILanguageCollection","props","locusUrl","approvalUrl","originalLanguage","sourceLanguage","targetLanguage","receiveLanguage","order","isActive","selfParticipantId","canManageInterpreters","supportLanguages","meetingSIEnabled","hostSIEnabled","selfIsInterpreter","derived","shouldQuerySupportLanguages","cache","deps","fn","initialize","_this","listenTo","querySupportLanguages","listenToHandoffRequests","cleanUp","stopListening","locusUrlUpdate","set","approvalUrlUpdate","updateCanManageInterpreters","updateHostSIEnabled","updateMeetingSIEnabled","updateInterpretation","interpretation","updateSelfInterpretation","_ref","preTargetLanguage","_ref2","getTargetLanguageCode","_this$siLanguages$get","get","languageCode","_this2","request","method","HTTP_VERBS","GET","uri","concat","then","result","_result$body","body","trigger","INTERPRETATION","EVENTS","SUPPORT_LANGUAGES_UPDATE","catch","error","LoggerProxy","logger","getInterpreters","updateInterpreters","interpreters","PATCH","changeDirection","_promise","default","reject","Error","_this3","webex","internal","mercury","event","_event$data","_event$data$approval","data","approval","resourceType","RESOURCE_TYPE","_receivers$","_event$data$approval2","receivers","initiator","actionType","url","receiverId","participantId","isReceiver","senderId","isSender","HANDOFF_REQUESTS_ARRIVED","handoffInterpreter","POST","ACTION_TYPE","OFFERED","requestHandoff","REQUESTED","acceptRequest","PUT","ACCEPTED","declineRequest","DECLINED","version","_default","exports"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2023 Cisco Systems, Inc. See LICENSE file.\n */\nimport {WebexPlugin} from '@webex/webex-core';\nimport LoggerProxy from '../common/logs/logger-proxy';\nimport {HTTP_VERBS, INTERPRETATION, MEETINGS} from '../constants';\n\nimport SILanguageCollection from './collection';\n\n/**\n * @class SimultaneousInterpretation\n */\nconst SimultaneousInterpretation = WebexPlugin.extend({\n namespace: MEETINGS,\n collections: {\n siLanguages: SILanguageCollection,\n },\n\n props: {\n locusUrl: 'string', // appears current meeting's locus url\n approvalUrl: 'string', // appears current meeting's approval url for handoff between interpreters\n originalLanguage: 'string', // appears current meeting's original language\n sourceLanguage: 'string', // appears self interpreter's source language\n targetLanguage: 'string', // appears self interpreter's target language\n receiveLanguage: 'string', // appears self's receive language\n order: 'number', // appears the order of self as interpreter\n isActive: 'boolean', // appears self is interpreter and is active\n selfParticipantId: 'string', // appears the self participant id\n canManageInterpreters: 'boolean', // appears the ability to manage interpreters\n supportLanguages: 'array', // appears the support languages\n meetingSIEnabled: 'boolean', // appears the meeting support SI feature\n hostSIEnabled: 'boolean', // appears the meeting host/interpreter feature of SI enabled\n selfIsInterpreter: 'boolean', // current user is interpreter or not\n },\n derived: {\n shouldQuerySupportLanguages: {\n cache: false,\n deps: ['canManageInterpreters', 'hostSIEnabled', 'locusUrl'],\n /**\n * Returns should query support languages or not\n * @returns {boolean}\n */\n fn() {\n return !!(this.canManageInterpreters && this.hostSIEnabled && this.locusUrl);\n },\n },\n },\n /**\n * initialize for interpretation\n * @returns {void}\n */\n initialize() {\n this.listenTo(this, 'change:shouldQuerySupportLanguages', () => {\n if (this.shouldQuerySupportLanguages && !this.supportLanguages) {\n this.querySupportLanguages();\n }\n });\n this.listenToHandoffRequests();\n },\n\n /**\n * Calls this to clean up listeners\n * @returns {void}\n */\n cleanUp() {\n this.stopListening();\n },\n /**\n * Update the current locus url of the meeting\n * @param {string} locusUrl // locus url\n * @returns {void}\n */\n locusUrlUpdate(locusUrl) {\n this.set('locusUrl', locusUrl);\n },\n /**\n * Update the approval url for handoff\n * @param {string} approvalUrl // approval url\n * @returns {void}\n */\n approvalUrlUpdate(approvalUrl) {\n this.set('approvalUrl', approvalUrl);\n },\n /**\n * Update whether self has capability to manage interpreters (only host can manage it)\n * @param {boolean} canManageInterpreters\n * @returns {void}\n */\n updateCanManageInterpreters(canManageInterpreters) {\n this.set('canManageInterpreters', canManageInterpreters);\n },\n /**\n * Update whether the meeting's host si is enabled or not\n * @param {boolean} hostSIEnabled\n * @returns {void}\n */\n updateHostSIEnabled(hostSIEnabled) {\n this.set('hostSIEnabled', hostSIEnabled);\n },\n\n /**\n * Update whether the meeting support SI feature or not from meeting info\n * @param {boolean} meetingSIEnabled\n * @param {boolean} selfIsInterpreter\n * @returns {void}\n */\n updateMeetingSIEnabled(meetingSIEnabled: boolean, selfIsInterpreter): void {\n this.set('meetingSIEnabled', meetingSIEnabled);\n this.set('selfIsInterpreter', selfIsInterpreter);\n },\n\n /**\n * Update the interpretation languages channels which user can choose to subscribe\n * @param {Object} interpretation\n * @returns {void}\n */\n updateInterpretation(interpretation) {\n this.siLanguages.set(interpretation?.siLanguages || []);\n },\n /**\n * Update self's interpretation information (self is interpreter)\n * @param {Object} interpretation\n * @param {String} selfParticipantId\n * @returns {bool} is target language changed\n */\n updateSelfInterpretation({interpretation, selfParticipantId}) {\n const preTargetLanguage = this.targetLanguage;\n const {originalLanguage, sourceLanguage, order, isActive, targetLanguage, receiveLanguage} =\n interpretation || {};\n this.set({originalLanguage, sourceLanguage, order, isActive, targetLanguage, receiveLanguage});\n this.set('selfParticipantId', selfParticipantId);\n this.set('selfIsInterpreter', !!targetLanguage);\n\n return !!(preTargetLanguage !== targetLanguage);\n },\n\n /**\n * Get the language code of the interpreter target language\n * @returns {number}\n */\n getTargetLanguageCode() {\n if (this.selfIsInterpreter) {\n return this.siLanguages.get(this.targetLanguage)?.languageCode;\n }\n\n return 0;\n },\n\n /**\n * query interpretation languages\n * @returns {Promise}\n */\n querySupportLanguages() {\n return this.request({\n method: HTTP_VERBS.GET,\n uri: `${this.locusUrl}/languages/interpretation`,\n })\n .then((result) => {\n this.set('supportLanguages', result.body?.siLanguages);\n this.trigger(INTERPRETATION.EVENTS.SUPPORT_LANGUAGES_UPDATE);\n })\n .catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#querySupportLanguages failed', error);\n throw error;\n });\n },\n /**\n * get interpreters of the meeting\n * @returns {Promise}\n */\n getInterpreters() {\n return this.request({\n method: HTTP_VERBS.GET,\n uri: `${this.locusUrl}/interpretation/interpreters`,\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#getInterpreters failed', error);\n throw error;\n });\n },\n /**\n * update interpreters of the meeting\n * @param {Array} interpreters\n * @returns {Promise}\n */\n updateInterpreters(interpreters) {\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri: `${this.locusUrl}/controls`,\n body: {\n interpretation: {\n interpreters,\n },\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#updateInterpreters failed', error);\n throw error;\n });\n },\n /**\n * Change direction of interpretation for an interpreter participant\n * @returns {Promise}\n */\n changeDirection() {\n if (!this.sourceLanguage || !this.targetLanguage) {\n return Promise.reject(new Error('Missing sourceLanguage or targetLanguage'));\n }\n\n if (!this.selfParticipantId) {\n return Promise.reject(new Error('Missing self participant id'));\n }\n\n return this.request({\n method: HTTP_VERBS.PATCH,\n uri: `${this.locusUrl}/participant/${this.selfParticipantId}/controls`,\n body: {\n interpretation: {\n sourceLanguage: this.targetLanguage,\n targetLanguage: this.sourceLanguage,\n isActive: this.isActive,\n order: this.order,\n },\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#changeDirection failed', error);\n throw error;\n });\n },\n /**\n * Sets up a listener for handoff requests from mercury\n * @returns {void}\n */\n listenToHandoffRequests() {\n this.listenTo(this.webex.internal.mercury, 'event:locus.approval_request', (event) => {\n if (event?.data?.approval?.resourceType === INTERPRETATION.RESOURCE_TYPE) {\n const {receivers, initiator, actionType, url} = event.data.approval;\n const receiverId = receivers?.[0]?.participantId;\n const isReceiver = !!receiverId && receiverId === this.selfParticipantId;\n const senderId = initiator?.participantId;\n const isSender = !!senderId && senderId === this.selfParticipantId;\n if (!isReceiver && !isSender) {\n return;\n }\n this.trigger(INTERPRETATION.EVENTS.HANDOFF_REQUESTS_ARRIVED, {\n actionType,\n isReceiver,\n isSender,\n senderId,\n receiverId,\n url,\n });\n }\n });\n },\n /**\n * handoff the active interpreter role to another interpreter in same group, only the interpreter is allowed to call this api\n * @param {string} participantId the participant id you want to hand off\n * @returns {Promise}\n */\n handoffInterpreter(participantId) {\n if (!participantId) {\n return Promise.reject(new Error('Missing target participant id'));\n }\n if (!this.approvalUrl) {\n return Promise.reject(new Error('Missing approval url'));\n }\n\n return this.request({\n method: HTTP_VERBS.POST,\n uri: this.approvalUrl,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.OFFERED,\n resourceType: INTERPRETATION.RESOURCE_TYPE,\n receivers: [\n {\n participantId,\n },\n ],\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#handoffInterpreter failed', error);\n throw error;\n });\n },\n /**\n * the in-active interpreter request to hand off the active role to self\n * @returns {Promise}\n */\n requestHandoff() {\n if (!this.approvalUrl) {\n return Promise.reject(new Error('Missing approval url'));\n }\n\n return this.request({\n method: HTTP_VERBS.POST,\n uri: this.approvalUrl,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.REQUESTED,\n resourceType: INTERPRETATION.RESOURCE_TYPE,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#requestHandoff failed', error);\n throw error;\n });\n },\n /**\n * accept the request of handoff\n * @param {String} url the url get from last approval event\n * @returns {Promise}\n */\n acceptRequest(url) {\n if (!url) {\n return Promise.reject(new Error('Missing the url to accept'));\n }\n\n return this.request({\n method: HTTP_VERBS.PUT,\n uri: url,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.ACCEPTED,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#acceptRequest failed', error);\n throw error;\n });\n },\n /**\n * decline the request of handoff\n * @param {String} url the url get from last approval event\n * @returns {Promise}\n */\n declineRequest(url) {\n if (!url) {\n return Promise.reject(new Error('Missing the url to decline'));\n }\n\n return this.request({\n method: HTTP_VERBS.PUT,\n uri: url,\n body: {\n actionType: INTERPRETATION.ACTION_TYPE.DECLINED,\n },\n }).catch((error) => {\n LoggerProxy.logger.error('Meeting:interpretation#declineRequest failed', error);\n throw error;\n });\n },\n});\n\nexport default SimultaneousInterpretation;\n"],"mappings":";;;;;;;;;AAGA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,YAAA,GAAAC,sBAAA,CAAAF,OAAA;AACA,IAAAG,UAAA,GAAAH,OAAA;AAEA,IAAAI,WAAA,GAAAF,sBAAA,CAAAF,OAAA;AAPA;AACA;AACA;;AAOA;AACA;AACA;AACA,IAAMK,0BAA0B,GAAGC,sBAAW,CAACC,MAAM,CAAC;EACpDC,SAAS,EAAEC,mBAAQ;EACnBC,WAAW,EAAE;IACXC,WAAW,EAAEC;EACf,CAAC;EAEDC,KAAK,EAAE;IACLC,QAAQ,EAAE,QAAQ;IAAE;IACpBC,WAAW,EAAE,QAAQ;IAAE;IACvBC,gBAAgB,EAAE,QAAQ;IAAE;IAC5BC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,cAAc,EAAE,QAAQ;IAAE;IAC1BC,eAAe,EAAE,QAAQ;IAAE;IAC3BC,KAAK,EAAE,QA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AC1B,OAAO,CAAC;MAClBC,MAAM,EAAEC,qBAAU,CAACuD,GAAG;MACtBrD,GAAG,EAAEuC,GAAG;MACRlC,IAAI,EAAE;QACJiC,UAAU,EAAE/B,yBAAc,CAACyC,WAAW,CAACM;MACzC;IACF,CAAC,CAAC,CAAC5C,KAAK,CAAC,UAACC,KAAK,EAAK;MAClBC,oBAAW,CAACC,MAAM,CAACF,KAAK,CAAC,6CAA6C,EAAEA,KAAK,CAAC;MAC9E,MAAMA,KAAK;IACb,CAAC,CAAC;EACJ,CAAC;EACD;AACF;AACA;AACA;AACA;EACE4C,cAAc,WAAAA,eAAChB,GAAG,EAAE;IAClB,IAAI,CAACA,GAAG,EAAE;MACR,OAAOpB,QAAA,CAAAC,OAAA,CAAQC,MAAM,CAAC,IAAIC,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChE;IAEA,OAAO,IAAI,CAAC1B,OAAO,CAAC;MAClBC,MAAM,EAAEC,qBAAU,CAACuD,GAAG;MACtBrD,GAAG,EAAEuC,GAAG;MACRlC,IAAI,EAAE;QACJiC,UAAU,EAAE/B,yBAAc,CAACyC,WAAW,CAACQ;MACzC;IACF,CAAC,CAAC,CAAC9C,KAAK,CAAC,UAACC,KAAK,EAAK;MAClBC,oBAAW,CAACC,MAAM,CAACF,KAAK,CAAC,8CAA8C,EAAEA,KAAK,CAAC;MAC/E,MAAMA,KAAK;IACb,CAAC,CAAC;EACJ,CAAC;EAAA8C,OAAA;AACH,CAAC,CAAC;AAAC,IAAAC,QAAA,GAAAC,OAAA,CAAAvC,OAAA,GAEY5E,0BAA0B"}
|
@@ -51,7 +51,8 @@ ControlsUtils.parse = function (controls) {
|
|
51
51
|
if (controls && controls.transcribe) {
|
52
52
|
parsedControls.transcribe = {
|
53
53
|
transcribing: controls.transcribe.transcribing,
|
54
|
-
caption: controls.transcribe.caption
|
54
|
+
caption: controls.transcribe.caption,
|
55
|
+
spokenLanguage: controls.transcribe.spokenLanguage
|
55
56
|
};
|
56
57
|
}
|
57
58
|
if (controls && controls.manualCaptionControl) {
|
@@ -121,6 +122,21 @@ ControlsUtils.parse = function (controls) {
|
|
121
122
|
enabled: controls.practiceSession.enabled
|
122
123
|
};
|
123
124
|
}
|
125
|
+
if (controls !== null && controls !== void 0 && controls.annotationControl) {
|
126
|
+
parsedControls.annotationControl = {
|
127
|
+
enabled: controls.annotationControl.enabled
|
128
|
+
};
|
129
|
+
}
|
130
|
+
if (controls !== null && controls !== void 0 && controls.rdcControl) {
|
131
|
+
parsedControls.rdcControl = {
|
132
|
+
enabled: controls.rdcControl.enabled
|
133
|
+
};
|
134
|
+
}
|
135
|
+
if (controls !== null && controls !== void 0 && controls.pollingQAControl) {
|
136
|
+
parsedControls.pollingQAControl = {
|
137
|
+
enabled: controls.pollingQAControl.enabled
|
138
|
+
};
|
139
|
+
}
|
124
140
|
return parsedControls;
|
125
141
|
};
|
126
142
|
|
@@ -131,7 +147,7 @@ ControlsUtils.parse = function (controls) {
|
|
131
147
|
* @returns {Object} combination of state plus the changes
|
132
148
|
*/
|
133
149
|
ControlsUtils.getControls = function (oldControls, newControls) {
|
134
|
-
var _current$muteOnEntry, _previous$muteOnEntry, _current$shareControl, _previous$shareContro, _current$disallowUnmu, _previous$disallowUnm, _current$reactions, _previous$reactions, _current$reactions2, _previous$reactions2, _current$viewTheParti, _previous$viewThePart, _current$viewTheParti2, _previous$viewThePart2, _current$viewTheParti3, _previous$viewThePart3, _current$raiseHand, _previous$raiseHand, _current$video, _previous$video, _previous$record, _previous$record2, _current$record, _previous$record3, _current$record2, _previous$record4, _current$record3, _previous$meetingCont, _current$meetingConta, _previous$transcribe, _current$transcribe, _previous$transcribe2, _current$transcribe2, _previous$manualCapti, _current$manualCaptio, _previous$manualCapti2, _current$manualCaptio2, _newControls$video, _previous$webcastCont, _current$webcastContr, _previous$meetingFull, _current$meetingFull, _previous$meetingFull2, _current$meetingFull2, _previous$practiceSes, _current$practiceSess;
|
150
|
+
var _current$muteOnEntry, _previous$muteOnEntry, _current$shareControl, _previous$shareContro, _current$disallowUnmu, _previous$disallowUnm, _current$reactions, _previous$reactions, _current$reactions2, _previous$reactions2, _current$viewTheParti, _previous$viewThePart, _current$viewTheParti2, _previous$viewThePart2, _current$viewTheParti3, _previous$viewThePart3, _current$raiseHand, _previous$raiseHand, _current$video, _previous$video, _previous$record, _previous$record2, _current$record, _previous$record3, _current$record2, _previous$record4, _current$record3, _previous$meetingCont, _current$meetingConta, _previous$transcribe, _current$transcribe, _previous$transcribe2, _current$transcribe2, _previous$transcribe3, _current$transcribe3, _previous$transcribe4, _current$transcribe4, _previous$manualCapti, _current$manualCaptio, _previous$manualCapti2, _current$manualCaptio2, _newControls$video, _previous$webcastCont, _current$webcastContr, _previous$meetingFull, _current$meetingFull, _previous$meetingFull2, _current$meetingFull2, _previous$practiceSes, _current$practiceSess, _current$annotationCo, _previous$annotationC, _current$rdcControl, _previous$rdcControl, _current$pollingQACon, _previous$pollingQACo;
|
135
151
|
var previous = ControlsUtils.parse(oldControls);
|
136
152
|
var current = ControlsUtils.parse(newControls);
|
137
153
|
return {
|
@@ -160,6 +176,7 @@ ControlsUtils.getControls = function (oldControls, newControls) {
|
|
160
176
|
(previous === null || previous === void 0 ? void 0 : (_previous$transcribe2 = previous.transcribe) === null || _previous$transcribe2 === void 0 ? void 0 : _previous$transcribe2.transcribing) || (current === null || current === void 0 ? void 0 : (_current$transcribe2 = current.transcribe) === null || _current$transcribe2 === void 0 ? void 0 : _current$transcribe2.transcribing)),
|
161
177
|
// therefore, condition added to prevent false firings of #meeting:recording:stopped upon first joining a meeting
|
162
178
|
|
179
|
+
hasTranscribeSpokenLanguageChanged: (current === null || current === void 0 ? void 0 : current.transcribe) && !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : (_previous$transcribe3 = previous.transcribe) === null || _previous$transcribe3 === void 0 ? void 0 : _previous$transcribe3.spokenLanguage, current === null || current === void 0 ? void 0 : (_current$transcribe3 = current.transcribe) === null || _current$transcribe3 === void 0 ? void 0 : _current$transcribe3.spokenLanguage) && !!(previous !== null && previous !== void 0 && (_previous$transcribe4 = previous.transcribe) !== null && _previous$transcribe4 !== void 0 && _previous$transcribe4.spokenLanguage || current !== null && current !== void 0 && (_current$transcribe4 = current.transcribe) !== null && _current$transcribe4 !== void 0 && _current$transcribe4.spokenLanguage),
|
163
180
|
hasManualCaptionChanged: (current === null || current === void 0 ? void 0 : current.manualCaptionControl) && !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : (_previous$manualCapti = previous.manualCaptionControl) === null || _previous$manualCapti === void 0 ? void 0 : _previous$manualCapti.enabled, current === null || current === void 0 ? void 0 : (_current$manualCaptio = current.manualCaptionControl) === null || _current$manualCaptio === void 0 ? void 0 : _current$manualCaptio.enabled) && ((previous === null || previous === void 0 ? void 0 : (_previous$manualCapti2 = previous.manualCaptionControl) === null || _previous$manualCapti2 === void 0 ? void 0 : _previous$manualCapti2.enabled) || (current === null || current === void 0 ? void 0 : (_current$manualCaptio2 = current.manualCaptionControl) === null || _current$manualCaptio2 === void 0 ? void 0 : _current$manualCaptio2.enabled)),
|
164
181
|
hasEntryExitToneChanged: !!(newControls.entryExitTone && !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : previous.entryExitTone, current === null || current === void 0 ? void 0 : current.entryExitTone) && (previous !== null && previous !== void 0 && previous.entryExitTone || current !== null && current !== void 0 && current.entryExitTone)),
|
165
182
|
hasBreakoutChanged: !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : previous.breakout, current === null || current === void 0 ? void 0 : current.breakout),
|
@@ -167,8 +184,11 @@ ControlsUtils.getControls = function (oldControls, newControls) {
|
|
167
184
|
hasVideoEnabledChanged: ((_newControls$video = newControls.video) === null || _newControls$video === void 0 ? void 0 : _newControls$video.enabled) !== undefined && !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : previous.videoEnabled, current === null || current === void 0 ? void 0 : current.videoEnabled),
|
168
185
|
hasWebcastChanged: !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : (_previous$webcastCont = previous.webcastControl) === null || _previous$webcastCont === void 0 ? void 0 : _previous$webcastCont.streaming, current === null || current === void 0 ? void 0 : (_current$webcastContr = current.webcastControl) === null || _current$webcastContr === void 0 ? void 0 : _current$webcastContr.streaming),
|
169
186
|
hasMeetingFullChanged: !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : (_previous$meetingFull = previous.meetingFull) === null || _previous$meetingFull === void 0 ? void 0 : _previous$meetingFull.meetingFull, current === null || current === void 0 ? void 0 : (_current$meetingFull = current.meetingFull) === null || _current$meetingFull === void 0 ? void 0 : _current$meetingFull.meetingFull) || !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : (_previous$meetingFull2 = previous.meetingFull) === null || _previous$meetingFull2 === void 0 ? void 0 : _previous$meetingFull2.meetingPanelistFull, current === null || current === void 0 ? void 0 : (_current$meetingFull2 = current.meetingFull) === null || _current$meetingFull2 === void 0 ? void 0 : _current$meetingFull2.meetingPanelistFull),
|
170
|
-
hasPracticeSessionEnabledChanged: !(0, _lodash.isEqual)(previous
|
171
|
-
hasStageViewChanged: !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : previous.videoLayout, current === null || current === void 0 ? void 0 : current.videoLayout)
|
187
|
+
hasPracticeSessionEnabledChanged: !(0, _lodash.isEqual)(!!(previous !== null && previous !== void 0 && (_previous$practiceSes = previous.practiceSession) !== null && _previous$practiceSes !== void 0 && _previous$practiceSes.enabled), !!(current !== null && current !== void 0 && (_current$practiceSess = current.practiceSession) !== null && _current$practiceSess !== void 0 && _current$practiceSess.enabled)),
|
188
|
+
hasStageViewChanged: !(0, _lodash.isEqual)(previous === null || previous === void 0 ? void 0 : previous.videoLayout, current === null || current === void 0 ? void 0 : current.videoLayout),
|
189
|
+
hasAnnotationControlChanged: (current === null || current === void 0 ? void 0 : (_current$annotationCo = current.annotationControl) === null || _current$annotationCo === void 0 ? void 0 : _current$annotationCo.enabled) !== (previous === null || previous === void 0 ? void 0 : (_previous$annotationC = previous.annotationControl) === null || _previous$annotationC === void 0 ? void 0 : _previous$annotationC.enabled),
|
190
|
+
hasRemoteDesktopControlChanged: (current === null || current === void 0 ? void 0 : (_current$rdcControl = current.rdcControl) === null || _current$rdcControl === void 0 ? void 0 : _current$rdcControl.enabled) !== (previous === null || previous === void 0 ? void 0 : (_previous$rdcControl = previous.rdcControl) === null || _previous$rdcControl === void 0 ? void 0 : _previous$rdcControl.enabled),
|
191
|
+
hasPollingQAControlChanged: (current === null || current === void 0 ? void 0 : (_current$pollingQACon = current.pollingQAControl) === null || _current$pollingQACon === void 0 ? void 0 : _current$pollingQACon.enabled) !== (previous === null || previous === void 0 ? void 0 : (_previous$pollingQACo = previous.pollingQAControl) === null || _previous$pollingQACo === void 0 ? void 0 : _previous$pollingQACo.enabled)
|
172
192
|
}
|
173
193
|
};
|
174
194
|
};
|
@@ -193,30 +213,36 @@ ControlsUtils.getId = function (controls) {
|
|
193
213
|
* @returns {Boolean}
|
194
214
|
*/
|
195
215
|
ControlsUtils.isNeedReplaceMembers = function (oldControls, controls) {
|
216
|
+
var _oldControls$breakout, _controls$breakout, _oldControls$breakout2, _controls$breakout2;
|
196
217
|
// no breakout case
|
197
218
|
if (!(oldControls !== null && oldControls !== void 0 && oldControls.breakout) || !(controls !== null && controls !== void 0 && controls.breakout)) {
|
198
219
|
return false;
|
199
220
|
}
|
200
|
-
return oldControls.breakout.groupId !== controls.breakout.groupId || oldControls.breakout.sessionId !== controls.breakout.sessionId;
|
221
|
+
return (oldControls === null || oldControls === void 0 ? void 0 : (_oldControls$breakout = oldControls.breakout) === null || _oldControls$breakout === void 0 ? void 0 : _oldControls$breakout.groupId) !== (controls === null || controls === void 0 ? void 0 : (_controls$breakout = controls.breakout) === null || _controls$breakout === void 0 ? void 0 : _controls$breakout.groupId) || (oldControls === null || oldControls === void 0 ? void 0 : (_oldControls$breakout2 = oldControls.breakout) === null || _oldControls$breakout2 === void 0 ? void 0 : _oldControls$breakout2.sessionId) !== (controls === null || controls === void 0 ? void 0 : (_controls$breakout2 = controls.breakout) === null || _controls$breakout2 === void 0 ? void 0 : _controls$breakout2.sessionId);
|
201
222
|
};
|
202
223
|
|
203
224
|
/**
|
204
225
|
* determine the switch status between breakout session and main session.
|
205
|
-
* @param {
|
206
|
-
* @param {
|
226
|
+
* @param {LocusInfo} oldLocus
|
227
|
+
* @param {LocusInfo} newLocus
|
207
228
|
* @returns {Object}
|
208
229
|
*/
|
209
|
-
ControlsUtils.getSessionSwitchStatus = function (
|
230
|
+
ControlsUtils.getSessionSwitchStatus = function (oldLocus, newLocus) {
|
231
|
+
var _oldLocus$controls, _newLocus$controls, _oldLocus$self, _newLocus$participant, _newLocus$participant2, _newLocus$participant3, _newLocus$controls2, _newLocus$controls2$b, _newLocus$controls3, _newLocus$controls3$b, _newLocus$controls3$b2;
|
210
232
|
var status = {
|
211
233
|
isReturnToMain: false,
|
212
234
|
isJoinToBreakout: false
|
213
235
|
};
|
214
236
|
// no breakout case
|
215
|
-
if (!(
|
237
|
+
if (!((_oldLocus$controls = oldLocus.controls) !== null && _oldLocus$controls !== void 0 && _oldLocus$controls.breakout) || !((_newLocus$controls = newLocus.controls) !== null && _newLocus$controls !== void 0 && _newLocus$controls.breakout)) {
|
216
238
|
return status;
|
217
239
|
}
|
218
|
-
|
219
|
-
|
240
|
+
|
241
|
+
// It is used to fix the timing issue triggered when the creator leaves session to ensure that the member list is complete
|
242
|
+
var needUseCache = !!((_oldLocus$self = oldLocus.self) !== null && _oldLocus$self !== void 0 && _oldLocus$self.isCreator && ((_newLocus$participant = newLocus.participants) === null || _newLocus$participant === void 0 ? void 0 : _newLocus$participant.length) === 1 && (_newLocus$participant2 = newLocus.participants) !== null && _newLocus$participant2 !== void 0 && _newLocus$participant2[0].isCreator && ((_newLocus$participant3 = newLocus.participants) === null || _newLocus$participant3 === void 0 ? void 0 : _newLocus$participant3[0].state) === _constants.MEETING_STATE.STATES.JOINED && ((_newLocus$controls2 = newLocus.controls) === null || _newLocus$controls2 === void 0 ? void 0 : (_newLocus$controls2$b = _newLocus$controls2.breakout) === null || _newLocus$controls2$b === void 0 ? void 0 : _newLocus$controls2$b.sessionType) === _constants.BREAKOUTS.SESSION_TYPES.MAIN && (_newLocus$controls3 = newLocus.controls) !== null && _newLocus$controls3 !== void 0 && (_newLocus$controls3$b = _newLocus$controls3.breakout) !== null && _newLocus$controls3$b !== void 0 && (_newLocus$controls3$b2 = _newLocus$controls3$b.groups) !== null && _newLocus$controls3$b2 !== void 0 && _newLocus$controls3$b2.length);
|
243
|
+
var isReturnToMain = oldLocus.controls.breakout.sessionType === _constants.BREAKOUTS.SESSION_TYPES.BREAKOUT && newLocus.controls.breakout.sessionType === _constants.BREAKOUTS.SESSION_TYPES.MAIN;
|
244
|
+
status.isReturnToMain = needUseCache || isReturnToMain;
|
245
|
+
status.isJoinToBreakout = oldLocus.controls.breakout.sessionType === _constants.BREAKOUTS.SESSION_TYPES.MAIN && newLocus.controls.breakout.sessionType === _constants.BREAKOUTS.SESSION_TYPES.BREAKOUT;
|
220
246
|
return status;
|
221
247
|
};
|
222
248
|
ControlsUtils.isMainSessionDTO = function (locus) {
|