@webex/internal-plugin-metrics 3.11.0 → 3.12.0-llmrefactor.2

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 (74) hide show
  1. package/dist/automated-user.js +19 -0
  2. package/dist/automated-user.js.map +1 -0
  3. package/dist/batcher.js +3 -0
  4. package/dist/batcher.js.map +1 -1
  5. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +639 -65
  6. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
  7. package/dist/call-diagnostic/call-diagnostic-metrics.js +168 -76
  8. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
  9. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +18 -4
  10. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
  11. package/dist/call-diagnostic/config.js +17 -3
  12. package/dist/call-diagnostic/config.js.map +1 -1
  13. package/dist/config.js +1 -0
  14. package/dist/config.js.map +1 -1
  15. package/dist/generic-metrics.js +8 -6
  16. package/dist/generic-metrics.js.map +1 -1
  17. package/dist/index.js +22 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/metrics.js +1 -1
  20. package/dist/metrics.types.js +4 -0
  21. package/dist/metrics.types.js.map +1 -1
  22. package/dist/new-metrics.js +105 -26
  23. package/dist/new-metrics.js.map +1 -1
  24. package/dist/prelogin-metrics.js +106 -0
  25. package/dist/prelogin-metrics.js.map +1 -0
  26. package/dist/privacy-and-security-permission-enricher/constants.js +18 -0
  27. package/dist/privacy-and-security-permission-enricher/constants.js.map +1 -0
  28. package/dist/privacy-and-security-permission-enricher/index.js +143 -0
  29. package/dist/privacy-and-security-permission-enricher/index.js.map +1 -0
  30. package/dist/privacy-and-security-permission-enricher/types.js +7 -0
  31. package/dist/privacy-and-security-permission-enricher/types.js.map +1 -0
  32. package/dist/privacy-and-security-permission-enricher/utils.js +71 -0
  33. package/dist/privacy-and-security-permission-enricher/utils.js.map +1 -0
  34. package/dist/types/automated-user.d.ts +2 -0
  35. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +208 -5
  36. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +79 -15
  37. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +5 -0
  38. package/dist/types/call-diagnostic/config.d.ts +5 -0
  39. package/dist/types/config.d.ts +1 -0
  40. package/dist/types/index.d.ts +6 -3
  41. package/dist/types/metrics.types.d.ts +9 -4
  42. package/dist/types/new-metrics.d.ts +29 -1
  43. package/dist/types/prelogin-metrics.d.ts +47 -0
  44. package/dist/types/privacy-and-security-permission-enricher/constants.d.ts +6 -0
  45. package/dist/types/privacy-and-security-permission-enricher/index.d.ts +40 -0
  46. package/dist/types/privacy-and-security-permission-enricher/types.d.ts +14 -0
  47. package/dist/types/privacy-and-security-permission-enricher/utils.d.ts +5 -0
  48. package/package.json +12 -11
  49. package/src/automated-user.ts +16 -0
  50. package/src/batcher.js +4 -0
  51. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +800 -75
  52. package/src/call-diagnostic/call-diagnostic-metrics.ts +102 -15
  53. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +22 -2
  54. package/src/call-diagnostic/config.ts +15 -0
  55. package/src/config.js +1 -0
  56. package/src/generic-metrics.ts +6 -6
  57. package/src/index.ts +9 -0
  58. package/src/metrics.types.ts +27 -5
  59. package/src/new-metrics.ts +95 -6
  60. package/src/prelogin-metrics.ts +94 -0
  61. package/src/privacy-and-security-permission-enricher/constants.ts +33 -0
  62. package/src/privacy-and-security-permission-enricher/index.ts +142 -0
  63. package/src/privacy-and-security-permission-enricher/types.ts +21 -0
  64. package/src/privacy-and-security-permission-enricher/utils.ts +82 -0
  65. package/test/unit/spec/automated-user.ts +43 -0
  66. package/test/unit/spec/batcher.js +43 -0
  67. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +47 -11
  68. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +1550 -416
  69. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +887 -159
  70. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +61 -3
  71. package/test/unit/spec/new-metrics.ts +183 -50
  72. package/test/unit/spec/prelogin-metrics-batcher.ts +71 -36
  73. package/test/unit/spec/prelogin-metrics.ts +132 -0
  74. package/test/unit/spec/privacy-and-security-permission-enricher.ts +318 -0
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
 
3
+ var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
3
4
  var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
5
  var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
5
6
  var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
@@ -7,6 +8,7 @@ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/o
7
8
  var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
8
9
  var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
