@webex/plugin-meetings 2.60.0-next.1 → 2.60.0-next.11

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 (185) hide show
  1. package/dist/annotation/annotation.types.d.ts +42 -0
  2. package/dist/annotation/constants.d.ts +31 -0
  3. package/dist/annotation/index.d.ts +117 -0
  4. package/dist/breakouts/breakout.d.ts +8 -0
  5. package/dist/breakouts/breakout.js +1 -1
  6. package/dist/breakouts/collection.d.ts +5 -0
  7. package/dist/breakouts/edit-lock-error.d.ts +15 -0
  8. package/dist/breakouts/events.d.ts +8 -0
  9. package/dist/breakouts/index.d.ts +5 -0
  10. package/dist/breakouts/index.js +1 -1
  11. package/dist/breakouts/request.d.ts +22 -0
  12. package/dist/breakouts/utils.d.ts +15 -0
  13. package/dist/common/browser-detection.d.ts +9 -0
  14. package/dist/common/collection.d.ts +48 -0
  15. package/dist/common/config.d.ts +2 -0
  16. package/dist/common/errors/captcha-error.d.ts +15 -0
  17. package/dist/common/errors/intent-to-join.d.ts +16 -0
  18. package/dist/common/errors/join-meeting.d.ts +17 -0
  19. package/dist/common/errors/media.d.ts +15 -0
  20. package/dist/common/errors/no-meeting-info.d.ts +14 -0
  21. package/dist/common/errors/parameter.d.ts +15 -0
  22. package/dist/common/errors/password-error.d.ts +15 -0
  23. package/dist/common/errors/permission.d.ts +14 -0
  24. package/dist/common/errors/reclaim-host-role-errors.d.ts +60 -0
  25. package/dist/common/errors/reconnection-in-progress.d.ts +9 -0
  26. package/dist/common/errors/reconnection.d.ts +15 -0
  27. package/dist/common/errors/stats.d.ts +15 -0
  28. package/dist/common/errors/webex-errors.d.ts +93 -0
  29. package/dist/common/errors/webex-meetings-error.d.ts +20 -0
  30. package/dist/common/events/events-scope.d.ts +17 -0
  31. package/dist/common/events/events.d.ts +12 -0
  32. package/dist/common/events/trigger-proxy.d.ts +2 -0
  33. package/dist/common/events/util.d.ts +2 -0
  34. package/dist/common/logs/logger-config.d.ts +2 -0
  35. package/dist/common/logs/logger-proxy.d.ts +2 -0
  36. package/dist/common/logs/request.d.ts +36 -0
  37. package/dist/common/queue.d.ts +34 -0
  38. package/dist/config.d.ts +71 -0
  39. package/dist/constants.d.ts +1072 -0
  40. package/dist/constants.js +1 -1
  41. package/dist/constants.js.map +1 -1
  42. package/dist/controls-options-manager/constants.d.ts +4 -0
  43. package/dist/controls-options-manager/enums.d.ts +15 -0
  44. package/dist/controls-options-manager/enums.js +2 -1
  45. package/dist/controls-options-manager/enums.js.map +1 -1
  46. package/dist/controls-options-manager/index.d.ts +136 -0
  47. package/dist/controls-options-manager/types.d.ts +43 -0
  48. package/dist/controls-options-manager/util.d.ts +1 -0
  49. package/dist/index.d.ts +7 -0
  50. package/dist/interpretation/collection.d.ts +5 -0
  51. package/dist/interpretation/index.d.ts +5 -0
  52. package/dist/interpretation/index.js +1 -1
  53. package/dist/interpretation/siLanguage.d.ts +5 -0
  54. package/dist/interpretation/siLanguage.js +1 -1
  55. package/dist/locus-info/controlsUtils.d.ts +2 -0
  56. package/dist/locus-info/embeddedAppsUtils.d.ts +2 -0
  57. package/dist/locus-info/fullState.d.ts +2 -0
  58. package/dist/locus-info/hostUtils.d.ts +2 -0
  59. package/dist/locus-info/index.d.ts +322 -0
  60. package/dist/locus-info/infoUtils.d.ts +2 -0
  61. package/dist/locus-info/mediaSharesUtils.d.ts +2 -0
  62. package/dist/locus-info/parser.d.ts +272 -0
  63. package/dist/locus-info/parser.js +5 -5
  64. package/dist/locus-info/parser.js.map +1 -1
  65. package/dist/locus-info/selfUtils.d.ts +2 -0
  66. package/dist/media/index.d.ts +34 -0
  67. package/dist/media/index.js +6 -5
  68. package/dist/media/index.js.map +1 -1
  69. package/dist/media/properties.d.ts +93 -0
  70. package/dist/media/util.d.ts +2 -0
  71. package/dist/mediaQualityMetrics/config.d.ts +237 -0
  72. package/dist/mediaQualityMetrics/config.js +1 -202
  73. package/dist/mediaQualityMetrics/config.js.map +1 -1
  74. package/dist/meeting/in-meeting-actions.d.ts +167 -0
  75. package/dist/meeting/in-meeting-actions.js +4 -0
  76. package/dist/meeting/in-meeting-actions.js.map +1 -1
  77. package/dist/meeting/index.d.ts +1719 -0
  78. package/dist/meeting/index.js +288 -155
  79. package/dist/meeting/index.js.map +1 -1
  80. package/dist/meeting/locusMediaRequest.d.ts +74 -0
  81. package/dist/meeting/muteState.d.ts +184 -0
  82. package/dist/meeting/request.d.ts +290 -0
  83. package/dist/meeting/request.type.d.ts +11 -0
  84. package/dist/meeting/state.d.ts +9 -0
  85. package/dist/meeting/util.d.ts +103 -0
  86. package/dist/meeting-info/collection.d.ts +20 -0
  87. package/dist/meeting-info/index.d.ts +69 -0
  88. package/dist/meeting-info/meeting-info-v2.d.ts +123 -0
  89. package/dist/meeting-info/meeting-info-v2.js +3 -0
  90. package/dist/meeting-info/meeting-info-v2.js.map +1 -1
  91. package/dist/meeting-info/request.d.ts +22 -0
  92. package/dist/meeting-info/util.d.ts +2 -0
  93. package/dist/meeting-info/utilv2.d.ts +2 -0
  94. package/dist/meeting-info/utilv2.js +14 -29
  95. package/dist/meeting-info/utilv2.js.map +1 -1
  96. package/dist/meetings/collection.d.ts +40 -0
  97. package/dist/meetings/collection.js +17 -0
  98. package/dist/meetings/collection.js.map +1 -1
  99. package/dist/meetings/index.d.ts +378 -0
  100. package/dist/meetings/index.js +30 -9
  101. package/dist/meetings/index.js.map +1 -1
  102. package/dist/meetings/meetings.types.d.ts +4 -0
  103. package/dist/meetings/request.d.ts +27 -0
  104. package/dist/meetings/util.d.ts +18 -0
  105. package/dist/member/index.d.ts +160 -0
  106. package/dist/member/member.types.d.ts +11 -0
  107. package/dist/member/types.d.ts +32 -0
  108. package/dist/member/util.d.ts +2 -0
  109. package/dist/members/collection.d.ts +29 -0
  110. package/dist/members/index.d.ts +353 -0
  111. package/dist/members/request.d.ts +114 -0
  112. package/dist/members/types.d.ts +25 -0
  113. package/dist/members/util.d.ts +215 -0
  114. package/dist/metrics/constants.d.ts +68 -0
  115. package/dist/metrics/constants.js +3 -0
  116. package/dist/metrics/constants.js.map +1 -1
  117. package/dist/metrics/index.d.ts +45 -0
  118. package/dist/multistream/mediaRequestManager.d.ts +118 -0
  119. package/dist/multistream/receiveSlot.d.ts +68 -0
  120. package/dist/multistream/receiveSlotManager.d.ts +56 -0
  121. package/dist/multistream/remoteMedia.d.ts +72 -0
  122. package/dist/multistream/remoteMediaGroup.d.ts +47 -0
  123. package/dist/multistream/remoteMediaManager.d.ts +285 -0
  124. package/dist/multistream/sendSlotManager.d.ts +61 -0
  125. package/dist/networkQualityMonitor/index.d.ts +70 -0
  126. package/dist/personal-meeting-room/index.d.ts +47 -0
  127. package/dist/personal-meeting-room/request.d.ts +14 -0
  128. package/dist/personal-meeting-room/util.d.ts +2 -0
  129. package/dist/reachability/index.d.ts +194 -0
  130. package/dist/reachability/request.d.ts +39 -0
  131. package/dist/reactions/constants.d.ts +3 -0
  132. package/dist/reactions/reactions.d.ts +4 -0
  133. package/dist/reactions/reactions.type.d.ts +52 -0
  134. package/dist/reconnection-manager/index.d.ts +136 -0
  135. package/dist/reconnection-manager/index.js +27 -28
  136. package/dist/reconnection-manager/index.js.map +1 -1
  137. package/dist/recording-controller/enums.d.ts +7 -0
  138. package/dist/recording-controller/index.d.ts +207 -0
  139. package/dist/recording-controller/util.d.ts +14 -0
  140. package/dist/roap/index.d.ts +78 -0
  141. package/dist/roap/request.d.ts +41 -0
  142. package/dist/roap/turnDiscovery.d.ts +92 -0
  143. package/dist/rtcMetrics/constants.d.ts +4 -0
  144. package/dist/rtcMetrics/index.d.ts +54 -0
  145. package/dist/rtcMetrics/index.js +25 -0
  146. package/dist/rtcMetrics/index.js.map +1 -1
  147. package/dist/statsAnalyzer/global.d.ts +36 -0
  148. package/dist/statsAnalyzer/index.d.ts +191 -0
  149. package/dist/statsAnalyzer/index.js +53 -146
  150. package/dist/statsAnalyzer/index.js.map +1 -1
  151. package/dist/statsAnalyzer/mqaUtil.d.ts +24 -0
  152. package/dist/statsAnalyzer/mqaUtil.js +11 -12
  153. package/dist/statsAnalyzer/mqaUtil.js.map +1 -1
  154. package/dist/transcription/index.d.ts +64 -0
  155. package/dist/webinar/collection.d.ts +16 -0
  156. package/dist/webinar/index.d.ts +5 -0
  157. package/dist/webinar/index.js +1 -1
  158. package/package.json +26 -27
  159. package/src/constants.ts +10 -4
  160. package/src/controls-options-manager/enums.ts +2 -0
  161. package/src/locus-info/parser.ts +6 -6
  162. package/src/media/index.ts +5 -5
  163. package/src/mediaQualityMetrics/config.ts +0 -135
  164. package/src/meeting/in-meeting-actions.ts +8 -0
  165. package/src/meeting/index.ts +263 -125
  166. package/src/meeting-info/meeting-info-v2.ts +4 -0
  167. package/src/meeting-info/utilv2.ts +6 -19
  168. package/src/meetings/collection.ts +13 -0
  169. package/src/meetings/index.ts +28 -10
  170. package/src/metrics/constants.ts +3 -0
  171. package/src/reconnection-manager/index.ts +63 -68
  172. package/src/rtcMetrics/index.ts +24 -0
  173. package/src/statsAnalyzer/index.ts +68 -216
  174. package/src/statsAnalyzer/mqaUtil.ts +17 -22
  175. package/test/unit/spec/media/index.ts +20 -4
  176. package/test/unit/spec/meeting/in-meeting-actions.ts +4 -0
  177. package/test/unit/spec/meeting/index.js +1376 -189
  178. package/test/unit/spec/meeting/muteState.js +2 -1
  179. package/test/unit/spec/meeting-info/meetinginfov2.js +28 -0
  180. package/test/unit/spec/meetings/collection.js +12 -0
  181. package/test/unit/spec/meetings/index.js +382 -118
  182. package/test/unit/spec/member/util.js +0 -31
  183. package/test/unit/spec/reconnection-manager/index.js +42 -12
  184. package/test/unit/spec/rtcMetrics/index.ts +20 -0
  185. package/test/unit/spec/stats-analyzer/index.js +12 -2
