@webex/plugin-meetings 3.0.0-beta.55 → 3.0.0-beta.57

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.55",
3
+ "version": "3.0.0-beta.57",
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.55",
36
- "@webex/test-helper-chai": "3.0.0-beta.55",
37
- "@webex/test-helper-mocha": "3.0.0-beta.55",
38
- "@webex/test-helper-mock-webex": "3.0.0-beta.55",
39
- "@webex/test-helper-retry": "3.0.0-beta.55",
40
- "@webex/test-helper-test-users": "3.0.0-beta.55",
35
+ "@webex/plugin-meetings": "3.0.0-beta.57",
36
+ "@webex/test-helper-chai": "3.0.0-beta.57",
37
+ "@webex/test-helper-mocha": "3.0.0-beta.57",
38
+ "@webex/test-helper-mock-webex": "3.0.0-beta.57",
39
+ "@webex/test-helper-retry": "3.0.0-beta.57",
40
+ "@webex/test-helper-test-users": "3.0.0-beta.57",
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.55",
49
+ "@webex/common": "3.0.0-beta.57",
50
50
  "@webex/internal-media-core": "1.35.3",
51
- "@webex/internal-plugin-conversation": "3.0.0-beta.55",
52
- "@webex/internal-plugin-device": "3.0.0-beta.55",
53
- "@webex/internal-plugin-llm": "3.0.0-beta.55",
54
- "@webex/internal-plugin-mercury": "3.0.0-beta.55",
55
- "@webex/internal-plugin-metrics": "3.0.0-beta.55",
56
- "@webex/internal-plugin-support": "3.0.0-beta.55",
57
- "@webex/internal-plugin-user": "3.0.0-beta.55",
58
- "@webex/plugin-people": "3.0.0-beta.55",
59
- "@webex/plugin-rooms": "3.0.0-beta.55",
60
- "@webex/webex-core": "3.0.0-beta.55",
51
+ "@webex/internal-plugin-conversation": "3.0.0-beta.57",
52
+ "@webex/internal-plugin-device": "3.0.0-beta.57",
53
+ "@webex/internal-plugin-llm": "3.0.0-beta.57",
54
+ "@webex/internal-plugin-mercury": "3.0.0-beta.57",
55
+ "@webex/internal-plugin-metrics": "3.0.0-beta.57",
56
+ "@webex/internal-plugin-support": "3.0.0-beta.57",
57
+ "@webex/internal-plugin-user": "3.0.0-beta.57",
58
+ "@webex/plugin-people": "3.0.0-beta.57",
59
+ "@webex/plugin-rooms": "3.0.0-beta.57",
60
+ "@webex/webex-core": "3.0.0-beta.57",
61
61
  "ampersand-collection": "^2.0.2",
62
62
  "bowser": "^2.11.0",
63
63
  "btoa": "^1.2.1",
