@webex/internal-plugin-metrics 3.0.0-beta.31 → 3.0.0-beta.310

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 +66 -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 +830 -0
  8. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
  9. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +337 -0
  10. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -0
  11. package/dist/call-diagnostic/config.js +610 -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 +22 -2
  16. package/dist/config.js.map +1 -1
  17. package/dist/index.js +30 -1
  18. package/dist/index.js.map +1 -1
  19. package/dist/metrics.js +30 -30
  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 +411 -0
  29. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +96 -0
  30. package/dist/types/call-diagnostic/config.d.ts +172 -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 +13 -8
  41. package/src/batcher.js +1 -0
  42. package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +83 -0
  43. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +414 -0
  44. package/src/call-diagnostic/call-diagnostic-metrics.ts +896 -0
  45. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +362 -0
  46. package/src/call-diagnostic/config.ts +666 -0
  47. package/src/client-metrics-batcher.js +1 -0
  48. package/src/config.js +20 -0
  49. package/src/index.ts +43 -0
  50. package/src/metrics.js +25 -27
  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 +465 -0
  56. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +477 -0
  57. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +2012 -0
  58. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +565 -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 +269 -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,830 @@
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
+ var _utils = require("../utils");
36
+ 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; }
37
+ 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; }
38
+ 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); }; }
39
+ 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; } }
40
+ var _BrowserDetection = (0, _common.BrowserDetection)(),
41
+ getOSVersion = _BrowserDetection.getOSVersion,
42
+ getBrowserName = _BrowserDetection.getBrowserName,
43
+ getBrowserVersion = _BrowserDetection.getBrowserVersion;
44
+ /**
45
+ * @description Util class to handle Call Analyzer Metrics
46
+ * @export
47
+ * @class CallDiagnosticMetrics
48
+ */
49
+ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
50
+ (0, _inherits2.default)(CallDiagnosticMetrics, _StatelessWebexPlugin);
51
+ var _super = _createSuper(CallDiagnosticMetrics);
52
+ // @ts-ignore
53
+
54
+ // to avoid adding @ts-ignore everywhere
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), "validator", function (options) {
73
+ return _promise.default.resolve({
74
+ event: options === null || options === void 0 ? void 0 : options.event,
75
+ valid: true
76
+ });
77
+ });
78
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "submitToCallDiagnosticsPreLogin", function (event, preLoginId) {
79
+ // build metrics-a event type
80
+ // @ts-ignore
81
+ var diagnosticEvent = (0, _callDiagnosticMetrics.prepareDiagnosticMetricItem)(_this.webex, {
82
+ eventPayload: event,
83
+ type: ['diagnostic-event']
84
+ });
85
+
86
+ // append sent timestamp
87
+ diagnosticEvent.eventPayload.originTime.sent = new Date().toISOString();
88
+ _this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, "CallDiagnosticMetrics: @submitToCallDiagnosticsPreLogin. Sending the request:", "diagnosticEvent: ".concat((0, _stringify.default)(diagnosticEvent)));
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 (defaultClientType && defaultSubClientType || options.clientType && options.subClientType) {
185
+ var _this$webex$meetings, _this$webex$meetings$7, _this$webex$meetings$8, _this$webex$meetings$9;
186
+ var origin = {
187
+ name: 'endpoint',
188
+ networkType: (options === null || options === void 0 ? void 0 : options.networkType) || 'unknown',
189
+ userAgent: (0, _callDiagnosticMetrics.userAgentToString)({
190
+ // @ts-ignore
191
+ 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,
192
+ // @ts-ignore
193
+ webexVersion: this.webex.version
194
+ }),
195
+ clientInfo: _objectSpread(_objectSpread({
196
+ clientType: (options === null || options === void 0 ? void 0 : options.clientType) || defaultClientType,
197
+ clientVersion: providedClientVersion || defaultSDKClientVersion
198
+ }, versionMetadata), {}, {
199
+ localNetworkPrefix:
200
+ // @ts-ignore
201
+ (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,
202
+ osVersion: getOSVersion() || 'unknown',
203
+ subClientType: (options === null || options === void 0 ? void 0 : options.subClientType) || defaultSubClientType,
204
+ os: (0, _internalPluginMetrics.getOSNameInternal)(),
205
+ browser: getBrowserName(),
206
+ browserVersion: getBrowserVersion()
207
+ })
208
+ };
209
+ if (meetingId) {
210
+ // @ts-ignore
211
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
212
+ if (meeting !== null && meeting !== void 0 && meeting.environment) {
213
+ origin.environment = meeting.environment;
214
+ }
215
+ }
216
+ if (options !== null && options !== void 0 && options.environment) {
217
+ origin.environment = options.environment;
218
+ }
219
+ if (options !== null && options !== void 0 && options.newEnvironment) {
220
+ origin.newEnvironment = options.newEnvironment;
221
+ }
222
+ if (options !== null && options !== void 0 && options.clientLaunchMethod) {
223
+ origin.clientInfo.clientLaunchMethod = options.clientLaunchMethod;
224
+ }
225
+ return origin;
226
+ }
227
+ throw new Error("ClientType and SubClientType can't be undefined");
228
+ }
229
+
230
+ /**
231
+ * Gather identifier details for call diagnostic payload.
232
+ * @throws Error if initialization fails.
233
+ * @param options
234
+ */
235
+ }, {
236
+ key: "getIdentifiers",
237
+ value: function getIdentifiers(options) {
238
+ var _meeting$locusInfo, _meeting$meetingInfo2, _meeting$meetingInfo3, _meeting$meetingInfo6, _meeting$meetingInfo8;
239
+ var meeting = options.meeting,
240
+ mediaConnections = options.mediaConnections,
241
+ correlationId = options.correlationId,
242
+ webexConferenceIdStr = options.webexConferenceIdStr,
243
+ globalMeetingId = options.globalMeetingId,
244
+ preLoginId = options.preLoginId;
245
+ var identifiers = {
246
+ correlationId: 'unknown'
247
+ };
248
+ if (meeting) {
249
+ identifiers.correlationId = meeting.correlationId;
250
+ }
251
+ if (correlationId) {
252
+ identifiers.correlationId = correlationId;
253
+ }
254
+ // @ts-ignore
255
+ if (this.webex.internal) {
256
+ // @ts-ignore
257
+ var device = this.webex.internal.device;
258
+ identifiers.userId = device.userId || preLoginId;
259
+ identifiers.deviceId = device.url;
260
+ identifiers.orgId = device.orgId;
261
+ // @ts-ignore
262
+ identifiers.locusUrl = this.webex.internal.services.get('locus');
263
+ }
264
+ if (meeting !== null && meeting !== void 0 && (_meeting$locusInfo = meeting.locusInfo) !== null && _meeting$locusInfo !== void 0 && _meeting$locusInfo.fullState) {
265
+ identifiers.locusUrl = meeting.locusUrl;
266
+ identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();
267
+ identifiers.locusStartTime = meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;
268
+ }
269
+ 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) {
270
+ var _meeting$meetingInfo4, _meeting$meetingInfo5;
271
+ 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));
272
+ }
273
+ if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo6 = meeting.meetingInfo) !== null && _meeting$meetingInfo6 !== void 0 && _meeting$meetingInfo6.meetingId) {
274
+ var _meeting$meetingInfo7;
275
+ identifiers.globalMeetingId = (_meeting$meetingInfo7 = meeting.meetingInfo) === null || _meeting$meetingInfo7 === void 0 ? void 0 : _meeting$meetingInfo7.meetingId;
276
+ }
277
+ if (meeting !== null && meeting !== void 0 && (_meeting$meetingInfo8 = meeting.meetingInfo) !== null && _meeting$meetingInfo8 !== void 0 && _meeting$meetingInfo8.siteName) {
278
+ var _meeting$meetingInfo9;
279
+ identifiers.webexSiteName = (_meeting$meetingInfo9 = meeting.meetingInfo) === null || _meeting$meetingInfo9 === void 0 ? void 0 : _meeting$meetingInfo9.siteName;
280
+ }
281
+ if (mediaConnections) {
282
+ var _mediaConnections$, _mediaConnections$2;
283
+ identifiers.mediaAgentAlias = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$ = mediaConnections[0]) === null || _mediaConnections$ === void 0 ? void 0 : _mediaConnections$.mediaAgentAlias;
284
+ identifiers.mediaAgentGroupId = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$2 = mediaConnections[0]) === null || _mediaConnections$2 === void 0 ? void 0 : _mediaConnections$2.mediaAgentGroupId;
285
+ }
286
+ if (!(identifiers !== null && identifiers !== void 0 && identifiers.webexConferenceIdStr) && webexConferenceIdStr) {
287
+ identifiers.webexConferenceIdStr = "".concat(webexConferenceIdStr);
288
+ }
289
+ if (!(identifiers !== null && identifiers !== void 0 && identifiers.globalMeetingId) && globalMeetingId) {
290
+ identifiers.globalMeetingId = globalMeetingId;
291
+ }
292
+ if (identifiers.correlationId === undefined) {
293
+ throw new Error('Identifiers initialization failed.');
294
+ }
295
+ return identifiers;
296
+ }
297
+
298
+ /**
299
+ * Create diagnostic event, which can hold client event, feature event or MQE event data.
300
+ * This just initiates the shared properties that are required for all the 3 event categories.
301
+ * @param eventData
302
+ * @param options
303
+ * @returns
304
+ */
305
+ }, {
306
+ key: "prepareDiagnosticEvent",
307
+ value: function prepareDiagnosticEvent(eventData, options) {
308
+ var _this$webex$meetings$10;
309
+ var meetingId = options.meetingId;
310
+ var origin = this.getOrigin(options, meetingId);
311
+ var event = {
312
+ eventId: _uuid.default.v4(),
313
+ version: 1,
314
+ origin: origin,
315
+ originTime: {
316
+ triggered: new Date().toISOString(),
317
+ // is overridden in prepareRequest batcher
318
+ sent: 'not_defined_yet'
319
+ },
320
+ // @ts-ignore
321
+ senderCountryCode: (_this$webex$meetings$10 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$10 === void 0 ? void 0 : _this$webex$meetings$10.countryCode,
322
+ event: eventData
323
+ };
324
+
325
+ // sanitize (remove empty properties, CA requires it)
326
+ // but we don't want to sanitize MQE as most of the times
327
+ // values will be 0, [] etc, and they are required.
328
+ if (eventData.name !== 'client.mediaquality.event') {
329
+ (0, _callDiagnosticMetrics.clearEmptyKeysRecursively)(event);
330
+ }
331
+ return event;
332
+ }
333
+
334
+ /**
335
+ * TODO: NOT IMPLEMENTED
336
+ * Submit Feature Event
337
+ * @returns
338
+ */
339
+ }, {
340
+ key: "submitFeatureEvent",
341
+ value: function submitFeatureEvent() {
342
+ throw Error('Not implemented');
343
+ }
344
+
345
+ /**
346
+ * Submit Media Quality Event
347
+ * @param args - submit params
348
+ * @param arg.name - event key
349
+ * @param arg.payload - additional payload to be merge with the default payload
350
+ * @param arg.options - options
351
+ */
352
+ }, {
353
+ key: "submitMQE",
354
+ value: function submitMQE(_ref2) {
355
+ var name = _ref2.name,
356
+ payload = _ref2.payload,
357
+ options = _ref2.options;
358
+ var meetingId = options.meetingId,
359
+ mediaConnections = options.mediaConnections,
360
+ webexConferenceIdStr = options.webexConferenceIdStr,
361
+ globalMeetingId = options.globalMeetingId;
362
+
363
+ // events that will most likely happen in join phase
364
+ if (meetingId) {
365
+ // @ts-ignore
366
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
367
+ if (!meeting) {
368
+ console.warn('Attempt to send MQE but no meeting was found...', "event: ".concat(name, ", meetingId: ").concat(meetingId));
369
+ // @ts-ignore
370
+ this.webex.internal.metrics.submitClientMetrics(_config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {
371
+ fields: {
372
+ meetingId: meetingId,
373
+ name: name
374
+ }
375
+ });
376
+ return;
377
+ }
378
+
379
+ // merge identifiers
380
+ var identifiers = this.getIdentifiers({
381
+ meeting: meeting,
382
+ mediaConnections: meeting.mediaConnections || mediaConnections,
383
+ webexConferenceIdStr: webexConferenceIdStr,
384
+ globalMeetingId: globalMeetingId
385
+ });
386
+
387
+ // create media quality event object
388
+ var clientEventObject = {
389
+ name: name,
390
+ canProceed: true,
391
+ identifiers: identifiers,
392
+ eventData: {
393
+ webClientDomain: window.location.hostname
394
+ },
395
+ intervals: payload.intervals,
396
+ sourceMetadata: {
397
+ applicationSoftwareType: _config.CLIENT_NAME,
398
+ // @ts-ignore
399
+ applicationSoftwareVersion: this.webex.version,
400
+ mediaEngineSoftwareType: getBrowserName() || 'browser',
401
+ mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
402
+ startTime: new Date().toISOString()
403
+ }
404
+ };
405
+
406
+ // merge any new properties, or override existing ones
407
+ clientEventObject = (0, _merge2.default)(clientEventObject, payload);
408
+
409
+ // append media quality event data to the call diagnostic event
410
+ var diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);
411
+ this.validator({
412
+ type: 'mqe',
413
+ event: diagnosticEvent
414
+ });
415
+ this.submitToCallDiagnostics(diagnosticEvent);
416
+ } else {
417
+ throw new Error('Media quality events cant be sent outside the context of a meeting. Meeting id is required.');
418
+ }
419
+ }
420
+
421
+ /**
422
+ * Return Client Event payload by client error code
423
+ * @param arg - get error arg
424
+ * @param arg.clientErrorCode
425
+ * @param arg.serviceErrorCode
426
+ * @param arg.payloadOverrides
427
+ * @returns
428
+ */
429
+ }, {
430
+ key: "getErrorPayloadForClientErrorCode",
431
+ value: function getErrorPayloadForClientErrorCode(_ref3) {
432
+ var clientErrorCode = _ref3.clientErrorCode,
433
+ serviceErrorCode = _ref3.serviceErrorCode,
434
+ serviceErrorName = _ref3.serviceErrorName,
435
+ payloadOverrides = _ref3.payloadOverrides;
436
+ var error;
437
+ if (clientErrorCode) {
438
+ var partialParsedError = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
439
+ if (partialParsedError) {
440
+ error = (0, _merge2.default)({
441
+ fatal: true,
442
+ shownToUser: false,
443
+ name: 'other',
444
+ category: 'other'
445
+ },
446
+ // default values
447
+ {
448
+ errorCode: clientErrorCode
449
+ }, serviceErrorName ? {
450
+ errorData: {
451
+ errorName: serviceErrorName
452
+ }
453
+ } : {}, {
454
+ serviceErrorCode: serviceErrorCode
455
+ }, partialParsedError, payloadOverrides || {});
456
+ return error;
457
+ }
458
+ }
459
+ return undefined;
460
+ }
461
+
462
+ /**
463
+ * Generate error payload for Client Event
464
+ * @param rawError
465
+ */
466
+ }, {
467
+ key: "generateClientEventErrorPayload",
468
+ value: function generateClientEventErrorPayload(rawError) {
469
+ var _rawError$error, _rawError$error$body, _rawError$body, _rawError$body2, _rawError$body3, _rawError$body3$reaso;
470
+ if (rawError.name) {
471
+ if ((0, _callDiagnosticMetrics.isBrowserMediaErrorName)(rawError.name)) {
472
+ return this.getErrorPayloadForClientErrorCode({
473
+ serviceErrorCode: undefined,
474
+ clientErrorCode: _config2.BROWSER_MEDIA_ERROR_NAME_TO_CLIENT_ERROR_CODES_MAP[rawError.name],
475
+ serviceErrorName: rawError.name
476
+ });
477
+ }
478
+ }
479
+ 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);
480
+ if (serviceErrorCode) {
481
+ var clientErrorCode = _config2.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];
482
+ if (clientErrorCode) {
483
+ return this.getErrorPayloadForClientErrorCode({
484
+ clientErrorCode: clientErrorCode,
485
+ serviceErrorCode: serviceErrorCode
486
+ });
487
+ }
488
+
489
+ // by default, if it is locus error, return new locus err
490
+ if ((0, _callDiagnosticMetrics.isLocusServiceErrorCode)(serviceErrorCode)) {
491
+ return this.getErrorPayloadForClientErrorCode({
492
+ clientErrorCode: _config2.NEW_LOCUS_ERROR_CLIENT_CODE,
493
+ serviceErrorCode: serviceErrorCode
494
+ });
495
+ }
496
+ }
497
+ if ((0, _callDiagnosticMetrics.isMeetingInfoServiceError)(rawError)) {
498
+ return this.getErrorPayloadForClientErrorCode({
499
+ clientErrorCode: _config2.MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,
500
+ serviceErrorCode: serviceErrorCode
501
+ });
502
+ }
503
+ if ((0, _callDiagnosticMetrics.isNetworkError)(rawError)) {
504
+ var payload = this.getErrorPayloadForClientErrorCode({
505
+ clientErrorCode: _config2.NETWORK_ERROR,
506
+ serviceErrorCode: serviceErrorCode,
507
+ payloadOverrides: rawError.payloadOverrides
508
+ });
509
+ payload.errorDescription = rawError.message;
510
+ return payload;
511
+ }
512
+ if ((0, _callDiagnosticMetrics.isUnauthorizedError)(rawError)) {
513
+ var _payload = this.getErrorPayloadForClientErrorCode({
514
+ clientErrorCode: _config2.AUTHENTICATION_FAILED_CODE,
515
+ serviceErrorCode: serviceErrorCode,
516
+ payloadOverrides: rawError.payloadOverrides
517
+ });
518
+ _payload.errorDescription = rawError.message;
519
+ return _payload;
520
+ }
521
+
522
+ // otherwise return unkown error
523
+ return this.getErrorPayloadForClientErrorCode({
524
+ clientErrorCode: _config2.UNKNOWN_ERROR,
525
+ serviceErrorCode: _config2.UNKNOWN_ERROR
526
+ });
527
+ }
528
+
529
+ /**
530
+ * Create client event object for in meeting events
531
+ * @param arg - create args
532
+ * @param arg.event - event key
533
+ * @param arg.options - options
534
+ * @returns object
535
+ */
536
+ }, {
537
+ key: "createClientEventObjectInMeeting",
538
+ value: function createClientEventObjectInMeeting(_ref4) {
539
+ var _options$rawError;
540
+ var name = _ref4.name,
541
+ options = _ref4.options,
542
+ errors = _ref4.errors;
543
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @createClientEventObjectInMeeting. Creating in meeting event object.', "name: ".concat(name));
544
+ var meetingId = options.meetingId,
545
+ mediaConnections = options.mediaConnections,
546
+ globalMeetingId = options.globalMeetingId,
547
+ webexConferenceIdStr = options.webexConferenceIdStr;
548
+
549
+ // @ts-ignore
550
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
551
+ if (!meeting) {
552
+ console.warn('Attempt to send client event but no meeting was found...', "name: ".concat(name, ", meetingId: ").concat(meetingId));
553
+ // @ts-ignore
554
+ this.webex.internal.metrics.submitClientMetrics(_config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {
555
+ fields: {
556
+ meetingId: meetingId,
557
+ name: name
558
+ }
559
+ });
560
+ return undefined;
561
+ }
562
+
563
+ // grab identifiers
564
+ var identifiers = this.getIdentifiers({
565
+ meeting: meeting,
566
+ mediaConnections: (meeting === null || meeting === void 0 ? void 0 : meeting.mediaConnections) || mediaConnections,
567
+ webexConferenceIdStr: webexConferenceIdStr,
568
+ globalMeetingId: globalMeetingId
569
+ });
570
+
571
+ // create client event object
572
+ var clientEventObject = {
573
+ name: name,
574
+ canProceed: true,
575
+ identifiers: identifiers,
576
+ errors: errors,
577
+ eventData: {
578
+ webClientDomain: window.location.hostname
579
+ },
580
+ userType: meeting.getCurUserType(),
581
+ loginType: this.getCurLoginType(),
582
+ isConvergedArchitectureEnabled: this.getIsConvergedArchitectureEnabled({
583
+ meetingId: meetingId
584
+ }),
585
+ webexSubServiceType: this.getSubServiceType(meeting)
586
+ };
587
+ if (options !== null && options !== void 0 && (_options$rawError = options.rawError) !== null && _options$rawError !== void 0 && _options$rawError.message) {
588
+ var _options$rawError2;
589
+ // @ts-ignore
590
+ clientEventObject.eventData.rawErrorMessage = options === null || options === void 0 ? void 0 : (_options$rawError2 = options.rawError) === null || _options$rawError2 === void 0 ? void 0 : _options$rawError2.message;
591
+ }
592
+ return clientEventObject;
593
+ }
594
+
595
+ /**
596
+ * Create client event object for pre meeting events
597
+ * @param arg - create args
598
+ * @param arg.event - event key
599
+ * @param arg.options - payload
600
+ * @returns object
601
+ */
602
+ }, {
603
+ key: "createClientEventObjectPreMeeting",
604
+ value: function createClientEventObjectPreMeeting(_ref5) {
605
+ var _options$rawError3;
606
+ var name = _ref5.name,
607
+ options = _ref5.options,
608
+ errors = _ref5.errors;
609
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @createClientEventObjectPreMeeting. Creating pre meeting event object.', "name: ".concat(name));
610
+ var correlationId = options.correlationId,
611
+ globalMeetingId = options.globalMeetingId,
612
+ webexConferenceIdStr = options.webexConferenceIdStr,
613
+ preLoginId = options.preLoginId;
614
+
615
+ // grab identifiers
616
+ var identifiers = this.getIdentifiers({
617
+ correlationId: correlationId,
618
+ preLoginId: preLoginId,
619
+ globalMeetingId: globalMeetingId,
620
+ webexConferenceIdStr: webexConferenceIdStr
621
+ });
622
+
623
+ // create client event object
624
+ var clientEventObject = {
625
+ name: name,
626
+ errors: errors,
627
+ canProceed: true,
628
+ identifiers: identifiers,
629
+ eventData: {
630
+ webClientDomain: window.location.hostname
631
+ },
632
+ loginType: this.getCurLoginType()
633
+ };
634
+ if (options !== null && options !== void 0 && (_options$rawError3 = options.rawError) !== null && _options$rawError3 !== void 0 && _options$rawError3.message) {
635
+ var _options$rawError4;
636
+ // @ts-ignore
637
+ clientEventObject.eventData.rawErrorMessage = options === null || options === void 0 ? void 0 : (_options$rawError4 = options.rawError) === null || _options$rawError4 === void 0 ? void 0 : _options$rawError4.message;
638
+ }
639
+ return clientEventObject;
640
+ }
641
+
642
+ /**
643
+ * Prepare Client Event CA event.
644
+ * @param arg - submit params
645
+ * @param arg.event - event key
646
+ * @param arg.payload - additional payload to be merged with default payload
647
+ * @param arg.options - payload
648
+ * @returns {any} options to be with fetch
649
+ * @throws
650
+ */
651
+ }, {
652
+ key: "prepareClientEvent",
653
+ value: function prepareClientEvent(_ref6) {
654
+ var name = _ref6.name,
655
+ payload = _ref6.payload,
656
+ options = _ref6.options;
657
+ var meetingId = options.meetingId,
658
+ correlationId = options.correlationId,
659
+ rawError = options.rawError;
660
+ var clientEventObject;
661
+
662
+ // check if we need to generate errors
663
+ var errors = [];
664
+ if (rawError) {
665
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @prepareClientEvent. Error detected, attempting to map and attach it to the event...', "name: ".concat(name), "rawError: ".concat((0, _utils.generateCommonErrorMetadata)(rawError)));
666
+ var generatedError = this.generateClientEventErrorPayload(rawError);
667
+ if (generatedError) {
668
+ errors.push(generatedError);
669
+ }
670
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @prepareClientEvent. Generated errors:', "generatedError: ".concat((0, _stringify.default)(generatedError)));
671
+ }
672
+
673
+ // events that will most likely happen in join phase
674
+ if (meetingId) {
675
+ clientEventObject = this.createClientEventObjectInMeeting({
676
+ name: name,
677
+ options: options,
678
+ errors: errors
679
+ });
680
+ } else if (correlationId) {
681
+ // any pre join events or events that are outside the meeting.
682
+ clientEventObject = this.createClientEventObjectPreMeeting({
683
+ name: name,
684
+ options: options,
685
+ errors: errors
686
+ });
687
+ } else {
688
+ throw new Error('Not implemented');
689
+ }
690
+
691
+ // merge any new properties, or override existing ones
692
+ clientEventObject = (0, _merge2.default)(clientEventObject, payload);
693
+
694
+ // append client event data to the call diagnostic event
695
+ var diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);
696
+ return diagnosticEvent;
697
+ }
698
+
699
+ /**
700
+ * Submit Client Event CA event.
701
+ * @param arg - submit params
702
+ * @param arg.event - event key
703
+ * @param arg.payload - additional payload to be merged with default payload
704
+ * @param arg.options - payload
705
+ * @throws
706
+ */
707
+ }, {
708
+ key: "submitClientEvent",
709
+ value: function submitClientEvent(_ref7) {
710
+ var name = _ref7.name,
711
+ payload = _ref7.payload,
712
+ options = _ref7.options;
713
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @submitClientEvent. Submit Client Event CA event.', "name: ".concat(name), "payload: ".concat((0, _stringify.default)(payload)), "options: ".concat((0, _stringify.default)(options)));
714
+ var diagnosticEvent = this.prepareClientEvent({
715
+ name: name,
716
+ payload: payload,
717
+ options: options
718
+ });
719
+ if (options !== null && options !== void 0 && options.preLoginId) {
720
+ return this.submitToCallDiagnosticsPreLogin(diagnosticEvent, options === null || options === void 0 ? void 0 : options.preLoginId);
721
+ }
722
+ this.validator({
723
+ type: 'ce',
724
+ event: diagnosticEvent
725
+ });
726
+ return this.submitToCallDiagnostics(diagnosticEvent);
727
+ }
728
+
729
+ /**
730
+ * Prepare the event and send the request to metrics-a service.
731
+ * @param event
732
+ * @returns promise
733
+ */
734
+ }, {
735
+ key: "submitToCallDiagnostics",
736
+ value: function submitToCallDiagnostics(event) {
737
+ // build metrics-a event type
738
+ var finalEvent = {
739
+ eventPayload: event,
740
+ type: ['diagnostic-event']
741
+ };
742
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @submitToCallDiagnostics. Preparing to send the request', "finalEvent: ".concat((0, _stringify.default)(finalEvent)));
743
+ return this.callDiagnosticEventsBatcher.request(finalEvent);
744
+ }
745
+
746
+ /**
747
+ * Pre login events are not batched. We make the request directly.
748
+ * @param event
749
+ * @param preLoginId
750
+ * @returns
751
+ */
752
+ }, {
753
+ key: "buildClientEventFetchRequestOptions",
754
+ value:
755
+ /**
756
+ * Builds a request options object to later be passed to fetch().
757
+ * @param arg - submit params
758
+ * @param arg.event - event key
759
+ * @param arg.payload - additional payload to be merged with default payload
760
+ * @param arg.options - client event options
761
+ * @returns {Promise<any>}
762
+ * @throws
763
+ */
764
+ function () {
765
+ var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref8) {
766
+ var name, payload, options, clientEvent, diagnosticEvent, request;
767
+ return _regenerator.default.wrap(function _callee$(_context) {
768
+ while (1) switch (_context.prev = _context.next) {
769
+ case 0:
770
+ name = _ref8.name, payload = _ref8.payload, options = _ref8.options;
771
+ this.logger.log(_config2.CALL_DIAGNOSTIC_LOG_IDENTIFIER, 'CallDiagnosticMetrics: @buildClientEventFetchRequestOptions. Building request options object for fetch()...', "name: ".concat(name), "payload: ".concat((0, _stringify.default)(payload)), "options: ".concat((0, _stringify.default)(options)));
772
+ clientEvent = this.prepareClientEvent({
773
+ name: name,
774
+ payload: payload,
775
+ options: options
776
+ }); // build metrics-a event type
777
+ // @ts-ignore
778
+ diagnosticEvent = (0, _callDiagnosticMetrics.prepareDiagnosticMetricItem)(this.webex, {
779
+ eventPayload: clientEvent,
780
+ type: ['diagnostic-event']
781
+ });
782
+ request = {
783
+ method: 'POST',
784
+ service: 'metrics',
785
+ resource: 'clientmetrics',
786
+ body: {
787
+ metrics: [diagnosticEvent]
788
+ },
789
+ headers: {},
790
+ // @ts-ignore
791
+ waitForServiceTimeout: this.webex.internal.metrics.config.waitForServiceTimeout
792
+ };
793
+ if (options.preLoginId) {
794
+ request.headers = {
795
+ authorization: false,
796
+ 'x-prelogin-userid': options.preLoginId
797
+ };
798
+ request.resource = 'clientmetrics-prelogin';
799
+ }
800
+
801
+ // @ts-ignore
802
+ return _context.abrupt("return", this.webex.prepareFetchOptions(request));
803
+ case 7:
804
+ case "end":
805
+ return _context.stop();
806
+ }
807
+ }, _callee, this);
808
+ }));
809
+ function buildClientEventFetchRequestOptions(_x) {
810
+ return _buildClientEventFetchRequestOptions.apply(this, arguments);
811
+ }
812
+ return buildClientEventFetchRequestOptions;
813
+ }()
814
+ /**
815
+ * Returns true if the specified serviceErrorCode maps to an expected error.
816
+ * @param {number} serviceErrorCode the service error code
817
+ * @returns {boolean}
818
+ */
819
+ }, {
820
+ key: "isServiceErrorExpected",
821
+ value: function isServiceErrorExpected(serviceErrorCode) {
822
+ var clientErrorCode = _config2.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];
823
+ var clientErrorPayload = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
824
+ return (clientErrorPayload === null || clientErrorPayload === void 0 ? void 0 : clientErrorPayload.category) === 'expected';
825
+ }
826
+ }]);
827
+ return CallDiagnosticMetrics;
828
+ }(_webexCore.StatelessWebexPlugin);
829
+ exports.default = CallDiagnosticMetrics;
830
+ //# sourceMappingURL=call-diagnostic-metrics.js.map