@webex/internal-plugin-metrics 3.12.0-next.4 → 3.12.0-next.40
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.
- package/dist/automated-user.js +19 -0
- package/dist/automated-user.js.map +1 -0
- package/dist/batcher.js +3 -0
- package/dist/batcher.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +638 -65
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +167 -76
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js +5 -0
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
- package/dist/call-diagnostic/config.js +16 -3
- package/dist/call-diagnostic/config.js.map +1 -1
- package/dist/config.js +1 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +15 -0
- package/dist/index.js.map +1 -1
- package/dist/metrics.js +1 -1
- package/dist/metrics.types.js +4 -0
- package/dist/metrics.types.js.map +1 -1
- package/dist/new-metrics.js +16 -6
- package/dist/new-metrics.js.map +1 -1
- package/dist/types/automated-user.d.ts +2 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +208 -5
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +67 -14
- package/dist/types/call-diagnostic/config.d.ts +4 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +5 -3
- package/dist/types/metrics.types.d.ts +4 -2
- package/dist/types/new-metrics.d.ts +4 -0
- package/package.json +12 -11
- package/src/automated-user.ts +16 -0
- package/src/batcher.js +4 -0
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +800 -73
- package/src/call-diagnostic/call-diagnostic-metrics.ts +101 -15
- package/src/call-diagnostic/call-diagnostic-metrics.util.ts +5 -0
- package/src/call-diagnostic/config.ts +14 -0
- package/src/config.js +1 -0
- package/src/index.ts +5 -0
- package/src/metrics.types.ts +16 -3
- package/src/new-metrics.ts +12 -4
- package/test/unit/spec/automated-user.ts +43 -0
- package/test/unit/spec/batcher.js +43 -0
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +14 -2
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +1434 -303
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +852 -159
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +27 -0
- package/test/unit/spec/new-metrics.ts +39 -2
- package/test/unit/spec/prelogin-metrics-batcher.ts +71 -36
|
@@ -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$
|
|
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
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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$
|
|
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
|
|
315
|
-
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;
|
|
@@ -367,7 +449,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
367
449
|
}, {
|
|
368
450
|
key: "prepareDiagnosticEvent",
|
|
369
451
|
value: function prepareDiagnosticEvent(eventData, options) {
|
|
370
|
-
var _this$webex$
|
|
452
|
+
var _this$webex$meetings18, _this$webex$meetings19;
|
|
371
453
|
var meetingId = options.meetingId,
|
|
372
454
|
triggeredTime = options.triggeredTime;
|
|
373
455
|
var origin = this.getOrigin(options, meetingId);
|
|
@@ -381,7 +463,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
381
463
|
sent: 'not_defined_yet'
|
|
382
464
|
},
|
|
383
465
|
// @ts-ignore
|
|
384
|
-
senderCountryCode: (_this$webex$
|
|
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,
|
|
385
467
|
event: eventData
|
|
386
468
|
};
|
|
387
469
|
|
|
@@ -403,10 +485,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
403
485
|
*/
|
|
404
486
|
}, {
|
|
405
487
|
key: "prepareClientFeatureEvent",
|
|
406
|
-
value: function prepareClientFeatureEvent(
|
|
407
|
-
var name =
|
|
408
|
-
payload =
|
|
409
|
-
options =
|
|
488
|
+
value: function prepareClientFeatureEvent(_ref4) {
|
|
489
|
+
var name = _ref4.name,
|
|
490
|
+
payload = _ref4.payload,
|
|
491
|
+
options = _ref4.options;
|
|
410
492
|
var meetingId = options.meetingId,
|
|
411
493
|
correlationId = options.correlationId;
|
|
412
494
|
var featureEventObject;
|
|
@@ -436,11 +518,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
436
518
|
*/
|
|
437
519
|
}, {
|
|
438
520
|
key: "submitFeatureEvent",
|
|
439
|
-
value: function submitFeatureEvent(
|
|
440
|
-
var name =
|
|
441
|
-
payload =
|
|
442
|
-
options =
|
|
443
|
-
delaySubmitEvent =
|
|
521
|
+
value: function submitFeatureEvent(_ref5) {
|
|
522
|
+
var name = _ref5.name,
|
|
523
|
+
payload = _ref5.payload,
|
|
524
|
+
options = _ref5.options,
|
|
525
|
+
delaySubmitEvent = _ref5.delaySubmitEvent;
|
|
444
526
|
if (delaySubmitEvent) {
|
|
445
527
|
// Preserve the time when the event was triggered if delaying the submission to Call Features
|
|
446
528
|
var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
@@ -491,10 +573,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
491
573
|
*/
|
|
492
574
|
}, {
|
|
493
575
|
key: "submitMQE",
|
|
494
|
-
value: function submitMQE(
|
|
495
|
-
var name =
|
|
496
|
-
payload =
|
|
497
|
-
options =
|
|
576
|
+
value: function submitMQE(_ref6) {
|
|
577
|
+
var name = _ref6.name,
|
|
578
|
+
payload = _ref6.payload,
|
|
579
|
+
options = _ref6.options;
|
|
498
580
|
var meetingId = options.meetingId,
|
|
499
581
|
mediaConnections = options.mediaConnections,
|
|
500
582
|
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
@@ -544,7 +626,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
544
626
|
mediaEngineSoftwareType: getBrowserName() || 'browser',
|
|
545
627
|
mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
|
|
546
628
|
startTime: new Date().toISOString()
|
|
547
|
-
}
|
|
629
|
+
},
|
|
630
|
+
webexSubServiceType: this.getSubServiceType(meeting)
|
|
548
631
|
};
|
|
549
632
|
|
|
550
633
|
// merge any new properties, or override existing ones
|
|
@@ -573,13 +656,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
573
656
|
*/
|
|
574
657
|
}, {
|
|
575
658
|
key: "getErrorPayloadForClientErrorCode",
|
|
576
|
-
value: function getErrorPayloadForClientErrorCode(
|
|
577
|
-
var clientErrorCode =
|
|
578
|
-
serviceErrorCode =
|
|
579
|
-
serviceErrorName =
|
|
580
|
-
rawErrorMessage =
|
|
581
|
-
payloadOverrides =
|
|
582
|
-
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;
|
|
583
666
|
var error;
|
|
584
667
|
if (clientErrorCode) {
|
|
585
668
|
var partialParsedError = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
|
|
@@ -627,9 +710,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
627
710
|
*/
|
|
628
711
|
}, {
|
|
629
712
|
key: "shouldSendEvent",
|
|
630
|
-
value: function shouldSendEvent(
|
|
713
|
+
value: function shouldSendEvent(_ref8) {
|
|
631
714
|
var _event$identifiers;
|
|
632
|
-
var event =
|
|
715
|
+
var event = _ref8.event;
|
|
633
716
|
var eventName = event === null || event === void 0 ? void 0 : event.name;
|
|
634
717
|
var correlationId = event === null || event === void 0 ? void 0 : (_event$identifiers = event.identifiers) === null || _event$identifiers === void 0 ? void 0 : _event$identifiers.correlationId;
|
|
635
718
|
if (!correlationId || correlationId === 'unknown') {
|
|
@@ -853,12 +936,12 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
853
936
|
*/
|
|
854
937
|
}, {
|
|
855
938
|
key: "createCommonEventObjectInMeeting",
|
|
856
|
-
value: function createCommonEventObjectInMeeting(
|
|
857
|
-
var _this$webex$
|
|
858
|
-
var name =
|
|
859
|
-
options =
|
|
860
|
-
|
|
861
|
-
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;
|
|
862
945
|
var meetingId = options.meetingId,
|
|
863
946
|
mediaConnections = options.mediaConnections,
|
|
864
947
|
globalMeetingId = options.globalMeetingId,
|
|
@@ -888,7 +971,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
888
971
|
sessionCorrelationId: sessionCorrelationId
|
|
889
972
|
});
|
|
890
973
|
|
|
891
|
-
// create common event object
|
|
974
|
+
// create common event object structure
|
|
892
975
|
var commonEventObject = _objectSpread(_objectSpread(_objectSpread({
|
|
893
976
|
name: name,
|
|
894
977
|
canProceed: true,
|
|
@@ -898,6 +981,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
898
981
|
},
|
|
899
982
|
userType: meeting.getCurUserType(),
|
|
900
983
|
loginType: 'loginType' in meeting.callStateForMetrics ? meeting.callStateForMetrics.loginType : this.getCurLoginType(),
|
|
984
|
+
telemetryOptOut: this.getTelemetryOptOut(),
|
|
901
985
|
isConvergedArchitectureEnabled: this.getIsConvergedArchitectureEnabled({
|
|
902
986
|
meetingId: meetingId
|
|
903
987
|
})
|
|
@@ -908,7 +992,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
908
992
|
}), {}, {
|
|
909
993
|
webexSubServiceType: this.getSubServiceType(meeting),
|
|
910
994
|
// @ts-ignore
|
|
911
|
-
webClientPreload: (_this$webex$
|
|
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()
|
|
912
999
|
});
|
|
913
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;
|
|
914
1001
|
if (joinFlowVersion) {
|
|
@@ -936,10 +1023,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
936
1023
|
*/
|
|
937
1024
|
}, {
|
|
938
1025
|
key: "createClientEventObjectInMeeting",
|
|
939
|
-
value: function createClientEventObjectInMeeting(
|
|
940
|
-
var name =
|
|
941
|
-
options =
|
|
942
|
-
errors =
|
|
1026
|
+
value: function createClientEventObjectInMeeting(_ref0) {
|
|
1027
|
+
var name = _ref0.name,
|
|
1028
|
+
options = _ref0.options,
|
|
1029
|
+
errors = _ref0.errors;
|
|
943
1030
|
var commonObject = this.createCommonEventObjectInMeeting({
|
|
944
1031
|
name: name,
|
|
945
1032
|
options: options,
|
|
@@ -962,9 +1049,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
962
1049
|
*/
|
|
963
1050
|
}, {
|
|
964
1051
|
key: "createFeatureEventObjectInMeeting",
|
|
965
|
-
value: function createFeatureEventObjectInMeeting(
|
|
966
|
-
var name =
|
|
967
|
-
options =
|
|
1052
|
+
value: function createFeatureEventObjectInMeeting(_ref1) {
|
|
1053
|
+
var name = _ref1.name,
|
|
1054
|
+
options = _ref1.options;
|
|
968
1055
|
var commonObject = this.createCommonEventObjectInMeeting({
|
|
969
1056
|
name: name,
|
|
970
1057
|
options: options,
|
|
@@ -985,11 +1072,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
985
1072
|
*/
|
|
986
1073
|
}, {
|
|
987
1074
|
key: "createClientEventObjectPreMeeting",
|
|
988
|
-
value: function createClientEventObjectPreMeeting(
|
|
989
|
-
var _this$webex$
|
|
990
|
-
var name =
|
|
991
|
-
options =
|
|
992
|
-
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;
|
|
993
1080
|
var correlationId = options.correlationId,
|
|
994
1081
|
globalMeetingId = options.globalMeetingId,
|
|
995
1082
|
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
@@ -1016,8 +1103,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1016
1103
|
isMercuryConnected: this.isMercuryConnected
|
|
1017
1104
|
},
|
|
1018
1105
|
loginType: this.getCurLoginType(),
|
|
1106
|
+
telemetryOptOut: this.getTelemetryOptOut(),
|
|
1019
1107
|
// @ts-ignore
|
|
1020
|
-
webClientPreload: (_this$webex$
|
|
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()
|
|
1021
1111
|
};
|
|
1022
1112
|
if (options.joinFlowVersion) {
|
|
1023
1113
|
clientEventObject.joinFlowVersion = options.joinFlowVersion;
|
|
@@ -1045,10 +1135,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1045
1135
|
*/
|
|
1046
1136
|
}, {
|
|
1047
1137
|
key: "prepareClientEvent",
|
|
1048
|
-
value: function prepareClientEvent(
|
|
1049
|
-
var name =
|
|
1050
|
-
payload =
|
|
1051
|
-
options =
|
|
1138
|
+
value: function prepareClientEvent(_ref11) {
|
|
1139
|
+
var name = _ref11.name,
|
|
1140
|
+
payload = _ref11.payload,
|
|
1141
|
+
options = _ref11.options;
|
|
1052
1142
|
var meetingId = options.meetingId,
|
|
1053
1143
|
correlationId = options.correlationId,
|
|
1054
1144
|
rawError = options.rawError;
|
|
@@ -1104,11 +1194,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1104
1194
|
*/
|
|
1105
1195
|
}, {
|
|
1106
1196
|
key: "submitClientEvent",
|
|
1107
|
-
value: function submitClientEvent(
|
|
1108
|
-
var name =
|
|
1109
|
-
payload =
|
|
1110
|
-
options =
|
|
1111
|
-
delaySubmitEvent =
|
|
1197
|
+
value: function submitClientEvent(_ref12) {
|
|
1198
|
+
var name = _ref12.name,
|
|
1199
|
+
payload = _ref12.payload,
|
|
1200
|
+
options = _ref12.options,
|
|
1201
|
+
delaySubmitEvent = _ref12.delaySubmitEvent;
|
|
1112
1202
|
if (delaySubmitEvent) {
|
|
1113
1203
|
// Preserve the time when the event was triggered if delaying the submission to Call Diagnostics
|
|
1114
1204
|
var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
@@ -1220,12 +1310,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1220
1310
|
* @throws
|
|
1221
1311
|
*/
|
|
1222
1312
|
function () {
|
|
1223
|
-
var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(
|
|
1313
|
+
var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(_ref13) {
|
|
1314
|
+
var _this$webex$internal$, _this$webex$internal$2;
|
|
1224
1315
|
var name, payload, options, clientEvent, diagnosticEvent, request;
|
|
1225
1316
|
return _regenerator.default.wrap(function (_context) {
|
|
1226
1317
|
while (1) switch (_context.prev = _context.next) {
|
|
1227
1318
|
case 0:
|
|
1228
|
-
name =
|
|
1319
|
+
name = _ref13.name, payload = _ref13.payload, options = _ref13.options;
|
|
1229
1320
|
this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...', "name: ".concat(name));
|
|
1230
1321
|
clientEvent = this.prepareClientEvent({
|
|
1231
1322
|
name: name,
|
|
@@ -1246,7 +1337,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1246
1337
|
},
|
|
1247
1338
|
headers: {},
|
|
1248
1339
|
// @ts-ignore
|
|
1249
|
-
waitForServiceTimeout: this.webex.internal.metrics
|
|
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
|
|
1250
1341
|
};
|
|
1251
1342
|
if (options.preLoginId) {
|
|
1252
1343
|
request.headers = {
|