@@ -140,32 +140,48 @@ export default class ControlsOptionsManager {
140
140
  * @returns {Promise}
141
141
  */
142
142
  private setControls(setting: {[key in Setting]?: boolean}): Promise<any> {
143
- const muteUnmuteAll = Object.keys(setting).includes(Setting.muted);
144
-
145
- const body = muteUnmuteAll ? {audio: {}} : {};
146
- for (const [key, value] of Object.entries(setting)) {
147
- LoggerProxy.logger.log(`ControlsOptionsManager:index#setControls --> ${key} [${value}]`);
148
- // mute unmute all has different body structure than toggling disable hard mute
149
- // or mute on entry by themselves
150
- if (muteUnmuteAll) {
151
- if (Util?.[`${value ? CAN_SET : CAN_UNSET}${Setting.muted}`](this.displayHints)) {
152
- body.audio[camelCase(key)] = value;
153
- } else {
154
- return Promise.reject(
155
- new PermissionError(
156
- `${Setting.muted} [${value}] not allowed, due to moderator property.`
157
- )
158
- );
159
- }
160
- } else if (Util?.[`${value ? CAN_SET : CAN_UNSET}${key}`](this.displayHints)) {
161
- body[camelCase(key)] = {
162
- [ENABLED]: value,
163
- };
164
- } else {
165
- return Promise.reject(
166
- new PermissionError(`${key} [${value}] not allowed, due to moderator property.`)
167
- );
143
+ LoggerProxy.logger.log(
144
+ `ControlsOptionsManager:index#setControls --> ${JSON.stringify(setting)}`
145
+ );
146
+
147
+ const body: Record<string, any> = {};
148
+ let error: PermissionError;
149
+
150
+ Object.entries(setting).forEach(([key, value]) => {
151
+ if (!Util?.[`${value ? CAN_SET : CAN_UNSET}${key}`](this.displayHints)) {
152
+ error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);
153
+ }
154
+
155
+ if (error) {
156
+ return;
168
157
  }
158
+
159
+ switch (key) {
160
+ case Setting.muted:
161
+ body.audio = body.audio
162
+ ? {...body.audio, [camelCase(key)]: value}
163
+ : {[camelCase(key)]: value};
164
+ break;
165
+
166
+ case Setting.disallowUnmute:
167
+ case Setting.muteOnEntry:
168
+ if (Object.keys(setting).includes(Setting.muted)) {
169
+ body.audio = body.audio
170
+ ? {...body.audio, [camelCase(key)]: value}
171
+ : {[camelCase(key)]: value};
172
+ body.audio[camelCase(key)] = value;
173
+ } else {
174
+ body[camelCase(key)] = {[ENABLED]: value};
175
+ }
176
+ break;
177
+
178
+ default:
179
+ error = new PermissionError(`${key} [${value}] not allowed, due to moderator property.`);
180
+ }
181
+ });
182
+
183
+ if (error) {
184
+ return Promise.reject(error);
169
185
  }
170
186
 
171
187
  // @ts-ignore
@@ -116,17 +116,17 @@ import ControlsOptionsManager from '../controls-options-manager';
116
116
 
117
117
  const {isBrowser} = BrowserDetection();
118
118
 
119
- const logRequest = (request: any, {header = '', success = '', failure = ''}) => {
120
- LoggerProxy.logger.info(header);
119
+ const logRequest = (request: any, {logText = ''}) => {
120
+ LoggerProxy.logger.info(`${logText} - sending request`);
121
121
 
122
122
  return request
123
123
  .then((arg) => {
124
- LoggerProxy.logger.info(success);
124
+ LoggerProxy.logger.info(`${logText} - has been successfully sent`);
125
125
 
126
126
  return arg;
127
127
  })
128
128
  .catch((error) => {
129
- LoggerProxy.logger.error(failure, error);
129
+ LoggerProxy.logger.error(`${logText} - has failed: `, error);
130
130
  throw error;
131
131
  });
132
132
  };
@@ -3490,8 +3490,6 @@ export default class Meeting extends StatelessWebexPlugin {
3490
3490
  return Promise.reject(new ParameterError('no audio control associated to the meeting'));
3491
3491
  }
3492
3492
 
3493
- const LOG_HEADER = 'Meeting:index#muteAudio -->';
3494
-
3495
3493
  // First, stop sending the local audio media
3496
3494
  return logRequest(
3497
3495
  this.audio
@@ -3515,9 +3513,7 @@ export default class Meeting extends StatelessWebexPlugin {
3515
3513
  throw error;
3516
3514
  }),
3517
3515
  {
3518
- header: `${LOG_HEADER} muting audio`,
3519
- success: `${LOG_HEADER} muted audio successfully`,
3520
- failure: `${LOG_HEADER} muting audio failed, `,
3516
+ logText: `Meeting:index#muteAudio --> correlationId=${this.correlationId} muting audio`,
3521
3517
  }
3522
3518
  );
3523
3519
  }
@@ -3543,8 +3539,6 @@ export default class Meeting extends StatelessWebexPlugin {
3543
3539
  return Promise.reject(new ParameterError('no audio control associated to the meeting'));
3544
3540
  }
3545
3541
 
3546
- const LOG_HEADER = 'Meeting:index#unmuteAudio -->';
3547
-
3548
3542
  // First, send the control to unmute the participant on the server
3549
3543
  return logRequest(
3550
3544
  this.audio
@@ -3568,9 +3562,7 @@ export default class Meeting extends StatelessWebexPlugin {
3568
3562
  throw error;
3569
3563
  }),
3570
3564
  {
3571
- header: `${LOG_HEADER} unmuting audio`,
3572
- success: `${LOG_HEADER} unmuted audio successfully`,
3573
- failure: `${LOG_HEADER} unmuting audio failed, `,
3565
+ logText: `Meeting:index#unmuteAudio --> correlationId=${this.correlationId} unmuting audio`,
3574
3566
  }
3575
3567
  );
3576
3568
  }
@@ -3596,8 +3588,6 @@ export default class Meeting extends StatelessWebexPlugin {
3596
3588
  return Promise.reject(new ParameterError('no video control associated to the meeting'));
3597
3589
  }
3598
3590
 
3599
- const LOG_HEADER = 'Meeting:index#muteVideo -->';
3600
-
3601
3591
  return logRequest(
3602
3592
  this.video
3603
3593
  .handleClientRequest(this, true)
@@ -3620,9 +3610,7 @@ export default class Meeting extends StatelessWebexPlugin {
3620
3610
  throw error;
3621
3611
  }),
3622
3612
  {
3623
- header: `${LOG_HEADER} muting video`,
3624
- success: `${LOG_HEADER} muted video successfully`,
3625
- failure: `${LOG_HEADER} muting video failed, `,
3613
+ logText: `Meeting:index#muteVideo --> correlationId=${this.correlationId} muting video`,
3626
3614
  }
