@webex/internal-plugin-metrics 3.11.0 → 3.12.0-metrics-init-fix-2.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.
- 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 +639 -65
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +166 -75
- package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js +18 -4
- package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -1
- package/dist/call-diagnostic/config.js +17 -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/generic-metrics.js +8 -6
- package/dist/generic-metrics.js.map +1 -1
- package/dist/index.js +22 -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 +69 -23
- package/dist/new-metrics.js.map +1 -1
- package/dist/prelogin-metrics.js +106 -0
- package/dist/prelogin-metrics.js.map +1 -0
- 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 +79 -15
- package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +5 -0
- package/dist/types/call-diagnostic/config.d.ts +5 -0
- package/dist/types/config.d.ts +1 -0
- package/dist/types/index.d.ts +6 -3
- package/dist/types/metrics.types.d.ts +6 -4
- package/dist/types/new-metrics.d.ts +16 -0
- package/dist/types/prelogin-metrics.d.ts +47 -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 -75
- package/src/call-diagnostic/call-diagnostic-metrics.ts +101 -14
- package/src/call-diagnostic/call-diagnostic-metrics.util.ts +22 -2
- package/src/call-diagnostic/config.ts +15 -0
- package/src/config.js +1 -0
- package/src/generic-metrics.ts +6 -6
- package/src/index.ts +7 -0
- package/src/metrics.types.ts +18 -5
- package/src/new-metrics.ts +54 -4
- package/src/prelogin-metrics.ts +94 -0
- 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 +47 -11
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +1550 -416
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +846 -159
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +61 -3
- package/test/unit/spec/new-metrics.ts +13 -2
- package/test/unit/spec/prelogin-metrics-batcher.ts +71 -36
- package/test/unit/spec/prelogin-metrics.ts +132 -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$
|
|
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$meetings$4;
|
|
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,35 +281,49 @@ 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$meetings$4 = this.webex.meetings.config) === null || _this$webex$meetings$4 === void 0 ? void 0 : _this$webex$meetings$4.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$meetings8, _this$webex$meetings9, _this$webex$meetings0, _this$webex$meetings1, _this$webex$meetings10, _this$webex$meetings11, _this$webex$meetings12, _this$webex$meetings13, _this$webex$meetings14;
|
|
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$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$meetings0 = _this$webex$meetings9.metrics) === null || _this$webex$meetings0 === void 0 ? void 0 : _this$webex$meetings0.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$meetings1 = this.webex.meetings) === null || _this$webex$meetings1 === void 0 ? void 0 : (_this$webex$meetings10 = _this$webex$meetings1.geoHintInfo) === null || _this$webex$meetings10 === void 0 ? void 0 : _this$webex$meetings10.clientAddress) || undefined,
|
|
239
316
|
localNetworkPrefix: (0, _callDiagnosticMetrics.anonymizeIPAddress)(// @ts-ignore
|
|
240
|
-
(_this$webex$
|
|
317
|
+
(_this$webex$meetings11 = this.webex.meetings) === null || _this$webex$meetings11 === void 0 ? void 0 : (_this$webex$meetings12 = _this$webex$meetings11.meetingCollection) === null || _this$webex$meetings12 === void 0 ? void 0 : (_this$webex$meetings13 = _this$webex$meetings12.get(meetingId)) === null || _this$webex$meetings13 === void 0 ? void 0 : (_this$webex$meetings14 = _this$webex$meetings13.statsAnalyzer) === null || _this$webex$meetings14 === void 0 ? void 0 : _this$webex$meetings14.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) {
|
|
@@ -311,8 +392,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
311
392
|
|
|
312
393
|
if (this.device) {
|
|
313
394
|
var device = this.device;
|
|
314
|
-
var
|
|
315
|
-
installationId =
|
|
395
|
+
var _ref3 = (device === null || device === void 0 ? void 0 : device.config) || {},
|
|
396
|
+
installationId = _ref3.installationId;
|
|
316
397
|
identifiers.userId = (device === null || device === void 0 ? void 0 : device.userId) || preLoginId;
|
|
317
398
|
identifiers.deviceId = device === null || device === void 0 ? void 0 : device.url;
|
|
318
399
|
identifiers.orgId = device === null || device === void 0 ? void 0 : device.orgId;
|
|
@@ -325,6 +406,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
325
406
|
if (meeting !== null && meeting !== void 0 && (_meeting$locusInfo = meeting.locusInfo) !== null && _meeting$locusInfo !== void 0 && _meeting$locusInfo.fullState) {
|
|
326
407
|
identifiers.locusUrl = meeting.locusUrl;
|
|
327
408
|
identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();
|
|
409
|
+
identifiers.locusSessionId = meeting.locusInfo.fullState.sessionId;
|
|
328
410
|
identifiers.locusStartTime = meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;
|
|
329
411
|
}
|
|
330
412
|
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 +448,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
366
448
|
}, {
|
|
367
449
|
key: "prepareDiagnosticEvent",
|
|
368
450
|
value: function prepareDiagnosticEvent(eventData, options) {
|
|
369
|
-
var _this$webex$
|
|
451
|
+
var _this$webex$meetings15, _this$webex$meetings16;
|
|
370
452
|
var meetingId = options.meetingId,
|
|
371
453
|
triggeredTime = options.triggeredTime;
|
|
372
454
|
var origin = this.getOrigin(options, meetingId);
|
|
@@ -380,7 +462,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
380
462
|
sent: 'not_defined_yet'
|
|
381
463
|
},
|
|
382
464
|
// @ts-ignore
|
|
383
|
-
senderCountryCode: (_this$webex$
|
|
465
|
+
senderCountryCode: (_this$webex$meetings15 = this.webex.meetings) === null || _this$webex$meetings15 === void 0 ? void 0 : (_this$webex$meetings16 = _this$webex$meetings15.geoHintInfo) === null || _this$webex$meetings16 === void 0 ? void 0 : _this$webex$meetings16.countryCode,
|
|
384
466
|
event: eventData
|
|
385
467
|
};
|
|
386
468
|
|
|
@@ -402,10 +484,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
402
484
|
*/
|
|
403
485
|
}, {
|
|
404
486
|
key: "prepareClientFeatureEvent",
|
|
405
|
-
value: function prepareClientFeatureEvent(
|
|
406
|
-
var name =
|
|
407
|
-
payload =
|
|
408
|
-
options =
|
|
487
|
+
value: function prepareClientFeatureEvent(_ref4) {
|
|
488
|
+
var name = _ref4.name,
|
|
489
|
+
payload = _ref4.payload,
|
|
490
|
+
options = _ref4.options;
|
|
409
491
|
var meetingId = options.meetingId,
|
|
410
492
|
correlationId = options.correlationId;
|
|
411
493
|
var featureEventObject;
|
|
@@ -435,11 +517,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
435
517
|
*/
|
|
436
518
|
}, {
|
|
437
519
|
key: "submitFeatureEvent",
|
|
438
|
-
value: function submitFeatureEvent(
|
|
439
|
-
var name =
|
|
440
|
-
payload =
|
|
441
|
-
options =
|
|
442
|
-
delaySubmitEvent =
|
|
520
|
+
value: function submitFeatureEvent(_ref5) {
|
|
521
|
+
var name = _ref5.name,
|
|
522
|
+
payload = _ref5.payload,
|
|
523
|
+
options = _ref5.options,
|
|
524
|
+
delaySubmitEvent = _ref5.delaySubmitEvent;
|
|
443
525
|
if (delaySubmitEvent) {
|
|
444
526
|
// Preserve the time when the event was triggered if delaying the submission to Call Features
|
|
445
527
|
var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
@@ -490,10 +572,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
490
572
|
*/
|
|
491
573
|
}, {
|
|
492
574
|
key: "submitMQE",
|
|
493
|
-
value: function submitMQE(
|
|
494
|
-
var name =
|
|
495
|
-
payload =
|
|
496
|
-
options =
|
|
575
|
+
value: function submitMQE(_ref6) {
|
|
576
|
+
var name = _ref6.name,
|
|
577
|
+
payload = _ref6.payload,
|
|
578
|
+
options = _ref6.options;
|
|
497
579
|
var meetingId = options.meetingId,
|
|
498
580
|
mediaConnections = options.mediaConnections,
|
|
499
581
|
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
@@ -543,7 +625,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
543
625
|
mediaEngineSoftwareType: getBrowserName() || 'browser',
|
|
544
626
|
mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
|
|
545
627
|
startTime: new Date().toISOString()
|
|
546
|
-
}
|
|
628
|
+
},
|
|
629
|
+
webexSubServiceType: this.getSubServiceType(meeting)
|
|
547
630
|
};
|
|
548
631
|
|
|
549
632
|
// merge any new properties, or override existing ones
|
|
@@ -572,13 +655,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
572
655
|
*/
|
|
573
656
|
}, {
|
|
574
657
|
key: "getErrorPayloadForClientErrorCode",
|
|
575
|
-
value: function getErrorPayloadForClientErrorCode(
|
|
576
|
-
var clientErrorCode =
|
|
577
|
-
serviceErrorCode =
|
|
578
|
-
serviceErrorName =
|
|
579
|
-
rawErrorMessage =
|
|
580
|
-
payloadOverrides =
|
|
581
|
-
httpStatusCode =
|
|
658
|
+
value: function getErrorPayloadForClientErrorCode(_ref7) {
|
|
659
|
+
var clientErrorCode = _ref7.clientErrorCode,
|
|
660
|
+
serviceErrorCode = _ref7.serviceErrorCode,
|
|
661
|
+
serviceErrorName = _ref7.serviceErrorName,
|
|
662
|
+
rawErrorMessage = _ref7.rawErrorMessage,
|
|
663
|
+
payloadOverrides = _ref7.payloadOverrides,
|
|
664
|
+
httpStatusCode = _ref7.httpStatusCode;
|
|
582
665
|
var error;
|
|
583
666
|
if (clientErrorCode) {
|
|
584
667
|
var partialParsedError = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
|
|
@@ -626,9 +709,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
626
709
|
*/
|
|
627
710
|
}, {
|
|
628
711
|
key: "shouldSendEvent",
|
|
629
|
-
value: function shouldSendEvent(
|
|
712
|
+
value: function shouldSendEvent(_ref8) {
|
|
630
713
|
var _event$identifiers;
|
|
631
|
-
var event =
|
|
714
|
+
var event = _ref8.event;
|
|
632
715
|
var eventName = event === null || event === void 0 ? void 0 : event.name;
|
|
633
716
|
var correlationId = event === null || event === void 0 ? void 0 : (_event$identifiers = event.identifiers) === null || _event$identifiers === void 0 ? void 0 : _event$identifiers.correlationId;
|
|
634
717
|
if (!correlationId || correlationId === 'unknown') {
|
|
@@ -852,12 +935,12 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
852
935
|
*/
|
|
853
936
|
}, {
|
|
854
937
|
key: "createCommonEventObjectInMeeting",
|
|
855
|
-
value: function createCommonEventObjectInMeeting(
|
|
856
|
-
var _this$webex$
|
|
857
|
-
var name =
|
|
858
|
-
options =
|
|
859
|
-
|
|
860
|
-
eventType =
|
|
938
|
+
value: function createCommonEventObjectInMeeting(_ref9) {
|
|
939
|
+
var _this$webex$meetings17, _this$webex$meetings18, _this$webex$meetings19, _meeting$meetingInfo0, _options$joinFlowVers, _meeting$callStateFor;
|
|
940
|
+
var name = _ref9.name,
|
|
941
|
+
options = _ref9.options,
|
|
942
|
+
_ref9$eventType = _ref9.eventType,
|
|
943
|
+
eventType = _ref9$eventType === void 0 ? 'client' : _ref9$eventType;
|
|
861
944
|
var meetingId = options.meetingId,
|
|
862
945
|
mediaConnections = options.mediaConnections,
|
|
863
946
|
globalMeetingId = options.globalMeetingId,
|
|
@@ -887,7 +970,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
887
970
|
sessionCorrelationId: sessionCorrelationId
|
|
888
971
|
});
|
|
889
972
|
|
|
890
|
-
// create common event object
|
|
973
|
+
// create common event object structure
|
|
891
974
|
var commonEventObject = _objectSpread(_objectSpread(_objectSpread({
|
|
892
975
|
name: name,
|
|
893
976
|
canProceed: true,
|
|
@@ -897,6 +980,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
897
980
|
},
|
|
898
981
|
userType: meeting.getCurUserType(),
|
|
899
982
|
loginType: 'loginType' in meeting.callStateForMetrics ? meeting.callStateForMetrics.loginType : this.getCurLoginType(),
|
|
983
|
+
telemetryOptOut: this.getTelemetryOptOut(),
|
|
900
984
|
isConvergedArchitectureEnabled: this.getIsConvergedArchitectureEnabled({
|
|
901
985
|
meetingId: meetingId
|
|
902
986
|
})
|
|
@@ -907,7 +991,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
907
991
|
}), {}, {
|
|
908
992
|
webexSubServiceType: this.getSubServiceType(meeting),
|
|
909
993
|
// @ts-ignore
|
|
910
|
-
webClientPreload: (_this$webex$
|
|
994
|
+
webClientPreload: (_this$webex$meetings17 = this.webex.meetings) === null || _this$webex$meetings17 === void 0 ? void 0 : (_this$webex$meetings18 = _this$webex$meetings17.config) === null || _this$webex$meetings18 === void 0 ? void 0 : (_this$webex$meetings19 = _this$webex$meetings18.metrics) === null || _this$webex$meetings19 === void 0 ? void 0 : _this$webex$meetings19.webClientPreload,
|
|
995
|
+
isVipMeeting: (meeting === null || meeting === void 0 ? void 0 : (_meeting$meetingInfo0 = meeting.meetingInfo) === null || _meeting$meetingInfo0 === void 0 ? void 0 : _meeting$meetingInfo0.vipmeeting) || false,
|
|
996
|
+
isAutomatedUser: AutomatedUserUtils.isAutomatedUser(),
|
|
997
|
+
userActivation: this.getUserActivation()
|
|
911
998
|
});
|
|
912
999
|
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
1000
|
if (joinFlowVersion) {
|
|
@@ -935,10 +1022,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
935
1022
|
*/
|
|
936
1023
|
}, {
|
|
937
1024
|
key: "createClientEventObjectInMeeting",
|
|
938
|
-
value: function createClientEventObjectInMeeting(
|
|
939
|
-
var name =
|
|
940
|
-
options =
|
|
941
|
-
errors =
|
|
1025
|
+
value: function createClientEventObjectInMeeting(_ref0) {
|
|
1026
|
+
var name = _ref0.name,
|
|
1027
|
+
options = _ref0.options,
|
|
1028
|
+
errors = _ref0.errors;
|
|
942
1029
|
var commonObject = this.createCommonEventObjectInMeeting({
|
|
943
1030
|
name: name,
|
|
944
1031
|
options: options,
|
|
@@ -961,9 +1048,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
961
1048
|
*/
|
|
962
1049
|
}, {
|
|
963
1050
|
key: "createFeatureEventObjectInMeeting",
|
|
964
|
-
value: function createFeatureEventObjectInMeeting(
|
|
965
|
-
var name =
|
|
966
|
-
options =
|
|
1051
|
+
value: function createFeatureEventObjectInMeeting(_ref1) {
|
|
1052
|
+
var name = _ref1.name,
|
|
1053
|
+
options = _ref1.options;
|
|
967
1054
|
var commonObject = this.createCommonEventObjectInMeeting({
|
|
968
1055
|
name: name,
|
|
969
1056
|
options: options,
|
|
@@ -984,11 +1071,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
984
1071
|
*/
|
|
985
1072
|
}, {
|
|
986
1073
|
key: "createClientEventObjectPreMeeting",
|
|
987
|
-
value: function createClientEventObjectPreMeeting(
|
|
988
|
-
var _this$webex$
|
|
989
|
-
var name =
|
|
990
|
-
options =
|
|
991
|
-
errors =
|
|
1074
|
+
value: function createClientEventObjectPreMeeting(_ref10) {
|
|
1075
|
+
var _this$webex$meetings20, _this$webex$meetings21, _this$webex$meetings22;
|
|
1076
|
+
var name = _ref10.name,
|
|
1077
|
+
options = _ref10.options,
|
|
1078
|
+
errors = _ref10.errors;
|
|
992
1079
|
var correlationId = options.correlationId,
|
|
993
1080
|
globalMeetingId = options.globalMeetingId,
|
|
994
1081
|
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
@@ -1015,8 +1102,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1015
1102
|
isMercuryConnected: this.isMercuryConnected
|
|
1016
1103
|
},
|
|
1017
1104
|
loginType: this.getCurLoginType(),
|
|
1105
|
+
telemetryOptOut: this.getTelemetryOptOut(),
|
|
1018
1106
|
// @ts-ignore
|
|
1019
|
-
webClientPreload: (_this$webex$
|
|
1107
|
+
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,
|
|
1108
|
+
isAutomatedUser: AutomatedUserUtils.isAutomatedUser(),
|
|
1109
|
+
userActivation: this.getUserActivation()
|
|
1020
1110
|
};
|
|
1021
1111
|
if (options.joinFlowVersion) {
|
|
1022
1112
|
clientEventObject.joinFlowVersion = options.joinFlowVersion;
|
|
@@ -1044,10 +1134,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1044
1134
|
*/
|
|
1045
1135
|
}, {
|
|
1046
1136
|
key: "prepareClientEvent",
|
|
1047
|
-
value: function prepareClientEvent(
|
|
1048
|
-
var name =
|
|
1049
|
-
payload =
|
|
1050
|
-
options =
|
|
1137
|
+
value: function prepareClientEvent(_ref11) {
|
|
1138
|
+
var name = _ref11.name,
|
|
1139
|
+
payload = _ref11.payload,
|
|
1140
|
+
options = _ref11.options;
|
|
1051
1141
|
var meetingId = options.meetingId,
|
|
1052
1142
|
correlationId = options.correlationId,
|
|
1053
1143
|
rawError = options.rawError;
|
|
@@ -1103,11 +1193,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1103
1193
|
*/
|
|
1104
1194
|
}, {
|
|
1105
1195
|
key: "submitClientEvent",
|
|
1106
|
-
value: function submitClientEvent(
|
|
1107
|
-
var name =
|
|
1108
|
-
payload =
|
|
1109
|
-
options =
|
|
1110
|
-
delaySubmitEvent =
|
|
1196
|
+
value: function submitClientEvent(_ref12) {
|
|
1197
|
+
var name = _ref12.name,
|
|
1198
|
+
payload = _ref12.payload,
|
|
1199
|
+
options = _ref12.options,
|
|
1200
|
+
delaySubmitEvent = _ref12.delaySubmitEvent;
|
|
1111
1201
|
if (delaySubmitEvent) {
|
|
1112
1202
|
// Preserve the time when the event was triggered if delaying the submission to Call Diagnostics
|
|
1113
1203
|
var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
@@ -1219,12 +1309,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1219
1309
|
* @throws
|
|
1220
1310
|
*/
|
|
1221
1311
|
function () {
|
|
1222
|
-
var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(
|
|
1312
|
+
var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(_ref13) {
|
|
1313
|
+
var _this$webex$internal$, _this$webex$internal$2;
|
|
1223
1314
|
var name, payload, options, clientEvent, diagnosticEvent, request;
|
|
1224
1315
|
return _regenerator.default.wrap(function (_context) {
|
|
1225
1316
|
while (1) switch (_context.prev = _context.next) {
|
|
1226
1317
|
case 0:
|
|
1227
|
-
name =
|
|
1318
|
+
name = _ref13.name, payload = _ref13.payload, options = _ref13.options;
|
|
1228
1319
|
this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...', "name: ".concat(name));
|
|
1229
1320
|
clientEvent = this.prepareClientEvent({
|
|
1230
1321
|
name: name,
|
|
@@ -1245,7 +1336,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1245
1336
|
},
|
|
1246
1337
|
headers: {},
|
|
1247
1338
|
// @ts-ignore
|
|
1248
|
-
waitForServiceTimeout: this.webex.internal.metrics
|
|
1339
|
+
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
1340
|
};
|
|
1250
1341
|
if (options.preLoginId) {
|
|
1251
1342
|
request.headers = {
|