@@ -372,7 +372,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
372
372
  * @memberof Meeting
373
373
  */
374
374
  function Meeting(attrs, _options) {
375
- var _this$locusInfo, _this$locusInfo$links, _this$locusInfo$links2, _this$locusInfo$links3, _this$locusInfo2, _this$locusInfo2$full, _this$locusInfo3, _this$locusInfo4;
375
+ var _attrs$callStateForMe, _this$locusInfo, _this$locusInfo$links, _this$locusInfo$links2, _this$locusInfo$links3, _this$locusInfo2, _this$locusInfo2$full, _this$locusInfo3, _this$locusInfo4;
376
376
  var _this;
377
377
  (0, _classCallCheck2.default)(this, Meeting);
378
378
  _this = _super.call(this, {}, _options);
@@ -390,7 +390,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
390
390
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "annotation", void 0);
391
391
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "webinar", void 0);
392
392
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "conversationUrl", void 0);
393
- (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "correlationId", void 0);
393
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callStateForMetrics", void 0);
394
394
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "destination", void 0);
395
395
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "destinationType", void 0);
396
396
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deviceUrl", void 0);
@@ -453,6 +453,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
453
453
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "requiredCaptcha", void 0);
454
454
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "receiveSlotManager", void 0);
455
455
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selfUserPolicies", void 0);
456
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "enforceVBGImagesURL", void 0);
456
457
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "shareStatus", void 0);
457
458
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "screenShareFloorState", void 0);
458
459
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "statsAnalyzer", void 0);
@@ -475,6 +476,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
475
476
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "meetingState", void 0);
476
477
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "permissionToken", void 0);
477
478
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "permissionTokenPayload", void 0);
479
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "permissionTokenReceivedLocalTime", void 0);
478
480
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resourceId", void 0);
479
481
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "resourceUrl", void 0);
480
482
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "selfId", void 0);
@@ -493,6 +495,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
493
495
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deferSDPAnswer", void 0);
494
496
  // used for waiting for a response