3627
3615
  );
3628
3616
  }
@@ -3648,8 +3636,6 @@ export default class Meeting extends StatelessWebexPlugin {
3648
3636
  return Promise.reject(new ParameterError('no audio control associated to the meeting'));
3649
3637
  }
3650
3638
 
3651
- const LOG_HEADER = 'Meeting:index#unmuteVideo -->';
3652
-
3653
3639
  return logRequest(
3654
3640
  this.video
3655
3641
  .handleClientRequest(this, false)
@@ -3672,9 +3658,7 @@ export default class Meeting extends StatelessWebexPlugin {
3672
3658
  throw error;
3673
3659
  }),
3674
3660
  {
3675
- header: `${LOG_HEADER} unmuting video`,
3676
- success: `${LOG_HEADER} unmuted video successfully`,
3677
- failure: `${LOG_HEADER} unmuting video failed, `,
3661
+ logText: `Meeting:index#unmuteVideo --> correlationId=${this.correlationId} unmuting video`,
3678
3662
  }
3679
3663
  );
3680
3664
  }
@@ -4799,7 +4783,7 @@ export default class Meeting extends StatelessWebexPlugin {
4799
4783
  this.mediaProperties.webrtcMediaConnection.on(Event.ROAP_FAILURE, this.handleRoapFailure);
4800
4784
 
4801
4785
  this.mediaProperties.webrtcMediaConnection.on(Event.ROAP_MESSAGE_TO_SEND, (event) => {
4802
- const LOG_HEADER = 'Meeting:index#setupMediaConnectionListeners.ROAP_MESSAGE_TO_SEND -->';
4786
+ const LOG_HEADER = `Meeting:index#setupMediaConnectionListeners.ROAP_MESSAGE_TO_SEND --> correlationId=${this.correlationId}`;
4803
4787
 
4804
4788
  switch (event.roapMessage.messageType) {
4805
4789
  case 'OK':
@@ -4815,9 +4799,7 @@ export default class Meeting extends StatelessWebexPlugin {
4815
4799
  correlationId: this.correlationId,
4816
4800
  }),
4817
4801
  {
4818
- header: `${LOG_HEADER} Send Roap OK`,
4819
- success: `${LOG_HEADER} Successfully send roap OK`,
4820
- failure: `${LOG_HEADER} Error joining the call on send roap OK, `,
4802
+ logText: `${LOG_HEADER} Roap OK`,
4821
4803
  }
4822
4804
  );
4823
4805
  break;
@@ -4837,9 +4819,7 @@ export default class Meeting extends StatelessWebexPlugin {
4837
4819
  reconnect: this.reconnectionManager.isReconnectInProgress(),
4838
4820
  }),
4839
4821
  {
4840
- header: `${LOG_HEADER} Send Roap Offer`,
4841
- success: `${LOG_HEADER} Successfully send roap offer`,
4842
- failure: `${LOG_HEADER} Error joining the call on send roap offer, `,
4822
+ logText: `${LOG_HEADER} Roap Offer`,
4843
4823
  }
4844
4824
  );
4845
4825
  break;
@@ -4858,9 +4838,7 @@ export default class Meeting extends StatelessWebexPlugin {
4858
4838
  correlationId: this.correlationId,
4859
4839
  }),
4860
4840
  {
4861
- header: `${LOG_HEADER} Send Roap Answer.`,
4862
- success: `${LOG_HEADER} Successfully send roap answer`,
4863
- failure: `${LOG_HEADER} Error joining the call on send roap answer, `,
4841
+ logText: `${LOG_HEADER} Roap Answer`,
4864
4842
  }
4865
4843
  ).catch((error) => {
4866
4844
  const metricName = BEHAVIORAL_METRICS.ROAP_ANSWER_FAILURE;
@@ -4897,9 +4875,7 @@ export default class Meeting extends StatelessWebexPlugin {
4897
4875
  correlationId: this.correlationId,
4898
4876
  }),
4899
4877
  {
4900
- header: `${LOG_HEADER} Send Roap Error.`,
4901
- success: `${LOG_HEADER} Successfully send roap error`,
4902
- failure: `${LOG_HEADER} Failed to send roap error, `,
4878
+ logText: `${LOG_HEADER} Roap Error (${event.roapMessage.errorType})`,
4903
4879
  }
4904
4880
  );
4905
4881
  break;
@@ -4993,7 +4969,7 @@ export default class Meeting extends StatelessWebexPlugin {
4993
4969
  };
4994
4970
 
4995
4971
  LoggerProxy.logger.info(
4996
- `Meeting:index#setupMediaConnectionListeners --> connection state changed to ${event.state}`
4972
+ `Meeting:index#setupMediaConnectionListeners --> correlationId=${this.correlationId} connection state changed to ${event.state}`
4997
4973
  );
4998
4974
  switch (event.state) {
4999
4975
  case ConnectionState.Connecting: