@webex/plugin-meetings 3.0.0-beta.80 → 3.0.0-beta.82

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (35) hide show
  1. package/dist/breakouts/breakout.js +1 -1
  2. package/dist/breakouts/index.js +1 -1
  3. package/dist/constants.js +7 -1
  4. package/dist/constants.js.map +1 -1
  5. package/dist/controls-options-manager/enums.js +11 -2
  6. package/dist/controls-options-manager/enums.js.map +1 -1
  7. package/dist/controls-options-manager/index.js +42 -11
  8. package/dist/controls-options-manager/index.js.map +1 -1
  9. package/dist/controls-options-manager/types.js +7 -0
  10. package/dist/controls-options-manager/types.js.map +1 -0
  11. package/dist/controls-options-manager/util.js +240 -29
  12. package/dist/controls-options-manager/util.js.map +1 -1
  13. package/dist/media/index.js +5 -3
  14. package/dist/media/index.js.map +1 -1
  15. package/dist/meeting/index.js +8 -4
  16. package/dist/meeting/index.js.map +1 -1
  17. package/dist/types/constants.d.ts +5 -0
  18. package/dist/types/controls-options-manager/enums.d.ts +7 -0
  19. package/dist/types/controls-options-manager/index.d.ts +8 -0
  20. package/dist/types/controls-options-manager/types.d.ts +37 -0
  21. package/dist/types/controls-options-manager/util.d.ts +103 -9
  22. package/dist/types/media/index.d.ts +2 -0
  23. package/dist/types/meeting/index.d.ts +3 -1
  24. package/package.json +18 -18
  25. package/src/constants.ts +7 -0
  26. package/src/controls-options-manager/enums.ts +9 -0
  27. package/src/controls-options-manager/index.ts +36 -1
  28. package/src/controls-options-manager/types.ts +49 -0
  29. package/src/controls-options-manager/util.ts +221 -22
  30. package/src/media/index.ts +15 -1
  31. package/src/meeting/index.ts +7 -3
  32. package/test/unit/spec/controls-options-manager/index.js +76 -0
  33. package/test/unit/spec/controls-options-manager/util.js +317 -0
  34. package/test/unit/spec/media/index.ts +4 -0
  35. package/test/unit/spec/meeting/index.js +42 -0