9
10
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
11
+ var _WeakMap2 = require("@babel/runtime-corejs2/core-js/weak-map");
10
12
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
11
13
  _Object$defineProperty(exports, "__esModule", {
12
14
  value: true
@@ -32,11 +34,13 @@ var _uuid = _interopRequireDefault(require("uuid"));
32
34
  var _lodash = require("lodash");
33
35
  var _webexCore = require("@webex/webex-core");
34
36
  var _metrics = require("../metrics");
37
+ var AutomatedUserUtils = _interopRequireWildcard(require("../automated-user"));
35
38
  var _callDiagnosticMetrics = require("./call-diagnostic-metrics.util");
36
39
  var _config = require("../config");
37
40
  var _callDiagnosticMetricsBatcher = _interopRequireDefault(require("./call-diagnostic-metrics-batcher"));
38
41
  var _preloginMetricsBatcher = _interopRequireDefault(require("../prelogin-metrics-batcher"));
39
42
  var _config2 = require("./config");
43
+ function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap2) var r = new _WeakMap2(), n = new _WeakMap2(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
40
44
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
41
45
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; }
42
46
  function _callSuper(t, o, e) { return o = (0, _getPrototypeOf2.default)(o), (0, _possibleConstructorReturn2.default)(t, _isNativeReflectConstruct() ? _Reflect$construct(o, e || [], (0, _getPrototypeOf2.default)(t).constructor) : o.apply(t, e)); }
@@ -67,8 +71,6 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
67
71
  (0, _defineProperty2.default)(_this, "callDiagnosticEventsBatcher", void 0);
68
72
  // @ts-ignore
69
73
  (0, _defineProperty2.default)(_this, "preLoginMetricsBatcher", void 0);
70
- (0, _defineProperty2.default)(_this, "logger", void 0);
71
- // to avoid adding @ts-ignore everywhere
72
74
  (0, _defineProperty2.default)(_this, "hasLoggedBrowserSerial", void 0);
73
75
  (0, _defineProperty2.default)(_this, "device", void 0);
74
76
  (0, _defineProperty2.default)(_this, "delayedClientEvents", []);
@@ -77,6 +79,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
77
79
  (0, _defineProperty2.default)(_this, "isMercuryConnected", false);
78
80
  (0, _defineProperty2.default)(_this, "eventLimitTracker", new _map.default());
79
81
  (0, _defineProperty2.default)(_this, "eventLimitWarningsLogged", new _set.default());
82
+ (0, _defineProperty2.default)(_this, "isTelemetryOptOutManual", false);
83
+ (0, _defineProperty2.default)(_this, "isTelemetryOptOutAutomatic", false);
80
84
  // the default validator before piping an event to the batcher
81
85
  // this function can be overridden by the user
82
86
  (0, _defineProperty2.default)(_this, "validator", function (options) {
@@ -100,8 +104,6 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
100
104
  _this.preLoginMetricsBatcher.savePreLoginId(preLoginId);
101
105
  return _this.preLoginMetricsBatcher.request(finalEvent);
102
106
  });
103
- _this.logger = _this.webex.logger;
104
- // @ts-ignore
105
107
  _this.callDiagnosticEventsBatcher = new _callDiagnosticMetricsBatcher.default({}, {
106
108
  parent: _this.webex
107
109
  });
@@ -118,6 +120,14 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
118
120
  */
119
121
  (0, _inherits2.default)(CallDiagnosticMetrics, _StatelessWebexPlugin);
120
122
  return (0, _createClass2.default)(CallDiagnosticMetrics, [{
123
+ key: "logger",
124
+ get:
125
+ // lazy getter to avoid @ts-ignore on every call site
126
+ function get() {
127
+ // @ts-ignore
128
+ return this.webex.logger;
129
+ }
130
+ }, {
121
131
  key: "getCurLoginType",
122
132
  value: function getCurLoginType() {
123
133
  // @ts-ignore
@@ -128,6 +138,59 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
128
138
  return null;
129
139
  }
130
140
 
141
+ /**
142
+ * Returns the user activation state reported from the browser's navigator.userActivation API
143
+ * @returns object with hasBeenActive and isActive booleans, or undefined if unavailable
144
+ */
145
+ }, {
146
+ key: "getUserActivation",
147
+ value: function getUserActivation() {
148
+ var userActivation = typeof navigator !== 'undefined' ? navigator.userActivation : undefined;
149
+ if (userActivation) {
150
+ return {
151
+ hasBeenActive: userActivation.hasBeenActive,
152
+ isActive: userActivation.isActive
153
+ };
154
+ }
155
+ return undefined;
156
+ }
157
+
158
+ /**
159
+ * Returns the telemetryOptOut value of the current user
160
+ * @returns one of 'manual', 'automatic', undefined
161
+ */
162
+ }, {
163
+ key: "getTelemetryOptOut",
164
+ value: function getTelemetryOptOut() {
165
+ if (this.isTelemetryOptOutManual) {
166
+ return 'manual';
167
+ }
168
+ if (this.isTelemetryOptOutAutomatic) {
169
+ return 'automatic';
170
+ }
171
+ return undefined;
172
+ }
173
+
174
+ /**
175
+ * Sets the manual telemetry opt-out status for the current user
176
+ * @param value - boolean value indicating manual telemetry opt-out status
177
+ */
178
+ }, {
179
+ key: "setIsTelemetryOptOutManual",
180
+ value: function setIsTelemetryOptOutManual(value) {
181
+ this.isTelemetryOptOutManual = value;
182
+ }
183
+
184
+ /**
185
+ * Sets the automatic telemetry opt-out status for the current user
186
+ * @param value - boolean value indicating automatic telemetry opt-out status
187
+ */
188
+ }, {
189
+ key: "setIsTelemetryOptOutAutomatic",
190
+ value: function setIsTelemetryOptOutAutomatic(value) {
191
+ this.isTelemetryOptOutAutomatic = value;
192
+ }
193
+
131
194
  /**
132
195
  * Returns if the meeting has converged architecture enabled
133
196
  * @param options.meetingId
@@ -179,6 +242,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
179
242
 
180
243
  // if ConvergedArchitecture enable and isConvergedWebinarWebcast -- then webcast
181
244
  if (meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableConvergedArchitecture && meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableEvent) {
245
+ // if enableConvergedWebinarLargeScale - then large scale webinar
246
+ if (meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableConvergedWebinarLargeScale) {
247
+ return _config2.WEBEX_SUB_SERVICE_TYPES.LARGE_SCALE_WEBINAR;
248
+ }
182
249
  return meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.isConvergedWebinarWebcast ? _config2.WEBEX_SUB_SERVICE_TYPES.WEBCAST : _config2.WEBEX_SUB_SERVICE_TYPES.WEBINAR;
183
250
  }
184
251
 
@@ -199,13 +266,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
199
266
  }, {
200
267
  key: "getOrigin",
201
268
  value: function getOrigin(options, meetingId) {
202
- var _this$webex$meetings$, _this$webex$meetings$2, _this$webex$meetings$3, _this$webex$meetings$4, _this$webex$meetings$5, _this$webex$meetings$6;
269
+ var _this$webex$meetings, _this$webex$meetings$, _this$webex$meetings$2, _this$webex$meetings2, _this$webex$meetings3, _this$webex$meetings4, _this$webex$meetings5, _this$webex$meetings6, _this$webex$meetings7, _this$webex$meetings$3, _this$webex$meetings8, _this$webex$meetings9;
203
270
  var defaultClientType = // @ts-ignore
204
- (_this$webex$meetings$ = this.webex.meetings.config) === null || _this$webex$meetings$ === void 0 ? void 0 : (_this$webex$meetings$2 = _this$webex$meetings$.metrics) === null || _this$webex$meetings$2 === void 0 ? void 0 : _this$webex$meetings$2.clientType;
271
+ (_this$webex$meetings = this.webex.meetings) === null || _this$webex$meetings === void 0 ? void 0 : (_this$webex$meetings$ = _this$webex$meetings.config) === null || _this$webex$meetings$ === void 0 ? void 0 : (_this$webex$meetings$2 = _this$webex$meetings$.metrics) === null || _this$webex$meetings$2 === void 0 ? void 0 : _this$webex$meetings$2.clientType;
205
272
  var defaultSubClientType = // @ts-ignore
206
- (_this$webex$meetings$3 = this.webex.meetings.config) === null || _this$webex$meetings$3 === void 0 ? void 0 : (_this$webex$meetings$4 = _this$webex$meetings$3.metrics) === null || _this$webex$meetings$4 === void 0 ? void 0 : _this$webex$meetings$4.subClientType;
273
+ (_this$webex$meetings2 = this.webex.meetings) === null || _this$webex$meetings2 === void 0 ? void 0 : (_this$webex$meetings3 = _this$webex$meetings2.config) === null || _this$webex$meetings3 === void 0 ? void 0 : (_this$webex$meetings4 = _this$webex$meetings3.metrics) === null || _this$webex$meetings4 === void 0 ? void 0 : _this$webex$meetings4.subClientType;
207
274
  // @ts-ignore
208
- var providedClientVersion = (_this$webex$meetings$5 = this.webex.meetings.config) === null || _this$webex$meetings$5 === void 0 ? void 0 : (_this$webex$meetings$6 = _this$webex$meetings$5.metrics) === null || _this$webex$meetings$6 === void 0 ? void 0 : _this$webex$meetings$6.clientVersion;
275
+ var providedClientVersion = (_this$webex$meetings5 = this.webex.meetings) === null || _this$webex$meetings5 === void 0 ? void 0 : (_this$webex$meetings6 = _this$webex$meetings5.config) === null || _this$webex$meetings6 === void 0 ? void 0 : (_this$webex$meetings7 = _this$webex$meetings6.metrics) === null || _this$webex$meetings7 === void 0 ? void 0 : _this$webex$meetings7.clientVersion;
209
276
  // @ts-ignore
210
277
  var defaultSDKClientVersion = "".concat(_config.CLIENT_NAME, "/").concat(this.webex.version);
211
278
  var versionMetadata = {};
@@ -214,40 +281,55 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
214
281
  if (providedClientVersion) {
215
282
  versionMetadata = (0, _callDiagnosticMetrics.extractVersionMetadata)(providedClientVersion);
216
283
  }
284
+
285
+ // Browser details and the support verdict can all be supplied by the host client, which is able
286
+ // to resolve wrapper browsers (Electron, WebOS) to the engine that actually determines
287
+ // capability. The browser fields fall back to the SDK's own detection when not supplied, the
288
+ // same way clientVersion falls back to the SDK version.
289
+ var _ref2 = (_this$webex$meetings$3 = (_this$webex$meetings8 = this.webex.meetings) === null || _this$webex$meetings8 === void 0 ? void 0 : (_this$webex$meetings9 = _this$webex$meetings8.config) === null || _this$webex$meetings9 === void 0 ? void 0 : _this$webex$meetings9.metrics) !== null && _this$webex$meetings$3 !== void 0 ? _this$webex$meetings$3 : {},
290
+ providedBrowser = _ref2.browser,
291
+ providedBrowserVersion = _ref2.browserVersion,
292
+ isSupportedBrowserFamily = _ref2.isSupportedBrowserFamily,
293
+ isOutdatedBrowserVersion = _ref2.isOutdatedBrowserVersion;
217
294
  if (!this.hasLoggedBrowserSerial) {
218
295
  this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, "CallDiagnosticMetrics: @createClientEventObjectInMeeting => collected browser data", (0, _stringify.default)((0, _common.getBrowserSerial)()));
219
296
  this.hasLoggedBrowserSerial = true;
220
297
  }
221
298
  if (defaultClientType && defaultSubClientType || options.clientType && options.subClientType) {
222
- var _this$webex$meetings, _this$webex$meetings$7, _this$webex$meetings$8, _this$webex$meetings$9, _this$webex$meetings$0, _this$webex$meetings$1;
299
+ var _this$webex$meetings0, _this$webex$meetings1, _this$webex$meetings10, _this$webex$meetings11, _this$webex$meetings12, _this$webex$meetings13, _this$webex$meetings14, _this$webex$meetings15, _this$webex$meetings16;
223
300
  var origin = {
224
301
  name: 'endpoint',
225
302
  networkType: (options === null || options === void 0 ? void 0 : options.networkType) || 'unknown',
226
303
  userAgent: (0, _callDiagnosticMetrics.userAgentToString)({
227
304
  // @ts-ignore
228
- clientName: (_this$webex$meetings = this.webex.meetings) === null || _this$webex$meetings === void 0 ? void 0 : (_this$webex$meetings$7 = _this$webex$meetings.config) === null || _this$webex$meetings$7 === void 0 ? void 0 : (_this$webex$meetings$8 = _this$webex$meetings$7.metrics) === null || _this$webex$meetings$8 === void 0 ? void 0 : _this$webex$meetings$8.clientName,
305
+ clientName: (_this$webex$meetings0 = this.webex.meetings) === null || _this$webex$meetings0 === void 0 ? void 0 : (_this$webex$meetings1 = _this$webex$meetings0.config) === null || _this$webex$meetings1 === void 0 ? void 0 : (_this$webex$meetings10 = _this$webex$meetings1.metrics) === null || _this$webex$meetings10 === void 0 ? void 0 : _this$webex$meetings10.clientName,
229
306
  // @ts-ignore
230
307
  webexVersion: this.webex.version
231
308
  }),
232
- clientInfo: _objectSpread(_objectSpread({
309
+ clientInfo: _objectSpread(_objectSpread(_objectSpread({
233
310
  clientType: (options === null || options === void 0 ? void 0 : options.clientType) || defaultClientType,
234
311
  clientVersion: providedClientVersion || defaultSDKClientVersion
235
312
  }, versionMetadata), {}, {
236
313
  publicNetworkPrefix:
237
314
  // @ts-ignore
238
- (0, _callDiagnosticMetrics.anonymizeIPAddress)((_this$webex$meetings$9 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$9 === void 0 ? void 0 : _this$webex$meetings$9.clientAddress) || undefined,
315
+ (0, _callDiagnosticMetrics.anonymizeIPAddress)((_this$webex$meetings11 = this.webex.meetings) === null || _this$webex$meetings11 === void 0 ? void 0 : (_this$webex$meetings12 = _this$webex$meetings11.geoHintInfo) === null || _this$webex$meetings12 === void 0 ? void 0 : _this$webex$meetings12.clientAddress) || undefined,
239
316
  localNetworkPrefix: (0, _callDiagnosticMetrics.anonymizeIPAddress)(// @ts-ignore
240
- (_this$webex$meetings$0 = this.webex.meetings.meetingCollection.get(meetingId)) === null || _this$webex$meetings$0 === void 0 ? void 0 : (_this$webex$meetings$1 = _this$webex$meetings$0.statsAnalyzer) === null || _this$webex$meetings$1 === void 0 ? void 0 : _this$webex$meetings$1.getLocalIpAddress()) || undefined,
317
+ (_this$webex$meetings13 = this.webex.meetings) === null || _this$webex$meetings13 === void 0 ? void 0 : (_this$webex$meetings14 = _this$webex$meetings13.meetingCollection) === null || _this$webex$meetings14 === void 0 ? void 0 : (_this$webex$meetings15 = _this$webex$meetings14.get(meetingId)) === null || _this$webex$meetings15 === void 0 ? void 0 : (_this$webex$meetings16 = _this$webex$meetings15.statsAnalyzer) === null || _this$webex$meetings16 === void 0 ? void 0 : _this$webex$meetings16.getLocalIpAddress()) || undefined,
241
318
  osVersion: getOSVersion() || 'unknown',
242
319
  subClientType: (options === null || options === void 0 ? void 0 : options.subClientType) || defaultSubClientType,
243
320
  os: (0, _metrics.getOSNameInternal)(),
244
- browser: getBrowserName(),
245
- browserVersion: getBrowserVersion()
321
+ browser: providedBrowser || getBrowserName(),
322
+ browserVersion: providedBrowserVersion || getBrowserVersion()
323
+ }, isSupportedBrowserFamily === undefined ? {} : {
324
+ isSupportedBrowserFamily: isSupportedBrowserFamily
325
+ }), isOutdatedBrowserVersion === undefined ? {} : {
326
+ isOutdatedBrowserVersion: isOutdatedBrowserVersion
246
327
  })
247
328
  };
248
329
  if (meetingId) {
330
+ var _this$webex$meetings17;
249
331
  // @ts-ignore
250
- var meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);
332
+ var meeting = (_this$webex$meetings17 = this.webex.meetings) === null || _this$webex$meetings17 === void 0 ? void 0 : _this$webex$meetings17.getBasicMeetingInformation(meetingId);
251
333
  if (meeting !== null && meeting !== void 0 && meeting.environment) {
252
334
  origin.environment = meeting.environment;
253
335
  }
@@ -311,8 +393,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
311
393
 
312
394
  if (this.device) {
313
395
  var device = this.device;
314
- var _ref2 = (device === null || device === void 0 ? void 0 : device.config) || {},
315
- installationId = _ref2.installationId;
396
+ var _ref3 = (device === null || device === void 0 ? void 0 : device.config) || {},
397
+ installationId = _ref3.installationId;
316
398
  identifiers.userId = (device === null || device === void 0 ? void 0 : device.userId) || preLoginId;
317
399
  identifiers.deviceId = device === null || device === void 0 ? void 0 : device.url;
318
400
  identifiers.orgId = device === null || device === void 0 ? void 0 : device.orgId;
@@ -325,6 +407,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
325
407
  if (meeting !== null && meeting !== void 0 && (_meeting$locusInfo = meeting.locusInfo) !== null && _meeting$locusInfo !== void 0 && _meeting$locusInfo.fullState) {
326
408
  identifiers.locusUrl = meeting.locusUrl;
327
409
  identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();
410
+ identifiers.locusSessionId = meeting.locusInfo.fullState.sessionId;
328
411
  identifiers.locusStartTime = meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;
329
412
  }
330
413
  if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo2 = meeting.meetingInfo) !== null && _meeting$meetingInfo2 !== void 0 && _meeting$meetingInfo2.confIdStr || meeting !== null && meeting !== void 0 && (_meeting$meetingInfo3 = meeting.meetingInfo) !== null && _meeting$meetingInfo3 !== void 0 && _meeting$meetingInfo3.confID) {
@@ -366,7 +449,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
366
449
  }, {
367
450
  key: "prepareDiagnosticEvent",
368
451
  value: function prepareDiagnosticEvent(eventData, options) {
369
- var _this$webex$meetings$10;
452
+ var _this$webex$meetings18, _this$webex$meetings19;
370
453
  var meetingId = options.meetingId,
371
454
  triggeredTime = options.triggeredTime;
372
455
  var origin = this.getOrigin(options, meetingId);
@@ -380,7 +463,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
380
463
  sent: 'not_defined_yet'
381
464
  },
382
465
  // @ts-ignore
383
- senderCountryCode: (_this$webex$meetings$10 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$10 === void 0 ? void 0 : _this$webex$meetings$10.countryCode,
466
+ senderCountryCode: (_this$webex$meetings18 = this.webex.meetings) === null || _this$webex$meetings18 === void 0 ? void 0 : (_this$webex$meetings19 = _this$webex$meetings18.geoHintInfo) === null || _this$webex$meetings19 === void 0 ? void 0 : _this$webex$meetings19.countryCode,
384
467
  event: eventData
385
468
  };
386
469
 
@@ -402,10 +485,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
402
485
  */
403
486
  }, {
404
487
  key: "prepareClientFeatureEvent",
405
- value: function prepareClientFeatureEvent(_ref3) {
406
- var name = _ref3.name,
407
- payload = _ref3.payload,
408
- options = _ref3.options;
488
+ value: function prepareClientFeatureEvent(_ref4) {
489
+ var name = _ref4.name,
490
+ payload = _ref4.payload,
491
+ options = _ref4.options;
409
492
  var meetingId = options.meetingId,
410
493
  correlationId = options.correlationId;
411
494
  var featureEventObject;
@@ -435,11 +518,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
435
518
  */
436
519
  }, {
437
520
  key: "submitFeatureEvent",
438
- value: function submitFeatureEvent(_ref4) {
439
- var name = _ref4.name,
440
- payload = _ref4.payload,
441
- options = _ref4.options,
442
- delaySubmitEvent = _ref4.delaySubmitEvent;
521
+ value: function submitFeatureEvent(_ref5) {
522
+ var name = _ref5.name,
523
+ payload = _ref5.payload,
524
+ options = _ref5.options,
525
+ delaySubmitEvent = _ref5.delaySubmitEvent;
443
526
  if (delaySubmitEvent) {
444
527
  // Preserve the time when the event was triggered if delaying the submission to Call Features
445
528
  var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
@@ -490,10 +573,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
490
573
  */
491
574
  }, {
492
575
  key: "submitMQE",
493
- value: function submitMQE(_ref5) {
494
- var name = _ref5.name,
495
- payload = _ref5.payload,
496
- options = _ref5.options;
576
+ value: function submitMQE(_ref6) {
577
+ var name = _ref6.name,
578
+ payload = _ref6.payload,
579
+ options = _ref6.options;
497
580
  var meetingId = options.meetingId,
498
581
  mediaConnections = options.mediaConnections,
499
582
  webexConferenceIdStr = options.webexConferenceIdStr,
@@ -543,7 +626,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
543
626
  mediaEngineSoftwareType: getBrowserName() || 'browser',
544
627
  mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
545
628
  startTime: new Date().toISOString()
546
- }
629
+ },
630
+ webexSubServiceType: this.getSubServiceType(meeting)
547
631
  };
548
632
 
549
633
  // merge any new properties, or override existing ones
@@ -572,13 +656,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
572
656
  */
573
657
  }, {
574
658
  key: "getErrorPayloadForClientErrorCode",
575
- value: function getErrorPayloadForClientErrorCode(_ref6) {
576
- var clientErrorCode = _ref6.clientErrorCode,
577
- serviceErrorCode = _ref6.serviceErrorCode,
578
- serviceErrorName = _ref6.serviceErrorName,
579
- rawErrorMessage = _ref6.rawErrorMessage,
580
- payloadOverrides = _ref6.payloadOverrides,
581
- httpStatusCode = _ref6.httpStatusCode;
659
+ value: function getErrorPayloadForClientErrorCode(_ref7) {
660
+ var clientErrorCode = _ref7.clientErrorCode,
661
+ serviceErrorCode = _ref7.serviceErrorCode,
662
+ serviceErrorName = _ref7.serviceErrorName,
663
+ rawErrorMessage = _ref7.rawErrorMessage,
664
+ payloadOverrides = _ref7.payloadOverrides,
665
+ httpStatusCode = _ref7.httpStatusCode;
582
666
  var error;
583
667
  if (clientErrorCode) {
584
668
  var partialParsedError = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
@@ -626,9 +710,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
626
710
  */
627
711
  }, {
628
712
  key: "shouldSendEvent",
629
- value: function shouldSendEvent(_ref7) {
713
+ value: function shouldSendEvent(_ref8) {
630
714
  var _event$identifiers;
631
- var event = _ref7.event;
715
+ var event = _ref8.event;
632
716
  var eventName = event === null || event === void 0 ? void 0 : event.name;
633
717
  var correlationId = event === null || event === void 0 ? void 0 : (_event$identifiers = event.identifiers) === null || _event$identifiers === void 0 ? void 0 : _event$identifiers.correlationId;
634
718
  if (!correlationId || correlationId === 'unknown') {
@@ -852,12 +936,12 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
852
936
  */
853
937
  }, {
854
938
  key: "createCommonEventObjectInMeeting",
855
- value: function createCommonEventObjectInMeeting(_ref8) {
856
- var _this$webex$meetings2, _this$webex$meetings3, _this$webex$meetings4, _options$joinFlowVers, _meeting$callStateFor;
857
- var name = _ref8.name,
858
- options = _ref8.options,
859
- _ref8$eventType = _ref8.eventType,
860
- eventType = _ref8$eventType === void 0 ? 'client' : _ref8$eventType;
939
+ value: function createCommonEventObjectInMeeting(_ref9) {
940
+ var _this$webex$meetings20, _this$webex$meetings21, _this$webex$meetings22, _meeting$meetingInfo0, _options$joinFlowVers, _meeting$callStateFor;
941
+ var name = _ref9.name,
942
+ options = _ref9.options,
943
+ _ref9$eventType = _ref9.eventType,
944
+ eventType = _ref9$eventType === void 0 ? 'client' : _ref9$eventType;
861
945
  var meetingId = options.meetingId,
862
946
  mediaConnections = options.mediaConnections,
863
947
  globalMeetingId = options.globalMeetingId,
@@ -887,7 +971,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
887
971
  sessionCorrelationId: sessionCorrelationId
888
972
  });
889
973
 
890
- // create common event object structur
974
+ // create common event object structure
891
975
  var commonEventObject = _objectSpread(_objectSpread(_objectSpread({
892
976
  name: name,
893
977
  canProceed: true,
@@ -897,6 +981,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
897
981
  },
898
982
  userType: meeting.getCurUserType(),
899
983
  loginType: 'loginType' in meeting.callStateForMetrics ? meeting.callStateForMetrics.loginType : this.getCurLoginType(),
984
+ telemetryOptOut: this.getTelemetryOptOut(),
900
985
  isConvergedArchitectureEnabled: this.getIsConvergedArchitectureEnabled({
901
986
  meetingId: meetingId
902
987
  })
@@ -907,7 +992,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
907
992
  }), {}, {
908
993
  webexSubServiceType: this.getSubServiceType(meeting),
909
994
  // @ts-ignore
910
- webClientPreload: (_this$webex$meetings2 = this.webex.meetings) === null || _this$webex$meetings2 === void 0 ? void 0 : (_this$webex$meetings3 = _this$webex$meetings2.config) === null || _this$webex$meetings3 === void 0 ? void 0 : (_this$webex$meetings4 = _this$webex$meetings3.metrics) === null || _this$webex$meetings4 === void 0 ? void 0 : _this$webex$meetings4.webClientPreload
995
+ webClientPreload: (_this$webex$meetings20 = this.webex.meetings) === null || _this$webex$meetings20 === void 0 ? void 0 : (_this$webex$meetings21 = _this$webex$meetings20.config) === null || _this$webex$meetings21 === void 0 ? void 0 : (_this$webex$meetings22 = _this$webex$meetings21.metrics) === null || _this$webex$meetings22 === void 0 ? void 0 : _this$webex$meetings22.webClientPreload,
996
+ isVipMeeting: (meeting === null || meeting === void 0 ? void 0 : (_meeting$meetingInfo0 = meeting.meetingInfo) === null || _meeting$meetingInfo0 === void 0 ? void 0 : _meeting$meetingInfo0.vipmeeting) || false,
997
+ isAutomatedUser: AutomatedUserUtils.isAutomatedUser(),
998
+ userActivation: this.getUserActivation()
911
999
  });
912
1000
  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;
913
1001
  if (joinFlowVersion) {
@@ -935,10 +1023,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
935
1023
  */
936
1024
  }, {
937
1025
  key: "createClientEventObjectInMeeting",
938
- value: function createClientEventObjectInMeeting(_ref9) {
939
- var name = _ref9.name,
940
- options = _ref9.options,
941
- errors = _ref9.errors;
1026
+ value: function createClientEventObjectInMeeting(_ref0) {
1027
+ var name = _ref0.name,
1028
+ options = _ref0.options,
1029
+ errors = _ref0.errors;
942
1030
  var commonObject = this.createCommonEventObjectInMeeting({
943
1031
  name: name,
944
1032
  options: options,
@@ -961,9 +1049,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
961
1049
  */
962
1050
  }, {
963
1051
  key: "createFeatureEventObjectInMeeting",
964
- value: function createFeatureEventObjectInMeeting(_ref0) {
965
- var name = _ref0.name,
966
- options = _ref0.options;
1052
+ value: function createFeatureEventObjectInMeeting(_ref1) {
1053
+ var name = _ref1.name,
1054
+ options = _ref1.options;
967
1055
  var commonObject = this.createCommonEventObjectInMeeting({
968
1056
  name: name,
969
1057
  options: options,
@@ -984,11 +1072,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
984
1072
  */
985
1073
  }, {
986
1074
  key: "createClientEventObjectPreMeeting",
987
- value: function createClientEventObjectPreMeeting(_ref1) {
988
- var _this$webex$meetings5, _this$webex$meetings6, _this$webex$meetings7;
989
- var name = _ref1.name,
990
- options = _ref1.options,
991
- errors = _ref1.errors;
1075
+ value: function createClientEventObjectPreMeeting(_ref10) {
1076
+ var _this$webex$meetings23, _this$webex$meetings24, _this$webex$meetings25;
1077
+ var name = _ref10.name,
1078
+ options = _ref10.options,
1079
+ errors = _ref10.errors;
992
1080
  var correlationId = options.correlationId,
993
1081
  globalMeetingId = options.globalMeetingId,
994
1082
  webexConferenceIdStr = options.webexConferenceIdStr,
@@ -1015,8 +1103,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
1015
1103
  isMercuryConnected: this.isMercuryConnected
1016
1104
  },
1017
1105
  loginType: this.getCurLoginType(),
1106
+ telemetryOptOut: this.getTelemetryOptOut(),
1018
1107
  // @ts-ignore
1019
- webClientPreload: (_this$webex$meetings5 = this.webex.meetings) === null || _this$webex$meetings5 === void 0 ? void 0 : (_this$webex$meetings6 = _this$webex$meetings5.config) === null || _this$webex$meetings6 === void 0 ? void 0 : (_this$webex$meetings7 = _this$webex$meetings6.metrics) === null || _this$webex$meetings7 === void 0 ? void 0 : _this$webex$meetings7.webClientPreload
1108
+ webClientPreload: (_this$webex$meetings23 = this.webex.meetings) === null || _this$webex$meetings23 === void 0 ? void 0 : (_this$webex$meetings24 = _this$webex$meetings23.config) === null || _this$webex$meetings24 === void 0 ? void 0 : (_this$webex$meetings25 = _this$webex$meetings24.metrics) === null || _this$webex$meetings25 === void 0 ? void 0 : _this$webex$meetings25.webClientPreload,
1109
+ isAutomatedUser: AutomatedUserUtils.isAutomatedUser(),
1110
+ userActivation: this.getUserActivation()
1020
1111
  };
1021
1112
  if (options.joinFlowVersion) {
1022
1113
  clientEventObject.joinFlowVersion = options.joinFlowVersion;
@@ -1044,10 +1135,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
1044
1135
  */
1045
1136
  }, {
1046
1137
  key: "prepareClientEvent",
1047
- value: function prepareClientEvent(_ref10) {
1048
- var name = _ref10.name,
1049
- payload = _ref10.payload,
1050
- options = _ref10.options;
1138
+ value: function prepareClientEvent(_ref11) {
1139
+ var name = _ref11.name,
1140
+ payload = _ref11.payload,
1141
+ options = _ref11.options;
1051
1142
  var meetingId = options.meetingId,
1052
1143
  correlationId = options.correlationId,
1053
1144
  rawError = options.rawError;
@@ -1103,11 +1194,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
1103
1194
  */
1104
1195
  }, {
1105
1196
  key: "submitClientEvent",
1106
- value: function submitClientEvent(_ref11) {
1107
- var name = _ref11.name,
1108
- payload = _ref11.payload,
1109
- options = _ref11.options,
1110
- delaySubmitEvent = _ref11.delaySubmitEvent;
1197
+ value: function submitClientEvent(_ref12) {
1198
+ var name = _ref12.name,
1199
+ payload = _ref12.payload,
1200
+ options = _ref12.options,
1201
+ delaySubmitEvent = _ref12.delaySubmitEvent;
1111
1202
  if (delaySubmitEvent) {
1112
1203
  // Preserve the time when the event was triggered if delaying the submission to Call Diagnostics
1113
1204
  var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
@@ -1219,12 +1310,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
1219
1310
  * @throws
1220
1311
  */
1221
1312
  function () {
1222
- var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(_ref12) {
1313
+ var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(_ref13) {
1314
+ var _this$webex$internal$, _this$webex$internal$2;
1223
1315
  var name, payload, options, clientEvent, diagnosticEvent, request;
1224
1316
  return _regenerator.default.wrap(function (_context) {
1225
1317
  while (1) switch (_context.prev = _context.next) {
1226
1318
  case 0:
1227
- name = _ref12.name, payload = _ref12.payload, options = _ref12.options;
1319
+ name = _ref13.name, payload = _ref13.payload, options = _ref13.options;
1228
1320
  this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...', "name: ".concat(name));
1229
1321
  clientEvent = this.prepareClientEvent({
1230
1322
  name: name,
@@ -1245,7 +1337,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
1245
1337
  },
1246
1338
  headers: {},
1247
1339
  // @ts-ignore
1248
- waitForServiceTimeout: this.webex.internal.metrics.config.waitForServiceTimeout
1340
+ waitForServiceTimeout: (_this$webex$internal$ = this.webex.internal.metrics) === null || _this$webex$internal$ === void 0 ? void 0 : (_this$webex$internal$2 = _this$webex$internal$.config) === null || _this$webex$internal$2 === void 0 ? void 0 : _this$webex$internal$2.waitForServiceTimeout
1249
1341
  };
1250
1342
  if (options.preLoginId) {
1251
1343
  request.headers = {