@webex/internal-plugin-metrics 3.8.1 → 3.9.0-multiple-llm.1

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 (35) hide show
  1. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +92 -14
  2. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
  3. package/dist/call-diagnostic/call-diagnostic-metrics.js +351 -48
  4. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
  5. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +21 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
  7. package/dist/call-diagnostic/config.js +3 -1
  8. package/dist/call-diagnostic/config.js.map +1 -1
  9. package/dist/index.js.map +1 -1
  10. package/dist/metrics.js +1 -1
  11. package/dist/metrics.types.js.map +1 -1
  12. package/dist/new-metrics.js +43 -1
  13. package/dist/new-metrics.js.map +1 -1
  14. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +23 -1
  15. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +177 -10
  16. package/dist/types/call-diagnostic/config.d.ts +2 -0
  17. package/dist/types/index.d.ts +2 -2
  18. package/dist/types/metrics.types.d.ts +19 -7
  19. package/dist/types/new-metrics.d.ts +19 -2
  20. package/package.json +12 -13
  21. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +104 -14
  22. package/src/call-diagnostic/call-diagnostic-metrics.ts +368 -25
  23. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +20 -0
  24. package/src/call-diagnostic/config.ts +3 -0
  25. package/src/index.ts +2 -0
  26. package/src/metrics.types.ts +26 -6
  27. package/src/new-metrics.ts +52 -1
  28. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +20 -1
  29. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +255 -0
  30. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +864 -39
  31. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +6 -0
  32. package/test/unit/spec/new-metrics.ts +67 -2
  33. package/test/unit/spec/prelogin-metrics-batcher.ts +72 -3
  34. package/dist/call-diagnostic-events-batcher.js +0 -60
  35. package/dist/call-diagnostic-events-batcher.js.map +0 -1
@@ -14,8 +14,11 @@ _Object$defineProperty(exports, "__esModule", {
14
14
  exports.default = void 0;
15
15
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
16
16
  var _weakMap = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/weak-map"));
17
+ var _map = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/map"));
18
+ var _set = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/set"));
17
19
  var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
18
20
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
21
+ var _from = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/array/from"));
19
22
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
20
23
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
21
24
  var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
@@ -72,7 +75,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
72
75
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hasLoggedBrowserSerial", void 0);
73
76
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "device", void 0);
74
77
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "delayedClientEvents", []);
78
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "delayedClientFeatureEvents", []);
75
79
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "eventErrorCache", new _weakMap.default());
80
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "isMercuryConnected", false);
81
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "eventLimitTracker", new _map.default());
82
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "eventLimitWarningsLogged", new _set.default());
76
83
  // the default validator before piping an event to the batcher
77
84
  // this function can be overridden by the user
78
85
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "validator", function (options) {
@@ -140,6 +147,18 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
140
147
  return undefined;
141
148
  }
142
149
 
150
+ /**
151
+ * Sets mercury connected status for event data object in CA events
152
+ * @public
153
+ * @param status - boolean value indicating mercury connection status
154
+ * @return {void}
155
+ */
156
+ }, {
157
+ key: "setMercuryConnectedStatus",
158
+ value: function setMercuryConnectedStatus(status) {
159
+ this.isMercuryConnected = status;
160
+ }
161
+
143
162
  /**
144
163
  * Returns meeting's subServiceType
145
164
  * @param meeting
@@ -247,6 +266,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
247
266
  if (options !== null && options !== void 0 && options.browserLaunchMethod) {
248
267
  origin.clientInfo.browserLaunchMethod = options.browserLaunchMethod;
249
268
  }
269
+ if (options !== null && options !== void 0 && options.vendorId) {
270
+ origin.clientInfo.vendorId = options.vendorId;
271
+ }
250
272
  return origin;
251
273
  }
252
274
  throw new Error("ClientType and SubClientType can't be undefined");
@@ -375,14 +397,91 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
375
397
  }
376
398
 
377
399
  /**
378
- * TODO: NOT IMPLEMENTED
400
+ * Create feature event
401
+ * @param name
402
+ * @param payload
403
+ * @param options
404
+ * @returns
405
+ */
406
+ }, {
407
+ key: "prepareClientFeatureEvent",
408
+ value: function prepareClientFeatureEvent(_ref3) {
409
+ var name = _ref3.name,
410
+ payload = _ref3.payload,
411
+ options = _ref3.options;
412
+ var meetingId = options.meetingId,
413
+ correlationId = options.correlationId;
414
+ var featureEventObject;
415
+
416
+ // events that will most likely happen in join phase
417
+ if (meetingId) {
418
+ featureEventObject = this.createFeatureEventObjectInMeeting({
419
+ name: name,
420
+ options: options
421
+ });
422
+ } else {
423
+ throw new Error('Not implemented');
424
+ }
425
+
426
+ // merge any new properties, or override existing ones
427
+ featureEventObject = (0, _lodash.merge)(featureEventObject, payload);
428
+
429
+ // append client event data to the call diagnostic event
430
+ var featureEvent = this.prepareDiagnosticEvent(featureEventObject, options);
431
+ return featureEvent;
432
+ }
433
+
434
+ /**
379
435
  * Submit Feature Event
436
+ * submit to business_ucf
380
437
  * @returns
381
438
  */
382
439
  }, {
383
440
  key: "submitFeatureEvent",
384
- value: function submitFeatureEvent() {
385
- throw Error('Not implemented');
441
+ value: function submitFeatureEvent(_ref4) {
442
+ var name = _ref4.name,
443
+ payload = _ref4.payload,
444
+ options = _ref4.options,
445
+ delaySubmitEvent = _ref4.delaySubmitEvent;
446
+ if (delaySubmitEvent) {
447
+ // Preserve the time when the event was triggered if delaying the submission to Call Features
448
+ var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
449
+ triggeredTime: new Date().toISOString()
450
+ });
451
+ this.delayedClientFeatureEvents.push({
452
+ name: name,
453
+ payload: payload,
454
+ options: delayedOptions
455
+ });
456
+ return _promise.default.resolve();
457
+ }
458
+ this.logger.log(_config2.CALL_FEATURE_LOG_IDENTIFIER, 'CallFeatureMetrics: @submitFeatureEvent. Submit Client Feature Event CA event.', "name: ".concat(name));
459
+ var featureEvent = this.prepareClientFeatureEvent({
460
+ name: name,
461
+ payload: payload,
462
+ options: options
463
+ });
464
+ this.validator({
465
+ type: 'ce',
466
+ event: featureEvent
467
+ });
468
+ return this.submitToCallFeatures(featureEvent);
469
+ }
470
+
471
+ /**
472
+ * Submit Feature Event
473
+ * type is business
474
+ * @param event
475
+ */
476
+ }, {
477
+ key: "submitToCallFeatures",
478
+ value: function submitToCallFeatures(event) {
479
+ // build metrics-a event type
480
+ var finalEvent = {
481
+ eventPayload: event,
482
+ type: ['business']
483
+ };
484
+ return this.callDiagnosticEventsBatcher.request(finalEvent);
386
485
  }
387
486
 
388
487
  /**
@@ -394,10 +493,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
394
493
  */
395
494
  }, {
396
495
  key: "submitMQE",
397
- value: function submitMQE(_ref3) {
398
- var name = _ref3.name,
399
- payload = _ref3.payload,
400
- options = _ref3.options;
496
+ value: function submitMQE(_ref5) {
497
+ var name = _ref5.name,
498
+ payload = _ref5.payload,
499
+ options = _ref5.options;
401
500
  var meetingId = options.meetingId,
402
501
  mediaConnections = options.mediaConnections,
403
502
  webexConferenceIdStr = options.webexConferenceIdStr,
@@ -476,13 +575,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
476
575
  */
477
576
  }, {
478
577
  key: "getErrorPayloadForClientErrorCode",
479
- value: function getErrorPayloadForClientErrorCode(_ref4) {
480
- var clientErrorCode = _ref4.clientErrorCode,
481
- serviceErrorCode = _ref4.serviceErrorCode,
482
- serviceErrorName = _ref4.serviceErrorName,
483
- rawErrorMessage = _ref4.rawErrorMessage,
484
- payloadOverrides = _ref4.payloadOverrides,
485
- httpStatusCode = _ref4.httpStatusCode;
578
+ value: function getErrorPayloadForClientErrorCode(_ref6) {
579
+ var clientErrorCode = _ref6.clientErrorCode,
580
+ serviceErrorCode = _ref6.serviceErrorCode,
581
+ serviceErrorName = _ref6.serviceErrorName,
582
+ rawErrorMessage = _ref6.rawErrorMessage,
583
+ payloadOverrides = _ref6.payloadOverrides,
584
+ httpStatusCode = _ref6.httpStatusCode;
486
585
  var error;
487
586
  if (clientErrorCode) {
488
587
  var partialParsedError = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
@@ -522,6 +621,128 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
522
621
  this.eventErrorCache = new _weakMap.default();
523
622
  }
524
623
 
624
+ /**
625
+ * Checks if an event should be limited based on criteria defined in the event dictionary.
626
+ * Returns true if the event should be sent, false if it has reached its limit.
627
+ * @param event - The diagnostic event object
628
+ * @returns boolean indicating whether the event should be sent
629
+ */
630
+ }, {
631
+ key: "shouldSendEvent",
632
+ value: function shouldSendEvent(_ref7) {
633
+ var _event$identifiers;
634
+ var event = _ref7.event;
635
+ var eventName = event === null || event === void 0 ? void 0 : event.name;
636
+ var correlationId = event === null || event === void 0 ? void 0 : (_event$identifiers = event.identifiers) === null || _event$identifiers === void 0 ? void 0 : _event$identifiers.correlationId;
637
+ if (!correlationId || correlationId === 'unknown') {
638
+ return true;
639
+ }
640
+ var limitKeyPrefix = "".concat(eventName, ":").concat(correlationId);
641
+ switch (eventName) {
642
+ case 'client.media.render.start':
643
+ case 'client.media.render.stop':
644
+ case 'client.media.rx.start':
645
+ case 'client.media.rx.stop':
646
+ case 'client.media.tx.start':
647
+ case 'client.media.tx.stop':
648
+ {
649
+ // Send only once per mediaType-correlationId pair (or mediaType-correlationId-shareInstanceId for share/share_audio)
650
+ var mediaType = event === null || event === void 0 ? void 0 : event.mediaType;
651
+ if (mediaType) {
652
+ if (mediaType === 'share' || mediaType === 'share_audio') {
653
+ var shareInstanceId = event === null || event === void 0 ? void 0 : event.shareInstanceId;
654
+ if (shareInstanceId) {
655
+ var limitKey = "".concat(limitKeyPrefix, ":").concat(mediaType, ":").concat(shareInstanceId);
656
+ return this.checkAndIncrementEventCount(limitKey, 1, "".concat(eventName, " for ").concat(mediaType, " instance ").concat(shareInstanceId));
657
+ }
658
+ } else {
659
+ var _limitKey = "".concat(limitKeyPrefix, ":").concat(mediaType);
660
+ return this.checkAndIncrementEventCount(_limitKey, 1, "".concat(eventName, " for mediaType ").concat(mediaType));
661
+ }
662
+ }
663
+ break;
664
+ }
665
+ case 'client.roap-message.received':
666
+ case 'client.roap-message.sent':
667
+ {
668
+ var _event$roap, _event$roap2;
669
+ // Send only once per correlationId and roap.messageType/roap.type
670
+ var roapMessageType = (event === null || event === void 0 ? void 0 : (_event$roap = event.roap) === null || _event$roap === void 0 ? void 0 : _event$roap.messageType) || (event === null || event === void 0 ? void 0 : (_event$roap2 = event.roap) === null || _event$roap2 === void 0 ? void 0 : _event$roap2.type);
671
+ if (roapMessageType) {
672
+ var _limitKey2 = "".concat(limitKeyPrefix, ":").concat(roapMessageType);
673
+ return this.checkAndIncrementEventCount(_limitKey2, 1, "".concat(eventName, " for ROAP type ").concat(roapMessageType));
674
+ }
675
+ break;
676
+ }
677
+ default:
678
+ return true;
679
+ }
680
+ return true;
681
+ }
682
+
683
+ /**
684
+ * Checks the current count for a limit key and increments if under limit.
685
+ * @param limitKey - The unique key for this limit combination
686
+ * @param maxCount - Maximum allowed count
687
+ * @param eventDescription - Description for logging
688
+ * @returns true if under limit and incremented, false if at/over limit
689
+ */
690
+ }, {
691
+ key: "checkAndIncrementEventCount",
692
+ value: function checkAndIncrementEventCount(limitKey, maxCount, eventDescription) {
693
+ var currentCount = this.eventLimitTracker.get(limitKey) || 0;
694
+ if (currentCount >= maxCount) {
695
+ // Log warning only once per limit key
696
+ if (!this.eventLimitWarningsLogged.has(limitKey)) {
697
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, "CallDiagnosticMetrics: Event limit reached for ".concat(eventDescription, ". ") + "Max count ".concat(maxCount, " exceeded. Event will not be sent."), "limitKey: ".concat(limitKey));
698
+ this.eventLimitWarningsLogged.add(limitKey);
699
+ }
700
+ return false;
701
+ }
702
+
703
+ // Increment count and allow event
704
+ this.eventLimitTracker.set(limitKey, currentCount + 1);
705
+ return true;
706
+ }
707
+
708
+ /**
709
+ * Clears event limit tracking
710
+ */
711
+ }, {
712
+ key: "clearEventLimits",
713
+ value: function clearEventLimits() {
714
+ this.eventLimitTracker.clear();
715
+ this.eventLimitWarningsLogged.clear();
716
+ }
717
+
718
+ /**
719
+ * Clears event limit tracking for a specific correlationId only.
720
+ * Keeps limits for other meetings intact.
721
+ */
722
+ }, {
723
+ key: "clearEventLimitsForCorrelationId",
724
+ value: function clearEventLimitsForCorrelationId(correlationId) {
725
+ if (!correlationId) {
726
+ return;
727
+ }
728
+ // Keys are formatted as "eventName:correlationId:..." across all limiters.
729
+ var hasCorrIdAtSecondToken = function hasCorrIdAtSecondToken(key) {
730
+ return key.split(':')[1] === correlationId;
731
+ };
732
+ for (var _i = 0, _Array$from = (0, _from.default)(this.eventLimitTracker.keys()); _i < _Array$from.length; _i++) {
733
+ var key = _Array$from[_i];
734
+ if (hasCorrIdAtSecondToken(key)) {
735
+ this.eventLimitTracker.delete(key);
736
+ }
737
+ }
738
+ for (var _i2 = 0, _Array$from3 = (0, _from.default)(this.eventLimitWarningsLogged.values()); _i2 < _Array$from3.length; _i2++) {
739
+ var _key2 = _Array$from3[_i2];
740
+ if (hasCorrIdAtSecondToken(_key2)) {
741
+ this.eventLimitWarningsLogged.delete(_key2);
742
+ }
743
+ }
744
+ }
745
+
525
746
  /**
526
747
  * Generate error payload for Client Event
527
748
  * @param rawError
@@ -626,19 +847,20 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
626
847
  }
627
848
 
628
849
  /**
629
- * Create client event object for in meeting events
630
- * @param arg - create args
631
- * @param arg.event - event key
632
- * @param arg.options - options
850
+ * Create common object for in meeting events
851
+ * @param name
852
+ * @param options
853
+ * @param eventType - 'client' | 'feature'
633
854
  * @returns object
634
855
  */
635
856
  }, {
636
- key: "createClientEventObjectInMeeting",
637
- value: function createClientEventObjectInMeeting(_ref5) {
857
+ key: "createCommonEventObjectInMeeting",
858
+ value: function createCommonEventObjectInMeeting(_ref8) {
638
859
  var _this$webex$meetings2, _this$webex$meetings3, _this$webex$meetings4, _options$joinFlowVers, _meeting$callStateFor;
639
- var name = _ref5.name,
640
- options = _ref5.options,
641
- errors = _ref5.errors;
860
+ var name = _ref8.name,
861
+ options = _ref8.options,
862
+ _ref8$eventType = _ref8.eventType,
863
+ eventType = _ref8$eventType === void 0 ? 'client' : _ref8$eventType;
642
864
  var meetingId = options.meetingId,
643
865
  mediaConnections = options.mediaConnections,
644
866
  globalMeetingId = options.globalMeetingId,
@@ -648,9 +870,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
648
870
  // @ts-ignore
649
871
  var meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);
650
872
  if (!meeting) {
651
- console.warn('Attempt to send client event but no meeting was found...', "name: ".concat(name, ", meetingId: ").concat(meetingId));
873
+ console.warn('Attempt to send common event but no meeting was found...', "name: ".concat(name, ", meetingId: ").concat(meetingId));
652
874
  // @ts-ignore
653
- this.webex.internal.metrics.submitClientMetrics(_config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {
875
+ this.webex.internal.metrics.submitClientMetrics(eventType === 'feature' ? _config2.CALL_FEATURE_EVENT_FAILED_TO_SEND : _config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {
654
876
  fields: {
655
877
  meetingId: meetingId,
656
878
  name: name
@@ -668,12 +890,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
668
890
  sessionCorrelationId: sessionCorrelationId
669
891
  });
670
892
 
671
- // create client event object
672
- var clientEventObject = _objectSpread(_objectSpread(_objectSpread({
893
+ // create common event object structur
894
+ var commonEventObject = _objectSpread(_objectSpread(_objectSpread({
673
895
  name: name,
674
896
  canProceed: true,
675
897
  identifiers: identifiers,
676
- errors: errors,
677
898
  eventData: {
678
899
  webClientDomain: window.location.hostname
679
900
  },
@@ -693,16 +914,68 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
693
914
  });
694
915
  var joinFlowVersion = (_options$joinFlowVers = options.joinFlowVersion) !== null && _options$joinFlowVers !== void 0 ? _options$joinFlowVers : (_meeting$callStateFor = meeting.callStateForMetrics) === null || _meeting$callStateFor === void 0 ? void 0 : _meeting$callStateFor.joinFlowVersion;
695
916
  if (joinFlowVersion) {
696
- clientEventObject.joinFlowVersion = joinFlowVersion;
917
+ // @ts-ignore
918
+ commonEventObject.joinFlowVersion = joinFlowVersion;
697
919
  }
698
920
  var meetingJoinedTime = meeting.isoLocalClientMeetingJoinTime;
699
921
  if (meetingJoinedTime) {
700
- clientEventObject.meetingJoinedTime = meetingJoinedTime;
922
+ // @ts-ignore
923
+ commonEventObject.meetingJoinedTime = meetingJoinedTime;
701
924
  }
702
925
  if (options.meetingJoinPhase) {
703
- clientEventObject.meetingJoinPhase = options.meetingJoinPhase;
926
+ // @ts-ignore
927
+ commonEventObject.meetingJoinPhase = options.meetingJoinPhase;
704
928
  }
705
- return clientEventObject;
929
+ return commonEventObject;
930
+ }
931
+
932
+ /**
933
+ * Create client event object for in meeting events
934
+ * @param arg - create args
935
+ * @param arg.event - event key
936
+ * @param arg.options - options
937
+ * @returns object
938
+ */
939
+ }, {
940
+ key: "createClientEventObjectInMeeting",
941
+ value: function createClientEventObjectInMeeting(_ref9) {
942
+ var name = _ref9.name,
943
+ options = _ref9.options,
944
+ errors = _ref9.errors;
945
+ var commonObject = this.createCommonEventObjectInMeeting({
946
+ name: name,
947
+ options: options,
948
+ eventType: 'client'
949
+ });
950
+ if (!commonObject) return undefined;
951
+ return _objectSpread(_objectSpread({}, commonObject), {}, {
952
+ errors: errors,
953
+ eventData: _objectSpread(_objectSpread({}, commonObject.eventData), {}, {
954
+ isMercuryConnected: this.isMercuryConnected
955
+ })
956
+ });
957
+ }
958
+
959
+ /**
960
+ * Create feature event object for in meeting function event
961
+ * @param name
962
+ * @param options
963
+ * @returns object
964
+ */
965
+ }, {
966
+ key: "createFeatureEventObjectInMeeting",
967
+ value: function createFeatureEventObjectInMeeting(_ref10) {
968
+ var name = _ref10.name,
969
+ options = _ref10.options;
970
+ var commonObject = this.createCommonEventObjectInMeeting({
971
+ name: name,
972
+ options: options,
973
+ eventType: 'feature'
974
+ });
975
+ if (!commonObject) return undefined;
976
+ return _objectSpread(_objectSpread({}, commonObject), {}, {
977
+ key: 'UcfFeatureUsage'
978
+ });
706
979
  }
707
980
 
708
981
  /**
@@ -714,11 +987,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
714
987
  */
715
988
  }, {
716
989
  key: "createClientEventObjectPreMeeting",
717
- value: function createClientEventObjectPreMeeting(_ref6) {
990
+ value: function createClientEventObjectPreMeeting(_ref11) {
718
991
  var _this$webex$meetings5, _this$webex$meetings6, _this$webex$meetings7;
719
- var name = _ref6.name,
720
- options = _ref6.options,
721
- errors = _ref6.errors;
992
+ var name = _ref11.name,
993
+ options = _ref11.options,
994
+ errors = _ref11.errors;
722
995
  var correlationId = options.correlationId,
723
996
  globalMeetingId = options.globalMeetingId,
724
997
  webexConferenceIdStr = options.webexConferenceIdStr,
@@ -741,7 +1014,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
741
1014
  canProceed: true,
742
1015
  identifiers: identifiers,
743
1016
  eventData: {
744
- webClientDomain: window.location.hostname
1017
+ webClientDomain: window.location.hostname,
1018
+ isMercuryConnected: this.isMercuryConnected
745
1019
  },
746
1020
  loginType: this.getCurLoginType(),
747
1021
  // @ts-ignore
@@ -773,10 +1047,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
773
1047
  */
774
1048
  }, {
775
1049
  key: "prepareClientEvent",
776
- value: function prepareClientEvent(_ref7) {
777
- var name = _ref7.name,
778
- payload = _ref7.payload,
779
- options = _ref7.options;
1050
+ value: function prepareClientEvent(_ref12) {
1051
+ var name = _ref12.name,
1052
+ payload = _ref12.payload,
1053
+ options = _ref12.options;
780
1054
  var meetingId = options.meetingId,
781
1055
  correlationId = options.correlationId,
782
1056
  rawError = options.rawError;
@@ -832,11 +1106,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
832
1106
  */
833
1107
  }, {
834
1108
  key: "submitClientEvent",
835
- value: function submitClientEvent(_ref8) {
836
- var name = _ref8.name,
837
- payload = _ref8.payload,
838
- options = _ref8.options,
839
- delaySubmitEvent = _ref8.delaySubmitEvent;
1109
+ value: function submitClientEvent(_ref13) {
1110
+ var name = _ref13.name,
1111
+ payload = _ref13.payload,
1112
+ options = _ref13.options,
1113
+ delaySubmitEvent = _ref13.delaySubmitEvent;
840
1114
  if (delaySubmitEvent) {
841
1115
  // Preserve the time when the event was triggered if delaying the submission to Call Diagnostics
842
1116
  var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
@@ -855,6 +1129,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
855
1129
  payload: payload,
856
1130
  options: options
857
1131
  });
1132
+ if (!this.shouldSendEvent(diagnosticEvent)) {
1133
+ return _promise.default.resolve();
1134
+ }
858
1135
  if (options !== null && options !== void 0 && options.preLoginId) {
859
1136
  return this.submitToCallDiagnosticsPreLogin(diagnosticEvent, options === null || options === void 0 ? void 0 : options.preLoginId);
860
1137
  }
@@ -891,6 +1168,32 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
891
1168
  return _promise.default.all(promises);
892
1169
  }
893
1170
 
1171
+ /**
1172
+ * Submit Delayed feature Event CA events. Clears submitDelayedClientFeatureEvents array after submission.
1173
+ */
1174
+ }, {
1175
+ key: "submitDelayedClientFeatureEvents",
1176
+ value: function submitDelayedClientFeatureEvents(overrides) {
1177
+ var _this3 = this;
1178
+ this.logger.log(_config2.CALL_FEATURE_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @submitDelayedClientFeatureEvents. Submitting delayed feature events.');
1179
+ if (this.delayedClientFeatureEvents.length === 0) {
1180
+ return _promise.default.resolve();
1181
+ }
1182
+ var promises = this.delayedClientFeatureEvents.map(function (delayedSubmitClientEventParams) {
1183
+ var name = delayedSubmitClientEventParams.name,
1184
+ payload = delayedSubmitClientEventParams.payload,
1185
+ options = delayedSubmitClientEventParams.options;
1186
+ var optionsWithOverrides = _objectSpread(_objectSpread({}, options), overrides);
1187
+ return _this3.submitFeatureEvent({
1188
+ name: name,
1189
+ payload: payload,
1190
+ options: optionsWithOverrides
1191
+ });
1192
+ });
1193
+ this.delayedClientFeatureEvents = [];
1194
+ return _promise.default.all(promises);
1195
+ }
1196
+
894
1197
  /**
895
1198
  * Prepare the event and send the request to metrics-a service.
896
1199
  * @param event
@@ -919,12 +1222,12 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
919
1222
  * @throws
920
1223
  */
921
1224
  function () {
922
- var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref9) {
1225
+ var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref14) {
923
1226
  var name, payload, options, clientEvent, diagnosticEvent, request;
924
1227
  return _regenerator.default.wrap(function _callee$(_context) {
925
1228
  while (1) switch (_context.prev = _context.next) {
926
1229
  case 0:
927
- name = _ref9.name, payload = _ref9.payload, options = _ref9.options;
1230
+ name = _ref14.name, payload = _ref14.payload, options = _ref14.options;
928
1231
  this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...', "name: ".concat(name));
929
1232
  clientEvent = this.prepareClientEvent({
930
1233
  name: name,