495
497
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "sdpResponseTimer", void 0);
498
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hasMediaConnectionConnectedAtLeastOnce", void 0);
496
499
  /**
497
500
  * Callback called when a relay event is received from meeting LLM Connection
498
501
  * @param {RelayEvent} e Event object coming from LLM Connection
@@ -784,36 +787,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
784
787
  });
785
788
  _this.mediaProperties.webrtcMediaConnection.on(_internalMediaCore.Event.CONNECTION_STATE_CHANGED, function (event) {
786
789
  var connectionFailed = function connectionFailed() {
787
- // we know the media connection failed and browser will not attempt to recover it any more
788
- // so reset the timer as it's not needed anymore, we want to reconnect immediately
789
- _this.reconnectionManager.resetReconnectionTimer();
790
- _this.reconnect({
791
- networkDisconnect: true
792
- });
793
- // @ts-ignore
794
- _this.webex.internal.newMetrics.submitClientEvent({
795
- name: 'client.ice.end',
796
- payload: {
797
- canProceed: false,
798
- icePhase: 'IN_MEETING',
799
- errors: [
800
- // @ts-ignore
801
- _this.webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode({
802
- clientErrorCode: _internalPluginMetrics.CALL_DIAGNOSTIC_CONFIG.ICE_FAILURE_CLIENT_CODE
803
- })]
804
- },
805
- options: {
806
- meetingId: _this.id
807
- }
808
- });
809
- _this.uploadLogs({
810
- file: 'peer-connection-manager/index',
811
- function: 'connectionFailed'
812
- });
813
790
  _metrics.default.sendBehavioralMetric(_constants2.default.CONNECTION_FAILURE, {
814
791
  correlation_id: _this.correlationId,
815
- locus_id: _this.locusId
792
+ locus_id: _this.locusId,
793
+ networkStatus: _this.networkStatus,
794
+ hasMediaConnectionConnectedAtLeastOnce: _this.hasMediaConnectionConnectedAtLeastOnce
816
795
  });
796
+ if (_this.hasMediaConnectionConnectedAtLeastOnce) {
797
+ // we know the media connection failed and browser will not attempt to recover it any more
798
+ // so reset the timer as it's not needed anymore, we want to reconnect immediately
799
+ _this.reconnectionManager.resetReconnectionTimer();
800
+ _this.reconnect({
801
+ networkDisconnect: true
802
+ });
803
+ _this.uploadLogs({
804
+ file: 'peer-connection-manager/index',
805
+ function: 'connectionFailed'
806
+ });
807
+ }
817
808
  };
818
809
  _loggerProxy.default.logger.info("Meeting:index#setupMediaConnectionListeners --> correlationId=".concat(_this.correlationId, " connection state changed to ").concat(event.state));
819
810
 
@@ -821,22 +812,32 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
821
812
  var cdl = _this.webex.internal.newMetrics.callDiagnosticLatencies;
822
813
  switch (event.state) {
823
814
  case _internalMediaCore.ConnectionState.Connecting:
824
- // @ts-ignore
825
- _this.webex.internal.newMetrics.submitClientEvent({
826
- name: 'client.ice.start',
827
- options: {
828
- meetingId: _this.id
829
- }
830
- });
815
+ if (!_this.hasMediaConnectionConnectedAtLeastOnce) {
816
+ // Only send CA event for join flow if we haven't successfully connected media yet
817
+ // @ts-ignore
818
+ _this.webex.internal.newMetrics.submitClientEvent({
819
+ name: 'client.ice.start',
820
+ options: {
821
+ meetingId: _this.id
822
+ }
823
+ });
824
+ }
831
825
  break;
832
826
  case _internalMediaCore.ConnectionState.Connected:
833
- // @ts-ignore
834
- _this.webex.internal.newMetrics.submitClientEvent({
835
- name: 'client.ice.end',
836
- options: {
837
- meetingId: _this.id
838
- }
839
- });
827
+ if (!_this.hasMediaConnectionConnectedAtLeastOnce) {
828
+ // Only send CA event for join flow if we haven't successfully connected media yet
829
+ // @ts-ignore
830
+ _this.webex.internal.newMetrics.submitClientEvent({
831
+ name: 'client.ice.end',
832
+ payload: {
833
+ canProceed: true,
834
+ icePhase: 'JOIN_MEETING_FINAL'
835
+ },
836
+ options: {
837
+ meetingId: _this.id
838
+ }
839
+ });
840
+ }
840
841
  _metrics.default.sendBehavioralMetric(_constants2.default.CONNECTION_SUCCESS, {
841
842
  correlation_id: _this.correlationId,
842
843
  locus_id: _this.locusId,
@@ -845,6 +846,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
845
846
  _this.setNetworkStatus(_constants.NETWORK_STATUS.CONNECTED);
846
847
  _this.reconnectionManager.iceReconnected();
847
848
  _this.statsAnalyzer.startAnalyzer(_this.mediaProperties.webrtcMediaConnection);
849
+ _this.hasMediaConnectionConnectedAtLeastOnce = true;
848
850
  break;
849
851
  case _internalMediaCore.ConnectionState.Disconnected:
850
852
  _this.setNetworkStatus(_constants.NETWORK_STATUS.DISCONNECTED);
@@ -1105,6 +1107,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1105
1107
  }
1106
1108
  }, _callee2, null, [[4, 9]]);
1107
1109
  })));
1110
+ /**
1111
+ * Functionality for when a share video is muted or unmuted.
1112
+ * @private
1113
+ * @memberof Meeting
1114
+ * @param {boolean} muted
1115
+ * @returns {undefined}
1116
+ */
1117
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "handleShareVideoStreamMuteStateChange", function (muted) {
1118
+ _loggerProxy.default.logger.log("Meeting:index#handleShareVideoStreamMuteStateChange --> Share video stream mute state changed to muted ".concat(muted));
1119
+ _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_VIDEO_MUTE_STATE_CHANGE, {
1120
+ correlationId: _this.correlationId,
1121
+ muted: muted
1122
+ });
1123
+ });
1108
1124
  /**
1109
1125
  * Functionality for when a share video is ended.
1110
1126
  * @private
@@ -1246,18 +1262,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1246
1262
  */
1247
1263
  _this.id = _uuid.default.v4();
1248
1264
  /**
1249
- * Correlation ID used for network tracking of meeting
1265
+ * Call state used for metrics
1250
1266
  * @instance
1251
- * @type {String}
1267
+ * @type {CallStateForMetrics}
1252
1268
  * @readonly
1253
1269
  * @public
1254
1270
  * @memberof Meeting
1255
1271
  */
1256
- if (attrs.correlationId) {
1257
- _loggerProxy.default.logger.log("Meetings:index#constructor --> Initializing the meeting object with correlation id from app ".concat(_this.correlationId));
1258
- _this.correlationId = attrs.correlationId;
1272
+ _this.callStateForMetrics = attrs.callStateForMetrics || {};
1273
+ var _correlationId = attrs.correlationId || ((_attrs$callStateForMe = attrs.callStateForMetrics) === null || _attrs$callStateForMe === void 0 ? void 0 : _attrs$callStateForMe.correlationId);
1274
+ if (_correlationId) {
1275
+ _loggerProxy.default.logger.log("Meetings:index#constructor --> Initializing the meeting object with correlation id from app ".concat(_correlationId));
1276
+ _this.callStateForMetrics.correlationId = _correlationId;
1259
1277
  } else {
1260
- _this.correlationId = _this.id;
1278
+ _this.callStateForMetrics.correlationId = _this.id;
1261
1279
  }
1262
1280
  /**
1263
1281
  * @instance
@@ -1702,13 +1720,14 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1702
1720
  */
1703
1721
  _this.networkQualityMonitor = null;
1704
1722
  /**
1723
+ * Indicates network status of the webrtc media connection
1705
1724
  * @instance
1706
1725
  * @type {String}
1707
1726
  * @readonly
1708
1727
  * @public
1709
1728
  * @memberof Meeting
1710
1729
  */
1711
- _this.networkStatus = null;
1730
+ _this.networkStatus = undefined;
1712
1731
  /**
1713
1732
  * Passing only info as we send basic info for meeting added event
1714
1733
  * @instance
@@ -1925,6 +1944,15 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1925
1944
  * @memberof Meeting
1926
1945
  */
1927
1946
  _this.retriedWithTurnServer = false;
1947
+
1948
+ /**
1949
+ * Whether or not the media connection has ever successfully connected.
1950
+ * @instance
1951
+ * @type {boolean}
1952
+ * @private
1953
+ * @memberof Meeting
1954
+ */
1955
+ _this.hasMediaConnectionConnectedAtLeastOnce = false;
1928
1956
  return _this;
1929
1957
  }
1930
1958
 
@@ -1965,6 +1993,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
1965
1993
  return this.type === 'CALL';
1966
1994
  }
1967
1995
 
