@webex/plugin-meetings 3.0.0-beta.328 → 3.0.0-beta.329

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.
@@ -1697,8 +1697,8 @@ export default class Meeting extends StatelessWebexPlugin {
1697
1697
  * @returns {object} containing timeLeft, expiryTime, currentTime
1698
1698
  */
1699
1699
  getPermissionTokenExpiryInfo(): {
1700
- timeLeft?: number;
1701
- expiryTime?: number;
1700
+ timeLeft: number;
1701
+ expiryTime: number;
1702
1702
  currentTime: number;
1703
1703
  };
1704
1704
  /**
@@ -62,7 +62,7 @@ var Webinar = _webexCore.WebexPlugin.extend({
62
62
  updateCanManageWebcast: function updateCanManageWebcast(canManageWebcast) {
63
63
  this.set('canManageWebcast', canManageWebcast);
64
64
  },
65
- version: "3.0.0-beta.328"
65
+ version: "3.0.0-beta.329"
66
66
  });
67
67
  var _default = Webinar;
68
68
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webex/plugin-meetings",
3
- "version": "3.0.0-beta.328",
3
+ "version": "3.0.0-beta.329",
4
4
  "description": "",
5
5
  "license": "Cisco EULA (https://www.cisco.com/c/en/us/products/end-user-license-agreement.html)",
6
6
  "contributors": [
@@ -33,12 +33,12 @@
33
33
  },
34
34
  "devDependencies": {
35
35
  "@peculiar/webcrypto": "^1.4.3",
36
- "@webex/plugin-meetings": "3.0.0-beta.328",
37
- "@webex/test-helper-chai": "3.0.0-beta.328",
38
- "@webex/test-helper-mocha": "3.0.0-beta.328",
39
- "@webex/test-helper-mock-webex": "3.0.0-beta.328",
40
- "@webex/test-helper-retry": "3.0.0-beta.328",
41
- "@webex/test-helper-test-users": "3.0.0-beta.328",
36
+ "@webex/plugin-meetings": "3.0.0-beta.329",
37
+ "@webex/test-helper-chai": "3.0.0-beta.329",
38
+ "@webex/test-helper-mocha": "3.0.0-beta.329",
39
+ "@webex/test-helper-mock-webex": "3.0.0-beta.329",
40
+ "@webex/test-helper-retry": "3.0.0-beta.329",
41
+ "@webex/test-helper-test-users": "3.0.0-beta.329",
42
42
  "chai": "^4.3.4",
43
43
  "chai-as-promised": "^7.1.1",
44
44
  "jsdom-global": "3.0.2",
@@ -47,19 +47,19 @@
47
47
  "typescript": "^4.7.4"
48
48
  },
49
49
  "dependencies": {
50
- "@webex/common": "3.0.0-beta.328",
50
+ "@webex/common": "3.0.0-beta.329",
51
51
  "@webex/internal-media-core": "2.2.2",
52
- "@webex/internal-plugin-conversation": "3.0.0-beta.328",
53
- "@webex/internal-plugin-device": "3.0.0-beta.328",
54
- "@webex/internal-plugin-llm": "3.0.0-beta.328",
55
- "@webex/internal-plugin-mercury": "3.0.0-beta.328",
56
- "@webex/internal-plugin-metrics": "3.0.0-beta.328",
57
- "@webex/internal-plugin-support": "3.0.0-beta.328",
58
- "@webex/internal-plugin-user": "3.0.0-beta.328",
59
- "@webex/media-helpers": "3.0.0-beta.328",
60
- "@webex/plugin-people": "3.0.0-beta.328",
61
- "@webex/plugin-rooms": "3.0.0-beta.328",
62
- "@webex/webex-core": "3.0.0-beta.328",
52
+ "@webex/internal-plugin-conversation": "3.0.0-beta.329",
53
+ "@webex/internal-plugin-device": "3.0.0-beta.329",
54
+ "@webex/internal-plugin-llm": "3.0.0-beta.329",
55
+ "@webex/internal-plugin-mercury": "3.0.0-beta.329",
56
+ "@webex/internal-plugin-metrics": "3.0.0-beta.329",
57
+ "@webex/internal-plugin-support": "3.0.0-beta.329",
58
+ "@webex/internal-plugin-user": "3.0.0-beta.329",
59
+ "@webex/media-helpers": "3.0.0-beta.329",
60
+ "@webex/plugin-people": "3.0.0-beta.329",
61
+ "@webex/plugin-rooms": "3.0.0-beta.329",
62
+ "@webex/webex-core": "3.0.0-beta.329",
63
63
  "ampersand-collection": "^2.0.2",
64
64
  "bowser": "^2.11.0",
65
65
  "btoa": "^1.2.1",
@@ -1525,7 +1525,11 @@ export default class Meeting extends StatelessWebexPlugin {
1525
1525
  : this.destination;
1526
1526
  const destinationType = isStartingSpaceInstantV2Meeting ? _MEETING_LINK_ : this.destinationType;
1527
1527
 
1528
- const {timeLeft, expiryTime, currentTime} = this.getPermissionTokenExpiryInfo();
1528
+ const permissionTokenExpiryInfo = this.getPermissionTokenExpiryInfo();
1529
+
1530
+ const timeLeft = permissionTokenExpiryInfo?.timeLeft;
1531
+ const expiryTime = permissionTokenExpiryInfo?.expiryTime;
1532
+ const currentTime = permissionTokenExpiryInfo?.currentTime;
1529
1533
 
1530
1534
  LoggerProxy.logger.info(
1531
1535
  `Meeting:index#refreshPermissionToken --> refreshing permission token, destinationType=${destinationType}, timeLeft=${timeLeft}, permissionTokenExpiry=${expiryTime}, currentTimestamp=${currentTime},reason=${reason}`
@@ -7962,11 +7966,7 @@ export default class Meeting extends StatelessWebexPlugin {
7962
7966
  *
7963
7967
  * @returns {object} containing timeLeft, expiryTime, currentTime
7964
7968
  */
7965
- public getPermissionTokenExpiryInfo(): {
7966
- timeLeft?: number;
7967
- expiryTime?: number;
7968
- currentTime: number;
7969
- } {
7969
+ public getPermissionTokenExpiryInfo() {
7970
7970
  if (!this.permissionTokenPayload) {
7971
7971
  return undefined;
7972
7972
  }
@@ -7993,7 +7993,7 @@ export default class Meeting extends StatelessWebexPlugin {
7993
7993
  * @returns {Promise<void>}
7994
7994
  */
7995
7995
  public checkAndRefreshPermissionToken(threshold: number, reason: string): Promise<void> {
7996
- const {timeLeft} = this.getPermissionTokenExpiryInfo();
7996
+ const timeLeft = this.getPermissionTokenExpiryInfo()?.timeLeft;
7997
7997
 
7998
7998
  if (timeLeft !== undefined && timeLeft <= threshold) {
7999
7999
  return this.refreshPermissionToken(reason);
@@ -4616,7 +4616,7 @@ describe('plugin-meetings', () => {
4616
4616
  meeting.destination = 'meeting-destination';
4617
4617
  meeting.destinationType = 'meeting-destination-type';
4618
4618
  meeting.updateMeetingActions = sinon.stub().returns(undefined);
4619
- meeting.getPermissionTokenExpiryInfo = sinon.stub().returns(FAKE_TIMESTAMPS);
4619
+
4620
4620
  meeting.meetingInfoExtraParams = {
4621
4621
  extraParam1: 'value1'
4622
4622
  };
@@ -4637,6 +4637,7 @@ describe('plugin-meetings', () => {
4637
4637
  });
4638
4638
 
4639
4639
  it('calls meetingInfoProvider.fetchMeetingInfo() with the right params', async () => {
4640
+ meeting.getPermissionTokenExpiryInfo = sinon.stub().returns(FAKE_TIMESTAMPS);
4640
4641
  await meeting.refreshPermissionToken('fake reason');
4641
4642
 
4642
4643
  assert.calledOnceWithExactly(
@@ -4678,7 +4679,51 @@ describe('plugin-meetings', () => {
4678
4679
  );
4679
4680
  });
4680
4681
 
4682
+ it('calls meetingInfoProvider.fetchMeetingInfo() with the right params when getPermissionTokenExpiryInfo returns undefined', async () => {
4683
+ meeting.getPermissionTokenExpiryInfo = sinon.stub().returns(undefined);
4684
+ await meeting.refreshPermissionToken('fake reason');
4685
+
4686
+ assert.calledOnceWithExactly(
4687
+ meeting.attrs.meetingInfoProvider.fetchMeetingInfo,
4688
+ 'meeting-destination',
4689
+ 'meeting-destination-type',
4690
+ null,
4691
+ null,
4692
+ 'fake-installed-org-id',
4693
+ 'locus-id',
4694
+ {extraParam1: 'value1', permissionToken: FAKE_PERMISSION_TOKEN},
4695
+ {meetingId: meeting.id, sendCAevents: true}
4696
+ );
4697
+ assert.deepEqual(meeting.meetingInfo, {
4698
+ ...FAKE_MEETING_INFO,
4699
+ meetingLookupUrl: FAKE_MEETING_INFO_LOOKUP_URL
4700
+ });
4701
+ assert.equal(meeting.meetingInfoFailureReason, MEETING_INFO_FAILURE_REASON.NONE);
4702
+ assert.equal(meeting.requiredCaptcha, null);
4703
+ assert.equal(meeting.passwordStatus, PASSWORD_STATUS.NOT_REQUIRED);
4704
+
4705
+ assert.calledWith(
4706
+ TriggerProxy.trigger,
4707
+ meeting,
4708
+ {file: 'meetings', function: 'fetchMeetingInfo'},
4709
+ 'meeting:meetingInfoAvailable'
4710
+ );
4711
+ assert.calledWith(meeting.updateMeetingActions);
4712
+
4713
+ assert.calledWith(
4714
+ Metrics.sendBehavioralMetric, BEHAVIORAL_METRICS.PERMISSION_TOKEN_REFRESH, {
4715
+ correlationId: meeting.correlationId,
4716
+ timeLeft: undefined,
4717
+ expiryTime: undefined,
4718
+ currentTime: undefined,
4719
+ reason: 'fake reason',
4720
+ destinationType: 'meeting-destination-type',
4721
+ }
4722
+ );
4723
+ });
4724
+
4681
4725
  it('calls meetingInfoProvider.fetchMeetingInfo() with the right params when we are starting an instant space meeting', async () => {
4726
+ meeting.getPermissionTokenExpiryInfo = sinon.stub().returns(FAKE_TIMESTAMPS);
4682
4727
  meeting.destination = 'some-convo-url';
4683
4728
  meeting.destinationType = 'CONVERSATION_URL';
4684
4729
  meeting.config.experimental = {enableAdhocMeetings: true};
@@ -9795,7 +9840,7 @@ describe('plugin-meetings', () => {
9795
9840
 
9796
9841
  describe('#checkAndRefreshPermissionToken', () => {
9797
9842
  it('should not fire refreshPermissionToken if permissionToken is not defined', async() => {
9798
- meeting.getPermissionTokenExpiryInfo = sinon.stub().returns({timeLeft: undefined, expiryTime: undefined, currentTime: Date.now()})
9843
+ meeting.getPermissionTokenExpiryInfo = sinon.stub().returns(undefined)
9799
9844
  meeting.refreshPermissionToken = sinon.stub().returns(Promise.resolve('test return value'));
9800
9845
 
9801
9846
  const returnValue = await meeting.checkAndRefreshPermissionToken(10, 'ttl-join');