@webex/internal-plugin-metrics 3.12.0-next.6 → 3.12.0-next.60
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/.repo-context.json +466 -0
- package/.sdd/manifest.json +626 -0
- package/AGENTS.md +208 -0
- package/README.md +274 -0
- 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 +613 -53
- package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -1
- package/dist/call-diagnostic/call-diagnostic-metrics.js +240 -103
- 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 +19 -4
- package/dist/call-diagnostic/config.js.map +1 -1
- package/dist/config.js +8 -0
- package/dist/config.js.map +1 -1
- package/dist/index.js +25 -1
- package/dist/index.js.map +1 -1
- package/dist/metrics.js +118 -5
- package/dist/metrics.js.map +1 -1
- package/dist/metrics.types.js +4 -0
- package/dist/metrics.types.js.map +1 -1
- package/dist/network-telemetry.js +610 -0
- package/dist/network-telemetry.js.map +1 -0
- package/dist/new-metrics.js +63 -17
- package/dist/new-metrics.js.map +1 -1
- package/dist/privacy-and-security-permission-enricher/constants.js +18 -0
- package/dist/privacy-and-security-permission-enricher/constants.js.map +1 -0
- package/dist/privacy-and-security-permission-enricher/index.js +143 -0
- package/dist/privacy-and-security-permission-enricher/index.js.map +1 -0
- package/dist/privacy-and-security-permission-enricher/types.js +7 -0
- package/dist/privacy-and-security-permission-enricher/types.js.map +1 -0
- package/dist/privacy-and-security-permission-enricher/utils.js +71 -0
- package/dist/privacy-and-security-permission-enricher/utils.js.map +1 -0
- package/dist/types/automated-user.d.ts +2 -0
- package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +200 -5
- package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +77 -17
- package/dist/types/call-diagnostic/config.d.ts +6 -0
- package/dist/types/config.d.ts +9 -0
- package/dist/types/index.d.ts +5 -3
- package/dist/types/metrics.types.d.ts +11 -5
- package/dist/types/network-telemetry.d.ts +108 -0
- package/dist/types/new-metrics.d.ts +17 -1
- package/dist/types/privacy-and-security-permission-enricher/constants.d.ts +6 -0
- package/dist/types/privacy-and-security-permission-enricher/index.d.ts +40 -0
- package/dist/types/privacy-and-security-permission-enricher/types.d.ts +14 -0
- package/dist/types/privacy-and-security-permission-enricher/utils.d.ts +5 -0
- package/dist/types/unhandled-exception-telemetry/index.d.ts +60 -0
- package/dist/types/unhandled-exception-telemetry/utils.d.ts +6 -0
- package/dist/unhandled-exception-telemetry/index.js +331 -0
- package/dist/unhandled-exception-telemetry/index.js.map +1 -0
- package/dist/unhandled-exception-telemetry/utils.js +105 -0
- package/dist/unhandled-exception-telemetry/utils.js.map +1 -0
- package/docs/adr/index.md +27 -0
- package/docs/architecture.md +437 -0
- package/docs/getting-started.md +131 -0
- package/docs/index.md +52 -0
- package/docs/specs/README.md +88 -0
- package/package.json +12 -11
- package/schemas/repo-context.schema.json +796 -0
- package/src/automated-user.ts +16 -0
- package/src/batcher.js +4 -0
- package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +737 -60
- package/src/call-diagnostic/call-diagnostic-metrics.ts +184 -42
- package/src/call-diagnostic/call-diagnostic-metrics.util.ts +5 -0
- package/src/call-diagnostic/config.ts +16 -0
- package/src/call-diagnostic/docs/README.md +535 -0
- package/src/config.js +8 -0
- package/src/docs/README.md +703 -0
- package/src/index.ts +16 -0
- package/src/metrics.js +123 -5
- package/src/metrics.types.ts +29 -6
- package/src/network-telemetry.ts +757 -0
- package/src/new-metrics.ts +56 -6
- package/src/privacy-and-security-permission-enricher/constants.ts +33 -0
- package/src/privacy-and-security-permission-enricher/docs/README.md +356 -0
- package/src/privacy-and-security-permission-enricher/index.ts +142 -0
- package/src/privacy-and-security-permission-enricher/types.ts +21 -0
- package/src/privacy-and-security-permission-enricher/utils.ts +82 -0
- package/src/rtcMetrics/docs/README.md +447 -0
- package/src/unhandled-exception-telemetry/docs/README.md +536 -0
- package/src/unhandled-exception-telemetry/index.ts +404 -0
- package/src/unhandled-exception-telemetry/utils.ts +101 -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 +10 -1
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +1336 -131
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +1265 -207
- package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +27 -0
- package/test/unit/spec/metrics.js +14 -5
- package/test/unit/spec/network-telemetry.ts +610 -0
- package/test/unit/spec/new-metrics.ts +203 -50
- package/test/unit/spec/prelogin-metrics-batcher.ts +71 -36
- package/test/unit/spec/privacy-and-security-permission-enricher.ts +318 -0
- package/test/unit/spec/unhandled-exception-telemetry/utils.ts +109 -0
- package/test/unit/spec/unhandled-exception-telemetry.ts +689 -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)); }
|
|
@@ -45,6 +49,10 @@ var _BrowserDetection = (0, _common.BrowserDetection)(),
|
|
|
45
49
|
getOSVersion = _BrowserDetection.getOSVersion,
|
|
46
50
|
getBrowserName = _BrowserDetection.getBrowserName,
|
|
47
51
|
getBrowserVersion = _BrowserDetection.getBrowserVersion;
|
|
52
|
+
var LOCUS_HTTP_STATUS_TO_CLIENT_ERROR_CODE = {
|
|
53
|
+
429: _config2.LOCUS_RATE_LIMITED_OUTGOING_CLIENT_CODE,
|
|
54
|
+
503: _config2.LOCUS_UNAVAILABLE_CLIENT_CODE
|
|
55
|
+
};
|
|
48
56
|
/**
|
|
49
57
|
* @description Util class to handle Call Analyzer Metrics
|
|
50
58
|
* @export
|
|
@@ -67,8 +75,6 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
67
75
|
(0, _defineProperty2.default)(_this, "callDiagnosticEventsBatcher", void 0);
|
|
68
76
|
// @ts-ignore
|
|
69
77
|
(0, _defineProperty2.default)(_this, "preLoginMetricsBatcher", void 0);
|
|
70
|
-
(0, _defineProperty2.default)(_this, "logger", void 0);
|
|
71
|
-
// to avoid adding @ts-ignore everywhere
|
|
72
78
|
(0, _defineProperty2.default)(_this, "hasLoggedBrowserSerial", void 0);
|
|
73
79
|
(0, _defineProperty2.default)(_this, "device", void 0);
|
|
74
80
|
(0, _defineProperty2.default)(_this, "delayedClientEvents", []);
|
|
@@ -77,6 +83,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
77
83
|
(0, _defineProperty2.default)(_this, "isMercuryConnected", false);
|
|
78
84
|
(0, _defineProperty2.default)(_this, "eventLimitTracker", new _map.default());
|
|
79
85
|
(0, _defineProperty2.default)(_this, "eventLimitWarningsLogged", new _set.default());
|
|
86
|
+
(0, _defineProperty2.default)(_this, "isTelemetryOptOutManual", false);
|
|
87
|
+
(0, _defineProperty2.default)(_this, "isTelemetryOptOutAutomatic", false);
|
|
80
88
|
// the default validator before piping an event to the batcher
|
|
81
89
|
// this function can be overridden by the user
|
|
82
90
|
(0, _defineProperty2.default)(_this, "validator", function (options) {
|
|
@@ -100,8 +108,6 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
100
108
|
_this.preLoginMetricsBatcher.savePreLoginId(preLoginId);
|
|
101
109
|
return _this.preLoginMetricsBatcher.request(finalEvent);
|
|
102
110
|
});
|
|
103
|
-
_this.logger = _this.webex.logger;
|
|
104
|
-
// @ts-ignore
|
|
105
111
|
_this.callDiagnosticEventsBatcher = new _callDiagnosticMetricsBatcher.default({}, {
|
|
106
112
|
parent: _this.webex
|
|
107
113
|
});
|
|
@@ -118,6 +124,14 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
118
124
|
*/
|
|
119
125
|
(0, _inherits2.default)(CallDiagnosticMetrics, _StatelessWebexPlugin);
|
|
120
126
|
return (0, _createClass2.default)(CallDiagnosticMetrics, [{
|
|
127
|
+
key: "logger",
|
|
128
|
+
get:
|
|
129
|
+
// lazy getter to avoid @ts-ignore on every call site
|
|
130
|
+
function get() {
|
|
131
|
+
// @ts-ignore
|
|
132
|
+
return this.webex.logger;
|
|
133
|
+
}
|
|
134
|
+
}, {
|
|
121
135
|
key: "getCurLoginType",
|
|
122
136
|
value: function getCurLoginType() {
|
|
123
137
|
// @ts-ignore
|
|
@@ -128,6 +142,59 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
128
142
|
return null;
|
|
129
143
|
}
|
|
130
144
|
|
|
145
|
+
/**
|
|
146
|
+
* Returns the user activation state reported from the browser's navigator.userActivation API
|
|
147
|
+
* @returns object with hasBeenActive and isActive booleans, or undefined if unavailable
|
|
148
|
+
*/
|
|
149
|
+
}, {
|
|
150
|
+
key: "getUserActivation",
|
|
151
|
+
value: function getUserActivation() {
|
|
152
|
+
var userActivation = typeof navigator !== 'undefined' ? navigator.userActivation : undefined;
|
|
153
|
+
if (userActivation) {
|
|
154
|
+
return {
|
|
155
|
+
hasBeenActive: userActivation.hasBeenActive,
|
|
156
|
+
isActive: userActivation.isActive
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
return undefined;
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Returns the telemetryOptOut value of the current user
|
|
164
|
+
* @returns one of 'manual', 'automatic', undefined
|
|
165
|
+
*/
|
|
166
|
+
}, {
|
|
167
|
+
key: "getTelemetryOptOut",
|
|
168
|
+
value: function getTelemetryOptOut() {
|
|
169
|
+
if (this.isTelemetryOptOutManual) {
|
|
170
|
+
return 'manual';
|
|
171
|
+
}
|
|
172
|
+
if (this.isTelemetryOptOutAutomatic) {
|
|
173
|
+
return 'automatic';
|
|
174
|
+
}
|
|
175
|
+
return undefined;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
/**
|
|
179
|
+
* Sets the manual telemetry opt-out status for the current user
|
|
180
|
+
* @param value - boolean value indicating manual telemetry opt-out status
|
|
181
|
+
*/
|
|
182
|
+
}, {
|
|
183
|
+
key: "setIsTelemetryOptOutManual",
|
|
184
|
+
value: function setIsTelemetryOptOutManual(value) {
|
|
185
|
+
this.isTelemetryOptOutManual = value;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/**
|
|
189
|
+
* Sets the automatic telemetry opt-out status for the current user
|
|
190
|
+
* @param value - boolean value indicating automatic telemetry opt-out status
|
|
191
|
+
*/
|
|
192
|
+
}, {
|
|
193
|
+
key: "setIsTelemetryOptOutAutomatic",
|
|
194
|
+
value: function setIsTelemetryOptOutAutomatic(value) {
|
|
195
|
+
this.isTelemetryOptOutAutomatic = value;
|
|
196
|
+
}
|
|
197
|
+
|
|
131
198
|
/**
|
|
132
199
|
* Returns if the meeting has converged architecture enabled
|
|
133
200
|
* @param options.meetingId
|
|
@@ -179,6 +246,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
179
246
|
|
|
180
247
|
// if ConvergedArchitecture enable and isConvergedWebinarWebcast -- then webcast
|
|
181
248
|
if (meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableConvergedArchitecture && meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableEvent) {
|
|
249
|
+
// if enableConvergedWebinarLargeScale - then large scale webinar
|
|
250
|
+
if (meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableConvergedWebinarLargeScale) {
|
|
251
|
+
return _config2.WEBEX_SUB_SERVICE_TYPES.LARGE_SCALE_WEBINAR;
|
|
252
|
+
}
|
|
182
253
|
return meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.isConvergedWebinarWebcast ? _config2.WEBEX_SUB_SERVICE_TYPES.WEBCAST : _config2.WEBEX_SUB_SERVICE_TYPES.WEBINAR;
|
|
183
254
|
}
|
|
184
255
|
|
|
@@ -199,13 +270,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
199
270
|
}, {
|
|
200
271
|
key: "getOrigin",
|
|
201
272
|
value: function getOrigin(options, meetingId) {
|
|
202
|
-
var _this$webex$meetings$, _this$webex$meetings$2, _this$webex$
|
|
273
|
+
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
274
|
var defaultClientType = // @ts-ignore
|
|
204
|
-
(_this$webex$meetings
|
|
275
|
+
(_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
276
|
var defaultSubClientType = // @ts-ignore
|
|
206
|
-
(_this$webex$
|
|
277
|
+
(_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
278
|
// @ts-ignore
|
|
208
|
-
var providedClientVersion = (_this$webex$
|
|
279
|
+
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
280
|
// @ts-ignore
|
|
210
281
|
var defaultSDKClientVersion = "".concat(_config.CLIENT_NAME, "/").concat(this.webex.version);
|
|
211
282
|
var versionMetadata = {};
|
|
@@ -214,40 +285,55 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
214
285
|
if (providedClientVersion) {
|
|
215
286
|
versionMetadata = (0, _callDiagnosticMetrics.extractVersionMetadata)(providedClientVersion);
|
|
216
287
|
}
|
|
288
|
+
|
|
289
|
+
// Browser details and the support verdict can all be supplied by the host client, which is able
|
|
290
|
+
// to resolve wrapper browsers (Electron, WebOS) to the engine that actually determines
|
|
291
|
+
// capability. The browser fields fall back to the SDK's own detection when not supplied, the
|
|
292
|
+
// same way clientVersion falls back to the SDK version.
|
|
293
|
+
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 : {},
|
|
294
|
+
providedBrowser = _ref2.browser,
|
|
295
|
+
providedBrowserVersion = _ref2.browserVersion,
|
|
296
|
+
isSupportedBrowserFamily = _ref2.isSupportedBrowserFamily,
|
|
297
|
+
isOutdatedBrowserVersion = _ref2.isOutdatedBrowserVersion;
|
|
217
298
|
if (!this.hasLoggedBrowserSerial) {
|
|
218
299
|
this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, "CallDiagnosticMetrics: @createClientEventObjectInMeeting => collected browser data", (0, _stringify.default)((0, _common.getBrowserSerial)()));
|
|
219
300
|
this.hasLoggedBrowserSerial = true;
|
|
220
301
|
}
|
|
221
302
|
if (defaultClientType && defaultSubClientType || options.clientType && options.subClientType) {
|
|
222
|
-
var _this$webex$
|
|
303
|
+
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
304
|
var origin = {
|
|
224
305
|
name: 'endpoint',
|
|
225
306
|
networkType: (options === null || options === void 0 ? void 0 : options.networkType) || 'unknown',
|
|
226
307
|
userAgent: (0, _callDiagnosticMetrics.userAgentToString)({
|
|
227
308
|
// @ts-ignore
|
|
228
|
-
clientName: (_this$webex$
|
|
309
|
+
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
310
|
// @ts-ignore
|
|
230
311
|
webexVersion: this.webex.version
|
|
231
312
|
}),
|
|
232
|
-
clientInfo: _objectSpread(_objectSpread({
|
|
313
|
+
clientInfo: _objectSpread(_objectSpread(_objectSpread({
|
|
233
314
|
clientType: (options === null || options === void 0 ? void 0 : options.clientType) || defaultClientType,
|
|
234
315
|
clientVersion: providedClientVersion || defaultSDKClientVersion
|
|
235
316
|
}, versionMetadata), {}, {
|
|
236
317
|
publicNetworkPrefix:
|
|
237
318
|
// @ts-ignore
|
|
238
|
-
(0, _callDiagnosticMetrics.anonymizeIPAddress)((_this$webex$
|
|
319
|
+
(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
320
|
localNetworkPrefix: (0, _callDiagnosticMetrics.anonymizeIPAddress)(// @ts-ignore
|
|
240
|
-
(_this$webex$
|
|
321
|
+
(_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
322
|
osVersion: getOSVersion() || 'unknown',
|
|
242
323
|
subClientType: (options === null || options === void 0 ? void 0 : options.subClientType) || defaultSubClientType,
|
|
243
324
|
os: (0, _metrics.getOSNameInternal)(),
|
|
244
|
-
browser: getBrowserName(),
|
|
245
|
-
browserVersion: getBrowserVersion()
|
|
325
|
+
browser: providedBrowser || getBrowserName(),
|
|
326
|
+
browserVersion: providedBrowserVersion || getBrowserVersion()
|
|
327
|
+
}, isSupportedBrowserFamily === undefined ? {} : {
|
|
328
|
+
isSupportedBrowserFamily: isSupportedBrowserFamily
|
|
329
|
+
}), isOutdatedBrowserVersion === undefined ? {} : {
|
|
330
|
+
isOutdatedBrowserVersion: isOutdatedBrowserVersion
|
|
246
331
|
})
|
|
247
332
|
};
|
|
248
333
|
if (meetingId) {
|
|
334
|
+
var _this$webex$meetings17;
|
|
249
335
|
// @ts-ignore
|
|
250
|
-
var meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);
|
|
336
|
+
var meeting = (_this$webex$meetings17 = this.webex.meetings) === null || _this$webex$meetings17 === void 0 ? void 0 : _this$webex$meetings17.getBasicMeetingInformation(meetingId);
|
|
251
337
|
if (meeting !== null && meeting !== void 0 && meeting.environment) {
|
|
252
338
|
origin.environment = meeting.environment;
|
|
253
339
|
}
|
|
@@ -272,6 +358,22 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
272
358
|
throw new Error("ClientType and SubClientType can't be undefined");
|
|
273
359
|
}
|
|
274
360
|
|
|
361
|
+
/**
|
|
362
|
+
* Returns the signed-in user's CI ID derived from credentials tokens.
|
|
363
|
+
* Used as a fallback when no device is registered.
|
|
364
|
+
* @returns the userId, or undefined if it can't be determined
|
|
365
|
+
*/
|
|
366
|
+
}, {
|
|
367
|
+
key: "getUserIdFromCredentials",
|
|
368
|
+
value: function getUserIdFromCredentials() {
|
|
369
|
+
try {
|
|
370
|
+
// @ts-ignore
|
|
371
|
+
return this.webex.credentials.getUserId();
|
|
372
|
+
} catch (_unused) {
|
|
373
|
+
return undefined;
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
|
|
275
377
|
/**
|
|
276
378
|
* Gather identifier details for call diagnostic payload.
|
|
277
379
|
* @throws Error if initialization fails.
|
|
@@ -280,14 +382,15 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
280
382
|
}, {
|
|
281
383
|
key: "getIdentifiers",
|
|
282
384
|
value: function getIdentifiers(options) {
|
|
283
|
-
var _meeting$locusInfo, _meeting$meetingInfo2, _meeting$meetingInfo3, _meeting$meetingInfo6, _meeting$meetingInfo8;
|
|
385
|
+
var _this$device, _meeting$locusInfo, _meeting$meetingInfo2, _meeting$meetingInfo3, _meeting$meetingInfo6, _meeting$meetingInfo8, _meeting$meetingInfo0;
|
|
284
386
|
var meeting = options.meeting,
|
|
285
387
|
mediaConnections = options.mediaConnections,
|
|
286
388
|
correlationId = options.correlationId,
|
|
287
389
|
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
288
390
|
globalMeetingId = options.globalMeetingId,
|
|
289
391
|
preLoginId = options.preLoginId,
|
|
290
|
-
sessionCorrelationId = options.sessionCorrelationId
|
|
392
|
+
sessionCorrelationId = options.sessionCorrelationId,
|
|
393
|
+
locusCluster = options.locusCluster;
|
|
291
394
|
var identifiers = {
|
|
292
395
|
correlationId: 'unknown' // concerned with setting this to unknown. This will fail diagnostic events parsing because it's not a uuid pattern
|
|
293
396
|
};
|
|
@@ -311,9 +414,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
311
414
|
|
|
312
415
|
if (this.device) {
|
|
313
416
|
var device = this.device;
|
|
314
|
-
var
|
|
315
|
-
installationId =
|
|
316
|
-
identifiers.userId = (device === null || device === void 0 ? void 0 : device.userId) || preLoginId;
|
|
417
|
+
var _ref3 = (device === null || device === void 0 ? void 0 : device.config) || {},
|
|
418
|
+
installationId = _ref3.installationId;
|
|
317
419
|
identifiers.deviceId = device === null || device === void 0 ? void 0 : device.url;
|
|
318
420
|
identifiers.orgId = device === null || device === void 0 ? void 0 : device.orgId;
|
|
319
421
|
// @ts-ignore
|
|
@@ -322,6 +424,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
322
424
|
identifiers.machineId = installationId;
|
|
323
425
|
}
|
|
324
426
|
}
|
|
427
|
+
|
|
428
|
+
// Prefer the device's userId, but fall back to the signed-in user's ID from
|
|
429
|
+
// credentials when no device is registered, then to the pre-login ID.
|
|
430
|
+
identifiers.userId = ((_this$device = this.device) === null || _this$device === void 0 ? void 0 : _this$device.userId) || this.getUserIdFromCredentials() || preLoginId;
|
|
325
431
|
if (meeting !== null && meeting !== void 0 && (_meeting$locusInfo = meeting.locusInfo) !== null && _meeting$locusInfo !== void 0 && _meeting$locusInfo.fullState) {
|
|
326
432
|
identifiers.locusUrl = meeting.locusUrl;
|
|
327
433
|
identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();
|
|
@@ -340,6 +446,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
340
446
|
var _meeting$meetingInfo9;
|
|
341
447
|
identifiers.webexSiteName = (_meeting$meetingInfo9 = meeting.meetingInfo) === null || _meeting$meetingInfo9 === void 0 ? void 0 : _meeting$meetingInfo9.siteName;
|
|
342
448
|
}
|
|
449
|
+
if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo0 = meeting.meetingInfo) !== null && _meeting$meetingInfo0 !== void 0 && _meeting$meetingInfo0.locusClusterUrl) {
|
|
450
|
+
identifiers.locusCluster = meeting.meetingInfo.locusClusterUrl;
|
|
451
|
+
}
|
|
343
452
|
if (mediaConnections) {
|
|
344
453
|
var _mediaConnections$, _mediaConnections$2;
|
|
345
454
|
identifiers.mediaAgentAlias = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$ = mediaConnections[0]) === null || _mediaConnections$ === void 0 ? void 0 : _mediaConnections$.mediaAgentAlias;
|
|
@@ -351,6 +460,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
351
460
|
if (!(identifiers !== null && identifiers !== void 0 && identifiers.globalMeetingId) && globalMeetingId) {
|
|
352
461
|
identifiers.globalMeetingId = globalMeetingId;
|
|
353
462
|
}
|
|
463
|
+
if (!(identifiers !== null && identifiers !== void 0 && identifiers.locusCluster) && locusCluster) {
|
|
464
|
+
identifiers.locusCluster = locusCluster;
|
|
465
|
+
}
|
|
354
466
|
if (identifiers.correlationId === undefined) {
|
|
355
467
|
throw new Error('Identifiers initialization failed.');
|
|
356
468
|
}
|
|
@@ -367,7 +479,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
367
479
|
}, {
|
|
368
480
|
key: "prepareDiagnosticEvent",
|
|
369
481
|
value: function prepareDiagnosticEvent(eventData, options) {
|
|
370
|
-
var _this$webex$
|
|
482
|
+
var _this$webex$meetings18, _this$webex$meetings19;
|
|
371
483
|
var meetingId = options.meetingId,
|
|
372
484
|
triggeredTime = options.triggeredTime;
|
|
373
485
|
var origin = this.getOrigin(options, meetingId);
|
|
@@ -381,7 +493,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
381
493
|
sent: 'not_defined_yet'
|
|
382
494
|
},
|
|
383
495
|
// @ts-ignore
|
|
384
|
-
senderCountryCode: (_this$webex$
|
|
496
|
+
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
497
|
event: eventData
|
|
386
498
|
};
|
|
387
499
|
|
|
@@ -403,10 +515,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
403
515
|
*/
|
|
404
516
|
}, {
|
|
405
517
|
key: "prepareClientFeatureEvent",
|
|
406
|
-
value: function prepareClientFeatureEvent(
|
|
407
|
-
var name =
|
|
408
|
-
payload =
|
|
409
|
-
options =
|
|
518
|
+
value: function prepareClientFeatureEvent(_ref4) {
|
|
519
|
+
var name = _ref4.name,
|
|
520
|
+
payload = _ref4.payload,
|
|
521
|
+
options = _ref4.options;
|
|
410
522
|
var meetingId = options.meetingId,
|
|
411
523
|
correlationId = options.correlationId;
|
|
412
524
|
var featureEventObject;
|
|
@@ -436,11 +548,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
436
548
|
*/
|
|
437
549
|
}, {
|
|
438
550
|
key: "submitFeatureEvent",
|
|
439
|
-
value: function submitFeatureEvent(
|
|
440
|
-
var name =
|
|
441
|
-
payload =
|
|
442
|
-
options =
|
|
443
|
-
delaySubmitEvent =
|
|
551
|
+
value: function submitFeatureEvent(_ref5) {
|
|
552
|
+
var name = _ref5.name,
|
|
553
|
+
payload = _ref5.payload,
|
|
554
|
+
options = _ref5.options,
|
|
555
|
+
delaySubmitEvent = _ref5.delaySubmitEvent;
|
|
444
556
|
if (delaySubmitEvent) {
|
|
445
557
|
// Preserve the time when the event was triggered if delaying the submission to Call Features
|
|
446
558
|
var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
@@ -491,10 +603,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
491
603
|
*/
|
|
492
604
|
}, {
|
|
493
605
|
key: "submitMQE",
|
|
494
|
-
value: function submitMQE(
|
|
495
|
-
var name =
|
|
496
|
-
payload =
|
|
497
|
-
options =
|
|
606
|
+
value: function submitMQE(_ref6) {
|
|
607
|
+
var name = _ref6.name,
|
|
608
|
+
payload = _ref6.payload,
|
|
609
|
+
options = _ref6.options;
|
|
498
610
|
var meetingId = options.meetingId,
|
|
499
611
|
mediaConnections = options.mediaConnections,
|
|
500
612
|
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
@@ -544,7 +656,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
544
656
|
mediaEngineSoftwareType: getBrowserName() || 'browser',
|
|
545
657
|
mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
|
|
546
658
|
startTime: new Date().toISOString()
|
|
547
|
-
}
|
|
659
|
+
},
|
|
660
|
+
webexSubServiceType: this.getSubServiceType(meeting)
|
|
548
661
|
};
|
|
549
662
|
|
|
550
663
|
// merge any new properties, or override existing ones
|
|
@@ -568,18 +681,18 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
568
681
|
* @param arg.clientErrorCode
|
|
569
682
|
* @param arg.serviceErrorCode
|
|
570
683
|
* @param arg.payloadOverrides
|
|
571
|
-
* @param arg.
|
|
684
|
+
* @param arg.httpCode
|
|
572
685
|
* @returns
|
|
573
686
|
*/
|
|
574
687
|
}, {
|
|
575
688
|
key: "getErrorPayloadForClientErrorCode",
|
|
576
|
-
value: function getErrorPayloadForClientErrorCode(
|
|
577
|
-
var clientErrorCode =
|
|
578
|
-
serviceErrorCode =
|
|
579
|
-
serviceErrorName =
|
|
580
|
-
rawErrorMessage =
|
|
581
|
-
payloadOverrides =
|
|
582
|
-
|
|
689
|
+
value: function getErrorPayloadForClientErrorCode(_ref7) {
|
|
690
|
+
var clientErrorCode = _ref7.clientErrorCode,
|
|
691
|
+
serviceErrorCode = _ref7.serviceErrorCode,
|
|
692
|
+
serviceErrorName = _ref7.serviceErrorName,
|
|
693
|
+
rawErrorMessage = _ref7.rawErrorMessage,
|
|
694
|
+
payloadOverrides = _ref7.payloadOverrides,
|
|
695
|
+
httpCode = _ref7.httpCode;
|
|
583
696
|
var error;
|
|
584
697
|
if (clientErrorCode) {
|
|
585
698
|
var partialParsedError = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
|
|
@@ -601,8 +714,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
601
714
|
serviceErrorCode: serviceErrorCode
|
|
602
715
|
}, {
|
|
603
716
|
rawErrorMessage: rawErrorMessage
|
|
604
|
-
},
|
|
605
|
-
|
|
717
|
+
}, httpCode === undefined ? {} : {
|
|
718
|
+
httpCode: httpCode
|
|
606
719
|
}, partialParsedError, payloadOverrides || {});
|
|
607
720
|
return error;
|
|
608
721
|
}
|
|
@@ -627,9 +740,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
627
740
|
*/
|
|
628
741
|
}, {
|
|
629
742
|
key: "shouldSendEvent",
|
|
630
|
-
value: function shouldSendEvent(
|
|
743
|
+
value: function shouldSendEvent(_ref8) {
|
|
631
744
|
var _event$identifiers;
|
|
632
|
-
var event =
|
|
745
|
+
var event = _ref8.event;
|
|
633
746
|
var eventName = event === null || event === void 0 ? void 0 : event.name;
|
|
634
747
|
var correlationId = event === null || event === void 0 ? void 0 : (_event$identifiers = event.identifiers) === null || _event$identifiers === void 0 ? void 0 : _event$identifiers.correlationId;
|
|
635
748
|
if (!correlationId || correlationId === 'unknown') {
|
|
@@ -748,13 +861,14 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
748
861
|
}, {
|
|
749
862
|
key: "generateClientEventErrorPayload",
|
|
750
863
|
value: function generateClientEventErrorPayload(rawError) {
|
|
751
|
-
var _rawError$error, _rawError$error$body, _rawError$body, _rawError$body2, _rawError$body3, _rawError$body3$reaso;
|
|
864
|
+
var _rawError$error, _rawError$error$body, _rawError$body, _rawError$body2, _rawError$body3, _rawError$body3$reaso, _rawError$options, _rawError$options2;
|
|
752
865
|
var cachedError = this.eventErrorCache.get(rawError);
|
|
753
866
|
if (cachedError) {
|
|
754
867
|
return [cachedError, true];
|
|
755
868
|
}
|
|
756
869
|
var rawErrorMessage = rawError.message;
|
|
757
|
-
var
|
|
870
|
+
var httpCode = rawError.statusCode;
|
|
871
|
+
var serviceErrorCode = (rawError === null || rawError === void 0 ? void 0 : (_rawError$error = rawError.error) === null || _rawError$error === void 0 ? void 0 : (_rawError$error$body = _rawError$error.body) === null || _rawError$error$body === void 0 ? void 0 : _rawError$error$body.errorCode) || (rawError === null || rawError === void 0 ? void 0 : (_rawError$body = rawError.body) === null || _rawError$body === void 0 ? void 0 : _rawError$body.errorCode) || (rawError === null || rawError === void 0 ? void 0 : (_rawError$body2 = rawError.body) === null || _rawError$body2 === void 0 ? void 0 : _rawError$body2.code) || (rawError === null || rawError === void 0 ? void 0 : (_rawError$body3 = rawError.body) === null || _rawError$body3 === void 0 ? void 0 : (_rawError$body3$reaso = _rawError$body3.reason) === null || _rawError$body3$reaso === void 0 ? void 0 : _rawError$body3$reaso.reasonCode);
|
|
758
872
|
var payload;
|
|
759
873
|
if (rawError.name) {
|
|
760
874
|
if ((0, _callDiagnosticMetrics.isBrowserMediaErrorName)(rawError.name)) {
|
|
@@ -763,7 +877,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
763
877
|
clientErrorCode: _config2.BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP[rawError.name],
|
|
764
878
|
serviceErrorName: rawError.name,
|
|
765
879
|
rawErrorMessage: rawErrorMessage,
|
|
766
|
-
|
|
880
|
+
httpCode: httpCode
|
|
767
881
|
});
|
|
768
882
|
}
|
|
769
883
|
}
|
|
@@ -776,10 +890,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
776
890
|
clientErrorCode: _config2.SDP_OFFER_CREATION_ERROR_MAP[causeType] || _config2.SDP_OFFER_CREATION_ERROR_MAP.GENERAL,
|
|
777
891
|
serviceErrorName: rawError.name,
|
|
778
892
|
rawErrorMessage: rawErrorMessage,
|
|
779
|
-
|
|
893
|
+
httpCode: httpCode
|
|
780
894
|
});
|
|
781
895
|
}
|
|
782
|
-
var serviceErrorCode = (rawError === null || rawError === void 0 ? void 0 : (_rawError$error = rawError.error) === null || _rawError$error === void 0 ? void 0 : (_rawError$error$body = _rawError$error.body) === null || _rawError$error$body === void 0 ? void 0 : _rawError$error$body.errorCode) || (rawError === null || rawError === void 0 ? void 0 : (_rawError$body = rawError.body) === null || _rawError$body === void 0 ? void 0 : _rawError$body.errorCode) || (rawError === null || rawError === void 0 ? void 0 : (_rawError$body2 = rawError.body) === null || _rawError$body2 === void 0 ? void 0 : _rawError$body2.code) || (rawError === null || rawError === void 0 ? void 0 : (_rawError$body3 = rawError.body) === null || _rawError$body3 === void 0 ? void 0 : (_rawError$body3$reaso = _rawError$body3.reason) === null || _rawError$body3$reaso === void 0 ? void 0 : _rawError$body3$reaso.reasonCode);
|
|
783
896
|
if (serviceErrorCode) {
|
|
784
897
|
var clientErrorCode = _config2.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];
|
|
785
898
|
if (clientErrorCode && !payload) {
|
|
@@ -787,17 +900,28 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
787
900
|
clientErrorCode: clientErrorCode,
|
|
788
901
|
serviceErrorCode: serviceErrorCode,
|
|
789
902
|
rawErrorMessage: rawErrorMessage,
|
|
790
|
-
|
|
903
|
+
httpCode: httpCode
|
|
791
904
|
});
|
|
792
905
|
}
|
|
793
|
-
|
|
906
|
+
}
|
|
907
|
+
var locusHttpClientErrorCode = LOCUS_HTTP_STATUS_TO_CLIENT_ERROR_CODE[httpCode];
|
|
908
|
+
var requestUrl = ((_rawError$options = rawError.options) === null || _rawError$options === void 0 ? void 0 : _rawError$options.uri) || ((_rawError$options2 = rawError.options) === null || _rawError$options2 === void 0 ? void 0 : _rawError$options2.url);
|
|
909
|
+
if (locusHttpClientErrorCode && !payload && requestUrl !== null && requestUrl !== void 0 && requestUrl.includes('locus')) {
|
|
910
|
+
payload = this.getErrorPayloadForClientErrorCode({
|
|
911
|
+
clientErrorCode: locusHttpClientErrorCode,
|
|
912
|
+
serviceErrorCode: serviceErrorCode,
|
|
913
|
+
rawErrorMessage: rawErrorMessage,
|
|
914
|
+
httpCode: httpCode
|
|
915
|
+
});
|
|
916
|
+
}
|
|
917
|
+
if (serviceErrorCode) {
|
|
794
918
|
// by default, if it is locus error, return new locus err
|
|
795
919
|
if ((0, _callDiagnosticMetrics.isLocusServiceErrorCode)(serviceErrorCode) && !payload) {
|
|
796
920
|
payload = this.getErrorPayloadForClientErrorCode({
|
|
797
921
|
clientErrorCode: _config2.NEW_LOCUS_ERROR_CLIENT_CODE,
|
|
798
922
|
serviceErrorCode: serviceErrorCode,
|
|
799
923
|
rawErrorMessage: rawErrorMessage,
|
|
800
|
-
|
|
924
|
+
httpCode: httpCode
|
|
801
925
|
});
|
|
802
926
|
}
|
|
803
927
|
}
|
|
@@ -806,7 +930,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
806
930
|
clientErrorCode: _config2.MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,
|
|
807
931
|
serviceErrorCode: serviceErrorCode,
|
|
808
932
|
rawErrorMessage: rawErrorMessage,
|
|
809
|
-
|
|
933
|
+
httpCode: httpCode
|
|
810
934
|
});
|
|
811
935
|
}
|
|
812
936
|
if ((0, _callDiagnosticMetrics.isNetworkError)(rawError) && !payload) {
|
|
@@ -815,7 +939,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
815
939
|
serviceErrorCode: serviceErrorCode,
|
|
816
940
|
payloadOverrides: rawError.payloadOverrides,
|
|
817
941
|
rawErrorMessage: rawErrorMessage,
|
|
818
|
-
|
|
942
|
+
httpCode: httpCode
|
|
819
943
|
});
|
|
820
944
|
}
|
|
821
945
|
if ((0, _callDiagnosticMetrics.isUnauthorizedError)(rawError) && !payload) {
|
|
@@ -824,7 +948,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
824
948
|
serviceErrorCode: serviceErrorCode,
|
|
825
949
|
payloadOverrides: rawError.payloadOverrides,
|
|
826
950
|
rawErrorMessage: rawErrorMessage,
|
|
827
|
-
|
|
951
|
+
httpCode: httpCode
|
|
828
952
|
});
|
|
829
953
|
}
|
|
830
954
|
if (!payload) {
|
|
@@ -835,7 +959,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
835
959
|
serviceErrorName: rawError === null || rawError === void 0 ? void 0 : rawError.name,
|
|
836
960
|
payloadOverrides: rawError.payloadOverrides,
|
|
837
961
|
rawErrorMessage: rawErrorMessage,
|
|
838
|
-
|
|
962
|
+
httpCode: httpCode
|
|
839
963
|
});
|
|
840
964
|
}
|
|
841
965
|
|
|
@@ -853,17 +977,18 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
853
977
|
*/
|
|
854
978
|
}, {
|
|
855
979
|
key: "createCommonEventObjectInMeeting",
|
|
856
|
-
value: function createCommonEventObjectInMeeting(
|
|
857
|
-
var _this$webex$
|
|
858
|
-
var name =
|
|
859
|
-
options =
|
|
860
|
-
|
|
861
|
-
eventType =
|
|
980
|
+
value: function createCommonEventObjectInMeeting(_ref9) {
|
|
981
|
+
var _this$webex$meetings20, _this$webex$meetings21, _this$webex$meetings22, _meeting$meetingInfo1, _options$joinFlowVers, _meeting$callStateFor, _options$meetingJoinP, _meeting$callStateFor2;
|
|
982
|
+
var name = _ref9.name,
|
|
983
|
+
options = _ref9.options,
|
|
984
|
+
_ref9$eventType = _ref9.eventType,
|
|
985
|
+
eventType = _ref9$eventType === void 0 ? 'client' : _ref9$eventType;
|
|
862
986
|
var meetingId = options.meetingId,
|
|
863
987
|
mediaConnections = options.mediaConnections,
|
|
864
988
|
globalMeetingId = options.globalMeetingId,
|
|
865
989
|
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
866
|
-
sessionCorrelationId = options.sessionCorrelationId
|
|
990
|
+
sessionCorrelationId = options.sessionCorrelationId,
|
|
991
|
+
locusCluster = options.locusCluster;
|
|
867
992
|
|
|
868
993
|
// @ts-ignore
|
|
869
994
|
var meeting = this.webex.meetings.getBasicMeetingInformation(meetingId);
|
|
@@ -885,10 +1010,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
885
1010
|
mediaConnections: (meeting === null || meeting === void 0 ? void 0 : meeting.mediaConnections) || mediaConnections,
|
|
886
1011
|
webexConferenceIdStr: webexConferenceIdStr,
|
|
887
1012
|
globalMeetingId: globalMeetingId,
|
|
888
|
-
sessionCorrelationId: sessionCorrelationId
|
|
1013
|
+
sessionCorrelationId: sessionCorrelationId,
|
|
1014
|
+
locusCluster: locusCluster
|
|
889
1015
|
});
|
|
890
1016
|
|
|
891
|
-
// create common event object
|
|
1017
|
+
// create common event object structure
|
|
892
1018
|
var commonEventObject = _objectSpread(_objectSpread(_objectSpread({
|
|
893
1019
|
name: name,
|
|
894
1020
|
canProceed: true,
|
|
@@ -898,6 +1024,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
898
1024
|
},
|
|
899
1025
|
userType: meeting.getCurUserType(),
|
|
900
1026
|
loginType: 'loginType' in meeting.callStateForMetrics ? meeting.callStateForMetrics.loginType : this.getCurLoginType(),
|
|
1027
|
+
telemetryOptOut: this.getTelemetryOptOut(),
|
|
901
1028
|
isConvergedArchitectureEnabled: this.getIsConvergedArchitectureEnabled({
|
|
902
1029
|
meetingId: meetingId
|
|
903
1030
|
})
|
|
@@ -908,7 +1035,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
908
1035
|
}), {}, {
|
|
909
1036
|
webexSubServiceType: this.getSubServiceType(meeting),
|
|
910
1037
|
// @ts-ignore
|
|
911
|
-
webClientPreload: (_this$webex$
|
|
1038
|
+
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,
|
|
1039
|
+
isVipMeeting: (meeting === null || meeting === void 0 ? void 0 : (_meeting$meetingInfo1 = meeting.meetingInfo) === null || _meeting$meetingInfo1 === void 0 ? void 0 : _meeting$meetingInfo1.vipmeeting) || false,
|
|
1040
|
+
isAutomatedUser: AutomatedUserUtils.isAutomatedUser(),
|
|
1041
|
+
userActivation: this.getUserActivation()
|
|
912
1042
|
});
|
|
913
1043
|
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
1044
|
if (joinFlowVersion) {
|
|
@@ -920,9 +1050,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
920
1050
|
// @ts-ignore
|
|
921
1051
|
commonEventObject.meetingJoinedTime = meetingJoinedTime;
|
|
922
1052
|
}
|
|
923
|
-
|
|
1053
|
+
var meetingJoinPhase = (_options$meetingJoinP = options.meetingJoinPhase) !== null && _options$meetingJoinP !== void 0 ? _options$meetingJoinP : (_meeting$callStateFor2 = meeting.callStateForMetrics) === null || _meeting$callStateFor2 === void 0 ? void 0 : _meeting$callStateFor2.meetingJoinPhase;
|
|
1054
|
+
if (meetingJoinPhase) {
|
|
924
1055
|
// @ts-ignore
|
|
925
|
-
commonEventObject.meetingJoinPhase =
|
|
1056
|
+
commonEventObject.meetingJoinPhase = meetingJoinPhase;
|
|
926
1057
|
}
|
|
927
1058
|
return commonEventObject;
|
|
928
1059
|
}
|
|
@@ -936,10 +1067,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
936
1067
|
*/
|
|
937
1068
|
}, {
|
|
938
1069
|
key: "createClientEventObjectInMeeting",
|
|
939
|
-
value: function createClientEventObjectInMeeting(
|
|
940
|
-
var name =
|
|
941
|
-
options =
|
|
942
|
-
errors =
|
|
1070
|
+
value: function createClientEventObjectInMeeting(_ref0) {
|
|
1071
|
+
var name = _ref0.name,
|
|
1072
|
+
options = _ref0.options,
|
|
1073
|
+
errors = _ref0.errors;
|
|
943
1074
|
var commonObject = this.createCommonEventObjectInMeeting({
|
|
944
1075
|
name: name,
|
|
945
1076
|
options: options,
|
|
@@ -962,9 +1093,9 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
962
1093
|
*/
|
|
963
1094
|
}, {
|
|
964
1095
|
key: "createFeatureEventObjectInMeeting",
|
|
965
|
-
value: function createFeatureEventObjectInMeeting(
|
|
966
|
-
var name =
|
|
967
|
-
options =
|
|
1096
|
+
value: function createFeatureEventObjectInMeeting(_ref1) {
|
|
1097
|
+
var name = _ref1.name,
|
|
1098
|
+
options = _ref1.options;
|
|
968
1099
|
var commonObject = this.createCommonEventObjectInMeeting({
|
|
969
1100
|
name: name,
|
|
970
1101
|
options: options,
|
|
@@ -985,16 +1116,17 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
985
1116
|
*/
|
|
986
1117
|
}, {
|
|
987
1118
|
key: "createClientEventObjectPreMeeting",
|
|
988
|
-
value: function createClientEventObjectPreMeeting(
|
|
989
|
-
var _this$webex$
|
|
990
|
-
var name =
|
|
991
|
-
options =
|
|
992
|
-
errors =
|
|
1119
|
+
value: function createClientEventObjectPreMeeting(_ref10) {
|
|
1120
|
+
var _this$webex$meetings23, _this$webex$meetings24, _this$webex$meetings25, _options$meetingJoinP2;
|
|
1121
|
+
var name = _ref10.name,
|
|
1122
|
+
options = _ref10.options,
|
|
1123
|
+
errors = _ref10.errors;
|
|
993
1124
|
var correlationId = options.correlationId,
|
|
994
1125
|
globalMeetingId = options.globalMeetingId,
|
|
995
1126
|
webexConferenceIdStr = options.webexConferenceIdStr,
|
|
996
1127
|
preLoginId = options.preLoginId,
|
|
997
|
-
sessionCorrelationId = options.sessionCorrelationId
|
|
1128
|
+
sessionCorrelationId = options.sessionCorrelationId,
|
|
1129
|
+
locusCluster = options.locusCluster;
|
|
998
1130
|
|
|
999
1131
|
// grab identifiers
|
|
1000
1132
|
var identifiers = this.getIdentifiers({
|
|
@@ -1002,7 +1134,8 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1002
1134
|
sessionCorrelationId: sessionCorrelationId,
|
|
1003
1135
|
preLoginId: preLoginId,
|
|
1004
1136
|
globalMeetingId: globalMeetingId,
|
|
1005
|
-
webexConferenceIdStr: webexConferenceIdStr
|
|
1137
|
+
webexConferenceIdStr: webexConferenceIdStr,
|
|
1138
|
+
locusCluster: locusCluster
|
|
1006
1139
|
});
|
|
1007
1140
|
|
|
1008
1141
|
// create client event object
|
|
@@ -1016,15 +1149,18 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1016
1149
|
isMercuryConnected: this.isMercuryConnected
|
|
1017
1150
|
},
|
|
1018
1151
|
loginType: this.getCurLoginType(),
|
|
1152
|
+
telemetryOptOut: this.getTelemetryOptOut(),
|
|
1019
1153
|
// @ts-ignore
|
|
1020
|
-
webClientPreload: (_this$webex$
|
|
1154
|
+
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,
|
|
1155
|
+
isAutomatedUser: AutomatedUserUtils.isAutomatedUser(),
|
|
1156
|
+
userActivation: this.getUserActivation()
|
|
1021
1157
|
};
|
|
1022
1158
|
if (options.joinFlowVersion) {
|
|
1023
1159
|
clientEventObject.joinFlowVersion = options.joinFlowVersion;
|
|
1024
1160
|
}
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1161
|
+
|
|
1162
|
+
// No meeting exists yet for pre-meeting events, so the join phase is pre-join by construction
|
|
1163
|
+
clientEventObject.meetingJoinPhase = (_options$meetingJoinP2 = options.meetingJoinPhase) !== null && _options$meetingJoinP2 !== void 0 ? _options$meetingJoinP2 : 'pre-join';
|
|
1028
1164
|
if (options.userNameInput) {
|
|
1029
1165
|
clientEventObject.userNameInput = options.userNameInput;
|
|
1030
1166
|
}
|
|
@@ -1045,10 +1181,10 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1045
1181
|
*/
|
|
1046
1182
|
}, {
|
|
1047
1183
|
key: "prepareClientEvent",
|
|
1048
|
-
value: function prepareClientEvent(
|
|
1049
|
-
var name =
|
|
1050
|
-
payload =
|
|
1051
|
-
options =
|
|
1184
|
+
value: function prepareClientEvent(_ref11) {
|
|
1185
|
+
var name = _ref11.name,
|
|
1186
|
+
payload = _ref11.payload,
|
|
1187
|
+
options = _ref11.options;
|
|
1052
1188
|
var meetingId = options.meetingId,
|
|
1053
1189
|
correlationId = options.correlationId,
|
|
1054
1190
|
rawError = options.rawError;
|
|
@@ -1104,11 +1240,11 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1104
1240
|
*/
|
|
1105
1241
|
}, {
|
|
1106
1242
|
key: "submitClientEvent",
|
|
1107
|
-
value: function submitClientEvent(
|
|
1108
|
-
var name =
|
|
1109
|
-
payload =
|
|
1110
|
-
options =
|
|
1111
|
-
delaySubmitEvent =
|
|
1243
|
+
value: function submitClientEvent(_ref12) {
|
|
1244
|
+
var name = _ref12.name,
|
|
1245
|
+
payload = _ref12.payload,
|
|
1246
|
+
options = _ref12.options,
|
|
1247
|
+
delaySubmitEvent = _ref12.delaySubmitEvent;
|
|
1112
1248
|
if (delaySubmitEvent) {
|
|
1113
1249
|
// Preserve the time when the event was triggered if delaying the submission to Call Diagnostics
|
|
1114
1250
|
var delayedOptions = _objectSpread(_objectSpread({}, options), {}, {
|
|
@@ -1220,12 +1356,13 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1220
1356
|
* @throws
|
|
1221
1357
|
*/
|
|
1222
1358
|
function () {
|
|
1223
|
-
var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(
|
|
1359
|
+
var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(_ref13) {
|
|
1360
|
+
var _this$webex$internal$, _this$webex$internal$2;
|
|
1224
1361
|
var name, payload, options, clientEvent, diagnosticEvent, request;
|
|
1225
1362
|
return _regenerator.default.wrap(function (_context) {
|
|
1226
1363
|
while (1) switch (_context.prev = _context.next) {
|
|
1227
1364
|
case 0:
|
|
1228
|
-
name =
|
|
1365
|
+
name = _ref13.name, payload = _ref13.payload, options = _ref13.options;
|
|
1229
1366
|
this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...', "name: ".concat(name));
|
|
1230
1367
|
clientEvent = this.prepareClientEvent({
|
|
1231
1368
|
name: name,
|
|
@@ -1246,7 +1383,7 @@ var CallDiagnosticMetrics = exports.default = /*#__PURE__*/function (_StatelessW
|
|
|
1246
1383
|
},
|
|
1247
1384
|
headers: {},
|
|
1248
1385
|
// @ts-ignore
|
|
1249
|
-
waitForServiceTimeout: this.webex.internal.metrics
|
|
1386
|
+
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
1387
|
};
|
|
1251
1388
|
if (options.preLoginId) {
|
|
1252
1389
|
request.headers = {
|