@webex/internal-plugin-metrics 3.0.0-beta.37 → 3.0.0-beta.371

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (68) hide show
  1. package/dist/batcher.js +2 -1
  2. package/dist/batcher.js.map +1 -1
  3. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js +65 -0
  4. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -0
  5. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +456 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -0
  7. package/dist/call-diagnostic/call-diagnostic-metrics.js +838 -0
  8. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
  9. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +359 -0
  10. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -0
  11. package/dist/call-diagnostic/config.js +627 -0
  12. package/dist/call-diagnostic/config.js.map +1 -0
  13. package/dist/client-metrics-batcher.js +2 -1
  14. package/dist/client-metrics-batcher.js.map +1 -1
  15. package/dist/config.js +2 -1
  16. package/dist/config.js.map +1 -1
  17. package/dist/index.js +18 -0
  18. package/dist/index.js.map +1 -1
  19. package/dist/metrics.js +23 -28
  20. package/dist/metrics.js.map +1 -1
  21. package/dist/metrics.types.js +7 -0
  22. package/dist/metrics.types.js.map +1 -0
  23. package/dist/new-metrics.js +333 -0
  24. package/dist/new-metrics.js.map +1 -0
  25. package/dist/types/batcher.d.ts +2 -0
  26. package/dist/types/call-diagnostic/call-diagnostic-metrics-batcher.d.ts +2 -0
  27. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +194 -0
  28. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +418 -0
  29. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +103 -0
  30. package/dist/types/call-diagnostic/config.d.ts +178 -0
  31. package/dist/types/client-metrics-batcher.d.ts +2 -0
  32. package/dist/types/config.d.ts +36 -0
  33. package/dist/types/index.d.ts +13 -0
  34. package/dist/types/metrics.d.ts +3 -0
  35. package/dist/types/metrics.types.d.ts +104 -0
  36. package/dist/types/new-metrics.d.ts +139 -0
  37. package/dist/types/utils.d.ts +6 -0
  38. package/dist/utils.js +27 -0
  39. package/dist/utils.js.map +1 -0
  40. package/package.json +16 -8
  41. package/src/batcher.js +1 -0
  42. package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +75 -0
  43. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +416 -0
  44. package/src/call-diagnostic/call-diagnostic-metrics.ts +898 -0
  45. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +387 -0
  46. package/src/call-diagnostic/config.ts +685 -0
  47. package/src/client-metrics-batcher.js +1 -0
  48. package/src/config.js +1 -0
  49. package/src/index.ts +43 -0
  50. package/src/metrics.js +18 -24
  51. package/src/metrics.types.ts +160 -0
  52. package/src/new-metrics.ts +317 -0
  53. package/src/utils.ts +17 -0
  54. package/test/unit/spec/batcher.js +2 -0
  55. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +452 -0
  56. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +509 -0
  57. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +2174 -0
  58. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +622 -0
  59. package/test/unit/spec/client-metrics-batcher.js +2 -0
  60. package/test/unit/spec/metrics.js +66 -97
  61. package/test/unit/spec/new-metrics.ts +267 -0
  62. package/test/unit/spec/utils.ts +22 -0
  63. package/tsconfig.json +6 -0
  64. package/dist/call-diagnostic-events-batcher.js +0 -60
  65. package/dist/call-diagnostic-events-batcher.js.map +0 -1
  66. package/src/call-diagnostic-events-batcher.js +0 -62
  67. package/src/index.js +0 -17
  68. package/test/unit/spec/call-diagnostic-events-batcher.js +0 -195