@@ -631,7 +631,10 @@ export declare const DISPLAY_HINTS: {
631
631
  DISABLE_REACTIONS: string;
632
632
  REACTIONS_ACTIVE: string;
633
633
  REACTIONS_INACTIVE: string;
634
+ SHARE_CONTROL: string;
634
635
  ENABLE_MUTE_ON_ENTRY: string;
636
+ ENABLE_SHOW_DISPLAY_NAME: string;
637
+ DISABLE_SHOW_DISPLAY_NAME: string;
635
638
  DISABLE_MUTE_ON_ENTRY: string;
636
639
  ENABLE_HARD_MUTE: string;
637
640
  DISABLE_HARD_MUTE: string;
@@ -645,6 +648,8 @@ export declare const DISPLAY_HINTS: {
645
648
  DISABLE_ASK_FOR_HELP: string;
646
649
  DISABLE_BREAKOUT_PREASSIGNMENTS: string;
647
650
  DISABLE_LOBBY_TO_BREAKOUT: string;
651
+ DISABLE_VIEW_THE_PARTICIPANT_LIST: string;
652
+ ENABLE_VIEW_THE_PARTICIPANT_LIST: string;
648
653
  };
649
654
  export declare const SELF_ROLES: {
650
655
  COHOST: string;
@@ -3,4 +3,11 @@ declare enum Setting {
3
3
  muteOnEntry = "MuteOnEntry",
4
4
  muted = "Muted"
5
5
  }
6
+ declare enum Control {
7
+ audio = "audio",
8
+ reactions = "reactions",
9
+ shareControl = "shareControl",
10
+ viewTheParticipantList = "viewTheParticipantList"
11
+ }
12
+ export { Control, Setting };
6
13
  export default Setting;
@@ -1,4 +1,5 @@
1
1
  import MeetingRequest from '../meeting/request';
2
+ import { ControlConfig } from './types';
2
3
  /**
3
4
  * docs
4
5
  * https://sqbu-github.cisco.com/pages/WebExSquared/locus/guides/mute.html
@@ -95,6 +96,13 @@ export default class ControlsOptionsManager {
95
96
  * @memberof ControlsOptionsManager
96
97
  */
97
98
  private extract;
99
+ /**
100
+ * Set controls for this meeting.
101
+ *
102
+ * @param {Array<ControlConfig>} controls - Spread Array of ControlConfigs
103
+ * @returns {Promise<Array<any>>}- Promise resolving if the request was successful.
104
+ */
105
+ protected update(...controls: Array<ControlConfig>): any;
98
106
  /**
99
107
  * @param {Setting} setting
100
108
  * @private
@@ -0,0 +1,37 @@
1
+ import { Control } from './enums';
2
+ export interface ControlProperties {
3
+ /**
4
+ * A list of additional properties that apply to various specific settings.
5
+ *
6
+ * @remarks
7
+ * The values stored here, per the service, are fully ambiguous, an can vary
8
+ * depending on which control scope is being configured.
9
+ */
10
+ [key: string]: boolean;
11
+ }
12
+ export interface AudioProperties {
13
+ muted?: boolean;
14
+ disallowUnmute?: boolean;
15
+ muteOnEntry?: boolean;
16
+ }
17
+ export interface ReactionsProperties {
18
+ enabled?: boolean;
19
+ showDisplayNameWithReactions?: boolean;
20
+ }
21
+ export interface ShareControlProperties {
22
+ control?: 'ANYONE' | 'MODERATOR_PRESENTER';
23
+ }
24
+ export interface ViewTheParticipantListProperties {
25
+ enabled?: boolean;
26
+ }
27
+ export type Properties = AudioProperties | ReactionsProperties | ShareControlProperties | ViewTheParticipantListProperties;
28
+ export interface ControlConfig<Props = Properties> {
29
+ /**
30
+ * The scope of the control within this object.
31
+ */
32
+ scope: Control;
33
+ /**
34
+ * The properties to assign to this control.
35
+ */
36
+ properties: Props;
37
+ }
@@ -1,9 +1,103 @@
1
- declare const _default: {
2
- canSetMuteOnEntry: (displayHints: string[]) => boolean;
3
- canSetDisallowUnmute: (displayHints: string[]) => boolean;
4
- canSetMuted: (displayHints: string[]) => boolean;
5
- canUnsetMuteOnEntry: (displayHints: string[]) => boolean;
6
- canUnsetDisallowUnmute: (displayHints: string[]) => boolean;
7
- canUnsetMuted: (displayHints: string[]) => boolean;
8
- };
9
- export default _default;
1
+ import { ControlConfig, AudioProperties, ReactionsProperties, ViewTheParticipantListProperties } from './types';
2
+ /**
3
+ * The Controls Options Manager utilities
4
+ *
5
+ * @internal
6
+ */
7
+ declare class Utils {
8
+ /**
9
+ * Validate if enabling mute on entry can be set.
10
+ *
11
+ * @param {Array<string>} displayHints - Display Hints to use when validating.
12
+ * @returns {boolean} - True if the action is allowed.
13
+ */
14
+ static canSetMuteOnEntry(displayHints: Array<string>): boolean;
15
+ /**
16
+ * Validate if allowing unmuting can be set.
17
+ *
18
+ * @param {Array<string>} displayHints - Display Hints to use when validating.
19
+ * @returns {boolean} - True if the action is allowed.
20
+ */
21
+ static canSetDisallowUnmute(displayHints: Array<string>): boolean;
22
+ /**
23
+ * Validate if disabling mute on entry can be set.
24
+ *
25
+ * @param {Array<string>} displayHints - Display Hints to use when validating.
26
+ * @returns {boolean} - True if the action is allowed.
27
+ */
28
+ static canUnsetMuteOnEntry(displayHints: Array<string>): boolean;
29
+ /**
30
+ * Validate if enabling muting can be set.
31
+ *
32
+ * @param {Array<string>} displayHints - Display Hints to use when validating.
33
+ * @returns {boolean} - True if the action is allowed.
34
+ */
35
+ static canUnsetDisallowUnmute(displayHints: Array<string>): boolean;
36
+ /**
37
+ * Validate if muting all can be set.
38
+ *
39
+ * @param {Array<string>} displayHints - Display Hints to use when validating.
40
+ * @returns {boolean} - True if the action is allowed.
41
+ */
42
+ static canSetMuted(displayHints: Array<string>): boolean;
43
+ /**
44
+ * Validate if unmuting all can be set.
45
+ *
46
+ * @param {Array<string>} displayHints - Display Hints to use when validating.
47
+ * @returns {boolean} - True if the action is allowed.
48
+ */
49
+ static canUnsetMuted(displayHints: Array<string>): boolean;
50
+ /**
51
+ * Validate an array of hints are allowed based on a full collection of hints.
52
+ *
53
+ * @param {Object} config - Configuration Object.
54
+ * @param {Array<string>} config.requiredHints - Hints required for validation.
55
+ * @param {Array<string>} config.displayHints - All available hints.
56
+ * @returns {boolean} - True if all of the actions are allowed.
57
+ */
58
+ static hasHints(config: {
59
+ requiredHints: Array<string>;
60
+ displayHints: Array<string>;
61
+ }): boolean;
62
+ /**
63
+ * Validate if an audio-scoped control is allowed to be sent to the service.
64
+ *
65
+ * @param {ControlConfig<AudioProperties>} control - Audio control config to validate.
66
+ * @param {Array<string>} displayHints - All available hints.
67
+ * @returns {boolean} - True if all of the actions are allowed.
68
+ */
69
+ static canUpdateAudio(control: ControlConfig<AudioProperties>, displayHints: Array<string>): boolean;
70
+ /**
71
+ * Validate if an reactions-scoped control is allowed to be sent to the service.
72
+ *
73
+ * @param {ControlConfig<ReactionsProperties>} control - Reaction control config to validate.
74
+ * @param {Array<string>} displayHints - All available hints.
75
+ * @returns {boolean} - True if all of the actions are allowed.
76
+ */
77
+ static canUpdateReactions(control: ControlConfig<ReactionsProperties>, displayHints: Array<string>): boolean;
78
+ /**
79
+ * Validate if an share-control-scoped control is allowed to be sent to the service.
80
+ *
81
+ * @param {Array<string>} displayHints - All available hints.
82
+ * @returns {boolean} - True if all of the actions are allowed.
83
+ */
84
+ static canUpdateShareControl(displayHints: Array<string>): boolean;
85
+ /**
86
+ * Validate if an view-the-participants-list-scoped control is allowed to be sent to the service.
87
+ *
88
+ * @param {ControlConfig<ViewTheParticipantListProperties>} control - View Participants List control config to validate.
89
+ * @param {Array<string>} displayHints - All available hints.
90
+ * @returns {boolean} - True if all of the actions are allowed.
91
+ */
92
+ static canUpdateViewTheParticipantsList(control: ControlConfig<ViewTheParticipantListProperties>, displayHints: Array<string>): boolean;
93
+ /**
94
+ * Validate that a control can be sent to the service based on the provided
95
+ * display hints.
96
+ *
97
+ * @param {ControlConfig} control - Control to validate.
98
+ * @param {Array<string>} displayHints - All available hints.
99
+ * @returns {boolean} - True if all of the actions are allowed.
100
+ */
101
+ static canUpdate(control: ControlConfig, displayHints: Array<string>): boolean;
102
+ }
103
+ export default Utils;
@@ -1,6 +1,8 @@
1
1
  /*!
2
2
  * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
3
3
  */
4
+ import { MultistreamRoapMediaConnection } from '@webex/internal-media-core';
5
+ export type BundlePolicy = ConstructorParameters<typeof MultistreamRoapMediaConnection>[0]['bundlePolicy'];
4
6
  /**
5
7
  * MediaDirection
6
8
  * @typedef {Object} MediaDirection
@@ -1180,9 +1180,10 @@ export default class Meeting extends StatelessWebexPlugin {
1180
1180
  * Creates a webrtc media connection
1181
1181
  *
1182
1182
  * @param {Object} turnServerInfo TURN server information
1183
+ * @param {BundlePolicy} [bundlePolicy] Bundle policy settings
1183
1184
  * @returns {RoapMediaConnection | MultistreamRoapMediaConnection}
1184
1185
  */
1185
- createMediaConnection(turnServerInfo: any): any;
1186
+ createMediaConnection(turnServerInfo: any, bundlePolicy: any): any;
1186
1187
  /**
1187
1188
  * Listens for an event emitted by eventEmitter and emits it from the meeting object
1188
1189
  *
@@ -1200,6 +1201,7 @@ export default class Meeting extends StatelessWebexPlugin {
1200
1201
  * @param {MediaDirection} options.mediaSettings pass media options
1201
1202
  * @param {MediaStream} options.localStream
1202
1203
  * @param {MediaStream} options.localShare
1204
+ * @param {BundlePolicy} options.bundlePolicy bundle policy for multistream meetings
1203
1205
  * @param {RemoteMediaManagerConfig} options.remoteMediaManagerConfig only applies if multistream is enabled
1204
1206
  * @returns {Promise}
1205
1207
  * @public
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.80",
3
+ "version": "3.0.0-beta.82",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -32,12 +32,12 @@
32
32
  "build": "yarn run -T tsc --declaration true --declarationDir ./dist/types"
33
33
  },
34
34
  "devDependencies": {
35
- "@webex/plugin-meetings": "3.0.0-beta.80",
36
- "@webex/test-helper-chai": "3.0.0-beta.80",
37
- "@webex/test-helper-mocha": "3.0.0-beta.80",
38
- "@webex/test-helper-mock-webex": "3.0.0-beta.80",
39
- "@webex/test-helper-retry": "3.0.0-beta.80",
40
- "@webex/test-helper-test-users": "3.0.0-beta.80",
35
+ "@webex/plugin-meetings": "3.0.0-beta.82",
36
+ "@webex/test-helper-chai": "3.0.0-beta.82",
37
+ "@webex/test-helper-mocha": "3.0.0-beta.82",
38
+ "@webex/test-helper-mock-webex": "3.0.0-beta.82",
39
+ "@webex/test-helper-retry": "3.0.0-beta.82",
40
+ "@webex/test-helper-test-users": "3.0.0-beta.82",
41
41
  "chai": "^4.3.4",
42
42
  "chai-as-promised": "^7.1.1",
43
43
  "jsdom-global": "3.0.2",
@@ -46,18 +46,18 @@
46
46
  "typescript": "^4.7.4"
47
47
  },
48
48
  "dependencies": {
49
- "@webex/common": "3.0.0-beta.80",
49
+ "@webex/common": "3.0.0-beta.82",
50
50
  "@webex/internal-media-core": "1.36.0",
51
- "@webex/internal-plugin-conversation": "3.0.0-beta.80",
52
- "@webex/internal-plugin-device": "3.0.0-beta.80",
53
- "@webex/internal-plugin-llm": "3.0.0-beta.80",
54
- "@webex/internal-plugin-mercury": "3.0.0-beta.80",
55
- "@webex/internal-plugin-metrics": "3.0.0-beta.80",
56
- "@webex/internal-plugin-support": "3.0.0-beta.80",
57
- "@webex/internal-plugin-user": "3.0.0-beta.80",
58
- "@webex/plugin-people": "3.0.0-beta.80",
59
- "@webex/plugin-rooms": "3.0.0-beta.80",
60
- "@webex/webex-core": "3.0.0-beta.80",
51
+ "@webex/internal-plugin-conversation": "3.0.0-beta.82",
52
+ "@webex/internal-plugin-device": "3.0.0-beta.82",
53
+ "@webex/internal-plugin-llm": "3.0.0-beta.82",
54
+ "@webex/internal-plugin-mercury": "3.0.0-beta.82",
55
+ "@webex/internal-plugin-metrics": "3.0.0-beta.82",
56
+ "@webex/internal-plugin-support": "3.0.0-beta.82",
57
+ "@webex/internal-plugin-user": "3.0.0-beta.82",
58
+ "@webex/plugin-people": "3.0.0-beta.82",
59
+ "@webex/plugin-rooms": "3.0.0-beta.82",
60
+ "@webex/webex-core": "3.0.0-beta.82",
61
61
  "ampersand-collection": "^2.0.2",
62
62
  "bowser": "^2.11.0",
63
63
  "btoa": "^1.2.1",
package/src/constants.ts CHANGED
@@ -797,7 +797,10 @@ export const DISPLAY_HINTS = {
797
797
  DISABLE_REACTIONS: 'DISABLE_REACTIONS',
798
798
  REACTIONS_ACTIVE: 'REACTIONS_ACTIVE',
799
799
  REACTIONS_INACTIVE: 'REACTIONS_INACTIVE',
800
+ SHARE_CONTROL: 'SHARE_CONTROL',
800
801
  ENABLE_MUTE_ON_ENTRY: 'ENABLE_MUTE_ON_ENTRY',
802
+ ENABLE_SHOW_DISPLAY_NAME: 'ENABLE_SHOW_DISPLAY_NAME',
803
+ DISABLE_SHOW_DISPLAY_NAME: 'DISABLE_SHOW_DISPLAY_NAME',
801
804
  DISABLE_MUTE_ON_ENTRY: 'DISABLE_MUTE_ON_ENTRY',
802
805
  ENABLE_HARD_MUTE: 'ENABLE_HARD_MUTE',
803
806
  DISABLE_HARD_MUTE: 'DISABLE_HARD_MUTE',
@@ -813,6 +816,10 @@ export const DISPLAY_HINTS = {
813
816
  DISABLE_ASK_FOR_HELP: 'DISABLE_ASK_FOR_HELP',
814
817
  DISABLE_BREAKOUT_PREASSIGNMENTS: 'DISABLE_BREAKOUT_PREASSIGNMENTS',
815
818
  DISABLE_LOBBY_TO_BREAKOUT: 'DISABLE_LOBBY_TO_BREAKOUT',
819
+
820
+ // participants list
821
+ DISABLE_VIEW_THE_PARTICIPANT_LIST: 'DISABLE_VIEW_THE_PARTICIPANT_LIST',
822
+ ENABLE_VIEW_THE_PARTICIPANT_LIST: 'ENABLE_VIEW_THE_PARTICIPANT_LIST',
816
823
  };
817
824
 
818
825
  export const SELF_ROLES = {
@@ -4,4 +4,13 @@ enum Setting {
4
4
  muted = 'Muted',
5
5
  }
6
6
 
7
+ enum Control {
8
+ audio = 'audio',
9
+ reactions = 'reactions',
10
+ shareControl = 'shareControl',
11
+ viewTheParticipantList = 'viewTheParticipantList',
12
+ }
13
+
14
+ export {Control, Setting};
15
+
7
16
  export default Setting;
@@ -3,7 +3,8 @@ import PermissionError from '../common/errors/permission';
3
3
  import {CONTROLS, HTTP_VERBS} from '../constants';
4
4
  import MeetingRequest from '../meeting/request';
5
5
  import LoggerProxy from '../common/logs/logger-proxy';
6
- import Setting from './enums';
6
+ import {Control, Setting} from './enums';
7
+ import {ControlConfig} from './types';
7
8
  import Util from './util';
8
9
  import {CAN_SET, CAN_UNSET, ENABLED} from './constants';
9
10
 
@@ -133,6 +134,40 @@ export default class ControlsOptionsManager {
133
134
  this.setLocusUrl(options?.locusUrl);
134
135
  }
135
136
 
137
+ /**
138
+ * Set controls for this meeting.
139
+ *
140
+ * @param {Array<ControlConfig>} controls - Spread Array of ControlConfigs
141
+ * @returns {Promise<Array<any>>}- Promise resolving if the request was successful.
142
+ */
143
+ protected update(...controls: Array<ControlConfig>) {
144
+ const payload = controls.reduce((output, control) => {
145
+ if (!Object.keys(Control).includes(control.scope)) {
146
+ throw new Error(
147
+ `updating meeting control scope "${control.scope}" is not a supported scope`
148
+ );
149
+ }
150
+
151
+ if (!Util.canUpdate(control, this.displayHints)) {
152
+ throw new PermissionError(
153
+ `updating meeting control scope "${control.scope}" not allowed, due to moderator property.`
154
+ );
155
+ }
156
+
157
+ return {
158
+ ...output,
159
+ [control.scope]: control.properties,
160
+ };
161
+ }, {});
162
+
163
+ // @ts-ignore
164
+ return this.request.request({
165
+ uri: `${this.locusUrl}/${CONTROLS}`,
166
+ body: payload,
167
+ method: HTTP_VERBS.PATCH,
168
+ });
169
+ }
170
+
136
171
  /**
137
172
  * @param {Setting} setting
138
173
  * @private
@@ -0,0 +1,49 @@
1
+ import {Control} from './enums';
2
+
3
+ export interface ControlProperties {
4
+ /**
5
+ * A list of additional properties that apply to various specific settings.
6
+ *
7
+ * @remarks
8
+ * The values stored here, per the service, are fully ambiguous, an can vary
9
+ * depending on which control scope is being configured.
10
+ */
11
+ [key: string]: boolean;
12
+ }
13
+
14
+ export interface AudioProperties {
15
+ muted?: boolean;
16
+ disallowUnmute?: boolean;
17
+ muteOnEntry?: boolean;
18
+ }
19
+
20
+ export interface ReactionsProperties {
21
+ enabled?: boolean;
22
+ showDisplayNameWithReactions?: boolean;
23
+ }
24
+
25
+ export interface ShareControlProperties {
26
+ control?: 'ANYONE' | 'MODERATOR_PRESENTER';
27
+ }
28
+
29
+ export interface ViewTheParticipantListProperties {
30
+ enabled?: boolean;
31
+ }
32
+
33
+ export type Properties =
34
+ | AudioProperties
35
+ | ReactionsProperties
36
+ | ShareControlProperties
37
+ | ViewTheParticipantListProperties;
38
+
39
+ export interface ControlConfig<Props = Properties> {
40
+ /**
41
+ * The scope of the control within this object.
42
+ */
43
+ scope: Control;
44
+
45
+ /**
46
+ * The properties to assign to this control.
47
+ */
48
+ properties: Props;
49
+ }