1996
+ /**
1997
+ * Getter - Returns callStateForMetrics.correlationId
1998
+ * @returns {string}
1999
+ */
2000
+ }, {
2001
+ key: "correlationId",
2002
+ get: function get() {
2003
+ return this.callStateForMetrics.correlationId;
2004
+ }
2005
+
2006
+ /**
2007
+ * Setter - sets callStateForMetrics.correlationId
2008
+ * @param {string} correlationId
2009
+ */,
2010
+ set: function set(correlationId) {
2011
+ this.callStateForMetrics.correlationId = correlationId;
2012
+ }
2013
+
1968
2014
  /**
1969
2015
  * Internal method for fetching meeting info
1970
2016
  *
@@ -2088,7 +2134,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2088
2134
  value: (function () {
2089
2135
  var _refreshPermissionToken = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(reason) {
2090
2136
  var _this$meetingInfo;
2091
- var isStartingSpaceInstantV2Meeting, destination, destinationType, timeLeft;
2137
+ var isStartingSpaceInstantV2Meeting, destination, destinationType, permissionTokenExpiryInfo, timeLeft, expiryTime, currentTime;
2092
2138
  return _regenerator.default.wrap(function _callee5$(_context5) {
2093
2139
  while (1) switch (_context5.prev = _context5.next) {
2094
2140
  case 0:
@@ -2106,16 +2152,21 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2106
2152
  this.webex.meetings.preferredWebexSite;
2107
2153
  destination = isStartingSpaceInstantV2Meeting ? this.meetingInfo.meetingJoinUrl : this.destination;
2108
2154
  destinationType = isStartingSpaceInstantV2Meeting ? _constants._MEETING_LINK_ : this.destinationType;
2109
- timeLeft = this.getPermissionTokenTimeLeftInSec();
2110
- _loggerProxy.default.logger.info("Meeting:index#refreshPermissionToken --> refreshing permission token, destinationType=".concat(destinationType, ", timeLeft=").concat(timeLeft, ", reason=").concat(reason));
2155
+ permissionTokenExpiryInfo = this.getPermissionTokenExpiryInfo();
2156
+ timeLeft = permissionTokenExpiryInfo === null || permissionTokenExpiryInfo === void 0 ? void 0 : permissionTokenExpiryInfo.timeLeft;
2157
+ expiryTime = permissionTokenExpiryInfo === null || permissionTokenExpiryInfo === void 0 ? void 0 : permissionTokenExpiryInfo.expiryTime;
2158
+ currentTime = permissionTokenExpiryInfo === null || permissionTokenExpiryInfo === void 0 ? void 0 : permissionTokenExpiryInfo.currentTime;
2159
+ _loggerProxy.default.logger.info("Meeting:index#refreshPermissionToken --> refreshing permission token, destinationType=".concat(destinationType, ", timeLeft=").concat(timeLeft, ", permissionTokenExpiry=").concat(expiryTime, ", currentTimestamp=").concat(currentTime, ",reason=").concat(reason));
2111
2160
  _metrics.default.sendBehavioralMetric(_constants2.default.PERMISSION_TOKEN_REFRESH, {
2112
2161
  correlationId: this.correlationId,
2113
2162
  timeLeft: timeLeft,
2163
+ expiryTime: expiryTime,
2164
+ currentTime: currentTime,
2114
2165
  reason: reason,
2115
2166
  destinationType: destinationType
2116
2167
  });
2117
- _context5.prev = 9;
2118
- _context5.next = 12;
2168
+ _context5.prev = 12;
2169
+ _context5.next = 15;
2119
2170
  return this.fetchMeetingInfoInternal({
2120
2171
  destination: destination,
2121
2172
  destinationType: destinationType,
@@ -2124,12 +2175,12 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2124
2175
  }),
2125
2176
  sendCAevents: true // because if we're refreshing the permissionToken, it means that user is intending to join that meeting, so we want CA events
2126
2177
  });
2127
- case 12:
2128
- _context5.next = 19;
2178
+ case 15:
2179
+ _context5.next = 22;
2129
2180
  break;
2130
- case 14:
2131
- _context5.prev = 14;
2132
- _context5.t0 = _context5["catch"](9);
2181
+ case 17:
2182
+ _context5.prev = 17;
2183
+ _context5.t0 = _context5["catch"](12);
2133
2184
  _loggerProxy.default.logger.info('Meeting:index#refreshPermissionToken --> failed to refresh the permission token:', _context5.t0);
2134
2185
  _metrics.default.sendBehavioralMetric(_constants2.default.PERMISSION_TOKEN_REFRESH_ERROR, {
2135
2186
  correlationId: this.correlationId,
@@ -2137,11 +2188,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2137
2188
  stack: _context5.t0.stack
2138
2189
  });
2139
2190
  throw _context5.t0;
2140
- case 19:
2191
+ case 22:
2141
2192
  case "end":
2142
2193
  return _context5.stop();
2143
2194
  }
2144
- }, _callee5, this, [[9, 14]]);
2195
+ }, _callee5, this, [[12, 17]]);
2145
2196
  }));
2146
2197
  function refreshPermissionToken(_x3) {
2147
2198
  return _refreshPermissionToken.apply(this, arguments);
@@ -2494,7 +2545,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
2494
2545
 
2495
2546
  /**
2496
2547
  * sets the network status on meeting object
2497
- * @param {String} networkStatus
2548
+ * @param {NETWORK_STATUS} networkStatus
2498
2549
  * @private
2499
2550
  * @returns {undefined}
2500
2551
  * @memberof Meeting
@@ -3697,6 +3748,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3697
3748
  requiredPolicies: [_constants.SELF_POLICY.SUPPORT_HDV],
3698
3749
  policies: this.selfUserPolicies
3699
3750
  }) && ((_this$meetingInfo4 = this.meetingInfo) === null || _this$meetingInfo4 === void 0 ? void 0 : (_this$meetingInfo4$vi = _this$meetingInfo4.video) === null || _this$meetingInfo4$vi === void 0 ? void 0 : _this$meetingInfo4$vi.supportHDV) || !this.arePolicyRestrictionsSupported(),
3751
+ enforceVirtualBackground: _util4.default.hasPolicies({
3752
+ requiredPolicies: [_constants.SELF_POLICY.ENFORCE_VIRTUAL_BACKGROUND],
3753
+ policies: this.selfUserPolicies
3754
+ }) && this.arePolicyRestrictionsSupported(),
3700
3755
  supportHQV: _util4.default.hasPolicies({
3701
3756
  requiredPolicies: [_constants.SELF_POLICY.SUPPORT_HQV],
3702
3757
  policies: this.selfUserPolicies
@@ -3820,6 +3875,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3820
3875
  requiredPolicies: [_constants.SELF_POLICY.SUPPORT_FILE_TRANSFER],
3821
3876
  policies: this.selfUserPolicies
3822
3877
  }),
3878
+ canChat: _util4.default.hasPolicies({
3879
+ requiredPolicies: [_constants.SELF_POLICY.SUPPORT_CHAT],
3880
+ policies: this.selfUserPolicies
3881
+ }),
3823
3882
  canShareApplication: _util4.default.hasHints({
3824
3883
  requiredHints: [_constants.DISPLAY_HINTS.SHARE_APPLICATION],
3825
3884
  displayHints: this.userDisplayHints
@@ -3866,8 +3925,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3866
3925
  }, {
3867
3926
  key: "setSelfUserPolicies",
3868
3927
  value: function setSelfUserPolicies() {
3869
- var _this$permissionToken, _this$permissionToken2;
3928
+ var _this$permissionToken, _this$permissionToken2, _this$permissionToken3, _this$permissionToken4;
3870
3929
  this.selfUserPolicies = (_this$permissionToken = this.permissionTokenPayload) === null || _this$permissionToken === void 0 ? void 0 : (_this$permissionToken2 = _this$permissionToken.permission) === null || _this$permissionToken2 === void 0 ? void 0 : _this$permissionToken2.userPolicies;
3930
+ this.enforceVBGImagesURL = (_this$permissionToken3 = this.permissionTokenPayload) === null || _this$permissionToken3 === void 0 ? void 0 : (_this$permissionToken4 = _this$permissionToken3.permission) === null || _this$permissionToken4 === void 0 ? void 0 : _this$permissionToken4.enforceVBGImagesURL;
3871
3931
  }
3872
3932
 
3873
3933
  /**
@@ -3880,6 +3940,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3880
3940
  key: "setPermissionTokenPayload",
3881
3941
  value: function setPermissionTokenPayload(permissionToken) {
3882
3942
  this.permissionTokenPayload = (0, _jwtDecode.jwtDecode)(permissionToken);
3943
+ this.permissionTokenReceivedLocalTime = new Date().getTime();
3883
3944
  }
3884
3945
 
3885
3946
  /**
@@ -3981,8 +4042,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
3981
4042
  var _this$mediaProperties4 = this.mediaProperties,
3982
4043
  remoteAudioStream = _this$mediaProperties4.remoteAudioStream,
3983
4044
  remoteVideoStream = _this$mediaProperties4.remoteVideoStream,
3984
- remoteShareStream = _this$mediaProperties4.remoteShareStream,
3985
- shareAudioStream = _this$mediaProperties4.shareAudioStream;
4045
+ remoteShareStream = _this$mediaProperties4.remoteShareStream;
3986
4046
 
3987
4047
  /**
3988
4048
  * Triggers an event to the developer
@@ -4013,7 +4073,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4013
4073
  triggerMediaStoppedEvent(type);
4014
4074
  });
4015
4075
  };
4016
- return _promise.default.all([stopStream(remoteAudioStream, _constants.EVENT_TYPES.REMOTE_AUDIO), stopStream(remoteVideoStream, _constants.EVENT_TYPES.REMOTE_VIDEO), stopStream(remoteShareStream, _constants.EVENT_TYPES.REMOTE_SHARE), stopStream(shareAudioStream, _constants.EVENT_TYPES.REMOTE_SHARE_AUDIO)]);
4076
+ return _promise.default.all([stopStream(remoteAudioStream, _constants.EVENT_TYPES.REMOTE_AUDIO), stopStream(remoteVideoStream, _constants.EVENT_TYPES.REMOTE_VIDEO), stopStream(remoteShareStream, _constants.EVENT_TYPES.REMOTE_SHARE)]);
4017
4077
  }
4018
4078
 
4019
4079
  /**
@@ -4123,22 +4183,24 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4123
4183
  while (1) switch (_context12.prev = _context12.next) {
4124
4184
  case 0:
4125
4185
  oldStream = this.mediaProperties.shareVideoStream;
4186
+ oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareVideoStreamMuteStateChange);
4126
4187
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareVideoStreamEnded);
4127
4188
  oldStream === null || oldStream === void 0 ? void 0 : oldStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4128
4189
  this.mediaProperties.setLocalShareVideoStream(localDisplayStream);
4190
+ localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareVideoStreamMuteStateChange);
4129
4191
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.StreamEventNames.Ended, this.handleShareVideoStreamEnded);
4130
4192
  localDisplayStream === null || localDisplayStream === void 0 ? void 0 : localDisplayStream.on(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4131
4193
  this.mediaProperties.mediaDirection.sendShare = this.mediaProperties.hasLocalShareStream();
4132
4194
  if (!(!this.isMultistream || !localDisplayStream)) {
4133
- _context12.next = 10;
4195
+ _context12.next = 12;
4134
4196
  break;
4135
4197
  }
4136
- _context12.next = 10;
4137
- return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
4138
- case 10:
4139
4198
  _context12.next = 12;
4140
- return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
4199
+ return this.unpublishStream(_internalMediaCore.MediaType.VideoSlides, oldStream);
4141
4200
  case 12:
4201
+ _context12.next = 14;
4202
+ return this.publishStream(_internalMediaCore.MediaType.VideoSlides, this.mediaProperties.shareVideoStream);
4203
+ case 14:
4142
4204
  case "end":
4143
4205
  return _context12.stop();
4144
4206
  }
@@ -4235,9 +4297,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4235
4297
  audioStream === null || audioStream === void 0 ? void 0 : audioStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4236
4298
  videoStream === null || videoStream === void 0 ? void 0 : videoStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.localVideoStreamMuteStateHandler);
4237
4299
  videoStream === null || videoStream === void 0 ? void 0 : videoStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4238
- shareAudioStream === null || shareAudioStream === void 0 ? void 0 : shareAudioStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareAudioStreamEnded);
4300
+ shareAudioStream === null || shareAudioStream === void 0 ? void 0 : shareAudioStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareAudioStreamEnded);
4239
4301
  shareAudioStream === null || shareAudioStream === void 0 ? void 0 : shareAudioStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4240
- shareVideoStream === null || shareVideoStream === void 0 ? void 0 : shareVideoStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareVideoStreamEnded);
4302
+ shareVideoStream === null || shareVideoStream === void 0 ? void 0 : shareVideoStream.off(_mediaHelpers.StreamEventNames.MuteStateChange, this.handleShareVideoStreamMuteStateChange);
4303
+ shareVideoStream === null || shareVideoStream === void 0 ? void 0 : shareVideoStream.off(_mediaHelpers.StreamEventNames.Ended, this.handleShareVideoStreamEnded);
4241
4304
  shareVideoStream === null || shareVideoStream === void 0 ? void 0 : shareVideoStream.off(_mediaHelpers.LocalStreamEventNames.OutputTrackChange, this.localOutputTrackChangeHandler);
4242
4305
  this.mediaProperties.setLocalAudioStream(undefined);
4243
4306
  this.mediaProperties.setLocalVideoStream(undefined);
@@ -4351,6 +4414,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4351
4414
  this.receiveSlotManager.reset();
4352
4415
  this.mediaProperties.webrtcMediaConnection.close();
4353
4416
  this.sendSlotManager.reset();
4417
+ this.setNetworkStatus(undefined);
4354
4418
  }
4355
4419
  this.audio = null;
4356
4420
  this.video = null;
@@ -4378,8 +4442,8 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4378
4442
  }
4379
4443
 
4380
4444
  /**
4381
- * Convenience method to set the correlation id for the Meeting
4382
- * @param {String} id correlation id to set on the class
4445
+ * Convenience method to set the correlation id for the callStateForMetrics
4446
+ * @param {String} id correlation id to set on the callStateForMetrics
4383
4447
  * @returns {undefined}
4384
4448
  * @public
4385
4449
  * @memberof Meeting
@@ -4387,7 +4451,20 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4387
4451
  }, {
4388
4452
  key: "setCorrelationId",
4389
4453
  value: function setCorrelationId(id) {
4390
- this.correlationId = id;
4454
+ this.callStateForMetrics.correlationId = id;
4455
+ }
4456
+
4457
+ /**
4458
+ * Update the callStateForMetrics
4459
+ * @param {CallStateForMetrics} callStateForMetrics updated values for callStateForMetrics
4460
+ * @returns {undefined}
4461
+ * @public
4462
+ * @memberof Meeting
4463
+ */
4464
+ }, {
4465
+ key: "updateCallStateForMetrics",
4466
+ value: function updateCallStateForMetrics(callStateForMetrics) {
4467
+ this.callStateForMetrics = _objectSpread(_objectSpread({}, this.callStateForMetrics), callStateForMetrics);
4391
4468
  }
4392
4469
 
4393
4470
  /**
@@ -4682,11 +4759,27 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4682
4759
  function: 'reconnect'
4683
4760
  }, _constants.EVENT_TRIGGERS.MEETING_RECONNECTION_STARTING);
4684
4761
  return this.reconnectionManager.reconnect(options).then(function () {
4762
+ return _this29.waitForRemoteSDPAnswer();
4763
+ }).then(function () {
4764
+ return _this29.waitForMediaConnectionConnected();
4765
+ }).then(function () {
4685
4766
  _triggerProxy.default.trigger(_this29, {
4686
4767
  file: 'meeting/index',
4687
4768
  function: 'reconnect'
4688
4769
  }, _constants.EVENT_TRIGGERS.MEETING_RECONNECTION_SUCCESS);
4689
4770
  _loggerProxy.default.logger.log('Meeting:index#reconnect --> Meeting reconnect success');
4771
+
4772
+ // @ts-ignore
4773
+ _this29.webex.internal.newMetrics.submitClientEvent({
4774
+ name: 'client.media.recovered',
4775
+ payload: {
4776
+ recoveredBy: 'new'
4777
+ },
4778
+ options: {
4779
+ meetingId: _this29.id
4780
+ }
4781
+ });
4782
+ _this29.reconnectionManager.setStatus(_constants.RECONNECTION.STATE.COMPLETE);
4690
4783
  }).catch(function (error) {
4691
4784
  _triggerProxy.default.trigger(_this29, {
4692
4785
  file: 'meeting/index',
@@ -4937,8 +5030,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
4937
5030
  this.webex.internal.newMetrics.submitClientEvent({
4938
5031
  name: 'client.call.initiated',
4939
5032
  payload: {
4940
- trigger: 'user-interaction',
4941
- isRoapCallEnabled: true
5033
+ trigger: this.callStateForMetrics.joinTrigger || 'user-interaction',
5034
+ isRoapCallEnabled: true,
5035
+ pstnAudioType: options === null || options === void 0 ? void 0 : options.pstnAudioType
4942
5036
  },
4943
5037
  options: {
4944
5038
  meetingId: this.id
@@ -5085,7 +5179,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5085
5179
  }).then(function (join) {
5086
5180
  if (isBrowser) {
5087
5181
  // @ts-ignore - config coming from registerPlugin
5088
- if (_this32.config.receiveTranscription || _this32.receiveTranscription) {
5182
+ if (_this32.config.receiveTranscription || options.receiveTranscription) {
5089
5183
  if (_this32.isTranscriptionSupported()) {
5090
5184
  _loggerProxy.default.logger.info('Meeting:index#join --> Attempting to enabled to receive transcription!');
5091
5185
  _this32.startTranscription().catch(function (error) {
@@ -5639,27 +5733,30 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5639
5733
  case 5:
5640
5734
  _context20.prev = 5;
5641
5735
  _context20.t0 = _context20["catch"](0);
5642
- // @ts-ignore
5643
- this.webex.internal.newMetrics.submitClientEvent({
5644
- name: 'client.ice.end',
5645
- payload: {
5646
- canProceed: !this.turnServerUsed,
5647
- // If we haven't done turn tls retry yet we will proceed with join attempt
5648
- icePhase: this.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY',
5649
- errors: [
5650
- // @ts-ignore
5651
- this.webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode({
5652
- clientErrorCode: _internalPluginMetrics.CallDiagnosticUtils.generateClientErrorCodeForIceFailure({
5653
- signalingState: ((_this$mediaProperties6 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties6 === void 0 ? void 0 : (_this$mediaProperties7 = _this$mediaProperties6.multistreamConnection) === null || _this$mediaProperties7 === void 0 ? void 0 : (_this$mediaProperties8 = _this$mediaProperties7.pc) === null || _this$mediaProperties8 === void 0 ? void 0 : (_this$mediaProperties9 = _this$mediaProperties8.pc) === null || _this$mediaProperties9 === void 0 ? void 0 : _this$mediaProperties9.signalingState) || ((_this$mediaProperties10 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties10 === void 0 ? void 0 : (_this$mediaProperties11 = _this$mediaProperties10.mediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.pc) === null || _this$mediaProperties12 === void 0 ? void 0 : _this$mediaProperties12.signalingState) || 'unknown',
5654
- iceConnectionState: ((_this$mediaProperties13 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties13 === void 0 ? void 0 : (_this$mediaProperties14 = _this$mediaProperties13.multistreamConnection) === null || _this$mediaProperties14 === void 0 ? void 0 : (_this$mediaProperties15 = _this$mediaProperties14.pc) === null || _this$mediaProperties15 === void 0 ? void 0 : (_this$mediaProperties16 = _this$mediaProperties15.pc) === null || _this$mediaProperties16 === void 0 ? void 0 : _this$mediaProperties16.iceConnectionState) || ((_this$mediaProperties17 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties17 === void 0 ? void 0 : (_this$mediaProperties18 = _this$mediaProperties17.mediaConnection) === null || _this$mediaProperties18 === void 0 ? void 0 : (_this$mediaProperties19 = _this$mediaProperties18.pc) === null || _this$mediaProperties19 === void 0 ? void 0 : _this$mediaProperties19.iceConnectionState) || 'unknown',
5655
- turnServerUsed: this.turnServerUsed
5656
- })
5657
- })]
5658
- },
5659
- options: {
5660
- meetingId: this.id
5661
- }
5662
- });
5736
+ if (!this.hasMediaConnectionConnectedAtLeastOnce) {
5737
+ // Only send CA event for join flow if we haven't successfully connected media yet
5738
+ // @ts-ignore
5739
+ this.webex.internal.newMetrics.submitClientEvent({
5740
+ name: 'client.ice.end',
5741
+ payload: {
5742
+ canProceed: !this.turnServerUsed,
5743
+ // If we haven't done turn tls retry yet we will proceed with join attempt
5744
+ icePhase: this.turnServerUsed ? 'JOIN_MEETING_FINAL' : 'JOIN_MEETING_RETRY',
5745
+ errors: [
5746
+ // @ts-ignore
5747
+ this.webex.internal.newMetrics.callDiagnosticMetrics.getErrorPayloadForClientErrorCode({
5748
+ clientErrorCode: _internalPluginMetrics.CallDiagnosticUtils.generateClientErrorCodeForIceFailure({
5749
+ signalingState: ((_this$mediaProperties6 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties6 === void 0 ? void 0 : (_this$mediaProperties7 = _this$mediaProperties6.multistreamConnection) === null || _this$mediaProperties7 === void 0 ? void 0 : (_this$mediaProperties8 = _this$mediaProperties7.pc) === null || _this$mediaProperties8 === void 0 ? void 0 : (_this$mediaProperties9 = _this$mediaProperties8.pc) === null || _this$mediaProperties9 === void 0 ? void 0 : _this$mediaProperties9.signalingState) || ((_this$mediaProperties10 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties10 === void 0 ? void 0 : (_this$mediaProperties11 = _this$mediaProperties10.mediaConnection) === null || _this$mediaProperties11 === void 0 ? void 0 : (_this$mediaProperties12 = _this$mediaProperties11.pc) === null || _this$mediaProperties12 === void 0 ? void 0 : _this$mediaProperties12.signalingState) || 'unknown',
5750
+ iceConnectionState: ((_this$mediaProperties13 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties13 === void 0 ? void 0 : (_this$mediaProperties14 = _this$mediaProperties13.multistreamConnection) === null || _this$mediaProperties14 === void 0 ? void 0 : (_this$mediaProperties15 = _this$mediaProperties14.pc) === null || _this$mediaProperties15 === void 0 ? void 0 : (_this$mediaProperties16 = _this$mediaProperties15.pc) === null || _this$mediaProperties16 === void 0 ? void 0 : _this$mediaProperties16.iceConnectionState) || ((_this$mediaProperties17 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties17 === void 0 ? void 0 : (_this$mediaProperties18 = _this$mediaProperties17.mediaConnection) === null || _this$mediaProperties18 === void 0 ? void 0 : (_this$mediaProperties19 = _this$mediaProperties18.pc) === null || _this$mediaProperties19 === void 0 ? void 0 : _this$mediaProperties19.iceConnectionState) || 'unknown',
5751
+ turnServerUsed: this.turnServerUsed
5752
+ })
5753
+ })]
5754
+ },
5755
+ options: {
5756
+ meetingId: this.id
5757
+ }
5758
+ });
5759
+ }
5663
5760
  throw new Error("Timed out waiting for media connection to be connected, correlationId=".concat(this.correlationId));
5664
5761
  case 9:
5665
5762
  case "end":
@@ -5800,16 +5897,34 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
5800
5897
  key: "retryWithForcedTurnDiscovery",
5801
5898
  value: (function () {
5802
5899
  var _retryWithForcedTurnDiscovery = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(remoteMediaManagerConfig, bundlePolicy) {
5900
+ var LOG_HEADER;
5803
5901
  return _regenerator.default.wrap(function _callee23$(_context23) {
5804
5902
  while (1) switch (_context23.prev = _context23.next) {
5805
5903
  case 0:
5806
5904
  this.retriedWithTurnServer = true;
5807
- _context23.next = 3;
5905
+ LOG_HEADER = 'Meeting:index#addMedia():retryWithForcedTurnDiscovery -->';
5906
+ _context23.next = 4;
5808
5907
  return this.cleanUpBeforeRetryWithTurnServer();
5809
- case 3:
5810
- _context23.next = 5;
5908
+ case 4:
5909
+ _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_RETRY, {
5910
+ correlation_id: this.correlationId,
5911
+ state: this.state,
5912
+ meetingState: this.meetingState,
5913
+ reason: 'forcingTurnTls'
5914
+ });
5915
+ if (!(this.state === _constants.MEETING_STATE.STATES.LEFT)) {
5916
+ _context23.next = 9;
5917
+ break;
5918
+ }
5919
+ _loggerProxy.default.logger.info("".concat(LOG_HEADER, " meeting state was LEFT after first attempt to establish media connection. Attempting to rejoin. "));
5920
+ _context23.next = 9;
5921
+ return this.join({
5922
+ rejoin: true
5923
+ });
5924
+ case 9:
5925
+ _context23.next = 11;
5811
5926
  return this.retryEstablishMediaConnectionWithForcedTurnDiscovery(remoteMediaManagerConfig, bundlePolicy);
5812
- case 5:
5927
+ case 11:
5813
5928
  case "end":
5814
5929
  return _context23.stop();
5815
5930
  }
@@ -6112,31 +6227,32 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6112
6227
  case 0:
6113
6228
  options = _args28.length > 0 && _args28[0] !== undefined ? _args28[0] : {};
6114
6229
  this.retriedWithTurnServer = false;
6230
+ this.hasMediaConnectionConnectedAtLeastOnce = false;
6115
6231
  LOG_HEADER = 'Meeting:index#addMedia -->';
6116
6232
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " called with: ").concat((0, _stringify.default)(options)));
6117
- if (!(this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
6118
- _context28.next = 6;
6233
+ if (!(options.allowMediaInLobby !== true && this.meetingState !== _constants.FULL_STATE.ACTIVE)) {
6234
+ _context28.next = 7;
6119
6235
  break;
6120
6236
  }
6121
6237
  throw new _webexErrors.MeetingNotActiveError();
6122
- case 6:
6238
+ case 7:
6123
6239
  if (!_util.default.isUserInLeftState(this.locusInfo)) {
6124
- _context28.next = 8;
6240
+ _context28.next = 9;
6125
6241
  break;
6126
6242
  }
6127
6243
  throw new _webexErrors.UserNotJoinedError();
6128
- case 8:
6244
+ case 9:
6129
6245
  localStreams = options.localStreams, _options$audioEnabled = options.audioEnabled, audioEnabled = _options$audioEnabled === void 0 ? true : _options$audioEnabled, _options$videoEnabled = options.videoEnabled, videoEnabled = _options$videoEnabled === void 0 ? true : _options$videoEnabled, _options$shareAudioEn = options.shareAudioEnabled, shareAudioEnabled = _options$shareAudioEn === void 0 ? true : _options$shareAudioEn, _options$shareVideoEn = options.shareVideoEnabled, shareVideoEnabled = _options$shareVideoEn === void 0 ? true : _options$shareVideoEn, remoteMediaManagerConfig = options.remoteMediaManagerConfig, bundlePolicy = options.bundlePolicy, allowMediaInLobby = options.allowMediaInLobby;
6130
6246
  this.allowMediaInLobby = options === null || options === void 0 ? void 0 : options.allowMediaInLobby;
6131
6247
 
6132
6248
  // If the user is unjoined or guest waiting in lobby dont allow the user to addMedia
6133
6249
  // @ts-ignore - isUserUnadmitted coming from SelfUtil
6134
6250
  if (!(this.isUserUnadmitted && !this.wirelessShare && !allowMediaInLobby)) {
6135
- _context28.next = 12;
6251
+ _context28.next = 13;
6136
6252
  break;
6137
6253
  }
6138
6254
  throw new _webexErrors.UserInLobbyError();
6139
- case 12:
6255
+ case 13:
6140
6256
  // @ts-ignore
6141
6257
  this.webex.internal.newMetrics.submitClientEvent({
6142
6258
  name: 'client.media.capabilities',
@@ -6191,32 +6307,32 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6191
6307
  });
6192
6308
  this.audio = (0, _muteState.createMuteState)(_constants.AUDIO, this, audioEnabled);
6193
6309
  this.video = (0, _muteState.createMuteState)(_constants.VIDEO, this, videoEnabled);
6194
- _context28.prev = 17;
6195
- _context28.next = 20;
6310
+ _context28.prev = 18;
6311
+ _context28.next = 21;
6196
6312
  return this.setUpLocalStreamReferences(localStreams);
6197
- case 20:
6313
+ case 21:
6198
6314
  this.setMercuryListener();
6199
6315
  this.createStatsAnalyzer();
6200
- _context28.next = 24;
6316
+ _context28.next = 25;
6201
6317
  return this.establishMediaConnection(remoteMediaManagerConfig, bundlePolicy, false);
6202
- case 24:
6203
- _context28.next = 26;
6318
+ case 25:
6319
+ _context28.next = 27;
6204
6320
  return Meeting.handleDeviceLogging();
6205
- case 26:
6321
+ case 27:
6206
6322
  if (!this.mediaProperties.hasLocalShareStream()) {
6207
- _context28.next = 29;
6323
+ _context28.next = 30;
6208
6324
  break;
6209
6325
  }
6210
- _context28.next = 29;
6326
+ _context28.next = 30;
6211
6327
  return this.enqueueScreenShareFloorRequest();
6212
- case 29:
6213
- _context28.next = 31;
6328
+ case 30:
6329
+ _context28.next = 32;
6214
6330
  return this.mediaProperties.getCurrentConnectionType();
6215
- case 31:
6331
+ case 32:
6216
6332
  connectionType = _context28.sent;
6217
- _context28.next = 34;
6333
+ _context28.next = 35;
6218
6334
  return this.webex.meetings.reachability.getReachabilityMetrics();
6219
- case 34:
6335
+ case 35:
6220
6336
  reachabilityStats = _context28.sent;
6221
6337
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_SUCCESS, _objectSpread({
6222
6338
  correlation_id: this.correlationId,
@@ -6236,17 +6352,17 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6236
6352
 
6237
6353
  // We can log ReceiveSlot SSRCs only after the SDP exchange, so doing it here:
6238
6354
  (_this$remoteMediaMana = this.remoteMediaManager) === null || _this$remoteMediaMana === void 0 ? void 0 : _this$remoteMediaMana.logAllReceiveSlots();
6239
- _context28.next = 53;
6355
+ _context28.next = 54;
6240
6356
  break;
6241
- case 41:
6242
- _context28.prev = 41;
6243
- _context28.t0 = _context28["catch"](17);
6357
+ case 42:
6358
+ _context28.prev = 42;
6359
+ _context28.t0 = _context28["catch"](18);
6244
6360
  _loggerProxy.default.logger.error("".concat(LOG_HEADER, " failed to establish media connection: "), _context28.t0);
6245
6361
 
6246
6362
  // @ts-ignore
6247
- _context28.next = 46;
6363
+ _context28.next = 47;
6248
6364
  return this.webex.meetings.reachability.getReachabilityMetrics();
6249
- case 46:
6365
+ case 47:
6250
6366
  reachabilityMetrics = _context28.sent;
6251
6367
  _metrics.default.sendBehavioralMetric(_constants2.default.ADD_MEDIA_FAILURE, _objectSpread({
6252
6368
  correlation_id: this.correlationId,
@@ -6262,9 +6378,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6262
6378
  connectionState: ((_this$mediaProperties27 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties27 === void 0 ? void 0 : (_this$mediaProperties28 = _this$mediaProperties27.multistreamConnection) === null || _this$mediaProperties28 === void 0 ? void 0 : (_this$mediaProperties29 = _this$mediaProperties28.pc) === null || _this$mediaProperties29 === void 0 ? void 0 : (_this$mediaProperties30 = _this$mediaProperties29.pc) === null || _this$mediaProperties30 === void 0 ? void 0 : _this$mediaProperties30.connectionState) || ((_this$mediaProperties31 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties31 === void 0 ? void 0 : (_this$mediaProperties32 = _this$mediaProperties31.mediaConnection) === null || _this$mediaProperties32 === void 0 ? void 0 : (_this$mediaProperties33 = _this$mediaProperties32.pc) === null || _this$mediaProperties33 === void 0 ? void 0 : _this$mediaProperties33.connectionState) || 'unknown',
6263
6379
  iceConnectionState: ((_this$mediaProperties34 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties34 === void 0 ? void 0 : (_this$mediaProperties35 = _this$mediaProperties34.multistreamConnection) === null || _this$mediaProperties35 === void 0 ? void 0 : (_this$mediaProperties36 = _this$mediaProperties35.pc) === null || _this$mediaProperties36 === void 0 ? void 0 : (_this$mediaProperties37 = _this$mediaProperties36.pc) === null || _this$mediaProperties37 === void 0 ? void 0 : _this$mediaProperties37.iceConnectionState) || ((_this$mediaProperties38 = this.mediaProperties.webrtcMediaConnection) === null || _this$mediaProperties38 === void 0 ? void 0 : (_this$mediaProperties39 = _this$mediaProperties38.mediaConnection) === null || _this$mediaProperties39 === void 0 ? void 0 : (_this$mediaProperties40 = _this$mediaProperties39.pc) === null || _this$mediaProperties40 === void 0 ? void 0 : _this$mediaProperties40.iceConnectionState) || 'unknown'
6264
6380
  }, reachabilityMetrics));
6265
- _context28.next = 50;
6381
+ _context28.next = 51;
6266
6382
  return this.cleanUpOnAddMediaFailure();
6267
- case 50:
6383
+ case 51:
6268
6384
  // Upload logs on error while adding media
6269
6385
  _triggerProxy.default.trigger(this, {
6270
6386
  file: 'meeting/index',
@@ -6276,11 +6392,11 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6276
6392
  });
6277
6393
  }
6278
6394
  throw _context28.t0;
6279
- case 53:
6395
+ case 54:
6280
6396
  case "end":
6281
6397
  return _context28.stop();
6282
6398
  }
6283
- }, _callee28, this, [[17, 41]]);
6399
+ }, _callee28, this, [[18, 42]]);
6284
6400
  }));
6285
6401
  function addMedia() {
6286
6402
  return _addMedia.apply(this, arguments);
@@ -6700,9 +6816,7 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6700
6816
  uri: whiteboard.url
6701
6817
  }).catch(function (error) {
6702
6818
  _loggerProxy.default.logger.error('Meeting:index#stopWhiteboardShare --> Error ', error);
6703
- _metrics.default.sendBehavioralMetric(
6704
- // @ts-ignore - check if STOP_WHITEBOARD_SHARE_FAILURE exists
6705
- _constants2.default.STOP_WHITEBOARD_SHARE_FAILURE, {
6819
+ _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_STOP_WHITEBOARD_SHARE_FAILURE, {
6706
6820
  correlation_id: _this45.correlationId,
6707
6821
  locus_id: _this45.locusUrl.split('/').pop(),
6708
6822
  reason: error.message,
@@ -6756,6 +6870,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
6756
6870
  resourceUrl: this.resourceUrl
6757
6871
  }).then(function () {
6758
6872
  _this46.screenShareFloorState = ScreenShareFloorStatus.GRANTED;
6873
+ _metrics.default.sendBehavioralMetric(_constants2.default.MEETING_SHARE_SUCCESS, {
6874
+ correlation_id: _this46.correlationId,
6875
+ locus_id: _this46.locusUrl.split('/').pop()
6876
+ });
6759
6877
  return _promise.default.resolve();
6760
6878
  }).catch(function (error) {
6761
6879
  _loggerProxy.default.logger.error('Meeting:index#share --> Error ', error);
@@ -7359,6 +7477,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7359
7477
  _this$mediaProperties44,
7360
7478
  _this$mediaProperties45,
7361
7479
  _this$mediaProperties46,
7480
+ _this$mediaProperties47,
7481
+ _this$mediaProperties48,
7482
+ _this$mediaProperties49,
7483
+ _this$mediaProperties50,
7362
7484
  _this51 = this;
7363
7485
  var LOG_HEADER = 'Meeting:index#updateTranscodedMediaConnection -->';
7364
7486
  _loggerProxy.default.logger.info("".concat(LOG_HEADER, " starting"));
@@ -7368,10 +7490,10 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7368
7490
  return this.mediaProperties.webrtcMediaConnection.update({
7369
7491
  // TODO: RoapMediaConnection is not ready to use stream classes yet, so we pass the raw MediaStreamTrack for now
7370
7492
  localTracks: {
7371
- audio: ((_this$mediaProperties43 = this.mediaProperties.audioStream) === null || _this$mediaProperties43 === void 0 ? void 0 : _this$mediaProperties43.outputTrack) || null,
7372
- video: ((_this$mediaProperties44 = this.mediaProperties.videoStream) === null || _this$mediaProperties44 === void 0 ? void 0 : _this$mediaProperties44.outputTrack) || null,
7373
- screenShareVideo: ((_this$mediaProperties45 = this.mediaProperties.shareVideoStream) === null || _this$mediaProperties45 === void 0 ? void 0 : _this$mediaProperties45.outputTrack) || null,
7374
- screenShareAudio: ((_this$mediaProperties46 = this.mediaProperties.shareAudioStream) === null || _this$mediaProperties46 === void 0 ? void 0 : _this$mediaProperties46.outputTrack) || null
7493
+ audio: ((_this$mediaProperties43 = this.mediaProperties.audioStream) === null || _this$mediaProperties43 === void 0 ? void 0 : (_this$mediaProperties44 = _this$mediaProperties43.outputStream) === null || _this$mediaProperties44 === void 0 ? void 0 : _this$mediaProperties44.getTracks()[0]) || null,
7494
+ video: ((_this$mediaProperties45 = this.mediaProperties.videoStream) === null || _this$mediaProperties45 === void 0 ? void 0 : (_this$mediaProperties46 = _this$mediaProperties45.outputStream) === null || _this$mediaProperties46 === void 0 ? void 0 : _this$mediaProperties46.getTracks()[0]) || null,
7495
+ screenShareVideo: ((_this$mediaProperties47 = this.mediaProperties.shareVideoStream) === null || _this$mediaProperties47 === void 0 ? void 0 : (_this$mediaProperties48 = _this$mediaProperties47.outputStream) === null || _this$mediaProperties48 === void 0 ? void 0 : _this$mediaProperties48.getTracks()[0]) || null,
7496
+ screenShareAudio: ((_this$mediaProperties49 = this.mediaProperties.shareAudioStream) === null || _this$mediaProperties49 === void 0 ? void 0 : (_this$mediaProperties50 = _this$mediaProperties49.outputStream) === null || _this$mediaProperties50 === void 0 ? void 0 : _this$mediaProperties50.getTracks()[0]) || null
7375
7497
  },
7376
7498
  direction: {
7377
7499
  audio: _media.default.getDirection(true, this.mediaProperties.mediaDirection.receiveAudio, this.mediaProperties.mediaDirection.sendAudio),
@@ -7635,27 +7757,37 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7635
7757
  return unpublishStreams;
7636
7758
  }()
7637
7759
  /**
7638
- * Gets the time left in seconds till the permission token expires
7760
+ * Gets permission token expiry information including timeLeft, expiryTime, currentTime
7639
7761
  * (from the time the function has been fired)
7640
7762
  *
7641
- * @returns {number} time left in seconds
7763
+ * @returns {object} permissionTokenExpiryInfo
7764
+ * @returns {number} permissionTokenExpiryInfo.timeLeft The time left for token to expire
7765
+ * @returns {number} permissionTokenExpiryInfo.expiryTime The expiry time of permission token from the server
7766
+ * @returns {number} permissionTokenExpiryInfo.currentTime The current time of the local machine
7642
7767
  */
7643
7768
  )