@@ -0,0 +1,838 @@
1
+ "use strict";
2
+
3
+ var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
+ var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
5
+ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
6
+ var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
7
+ var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
8
+ var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
9
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
10
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
11
+ _Object$defineProperty(exports, "__esModule", {
12
+ value: true
13
+ });
14
+ exports.default = void 0;
15
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
16
+ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
17
+ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
18
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
19
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
20
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
21
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
22
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
23
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
24
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
25
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
26
+ var _merge2 = _interopRequireDefault(require("lodash/merge"));
27
+ var _internalPluginMetrics = require("@webex/internal-plugin-metrics");
28
+ var _common = require("@webex/common");
29
+ var _uuid = _interopRequireDefault(require("uuid"));
30
+ var _webexCore = require("@webex/webex-core");
31
+ var _callDiagnosticMetrics = require("./call-diagnostic-metrics.util");
32
+ var _config = require("../config");
33
+ var _callDiagnosticMetricsBatcher = _interopRequireDefault(require("./call-diagnostic-metrics-batcher"));
34
+ var _config2 = require("./config");
35
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
36
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
37
+ function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
38
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
39
+ var _BrowserDetection = (0, _common.BrowserDetection)(),
40
+ getOSVersion = _BrowserDetection.getOSVersion,
41
+ getBrowserName = _BrowserDetection.getBrowserName,
42
+ getBrowserVersion = _BrowserDetection.getBrowserVersion;
43
+ /**
44
+ * @description Util class to handle Call Analyzer Metrics
45
+ * @export
46
+ * @class CallDiagnosticMetrics
47
+ */
48
+ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
49
+ (0, _inherits2.default)(CallDiagnosticMetrics, _StatelessWebexPlugin);
50
+ var _super = _createSuper(CallDiagnosticMetrics);
51
+ // @ts-ignore
52
+
53
+ // to avoid adding @ts-ignore everywhere
54
+
55
+ // the default validator before piping an event to the batcher
56
+ // this function can be overridden by the user
57
+
58
+ /**
59
+ * Constructor
60
+ * @param args
61
+ */
62
+ function CallDiagnosticMetrics() {
63
+ var _this;
64
+ (0, _classCallCheck2.default)(this, CallDiagnosticMetrics);
65
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
66
+ args[_key] = arguments[_key];
67
+ }
68
+ _this = _super.call.apply(_super, [this].concat(args));
69
+ // @ts-ignore
70
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callDiagnosticEventsBatcher", void 0);
71
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "logger", void 0);
72
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "hasLoggedBrowserSerial", void 0);
73
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "validator", function (options) {
74
+ return _promise.default.resolve({
75
+ event: options === null || options === void 0 ? void 0 : options.event,
76
+ valid: true
77
+ });
78
+ });
79
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "submitToCallDiagnosticsPreLogin", function (event, preLoginId) {
80
+ // build metrics-a event type
81
+ // @ts-ignore
82
+ var diagnosticEvent = (0, _callDiagnosticMetrics.prepareDiagnosticMetricItem)(_this.webex, {
83
+ eventPayload: event,
84
+ type: ['diagnostic-event']
85
+ });
86
+
87
+ // append sent timestamp
88
+ diagnosticEvent.eventPayload.originTime.sent = new Date().toISOString();
89
+
90
+ // @ts-ignore
91
+ return _this.webex.internal.newMetrics.postPreLoginMetric(diagnosticEvent, preLoginId);
92
+ });
93
+ _this.logger = _this.webex.logger;
94
+ // @ts-ignore
95
+ _this.callDiagnosticEventsBatcher = new _callDiagnosticMetricsBatcher.default({}, {
96
+ parent: _this.webex
97
+ });
98
+ return _this;
99
+ }
100
+
101
+ /**
102
+ * Returns the login type of the current user
103
+ * @returns one of 'login-ci','unverified-guest', null
104
+ */
105
+ (0, _createClass2.default)(CallDiagnosticMetrics, [{
106
+ key: "getCurLoginType",
107
+ value: function getCurLoginType() {
108
+ // @ts-ignore
109
+ if (this.webex.canAuthorize) {
110
+ // @ts-ignore
111
+ return this.webex.credentials.isUnverifiedGuest ? 'unverified-guest' : 'login-ci';
112
+ }
113
+ return null;
114
+ }
115
+
116
+ /**
117
+ * Returns if the meeting has converged architecture enabled
118
+ * @param options.meetingId
119
+ */
120
+ }, {
121
+ key: "getIsConvergedArchitectureEnabled",
122
+ value: function getIsConvergedArchitectureEnabled(_ref) {
123
+ var meetingId = _ref.meetingId;
124
+ if (meetingId) {
125
+ var _meeting$meetingInfo;
126
+ // @ts-ignore
127
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
128
+ return meeting === null || meeting === void 0 ? void 0 : (_meeting$meetingInfo = meeting.meetingInfo) === null || _meeting$meetingInfo === void 0 ? void 0 : _meeting$meetingInfo.enableConvergedArchitecture;
129
+ }
130
+ return undefined;
131
+ }
132
+
133
+ /**
134
+ * Returns meeting's subServiceType
135
+ * @param meeting
136
+ * @returns
137
+ */
138
+ }, {
139
+ key: "getSubServiceType",
140
+ value: function getSubServiceType(meeting) {
141
+ if (meeting) {
142
+ // @ts-ignore
143
+ var meetingInfo = meeting === null || meeting === void 0 ? void 0 : meeting.meetingInfo;
144
+ // if not Scheduled, not Webinar, pmr - then pmr
145
+ if (!(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.webexScheduled) && !(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableEvent) && meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.pmr) {
146
+ return _config2.WEBEX_SUB_SERVICE_TYPES.PMR;
147
+ }
148
+ // if Scheduled, not Webinar, not pmr - then ScheduledMeeting
149
+ if (meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.webexScheduled && !(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableEvent) && !(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.pmr)) {
150
+ return _config2.WEBEX_SUB_SERVICE_TYPES.SCHEDULED_MEETING;
151
+ }
152
+ // if Scheduled, Webinar, not pmr - then Webinar
153
+ if (meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.webexScheduled && meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.enableEvent && !(meetingInfo !== null && meetingInfo !== void 0 && meetingInfo.pmr)) {
154
+ return _config2.WEBEX_SUB_SERVICE_TYPES.WEBINAR;
155
+ }
156
+ }
157
+ return undefined;
158
+ }
159
+
160
+ /**
161
+ * Get origin object for Call Diagnostic Event payload.
162
+ * @param options
163
+ * @param meetingId
164
+ * @returns
165
+ */
166
+ }, {
167
+ key: "getOrigin",
168
+ value: function getOrigin(options, meetingId) {
169
+ var _this$webex$meetings$, _this$webex$meetings$2, _this$webex$meetings$3, _this$webex$meetings$4, _this$webex$meetings$5, _this$webex$meetings$6;
170
+ var defaultClientType = // @ts-ignore
171
+ (_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;
172
+ var defaultSubClientType = // @ts-ignore
173
+ (_this$webex$meetings$3 = this.webex.meetings.config) === null || _this$webex$meetings$3 === void 0 ? void 0 : (_this$webex$meetings$4 = _this$webex$meetings$3.metrics) === null || _this$webex$meetings$4 === void 0 ? void 0 : _this$webex$meetings$4.subClientType;
174
+ // @ts-ignore
175
+ var providedClientVersion = (_this$webex$meetings$5 = this.webex.meetings.config) === null || _this$webex$meetings$5 === void 0 ? void 0 : (_this$webex$meetings$6 = _this$webex$meetings$5.metrics) === null || _this$webex$meetings$6 === void 0 ? void 0 : _this$webex$meetings$6.clientVersion;
176
+ // @ts-ignore
177
+ var defaultSDKClientVersion = "".concat(_config.CLIENT_NAME, "/").concat(this.webex.version);
178
+ var versionMetadata = {};
179
+
180
+ // sdk version split doesn't really make sense for now...
181
+ if (providedClientVersion) {
182
+ versionMetadata = (0, _callDiagnosticMetrics.extractVersionMetadata)(providedClientVersion);
183
+ }
184
+ if (!this.hasLoggedBrowserSerial) {
185
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, "CallDiagnosticMetrics: @createClientEventObjectInMeeting => collected browser data", (0, _stringify.default)((0, _common.getBrowserSerial)()));
186
+ this.hasLoggedBrowserSerial = true;
187
+ }
188
+ if (defaultClientType && defaultSubClientType || options.clientType && options.subClientType) {
189
+ var _this$webex$meetings, _this$webex$meetings$7, _this$webex$meetings$8, _this$webex$meetings$9, _this$webex$meetings$10, _this$webex$meetings$11;
190
+ var origin = {
191
+ name: 'endpoint',
192
+ networkType: (options === null || options === void 0 ? void 0 : options.networkType) || 'unknown',
193
+ userAgent: (0, _callDiagnosticMetrics.userAgentToString)({
194
+ // @ts-ignore
195
+ clientName: (_this$webex$meetings = this.webex.meetings) === null || _this$webex$meetings === void 0 ? void 0 : (_this$webex$meetings$7 = _this$webex$meetings.config) === null || _this$webex$meetings$7 === void 0 ? void 0 : (_this$webex$meetings$8 = _this$webex$meetings$7.metrics) === null || _this$webex$meetings$8 === void 0 ? void 0 : _this$webex$meetings$8.clientName,
196
+ // @ts-ignore
197
+ webexVersion: this.webex.version
198
+ }),
199
+ clientInfo: _objectSpread(_objectSpread({
200
+ clientType: (options === null || options === void 0 ? void 0 : options.clientType) || defaultClientType,
201
+ clientVersion: providedClientVersion || defaultSDKClientVersion
202
+ }, versionMetadata), {}, {
203
+ publicNetworkPrefix:
204
+ // @ts-ignore
205
+ (0, _callDiagnosticMetrics.anonymizeIPAddress)((_this$webex$meetings$9 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$9 === void 0 ? void 0 : _this$webex$meetings$9.clientAddress) || undefined,
206
+ localNetworkPrefix: (0, _callDiagnosticMetrics.anonymizeIPAddress)( // @ts-ignore
207
+ (_this$webex$meetings$10 = this.webex.meetings.meetingCollection.get(meetingId)) === null || _this$webex$meetings$10 === void 0 ? void 0 : (_this$webex$meetings$11 = _this$webex$meetings$10.statsAnalyzer) === null || _this$webex$meetings$11 === void 0 ? void 0 : _this$webex$meetings$11.getLocalIpAddress()) || undefined,
208
+ osVersion: getOSVersion() || 'unknown',
209
+ subClientType: (options === null || options === void 0 ? void 0 : options.subClientType) || defaultSubClientType,
210
+ os: (0, _internalPluginMetrics.getOSNameInternal)(),
211
+ browser: getBrowserName(),
212
+ browserVersion: getBrowserVersion()
213
+ })
214
+ };
215
+ if (meetingId) {
216
+ // @ts-ignore
217
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
218
+ if (meeting !== null && meeting !== void 0 && meeting.environment) {
219
+ origin.environment = meeting.environment;
220
+ }
221
+ }
222
+ if (options !== null && options !== void 0 && options.environment) {
223
+ origin.environment = options.environment;
224
+ }
225
+ if (options !== null && options !== void 0 && options.newEnvironment) {
226
+ origin.newEnvironment = options.newEnvironment;
227
+ }
228
+ if (options !== null && options !== void 0 && options.clientLaunchMethod) {
229
+ origin.clientInfo.clientLaunchMethod = options.clientLaunchMethod;
230
+ }
231
+ return origin;
232
+ }
233
+ throw new Error("ClientType and SubClientType can't be undefined");
234
+ }
235
+
236
+ /**
237
+ * Gather identifier details for call diagnostic payload.
238
+ * @throws Error if initialization fails.
239
+ * @param options
240
+ */
241
+ }, {
242
+ key: "getIdentifiers",
243
+ value: function getIdentifiers(options) {
244
+ var _meeting$locusInfo, _meeting$meetingInfo2, _meeting$meetingInfo3, _meeting$meetingInfo6, _meeting$meetingInfo8;
245
+ var meeting = options.meeting,
246
+ mediaConnections = options.mediaConnections,
247
+ correlationId = options.correlationId,
248
+ webexConferenceIdStr = options.webexConferenceIdStr,
249
+ globalMeetingId = options.globalMeetingId,
250
+ preLoginId = options.preLoginId;
251
+ var identifiers = {
252
+ correlationId: 'unknown'
253
+ };
254
+ if (meeting) {
255
+ identifiers.correlationId = meeting.correlationId;
256
+ }
257
+ if (correlationId) {
258
+ identifiers.correlationId = correlationId;
259
+ }
260
+ // @ts-ignore
261
+ if (this.webex.internal) {
262
+ // @ts-ignore
263
+ var device = this.webex.internal.device;
264
+ identifiers.userId = device.userId || preLoginId;
265
+ identifiers.deviceId = device.url;
266
+ identifiers.orgId = device.orgId;
267
+ // @ts-ignore
268
+ identifiers.locusUrl = this.webex.internal.services.get('locus');
269
+ }
270
+ if (meeting !== null && meeting !== void 0 && (_meeting$locusInfo = meeting.locusInfo) !== null && _meeting$locusInfo !== void 0 && _meeting$locusInfo.fullState) {
271
+ identifiers.locusUrl = meeting.locusUrl;
272
+ identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();
273
+ identifiers.locusStartTime = meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;
274
+ }
275
+ 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) {
276
+ var _meeting$meetingInfo4, _meeting$meetingInfo5;
277
+ identifiers.webexConferenceIdStr = "".concat(((_meeting$meetingInfo4 = meeting.meetingInfo) === null || _meeting$meetingInfo4 === void 0 ? void 0 : _meeting$meetingInfo4.confIdStr) || ((_meeting$meetingInfo5 = meeting.meetingInfo) === null || _meeting$meetingInfo5 === void 0 ? void 0 : _meeting$meetingInfo5.confID));
278
+ }
279
+ if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo6 = meeting.meetingInfo) !== null && _meeting$meetingInfo6 !== void 0 && _meeting$meetingInfo6.meetingId) {
280
+ var _meeting$meetingInfo7;
281
+ identifiers.globalMeetingId = (_meeting$meetingInfo7 = meeting.meetingInfo) === null || _meeting$meetingInfo7 === void 0 ? void 0 : _meeting$meetingInfo7.meetingId;
282
+ }
283
+ if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo8 = meeting.meetingInfo) !== null && _meeting$meetingInfo8 !== void 0 && _meeting$meetingInfo8.siteName) {
284
+ var _meeting$meetingInfo9;
285
+ identifiers.webexSiteName = (_meeting$meetingInfo9 = meeting.meetingInfo) === null || _meeting$meetingInfo9 === void 0 ? void 0 : _meeting$meetingInfo9.siteName;
286
+ }
287
+ if (mediaConnections) {
288
+ var _mediaConnections$, _mediaConnections$2;
289
+ identifiers.mediaAgentAlias = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$ = mediaConnections[0]) === null || _mediaConnections$ === void 0 ? void 0 : _mediaConnections$.mediaAgentAlias;
290
+ identifiers.mediaAgentGroupId = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$2 = mediaConnections[0]) === null || _mediaConnections$2 === void 0 ? void 0 : _mediaConnections$2.mediaAgentGroupId;
291
+ }
292
+ if (!(identifiers !== null && identifiers !== void 0 && identifiers.webexConferenceIdStr) && webexConferenceIdStr) {
293
+ identifiers.webexConferenceIdStr = "".concat(webexConferenceIdStr);
294
+ }
295
+ if (!(identifiers !== null && identifiers !== void 0 && identifiers.globalMeetingId) && globalMeetingId) {
296
+ identifiers.globalMeetingId = globalMeetingId;
297
+ }
298
+ if (identifiers.correlationId === undefined) {
299
+ throw new Error('Identifiers initialization failed.');
300
+ }
301
+ return identifiers;
302
+ }
303
+
304
+ /**
305
+ * Create diagnostic event, which can hold client event, feature event or MQE event data.
306
+ * This just initiates the shared properties that are required for all the 3 event categories.
307
+ * @param eventData
308
+ * @param options
309
+ * @returns
310
+ */
311
+ }, {
312
+ key: "prepareDiagnosticEvent",
313
+ value: function prepareDiagnosticEvent(eventData, options) {
314
+ var _this$webex$meetings$12;
315
+ var meetingId = options.meetingId;
316
+ var origin = this.getOrigin(options, meetingId);
317
+ var event = {
318
+ eventId: _uuid.default.v4(),
319
+ version: 1,
320
+ origin: origin,
321
+ originTime: {
322
+ triggered: new Date().toISOString(),
323
+ // is overridden in prepareRequest batcher
324
+ sent: 'not_defined_yet'
325
+ },
326
+ // @ts-ignore
327
+ senderCountryCode: (_this$webex$meetings$12 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$12 === void 0 ? void 0 : _this$webex$meetings$12.countryCode,
328
+ event: eventData
329
+ };
330
+
331
+ // sanitize (remove empty properties, CA requires it)
332
+ // but we don't want to sanitize MQE as most of the times
333
+ // values will be 0, [] etc, and they are required.
334
+ if (eventData.name !== 'client.mediaquality.event') {
335
+ (0, _callDiagnosticMetrics.clearEmptyKeysRecursively)(event);
336
+ }
337
+ return event;
338
+ }
339
+
340
+ /**
341
+ * TODO: NOT IMPLEMENTED
342
+ * Submit Feature Event
343
+ * @returns
344
+ */
345
+ }, {
346
+ key: "submitFeatureEvent",
347
+ value: function submitFeatureEvent() {
348
+ throw Error('Not implemented');
349
+ }
350
+
351
+ /**
352
+ * Submit Media Quality Event
353
+ * @param args - submit params
354
+ * @param arg.name - event key
355
+ * @param arg.payload - additional payload to be merge with the default payload
356
+ * @param arg.options - options
357
+ */
358
+ }, {
359
+ key: "submitMQE",
360
+ value: function submitMQE(_ref2) {
361
+ var name = _ref2.name,
362
+ payload = _ref2.payload,
363
+ options = _ref2.options;
364
+ var meetingId = options.meetingId,
365
+ mediaConnections = options.mediaConnections,
366
+ webexConferenceIdStr = options.webexConferenceIdStr,
367
+ globalMeetingId = options.globalMeetingId;
368
+
369
+ // events that will most likely happen in join phase
370
+ if (meetingId) {
371
+ // @ts-ignore
372
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
373
+ if (!meeting) {
374
+ console.warn('Attempt to send MQE but no meeting was found...', "event: ".concat(name, ", meetingId: ").concat(meetingId));
375
+ // @ts-ignore
376
+ this.webex.internal.metrics.submitClientMetrics(_config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {
377
+ fields: {
378
+ meetingId: meetingId,
379
+ name: name
380
+ }
381
+ });
382
+ return;
383
+ }
384
+
385
+ // merge identifiers
386
+ var identifiers = this.getIdentifiers({
387
+ meeting: meeting,
388
+ mediaConnections: meeting.mediaConnections || mediaConnections,
389
+ webexConferenceIdStr: webexConferenceIdStr,
390
+ globalMeetingId: globalMeetingId
391
+ });
392
+
393
+ // create media quality event object
394
+ var clientEventObject = {
395
+ name: name,
396
+ canProceed: true,
397
+ identifiers: identifiers,
398
+ eventData: {
399
+ webClientDomain: window.location.hostname
400
+ },
401
+ intervals: payload.intervals,
402
+ sourceMetadata: {
403
+ applicationSoftwareType: _config.CLIENT_NAME,
404
+ // @ts-ignore
405
+ applicationSoftwareVersion: this.webex.version,
406
+ mediaEngineSoftwareType: getBrowserName() || 'browser',
407
+ mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
408
+ startTime: new Date().toISOString()
409
+ }
410
+ };
411
+
412
+ // merge any new properties, or override existing ones
413
+ clientEventObject = (0, _merge2.default)(clientEventObject, payload);
414
+
415
+ // append media quality event data to the call diagnostic event
416
+ var diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);
417
+ this.validator({
418
+ type: 'mqe',
419
+ event: diagnosticEvent
420
+ });
421
+ this.submitToCallDiagnostics(diagnosticEvent);
422
+ } else {
423
+ throw new Error('Media quality events cant be sent outside the context of a meeting. Meeting id is required.');
424
+ }
425
+ }
426
+
427
+ /**
428
+ * Return Client Event payload by client error code
429
+ * @param arg - get error arg
430
+ * @param arg.clientErrorCode
431
+ * @param arg.serviceErrorCode
432
+ * @param arg.payloadOverrides
433
+ * @returns
434
+ */
435
+ }, {
436
+ key: "getErrorPayloadForClientErrorCode",
437
+ value: function getErrorPayloadForClientErrorCode(_ref3) {
438
+ var clientErrorCode = _ref3.clientErrorCode,
439
+ serviceErrorCode = _ref3.serviceErrorCode,
440
+ serviceErrorName = _ref3.serviceErrorName,
441
+ rawErrorMessage = _ref3.rawErrorMessage,
442
+ payloadOverrides = _ref3.payloadOverrides;
443
+ var error;
444
+ if (clientErrorCode) {
445
+ var partialParsedError = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
446
+ if (partialParsedError) {
447
+ error = (0, _merge2.default)({
448
+ fatal: true,
449
+ shownToUser: false,
450
+ name: 'other',
451
+ category: 'other'
452
+ },
453
+ // default values
454
+ {
455
+ errorCode: clientErrorCode
456
+ }, serviceErrorName ? {
457
+ errorData: {
458
+ errorName: serviceErrorName
459
+ }
460
+ } : {}, {
461
+ serviceErrorCode: serviceErrorCode
462
+ }, {
463
+ rawErrorMessage: rawErrorMessage
464
+ }, partialParsedError, payloadOverrides || {});
465
+ return error;
466
+ }
467
+ }
468
+ return undefined;
469
+ }
470
+
471
+ /**
472
+ * Generate error payload for Client Event
473
+ * @param rawError
474
+ */
475
+ }, {
476
+ key: "generateClientEventErrorPayload",
477
+ value: function generateClientEventErrorPayload(rawError) {
478
+ var _rawError$error, _rawError$error$body, _rawError$body, _rawError$body2, _rawError$body3, _rawError$body3$reaso;
479
+ var rawErrorMessage = rawError.message;
480
+ if (rawError.name) {
481
+ if ((0, _callDiagnosticMetrics.isBrowserMediaErrorName)(rawError.name)) {
482
+ return this.getErrorPayloadForClientErrorCode({
483
+ serviceErrorCode: undefined,
484
+ clientErrorCode: _config2.BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP[rawError.name],
485
+ serviceErrorName: rawError.name,
486
+ rawErrorMessage: rawErrorMessage
487
+ });
488
+ }
489
+ }
490
+ if ((0, _callDiagnosticMetrics.isSdpOfferCreationError)(rawError)) {
491
+ var _rawError$cause;
492
+ // error code is 30005, but that's not specific enough. we also need to check error.cause.type
493
+ var causeType = (_rawError$cause = rawError.cause) === null || _rawError$cause === void 0 ? void 0 : _rawError$cause.type;
494
+ return this.getErrorPayloadForClientErrorCode({
495
+ serviceErrorCode: undefined,
496
+ clientErrorCode: _config2.SDP_OFFER_CREATION_ERROR_MAP[causeType] || _config2.SDP_OFFER_CREATION_ERROR_MAP.GENERAL,
497
+ serviceErrorName: rawError.name,
498
+ rawErrorMessage: rawErrorMessage
499
+ });
500
+ }
501
+ 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);
502
+ if (serviceErrorCode) {
503
+ var clientErrorCode = _config2.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];
504
+ if (clientErrorCode) {
505
+ return this.getErrorPayloadForClientErrorCode({
506
+ clientErrorCode: clientErrorCode,
507
+ serviceErrorCode: serviceErrorCode,
508
+ rawErrorMessage: rawErrorMessage
509
+ });
510
+ }
511
+
512
+ // by default, if it is locus error, return new locus err
513
+ if ((0, _callDiagnosticMetrics.isLocusServiceErrorCode)(serviceErrorCode)) {
514
+ return this.getErrorPayloadForClientErrorCode({
515
+ clientErrorCode: _config2.NEW_LOCUS_ERROR_CLIENT_CODE,
516
+ serviceErrorCode: serviceErrorCode,
517
+ rawErrorMessage: rawErrorMessage
518
+ });
519
+ }
520
+ }
521
+ if ((0, _callDiagnosticMetrics.isMeetingInfoServiceError)(rawError)) {
522
+ return this.getErrorPayloadForClientErrorCode({
523
+ clientErrorCode: _config2.MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,
524
+ serviceErrorCode: serviceErrorCode,
525
+ rawErrorMessage: rawErrorMessage
526
+ });
527
+ }
528
+ if ((0, _callDiagnosticMetrics.isNetworkError)(rawError)) {
529
+ return this.getErrorPayloadForClientErrorCode({
530
+ clientErrorCode: _config2.NETWORK_ERROR,
531
+ serviceErrorCode: serviceErrorCode,
532
+ payloadOverrides: rawError.payloadOverrides,
533
+ rawErrorMessage: rawErrorMessage
534
+ });
535
+ }
536
+ if ((0, _callDiagnosticMetrics.isUnauthorizedError)(rawError)) {
537
+ return this.getErrorPayloadForClientErrorCode({
538
+ clientErrorCode: _config2.AUTHENTICATION_FAILED_CODE,
539
+ serviceErrorCode: serviceErrorCode,
540
+ payloadOverrides: rawError.payloadOverrides,
541
+ rawErrorMessage: rawErrorMessage
542
+ });
543
+ }
544
+
545
+ // otherwise return unkown error
546
+ return this.getErrorPayloadForClientErrorCode({
547
+ clientErrorCode: _config2.UNKNOWN_ERROR,
548
+ serviceErrorCode: _config2.UNKNOWN_ERROR,
549
+ rawErrorMessage: rawErrorMessage
550
+ });
551
+ }
552
+
553
+ /**
554
+ * Create client event object for in meeting events
555
+ * @param arg - create args
556
+ * @param arg.event - event key
557
+ * @param arg.options - options
558
+ * @returns object
559
+ */
560
+ }, {
561
+ key: "createClientEventObjectInMeeting",
562
+ value: function createClientEventObjectInMeeting(_ref4) {
563
+ var name = _ref4.name,
564
+ options = _ref4.options,
565
+ errors = _ref4.errors;
566
+ var meetingId = options.meetingId,
567
+ mediaConnections = options.mediaConnections,
568
+ globalMeetingId = options.globalMeetingId,
569
+ webexConferenceIdStr = options.webexConferenceIdStr;
570
+
571
+ // @ts-ignore
572
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
573
+ if (!meeting) {
574
+ console.warn('Attempt to send client event but no meeting was found...', "name: ".concat(name, ", meetingId: ").concat(meetingId));
575
+ // @ts-ignore
576
+ this.webex.internal.metrics.submitClientMetrics(_config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {
577
+ fields: {
578
+ meetingId: meetingId,
579
+ name: name
580
+ }
581
+ });
582
+ return undefined;
583
+ }
584
+
585
+ // grab identifiers
586
+ var identifiers = this.getIdentifiers({
587
+ meeting: meeting,
588
+ mediaConnections: (meeting === null || meeting === void 0 ? void 0 : meeting.mediaConnections) || mediaConnections,
589
+ webexConferenceIdStr: webexConferenceIdStr,
590
+ globalMeetingId: globalMeetingId
591
+ });
592
+
593
+ // create client event object
594
+ var clientEventObject = {
595
+ name: name,
596
+ canProceed: true,
597
+ identifiers: identifiers,
598
+ errors: errors,
599
+ eventData: {
600
+ webClientDomain: window.location.hostname
601
+ },
602
+ userType: meeting.getCurUserType(),
603
+ loginType: 'loginType' in meeting.callStateForMetrics ? meeting.callStateForMetrics.loginType : this.getCurLoginType(),
604
+ isConvergedArchitectureEnabled: this.getIsConvergedArchitectureEnabled({
605
+ meetingId: meetingId
606
+ }),
607
+ webexSubServiceType: this.getSubServiceType(meeting)
608
+ };
609
+ return clientEventObject;
610
+ }
611
+
612
+ /**
613
+ * Create client event object for pre meeting events
614
+ * @param arg - create args
615
+ * @param arg.event - event key
616
+ * @param arg.options - payload
617
+ * @returns object
618
+ */
619
+ }, {
620
+ key: "createClientEventObjectPreMeeting",
621
+ value: function createClientEventObjectPreMeeting(_ref5) {
622
+ var name = _ref5.name,
623
+ options = _ref5.options,
624
+ errors = _ref5.errors;
625
+ var correlationId = options.correlationId,
626
+ globalMeetingId = options.globalMeetingId,
627
+ webexConferenceIdStr = options.webexConferenceIdStr,
628
+ preLoginId = options.preLoginId;
629
+
630
+ // grab identifiers
631
+ var identifiers = this.getIdentifiers({
632
+ correlationId: correlationId,
633
+ preLoginId: preLoginId,
634
+ globalMeetingId: globalMeetingId,
635
+ webexConferenceIdStr: webexConferenceIdStr
636
+ });
637
+
638
+ // create client event object
639
+ var clientEventObject = {
640
+ name: name,
641
+ errors: errors,
642
+ canProceed: true,
643
+ identifiers: identifiers,
644
+ eventData: {
645
+ webClientDomain: window.location.hostname
646
+ },
647
+ loginType: this.getCurLoginType()
648
+ };
649
+ return clientEventObject;
650
+ }
651
+
652
+ /**
653
+ * Prepare Client Event CA event.
654
+ * @param arg - submit params
655
+ * @param arg.event - event key
656
+ * @param arg.payload - additional payload to be merged with default payload
657
+ * @param arg.options - payload
658
+ * @returns {any} options to be with fetch
659
+ * @throws
660
+ */
661
+ }, {
662
+ key: "prepareClientEvent",
663
+ value: function prepareClientEvent(_ref6) {
664
+ var name = _ref6.name,
665
+ payload = _ref6.payload,
666
+ options = _ref6.options;
667
+ var meetingId = options.meetingId,
668
+ correlationId = options.correlationId,
669
+ rawError = options.rawError;
670
+ var clientEventObject;
671
+
672
+ // check if we need to generate errors
673
+ var errors = [];
674
+ if (rawError) {
675
+ var generatedError = this.generateClientEventErrorPayload(rawError);
676
+ if (generatedError) {
677
+ errors.push(generatedError);
678
+ }
679
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @prepareClientEvent. Generated errors:', "generatedError: ".concat((0, _stringify.default)(generatedError)));
680
+ }
681
+
682
+ // events that will most likely happen in join phase
683
+ if (meetingId) {
684
+ clientEventObject = this.createClientEventObjectInMeeting({
685
+ name: name,
686
+ options: options,
687
+ errors: errors
688
+ });
689
+ } else if (correlationId) {
690
+ // any pre join events or events that are outside the meeting.
691
+ clientEventObject = this.createClientEventObjectPreMeeting({
692
+ name: name,
693
+ options: options,
694
+ errors: errors
695
+ });
696
+ } else {
697
+ throw new Error('Not implemented');
698
+ }
699
+
700
+ // merge any new properties, or override existing ones
701
+ clientEventObject = (0, _merge2.default)(clientEventObject, payload);
702
+
703
+ // append client event data to the call diagnostic event
704
+ var diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);
705
+ return diagnosticEvent;
706
+ }
707
+
708
+ /**
709
+ * Submit Client Event CA event.
710
+ * @param arg - submit params
711
+ * @param arg.event - event key
712
+ * @param arg.payload - additional payload to be merged with default payload
713
+ * @param arg.options - payload
714
+ * @throws
715
+ */
716
+ }, {
717
+ key: "submitClientEvent",
718
+ value: function submitClientEvent(_ref7) {
719
+ var name = _ref7.name,
720
+ payload = _ref7.payload,
721
+ options = _ref7.options;
722
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @submitClientEvent. Submit Client Event CA event.', "name: ".concat(name));
723
+ var diagnosticEvent = this.prepareClientEvent({
724
+ name: name,
725
+ payload: payload,
726
+ options: options
727
+ });
728
+ if (options !== null && options !== void 0 && options.preLoginId) {
729
+ return this.submitToCallDiagnosticsPreLogin(diagnosticEvent, options === null || options === void 0 ? void 0 : options.preLoginId);
730
+ }
731
+ this.validator({
732
+ type: 'ce',
733
+ event: diagnosticEvent
734
+ });
735
+ return this.submitToCallDiagnostics(diagnosticEvent);
736
+ }
737
+
738
+ /**
739
+ * Prepare the event and send the request to metrics-a service.
740
+ * @param event
741
+ * @returns promise
742
+ */
743
+ }, {
744
+ key: "submitToCallDiagnostics",
745
+ value: function submitToCallDiagnostics(event) {
746
+ // build metrics-a event type
747
+ var finalEvent = {
748
+ eventPayload: event,
749
+ type: ['diagnostic-event']
750
+ };
751
+ return this.callDiagnosticEventsBatcher.request(finalEvent);
752
+ }
753
+
754
+ /**
755
+ * Pre login events are not batched. We make the request directly.
756
+ * @param event
757
+ * @param preLoginId
758
+ * @returns
759
+ */
760
+ }, {
761
+ key: "buildClientEventFetchRequestOptions",
762
+ value:
763
+ /**
764
+ * Builds a request options object to later be passed to fetch().
765
+ * @param arg - submit params
766
+ * @param arg.event - event key
767
+ * @param arg.payload - additional payload to be merged with default payload
768
+ * @param arg.options - client event options
769
+ * @returns {Promise<any>}
770
+ * @throws
771
+ */
772
+ function () {
773
+ var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref8) {
774
+ var name, payload, options, clientEvent, diagnosticEvent, request;
775
+ return _regenerator.default.wrap(function _callee$(_context) {
776
+ while (1) switch (_context.prev = _context.next) {
777
+ case 0:
778
+ name = _ref8.name, payload = _ref8.payload, options = _ref8.options;
779
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...', "name: ".concat(name));
780
+ clientEvent = this.prepareClientEvent({
781
+ name: name,
782
+ payload: payload,
783
+ options: options
784
+ }); // build metrics-a event type
785
+ // @ts-ignore
786
+ diagnosticEvent = (0, _callDiagnosticMetrics.prepareDiagnosticMetricItem)(this.webex, {
787
+ eventPayload: clientEvent,
788
+ type: ['diagnostic-event']
789
+ });
790
+ request = {
791
+ method: 'POST',
792
+ service: 'metrics',
793
+ resource: 'clientmetrics',
794
+ body: {
795
+ metrics: [diagnosticEvent]
796
+ },
797
+ headers: {},
798
+ // @ts-ignore
799
+ waitForServiceTimeout: this.webex.internal.metrics.config.waitForServiceTimeout
800
+ };
801
+ if (options.preLoginId) {
802
+ request.headers = {
803
+ authorization: false,
804
+ 'x-prelogin-userid': options.preLoginId
805
+ };
806
+ request.resource = 'clientmetrics-prelogin';
807
+ }
808
+
809
+ // @ts-ignore
810
+ return _context.abrupt("return", this.webex.prepareFetchOptions(request));
811
+ case 7:
812
+ case "end":
813
+ return _context.stop();
814
+ }
815
+ }, _callee, this);
816
+ }));
817
+ function buildClientEventFetchRequestOptions(_x) {
818
+ return _buildClientEventFetchRequestOptions.apply(this, arguments);
819
+ }
820
+ return buildClientEventFetchRequestOptions;
821
+ }()
822
+ /**
823
+ * Returns true if the specified serviceErrorCode maps to an expected error.
824
+ * @param {number} serviceErrorCode the service error code
825
+ * @returns {boolean}
826
+ */
827
+ }, {
828
+ key: "isServiceErrorExpected",
829
+ value: function isServiceErrorExpected(serviceErrorCode) {
830
+ var clientErrorCode = _config2.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];
831
+ var clientErrorPayload = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
832
+ return (clientErrorPayload === null || clientErrorPayload === void 0 ? void 0 : clientErrorPayload.category) === 'expected';
833
+ }
834
+ }]);
835
+ return CallDiagnosticMetrics;
836
+ }(_webexCore.StatelessWebexPlugin);
837
+ exports.default = CallDiagnosticMetrics;
838
+ //# sourceMappingURL=call-diagnostic-metrics.js.map