@webex/plugin-meetings 3.7.0-next.41 → 3.7.0-next.43

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.
@@ -203,6 +203,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
203
203
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "mediaHelpers", void 0);
204
204
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "breakoutLocusForHandleLater", void 0);
205
205
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "namespace", _constants.MEETINGS);
206
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "registrationStatus", void 0);
206
207
  /**
207
208
  * Creates a noise reduction effect
208
209
  *
@@ -798,6 +799,21 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
798
799
  }
799
800
  }
800
801
 
802
+ /**
803
+ * Executes a registration step and updates the registration status.
804
+ * @param {Function} step - The registration step to execute.
805
+ * @param {string} stepName - The name of the registration step.
806
+ * @returns {Promise} A promise that resolves when the step is completed.
807
+ */
808
+ }, {
809
+ key: "executeRegistrationStep",
810
+ value: function executeRegistrationStep(step, stepName) {
811
+ var _this5 = this;
812
+ return step().then(function () {
813
+ _this5.registrationStatus[stepName] = true;
814
+ });
815
+ }
816
+
801
817
  /**
802
818
  * Explicitly sets up the meetings plugin by registering
803
819
  * the device, connecting to mercury, and listening for locus events.
@@ -810,7 +826,9 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
810
826
  }, {
811
827
  key: "register",
812
828
  value: function register(deviceRegistrationOptions) {
813
- var _this5 = this;
829
+ var _this6 = this;
830
+ this.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
831
+
814
832
  // @ts-ignore
815
833
  if (!this.webex.canAuthorize) {
816
834
  _loggerProxy.default.logger.error('Meetings:index#register --> ERROR, Unable to register, SDK cannot authorize');
@@ -820,26 +838,39 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
820
838
  _loggerProxy.default.logger.info('Meetings:index#register --> INFO, Meetings plugin already registered');
821
839
  return _promise.default.resolve();
822
840
  }
823
- return _promise.default.all([this.fetchUserPreferredWebexSite(), this.getGeoHint(), this.startReachability('registration').catch(function (error) {
824
- _loggerProxy.default.logger.error("Meetings:index#register --> GDM error, ".concat(error.message));
825
- }),
826
- // @ts-ignore
827
- this.webex.internal.device.register(deviceRegistrationOptions)
828
- // @ts-ignore
829
- .then(function () {
830
- return _loggerProxy.default.logger.info( // @ts-ignore
831
- "Meetings:index#register --> INFO, Device registered ".concat(_this5.webex.internal.device.url));
832
- })
833
- // @ts-ignore
834
- .then(function () {
835
- return _this5.webex.internal.mercury.connect();
836
- }), _util2.default.checkH264Support.call(this)]).then(function () {
837
- _this5.listenForEvents();
838
- _triggerProxy.default.trigger(_this5, {
841
+ return _promise.default.all([this.executeRegistrationStep(function () {
842
+ return _this6.fetchUserPreferredWebexSite();
843
+ }, 'fetchWebexSite'), this.executeRegistrationStep(function () {
844
+ return _this6.getGeoHint();
845
+ }, 'getGeoHint'), this.executeRegistrationStep(function () {
846
+ return _this6.startReachability('registration').catch(function (error) {
847
+ _loggerProxy.default.logger.error("Meetings:index#register --> GDM error, ".concat(error.message));
848
+ });
849
+ }, 'startReachability'), this.executeRegistrationStep(function () {
850
+ return (
851
+ // @ts-ignore
852
+ _this6.webex.internal.device.register(deviceRegistrationOptions)
853
+ // @ts-ignore
854
+ .then(function () {
855
+ _loggerProxy.default.logger.info( // @ts-ignore
856
+ "Meetings:index#register --> INFO, Device registered ".concat(_this6.webex.internal.device.url));
857
+ })
858
+ );
859
+ }, 'deviceRegister').then(function () {
860
+ return _this6.executeRegistrationStep(
861
+ // @ts-ignore
862
+ function () {
863
+ return _this6.webex.internal.mercury.connect();
864
+ }, 'mercuryConnect');
865
+ }), this.executeRegistrationStep(function () {
866
+ return _promise.default.resolve(_util2.default.checkH264Support.call(_this6));
867
+ }, 'checkH264Support')]).then(function () {
868
+ _this6.listenForEvents();
869
+ _triggerProxy.default.trigger(_this6, {
839
870
  file: 'meetings',
840
871
  function: 'register'
841
872
  }, _constants.EVENT_TRIGGERS.MEETINGS_REGISTERED);
842
- _this5.registered = true;
873
+ _this6.registered = true;
843
874
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETINGS_REGISTRATION_SUCCESS);
844
875
  }).catch(function (error) {
845
876
  _loggerProxy.default.logger.error("Meetings:index#register --> ERROR, Unable to register, ".concat(error.message));
@@ -862,7 +893,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
862
893
  }, {
863
894
  key: "unregister",
864
895
  value: function unregister() {
865
- var _this6 = this;
896
+ var _this7 = this;
866
897
  if (!this.registered) {
867
898
  _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');
868
899
  return _promise.default.resolve();
@@ -873,13 +904,14 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
873
904
  this.webex.internal.mercury.disconnect()
874
905
  // @ts-ignore
875
906
  .then(function () {
876
- return _this6.webex.internal.device.unregister();
907
+ return _this7.webex.internal.device.unregister();
877
908
  }).then(function () {
878
- _triggerProxy.default.trigger(_this6, {
909
+ _triggerProxy.default.trigger(_this7, {
879
910
  file: 'meetings',
880
911
  function: 'unregister'
881
912
  }, _constants.EVENT_TRIGGERS.MEETINGS_UNREGISTERED);
882
- _this6.registered = false;
913
+ _this7.registered = false;
914
+ _this7.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
883
915
  })
884
916
  );
885
917
  }
@@ -899,13 +931,13 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
899
931
  * @returns {String} feedback ID logs were submitted under
900
932
  */
901
933
  function uploadLogs() {
902
- var _this7 = this;
934
+ var _this8 = this;
903
935
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
904
936
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> uploading logs');
905
937
  return this.loggerRequest.uploadLogs(options).then(function (uploadResult) {
906
938
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);
907
939
  _metrics.default.sendBehavioralMetric(_constants2.default.UPLOAD_LOGS_SUCCESS, options);
908
- _triggerProxy.default.trigger(_this7, {
940
+ _triggerProxy.default.trigger(_this8, {
909
941
  file: 'meetings',
910
942
  function: 'uploadLogs'
911
943
  }, _constants.EVENT_TRIGGERS.MEETING_LOG_UPLOAD_SUCCESS, {
@@ -915,7 +947,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
915
947
  return uploadResult;
916
948
  }).catch(function (uploadError) {
917
949
  _loggerProxy.default.logger.error('Meetings:index#uploadLogs --> Unable to upload logs for meeting', uploadError);
918
- _triggerProxy.default.trigger(_this7, {
950
+ _triggerProxy.default.trigger(_this8, {
919
951
  file: 'meetings',
920
952
  function: 'uploadLogs'
921
953
  }, _constants.EVENT_TRIGGERS.MEETING_LOG_UPLOAD_FAILURE, {
@@ -965,9 +997,9 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
965
997
  }, {
966
998
  key: "getGeoHint",
967
999
  value: function getGeoHint() {
968
- var _this8 = this;
1000
+ var _this9 = this;
969
1001
  return this.request.fetchGeoHint().then(function (res) {
970
- _this8.geoHintInfo = res;
1002
+ _this9.geoHintInfo = res;
971
1003
  });
972
1004
  }
973
1005
 
@@ -981,29 +1013,29 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
981
1013
  }, {
982
1014
  key: "fetchUserPreferredWebexSite",
983
1015
  value: function fetchUserPreferredWebexSite() {
984
- var _this9 = this;
1016
+ var _this10 = this;
985
1017
  // @ts-ignore
986
1018
  return this.webex.people._getMe().then(function (me) {
987
1019
  var isGuestUser = me.type === 'appuser';
988
1020
  if (!isGuestUser) {
989
- return _this9.request.getMeetingPreferences().then(function (res) {
1021
+ return _this10.request.getMeetingPreferences().then(function (res) {
990
1022
  if (res) {
991
1023
  var preferredWebexSite = _util2.default.parseDefaultSiteFromMeetingPreferences(res);
992
- _this9.preferredWebexSite = preferredWebexSite;
1024
+ _this10.preferredWebexSite = preferredWebexSite;
993
1025
  // @ts-ignore
994
- _this9.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
1026
+ _this10.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
995
1027
  }
996
1028
 
997
1029
  // fall back to getting the preferred site from the user information
998
- if (!_this9.preferredWebexSite) {
1030
+ if (!_this10.preferredWebexSite) {
999
1031
  // @ts-ignore
1000
- return _this9.webex.internal.user.get().then(function (user) {
1032
+ return _this10.webex.internal.user.get().then(function (user) {
1001
1033
  var _user$userPreferences, _user$userPreferences2;
1002
1034
  var preferredWebexSite = user === null || user === void 0 ? void 0 : (_user$userPreferences = user.userPreferences) === null || _user$userPreferences === void 0 ? void 0 : (_user$userPreferences2 = _user$userPreferences.userPreferencesItems) === null || _user$userPreferences2 === void 0 ? void 0 : _user$userPreferences2.preferredWebExSite;
1003
1035
  if (preferredWebexSite) {
1004
- _this9.preferredWebexSite = preferredWebexSite;
1036
+ _this10.preferredWebexSite = preferredWebexSite;
1005
1037
  // @ts-ignore
1006
- _this9.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
1038
+ _this10.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
1007
1039
  } else {
1008
1040
  throw new Error('site not found');
1009
1041
  }
@@ -1111,7 +1143,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1111
1143
  }, {
1112
1144
  key: "create",
1113
1145
  value: function create(destination) {
1114
- var _this10 = this;
1146
+ var _this11 = this;
1115
1147
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1116
1148
  var useRandomDelayForInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1117
1149
  var infoExtraParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
@@ -1151,7 +1183,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1151
1183
  // check for the conversation URL then sip Url
1152
1184
  var meeting = null;
1153
1185
  if (type === _constants.DESTINATION_TYPE.CONVERSATION_URL || options.type === _constants.DESTINATION_TYPE.CONVERSATION_URL) {
1154
- var foundMeeting = _this10.meetingCollection.getByKey(_meetings.MEETING_KEY.CONVERSATION_URL, targetDest);
1186
+ var foundMeeting = _this11.meetingCollection.getByKey(_meetings.MEETING_KEY.CONVERSATION_URL, targetDest);
1155
1187
  if (foundMeeting) {
1156
1188
  var foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting;
1157
1189
 
@@ -1165,21 +1197,21 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1165
1197
 
1166
1198
  // Attempt to collect the meeting if it exists.
1167
1199
  if (!meeting) {
1168
- meeting = _this10.meetingCollection.getByKey(_meetings.MEETING_KEY.SIP_URI, targetDest);
1200
+ meeting = _this11.meetingCollection.getByKey(_meetings.MEETING_KEY.SIP_URI, targetDest);
1169
1201
  }
1170
1202
 
1171
1203
  // Validate if a meeting was found.
1172
1204
  if (!meeting) {
1173
1205
  // Create a meeting based on the normalized destination and type.
1174
- return _this10.createMeeting(targetDest, type, useRandomDelayForInfo, infoExtraParams, callStateForMetrics, failOnMissingMeetingInfo, meetingInfo, meetingLookupUrl).then(function (createdMeeting) {
1206
+ return _this11.createMeeting(targetDest, type, useRandomDelayForInfo, infoExtraParams, callStateForMetrics, failOnMissingMeetingInfo, meetingInfo, meetingLookupUrl).then(function (createdMeeting) {
1175
1207
  // If the meeting was successfully created.
1176
1208
  if (createdMeeting && createdMeeting.on) {
1177
1209
  // Create a destruction event for the meeting.
1178
1210
  createdMeeting.on(_constants.EVENTS.DESTROY_MEETING, function (payload) {
1179
1211
  // @ts-ignore
1180
- if (_this10.config.autoUploadLogs) {
1212
+ if (_this11.config.autoUploadLogs) {
1181
1213
  var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4, _createdMeeting$locus5, _createdMeeting$locus6;
1182
- _this10.uploadLogs({
1214
+ _this11.uploadLogs({
1183
1215
  callStart: (_createdMeeting$locus = createdMeeting.locusInfo) === null || _createdMeeting$locus === void 0 ? void 0 : (_createdMeeting$locus2 = _createdMeeting$locus.fullState) === null || _createdMeeting$locus2 === void 0 ? void 0 : _createdMeeting$locus2.lastActive,
1184
1216
  locussessionid: (_createdMeeting$locus3 = createdMeeting.locusInfo) === null || _createdMeeting$locus3 === void 0 ? void 0 : (_createdMeeting$locus4 = _createdMeeting$locus3.fullState) === null || _createdMeeting$locus4 === void 0 ? void 0 : _createdMeeting$locus4.sessionId,
1185
1217
  correlationId: createdMeeting.correlationId,
@@ -1189,13 +1221,13 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1189
1221
  autoupload: true
1190
1222
  });
1191
1223
  }
1192
- _this10.destroy(createdMeeting, payload.reason);
1224
+ _this11.destroy(createdMeeting, payload.reason);
1193
1225
  });
1194
1226
  createdMeeting.on(_constants.EVENTS.REQUEST_UPLOAD_LOGS, function (meetingInstance) {
1195
1227
  // @ts-ignore
1196
- if (_this10.config.autoUploadLogs) {
1228
+ if (_this11.config.autoUploadLogs) {
1197
1229
  var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4, _meetingInstance$locu5, _meetingInstance$locu6;
1198
- _this10.uploadLogs({
1230
+ _this11.uploadLogs({
1199
1231
  callStart: meetingInstance === null || meetingInstance === void 0 ? void 0 : (_meetingInstance$locu = meetingInstance.locusInfo) === null || _meetingInstance$locu === void 0 ? void 0 : (_meetingInstance$locu2 = _meetingInstance$locu.fullState) === null || _meetingInstance$locu2 === void 0 ? void 0 : _meetingInstance$locu2.lastActive,
1200
1232
  locussessionid: meetingInstance === null || meetingInstance === void 0 ? void 0 : (_meetingInstance$locu3 = meetingInstance.locusInfo) === null || _meetingInstance$locu3 === void 0 ? void 0 : (_meetingInstance$locu4 = _meetingInstance$locu3.fullState) === null || _meetingInstance$locu4 === void 0 ? void 0 : _meetingInstance$locu4.sessionId,
1201
1233
  correlationId: meetingInstance.correlationId,
@@ -1431,7 +1463,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1431
1463
  }, {
1432
1464
  key: "syncMeetings",
1433
1465
  value: function syncMeetings() {
1434
- var _this11 = this;
1466
+ var _this12 = this;
1435
1467
  var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1436
1468
  _ref3$keepOnlyLocusMe = _ref3.keepOnlyLocusMeetings,
1437
1469
  keepOnlyLocusMeetings = _ref3$keepOnlyLocusMe === void 0 ? true : _ref3$keepOnlyLocusMe;
@@ -1443,16 +1475,16 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1443
1475
  return this.request.getActiveMeetings().then(function (locusArray) {
1444
1476
  var activeLocusUrl = [];
1445
1477
  if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1446
- var lociToUpdate = _this11.sortLocusArrayToUpdate(locusArray.loci);
1478
+ var lociToUpdate = _this12.sortLocusArrayToUpdate(locusArray.loci);
1447
1479
  lociToUpdate.forEach(function (locus) {
1448
1480
  activeLocusUrl.push(locus.url);
1449
- _this11.handleLocusEvent({
1481
+ _this12.handleLocusEvent({
1450
1482
  locus: locus,
1451
1483
  locusUrl: locus.url
1452
1484
  });
1453
1485
  });
1454
1486
  }
1455
- var meetingsCollection = _this11.meetingCollection.getAll();
1487
+ var meetingsCollection = _this12.meetingCollection.getAll();
1456
1488
  if ((0, _keys.default)(meetingsCollection).length > 0) {
1457
1489
  // Sometimes the mercury events are lost after mercury reconnect
1458
1490
  // Remove any Locus meetings that are not returned by Locus
@@ -1464,7 +1496,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1464
1496
  if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1465
1497
  // destroy function also uploads logs
1466
1498
  // @ts-ignore
1467
- _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1499
+ _this12.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1468
1500
  }
1469
1501
  }
1470
1502
  }
@@ -1484,7 +1516,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1484
1516
  }, {
1485
1517
  key: "sortLocusArrayToUpdate",
1486
1518
  value: function sortLocusArrayToUpdate(loci) {
1487
- var _this12 = this;
1519
+ var _this13 = this;
1488
1520
  var mainLoci = loci.filter(function (locus) {
1489
1521
  return !_util2.default.isBreakoutLocusDTO(locus);
1490
1522
  });
@@ -1498,7 +1530,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1498
1530
  var _mainLocus$controls, _mainLocus$controls$b, _breakoutLocus$contro, _breakoutLocus$contro2;
1499
1531
  return ((_mainLocus$controls = mainLocus.controls) === null || _mainLocus$controls === void 0 ? void 0 : (_mainLocus$controls$b = _mainLocus$controls.breakout) === null || _mainLocus$controls$b === void 0 ? void 0 : _mainLocus$controls$b.url) === ((_breakoutLocus$contro = breakoutLocus.controls) === null || _breakoutLocus$contro === void 0 ? void 0 : (_breakoutLocus$contro2 = _breakoutLocus$contro.breakout) === null || _breakoutLocus$contro2 === void 0 ? void 0 : _breakoutLocus$contro2.url);
1500
1532
  });
1501
- var existCorrespondingMeeting = _this12.getCorrespondingMeetingByLocus({
1533
+ var existCorrespondingMeeting = _this13.getCorrespondingMeetingByLocus({
1502
1534
  locus: breakoutLocus,
1503
1535
  locusUrl: breakoutLocus.url
1504
1536
  });
@@ -1506,7 +1538,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1506
1538
  // if exists both main session and breakout session locus of the same non-exist meeting, handle main locus first,
1507
1539
  // after meeting create with main locus, then handle the associate breakout locus.
1508
1540
  // if only handle breakout locus, will miss some date
1509
- _this12.breakoutLocusForHandleLater.push(breakoutLocus);
1541
+ _this13.breakoutLocusForHandleLater.push(breakoutLocus);
1510
1542
  } else {
1511
1543
  lociToUpdate.push(breakoutLocus);
1512
1544
  }