7644
7769
  }, {
7645
- key: "getPermissionTokenTimeLeftInSec",
7646
- value: function getPermissionTokenTimeLeftInSec() {
7770
+ key: "getPermissionTokenExpiryInfo",
7771
+ value: function getPermissionTokenExpiryInfo() {
7647
7772
  if (!this.permissionTokenPayload) {
7648
7773
  return undefined;
7649
7774
  }
7650
- var permissionTokenExpValue = Number(this.permissionTokenPayload.exp);
7775
+ var permissionTokenExpiryFromServer = Number(this.permissionTokenPayload.exp);
7776
+ var permissionTokenIssuedTimeFromServer = Number(this.permissionTokenPayload.iat);
7777
+ var shiftInTime = this.permissionTokenReceivedLocalTime - permissionTokenIssuedTimeFromServer;
7651
7778
 
7652
7779
  // using new Date instead of Date.now() to allow for accurate unit testing
7653
7780
  // https://github.com/sinonjs/fake-timers/issues/321
7654
- var now = new Date().getTime();
7655
-
7656
- // substract current time from the permissionTokenExp
7657
- // (permissionTokenExp is a epoch timestamp, not a time to live duration)
7658
- return (permissionTokenExpValue - now) / 1000;
7781
+ var currentTime = new Date().getTime();
7782
+
7783
+ // adjusted time is calculated in case your machine time is wrong
7784
+ var adjustedCurrentTime = currentTime - shiftInTime;
7785
+ var timeLeft = (permissionTokenExpiryFromServer - adjustedCurrentTime) / 1000;
7786
+ return {
7787
+ timeLeft: timeLeft,
7788
+ expiryTime: permissionTokenExpiryFromServer,
7789
+ currentTime: currentTime
7790
+ };
7659
7791
  }
7660
7792
 
7661
7793
  /**
@@ -7669,8 +7801,9 @@ var Meeting = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
7669
7801
  }, {
7670
7802
  key: "checkAndRefreshPermissionToken",
7671
7803
  value: function checkAndRefreshPermissionToken(threshold, reason) {
7672
- var permissionTokenTimeLeft = this.getPermissionTokenTimeLeftInSec();
7673
- if (permissionTokenTimeLeft !== undefined && permissionTokenTimeLeft <= threshold) {
7804
+ var _this$getPermissionTo;
7805
+ var timeLeft = (_this$getPermissionTo = this.getPermissionTokenExpiryInfo()) === null || _this$getPermissionTo === void 0 ? void 0 : _this$getPermissionTo.timeLeft;
7806
+ if (timeLeft !== undefined && timeLeft <= threshold) {
7674
7807
  return this.refreshPermissionToken(reason);
7675
7808
  }
7676
7809
  return _promise.default.resolve();