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

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,37 @@ 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
- })
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(
833
860
  // @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, {
861
+ this.executeRegistrationStep(function () {
862
+ return _this6.webex.internal.mercury.connect();
863
+ }, 'mercuryConnect')), this.executeRegistrationStep(function () {
864
+ return _promise.default.resolve(_util2.default.checkH264Support.call(_this6));
865
+ }, 'checkH264Support')]).then(function () {
866
+ _this6.listenForEvents();
867
+ _triggerProxy.default.trigger(_this6, {
839
868
  file: 'meetings',
840
869
  function: 'register'
841
870
  }, _constants.EVENT_TRIGGERS.MEETINGS_REGISTERED);
842
- _this5.registered = true;
871
+ _this6.registered = true;
843
872
  _metrics.default.sendBehavioralMetric(_constants2.default.MEETINGS_REGISTRATION_SUCCESS);
844
873
  }).catch(function (error) {
845
874
  _loggerProxy.default.logger.error("Meetings:index#register --> ERROR, Unable to register, ".concat(error.message));
@@ -862,7 +891,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
862
891
  }, {
863
892
  key: "unregister",
864
893
  value: function unregister() {
865
- var _this6 = this;
894
+ var _this7 = this;
866
895
  if (!this.registered) {
867
896
  _loggerProxy.default.logger.info('Meetings:index#unregister --> INFO, Meetings plugin already unregistered');
868
897
  return _promise.default.resolve();
@@ -873,13 +902,14 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
873
902
  this.webex.internal.mercury.disconnect()
874
903
  // @ts-ignore
875
904
  .then(function () {
876
- return _this6.webex.internal.device.unregister();
905
+ return _this7.webex.internal.device.unregister();
877
906
  }).then(function () {
878
- _triggerProxy.default.trigger(_this6, {
907
+ _triggerProxy.default.trigger(_this7, {
879
908
  file: 'meetings',
880
909
  function: 'unregister'
881
910
  }, _constants.EVENT_TRIGGERS.MEETINGS_UNREGISTERED);
882
- _this6.registered = false;
911
+ _this7.registered = false;
912
+ _this7.registrationStatus = (0, _lodash.clone)(_constants.INITIAL_REGISTRATION_STATUS);
883
913
  })
884
914
  );
885
915
  }
@@ -899,13 +929,13 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
899
929
  * @returns {String} feedback ID logs were submitted under
900
930
  */
901
931
  function uploadLogs() {
902
- var _this7 = this;
932
+ var _this8 = this;
903
933
  var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
904
934
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> uploading logs');
905
935
  return this.loggerRequest.uploadLogs(options).then(function (uploadResult) {
906
936
  _loggerProxy.default.logger.info('Meetings:index#uploadLogs --> Upload logs for meeting completed.', uploadResult);
907
937
  _metrics.default.sendBehavioralMetric(_constants2.default.UPLOAD_LOGS_SUCCESS, options);
908
- _triggerProxy.default.trigger(_this7, {
938
+ _triggerProxy.default.trigger(_this8, {
909
939
  file: 'meetings',
910
940
  function: 'uploadLogs'
911
941
  }, _constants.EVENT_TRIGGERS.MEETING_LOG_UPLOAD_SUCCESS, {
@@ -915,7 +945,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
915
945
  return uploadResult;
916
946
  }).catch(function (uploadError) {
917
947
  _loggerProxy.default.logger.error('Meetings:index#uploadLogs --> Unable to upload logs for meeting', uploadError);
918
- _triggerProxy.default.trigger(_this7, {
948
+ _triggerProxy.default.trigger(_this8, {
919
949
  file: 'meetings',
920
950
  function: 'uploadLogs'
921
951
  }, _constants.EVENT_TRIGGERS.MEETING_LOG_UPLOAD_FAILURE, {
@@ -965,9 +995,9 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
965
995
  }, {
966
996
  key: "getGeoHint",
967
997
  value: function getGeoHint() {
968
- var _this8 = this;
998
+ var _this9 = this;
969
999
  return this.request.fetchGeoHint().then(function (res) {
970
- _this8.geoHintInfo = res;
1000
+ _this9.geoHintInfo = res;
971
1001
  });
972
1002
  }
973
1003
 
@@ -981,29 +1011,29 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
981
1011
  }, {
982
1012
  key: "fetchUserPreferredWebexSite",
983
1013
  value: function fetchUserPreferredWebexSite() {
984
- var _this9 = this;
1014
+ var _this10 = this;
985
1015
  // @ts-ignore
986
1016
  return this.webex.people._getMe().then(function (me) {
987
1017
  var isGuestUser = me.type === 'appuser';
988
1018
  if (!isGuestUser) {
989
- return _this9.request.getMeetingPreferences().then(function (res) {
1019
+ return _this10.request.getMeetingPreferences().then(function (res) {
990
1020
  if (res) {
991
1021
  var preferredWebexSite = _util2.default.parseDefaultSiteFromMeetingPreferences(res);
992
- _this9.preferredWebexSite = preferredWebexSite;
1022
+ _this10.preferredWebexSite = preferredWebexSite;
993
1023
  // @ts-ignore
994
- _this9.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
1024
+ _this10.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
995
1025
  }
996
1026
 
997
1027
  // fall back to getting the preferred site from the user information
998
- if (!_this9.preferredWebexSite) {
1028
+ if (!_this10.preferredWebexSite) {
999
1029
  // @ts-ignore
1000
- return _this9.webex.internal.user.get().then(function (user) {
1030
+ return _this10.webex.internal.user.get().then(function (user) {
1001
1031
  var _user$userPreferences, _user$userPreferences2;
1002
1032
  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
1033
  if (preferredWebexSite) {
1004
- _this9.preferredWebexSite = preferredWebexSite;
1034
+ _this10.preferredWebexSite = preferredWebexSite;
1005
1035
  // @ts-ignore
1006
- _this9.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
1036
+ _this10.webex.internal.services._getCatalog().addAllowedDomains([preferredWebexSite]);
1007
1037
  } else {
1008
1038
  throw new Error('site not found');
1009
1039
  }
@@ -1111,7 +1141,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1111
1141
  }, {
1112
1142
  key: "create",
1113
1143
  value: function create(destination) {
1114
- var _this10 = this;
1144
+ var _this11 = this;
1115
1145
  var type = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : null;
1116
1146
  var useRandomDelayForInfo = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
1117
1147
  var infoExtraParams = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : {};
@@ -1151,7 +1181,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1151
1181
  // check for the conversation URL then sip Url
1152
1182
  var meeting = null;
1153
1183
  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);
1184
+ var foundMeeting = _this11.meetingCollection.getByKey(_meetings.MEETING_KEY.CONVERSATION_URL, targetDest);
1155
1185
  if (foundMeeting) {
1156
1186
  var foundMeetingIsNotCalendarMeeting = !foundMeeting.locusInfo.scheduledMeeting;
1157
1187
 
@@ -1165,21 +1195,21 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1165
1195
 
1166
1196
  // Attempt to collect the meeting if it exists.
1167
1197
  if (!meeting) {
1168
- meeting = _this10.meetingCollection.getByKey(_meetings.MEETING_KEY.SIP_URI, targetDest);
1198
+ meeting = _this11.meetingCollection.getByKey(_meetings.MEETING_KEY.SIP_URI, targetDest);
1169
1199
  }
1170
1200
 
1171
1201
  // Validate if a meeting was found.
1172
1202
  if (!meeting) {
1173
1203
  // 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) {
1204
+ return _this11.createMeeting(targetDest, type, useRandomDelayForInfo, infoExtraParams, callStateForMetrics, failOnMissingMeetingInfo, meetingInfo, meetingLookupUrl).then(function (createdMeeting) {
1175
1205
  // If the meeting was successfully created.
1176
1206
  if (createdMeeting && createdMeeting.on) {
1177
1207
  // Create a destruction event for the meeting.
1178
1208
  createdMeeting.on(_constants.EVENTS.DESTROY_MEETING, function (payload) {
1179
1209
  // @ts-ignore
1180
- if (_this10.config.autoUploadLogs) {
1210
+ if (_this11.config.autoUploadLogs) {
1181
1211
  var _createdMeeting$locus, _createdMeeting$locus2, _createdMeeting$locus3, _createdMeeting$locus4, _createdMeeting$locus5, _createdMeeting$locus6;
1182
- _this10.uploadLogs({
1212
+ _this11.uploadLogs({
1183
1213
  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
1214
  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
1215
  correlationId: createdMeeting.correlationId,
@@ -1189,13 +1219,13 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1189
1219
  autoupload: true
1190
1220
  });
1191
1221
  }
1192
- _this10.destroy(createdMeeting, payload.reason);
1222
+ _this11.destroy(createdMeeting, payload.reason);
1193
1223
  });
1194
1224
  createdMeeting.on(_constants.EVENTS.REQUEST_UPLOAD_LOGS, function (meetingInstance) {
1195
1225
  // @ts-ignore
1196
- if (_this10.config.autoUploadLogs) {
1226
+ if (_this11.config.autoUploadLogs) {
1197
1227
  var _meetingInstance$locu, _meetingInstance$locu2, _meetingInstance$locu3, _meetingInstance$locu4, _meetingInstance$locu5, _meetingInstance$locu6;
1198
- _this10.uploadLogs({
1228
+ _this11.uploadLogs({
1199
1229
  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
1230
  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
1231
  correlationId: meetingInstance.correlationId,
@@ -1431,7 +1461,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1431
1461
  }, {
1432
1462
  key: "syncMeetings",
1433
1463
  value: function syncMeetings() {
1434
- var _this11 = this;
1464
+ var _this12 = this;
1435
1465
  var _ref3 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
1436
1466
  _ref3$keepOnlyLocusMe = _ref3.keepOnlyLocusMeetings,
1437
1467
  keepOnlyLocusMeetings = _ref3$keepOnlyLocusMe === void 0 ? true : _ref3$keepOnlyLocusMe;
@@ -1443,16 +1473,16 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1443
1473
  return this.request.getActiveMeetings().then(function (locusArray) {
1444
1474
  var activeLocusUrl = [];
1445
1475
  if (locusArray !== null && locusArray !== void 0 && locusArray.loci && locusArray.loci.length > 0) {
1446
- var lociToUpdate = _this11.sortLocusArrayToUpdate(locusArray.loci);
1476
+ var lociToUpdate = _this12.sortLocusArrayToUpdate(locusArray.loci);
1447
1477
  lociToUpdate.forEach(function (locus) {
1448
1478
  activeLocusUrl.push(locus.url);
1449
- _this11.handleLocusEvent({
1479
+ _this12.handleLocusEvent({
1450
1480
  locus: locus,
1451
1481
  locusUrl: locus.url
1452
1482
  });
1453
1483
  });
1454
1484
  }
1455
- var meetingsCollection = _this11.meetingCollection.getAll();
1485
+ var meetingsCollection = _this12.meetingCollection.getAll();
1456
1486
  if ((0, _keys.default)(meetingsCollection).length > 0) {
1457
1487
  // Sometimes the mercury events are lost after mercury reconnect
1458
1488
  // Remove any Locus meetings that are not returned by Locus
@@ -1464,7 +1494,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1464
1494
  if ((keepOnlyLocusMeetings || locusUrl) && !activeLocusUrl.includes(locusUrl)) {
1465
1495
  // destroy function also uploads logs
1466
1496
  // @ts-ignore
1467
- _this11.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1497
+ _this12.destroy(meeting, _constants.MEETING_REMOVED_REASON.NO_MEETINGS_TO_SYNC);
1468
1498
  }
1469
1499
  }
1470
1500
  }
@@ -1484,7 +1514,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1484
1514
  }, {
1485
1515
  key: "sortLocusArrayToUpdate",
1486
1516
  value: function sortLocusArrayToUpdate(loci) {
1487
- var _this12 = this;
1517
+ var _this13 = this;
1488
1518
  var mainLoci = loci.filter(function (locus) {
1489
1519
  return !_util2.default.isBreakoutLocusDTO(locus);
1490
1520
  });
@@ -1498,7 +1528,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1498
1528
  var _mainLocus$controls, _mainLocus$controls$b, _breakoutLocus$contro, _breakoutLocus$contro2;
1499
1529
  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
1530
  });
1501
- var existCorrespondingMeeting = _this12.getCorrespondingMeetingByLocus({
1531
+ var existCorrespondingMeeting = _this13.getCorrespondingMeetingByLocus({
1502
1532
  locus: breakoutLocus,
1503
1533
  locusUrl: breakoutLocus.url
1504
1534
  });
@@ -1506,7 +1536,7 @@ var Meetings = exports.default = /*#__PURE__*/function (_WebexPlugin) {
1506
1536
  // if exists both main session and breakout session locus of the same non-exist meeting, handle main locus first,
1507
1537
  // after meeting create with main locus, then handle the associate breakout locus.
1508
1538
  // if only handle breakout locus, will miss some date
1509
- _this12.breakoutLocusForHandleLater.push(breakoutLocus);
1539
+ _this13.breakoutLocusForHandleLater.push(breakoutLocus);
1510
1540
  } else {
1511
1541
  lociToUpdate.push(breakoutLocus);
1512
1542
  }