@webex/internal-plugin-metrics 3.0.0-beta.21 → 3.0.0-beta.210

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 (67) hide show
  1. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js +56 -0
  2. package/dist/call-diagnostic/call-diagnostic-metrics-batcher.js.map +1 -0
  3. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js +451 -0
  4. package/dist/call-diagnostic/call-diagnostic-metrics-latencies.js.map +1 -0
  5. package/dist/call-diagnostic/call-diagnostic-metrics.js +584 -0
  6. package/dist/call-diagnostic/call-diagnostic-metrics.js.map +1 -0
  7. package/dist/call-diagnostic/call-diagnostic-metrics.util.js +225 -0
  8. package/dist/call-diagnostic/call-diagnostic-metrics.util.js.map +1 -0
  9. package/dist/call-diagnostic/config.js +461 -0
  10. package/dist/call-diagnostic/config.js.map +1 -0
  11. package/dist/call-diagnostic/generated-types-temp/ClientEvent.js +7 -0
  12. package/dist/call-diagnostic/generated-types-temp/ClientEvent.js.map +1 -0
  13. package/dist/call-diagnostic/generated-types-temp/Event.js +7 -0
  14. package/dist/call-diagnostic/generated-types-temp/Event.js.map +1 -0
  15. package/dist/call-diagnostic/generated-types-temp/MediaQualityEvent.js +7 -0
  16. package/dist/call-diagnostic/generated-types-temp/MediaQualityEvent.js.map +1 -0
  17. package/dist/config.js +20 -1
  18. package/dist/config.js.map +1 -1
  19. package/dist/index.js +25 -1
  20. package/dist/index.js.map +1 -1
  21. package/dist/metrics.js +30 -30
  22. package/dist/metrics.js.map +1 -1
  23. package/dist/metrics.types.js +7 -0
  24. package/dist/metrics.types.js.map +1 -0
  25. package/dist/new-metrics.js +249 -0
  26. package/dist/new-metrics.js.map +1 -0
  27. package/dist/types/batcher.d.ts +2 -0
  28. package/dist/types/call-diagnostic/call-diagnostic-metrics-batcher.d.ts +2 -0
  29. package/dist/types/call-diagnostic/call-diagnostic-metrics-latencies.d.ts +189 -0
  30. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +348 -0
  31. package/dist/types/call-diagnostic/call-diagnostic-metrics.util.d.ts +53 -0
  32. package/dist/types/call-diagnostic/config.d.ts +57 -0
  33. package/dist/types/call-diagnostic/generated-types-temp/ClientEvent.d.ts +1112 -0
  34. package/dist/types/call-diagnostic/generated-types-temp/Event.d.ts +4851 -0
  35. package/dist/types/call-diagnostic/generated-types-temp/MediaQualityEvent.d.ts +2121 -0
  36. package/dist/types/client-metrics-batcher.d.ts +2 -0
  37. package/dist/types/config.d.ts +35 -0
  38. package/dist/types/index.d.ts +11 -0
  39. package/dist/types/metrics.d.ts +3 -0
  40. package/dist/types/metrics.types.d.ts +92 -0
  41. package/dist/types/new-metrics.d.ts +119 -0
  42. package/package.json +12 -8
  43. package/src/call-diagnostic/call-diagnostic-metrics-batcher.ts +51 -0
  44. package/src/call-diagnostic/call-diagnostic-metrics-latencies.ts +408 -0
  45. package/src/call-diagnostic/call-diagnostic-metrics.ts +591 -0
  46. package/src/call-diagnostic/call-diagnostic-metrics.util.ts +234 -0
  47. package/src/call-diagnostic/config.ts +455 -0
  48. package/src/call-diagnostic/generated-types-temp/ClientEvent.ts +2395 -0
  49. package/src/call-diagnostic/generated-types-temp/Event.ts +7762 -0
  50. package/src/call-diagnostic/generated-types-temp/MediaQualityEvent.ts +2321 -0
  51. package/src/config.js +19 -0
  52. package/src/index.ts +39 -0
  53. package/src/metrics.js +25 -27
  54. package/src/metrics.types.ts +137 -0
  55. package/src/new-metrics.ts +223 -0
  56. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-batcher.ts +243 -0
  57. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics-latencies.ts +474 -0
  58. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.ts +820 -0
  59. package/test/unit/spec/call-diagnostic/call-diagnostic-metrics.util.ts +336 -0
  60. package/test/unit/spec/metrics.js +65 -97
  61. package/test/unit/spec/new-metrics.ts +153 -0
  62. package/tsconfig.json +6 -0
  63. package/dist/call-diagnostic-events-batcher.js +0 -60
  64. package/dist/call-diagnostic-events-batcher.js.map +0 -1
  65. package/src/call-diagnostic-events-batcher.js +0 -62
  66. package/src/index.js +0 -17
  67. package/test/unit/spec/call-diagnostic-events-batcher.js +0 -195
@@ -0,0 +1,584 @@
1
+ "use strict";
2
+
3
+ var _Reflect$construct = require("@babel/runtime-corejs2/core-js/reflect/construct");
4
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
5
+ var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
6
+ _Object$defineProperty(exports, "__esModule", {
7
+ value: true
8
+ });
9
+ exports.default = void 0;
10
+ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
11
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
12
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
13
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
14
+ var _assertThisInitialized2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/assertThisInitialized"));
15
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
16
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
17
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
18
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
19
+ var _merge2 = _interopRequireDefault(require("lodash/merge"));
20
+ var _internalPluginMetrics = require("@webex/internal-plugin-metrics");
21
+ var _common = require("@webex/common");
22
+ var _uuid = _interopRequireDefault(require("uuid"));
23
+ var _webexCore = require("@webex/webex-core");
24
+ var _callDiagnosticMetrics = require("./call-diagnostic-metrics.util");
25
+ var _config = require("../config");
26
+ var _callDiagnosticMetricsBatcher = _interopRequireDefault(require("./call-diagnostic-metrics-batcher"));
27
+ var _config2 = require("./config");
28
+ 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); }; }
29
+ 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; } }
30
+ var _BrowserDetection = (0, _common.BrowserDetection)(),
31
+ getOSVersion = _BrowserDetection.getOSVersion,
32
+ getBrowserName = _BrowserDetection.getBrowserName,
33
+ getBrowserVersion = _BrowserDetection.getBrowserVersion;
34
+ /**
35
+ * @description Util class to handle Call Analyzer Metrics
36
+ * @export
37
+ * @class CallDiagnosticMetrics
38
+ */
39
+ var CallDiagnosticMetrics = /*#__PURE__*/function (_StatelessWebexPlugin) {
40
+ (0, _inherits2.default)(CallDiagnosticMetrics, _StatelessWebexPlugin);
41
+ var _super = _createSuper(CallDiagnosticMetrics);
42
+ // @ts-ignore
43
+
44
+ /**
45
+ * Constructor
46
+ * @param args
47
+ */
48
+ function CallDiagnosticMetrics() {
49
+ var _this;
50
+ (0, _classCallCheck2.default)(this, CallDiagnosticMetrics);
51
+ for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
52
+ args[_key] = arguments[_key];
53
+ }
54
+ _this = _super.call.apply(_super, [this].concat(args));
55
+ // @ts-ignore
56
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "callDiagnosticEventsBatcher", void 0);
57
+ _this.callDiagnosticEventsBatcher = new _callDiagnosticMetricsBatcher.default({}, {
58
+ parent: _this.webex
59
+ });
60
+ return _this;
61
+ }
62
+
63
+ /**
64
+ * Returns the login type of the current user
65
+ * @returns one of 'login-ci','unverified-guest', null
66
+ */
67
+ (0, _createClass2.default)(CallDiagnosticMetrics, [{
68
+ key: "getCurLoginType",
69
+ value: function getCurLoginType() {
70
+ // @ts-ignore
71
+ if (this.webex.canAuthorize) {
72
+ // @ts-ignore
73
+ return this.webex.credentials.isUnverifiedGuest ? 'unverified-guest' : 'login-ci';
74
+ }
75
+ return null;
76
+ }
77
+
78
+ /**
79
+ * Get origin object for Call Diagnostic Event payload.
80
+ * @param options
81
+ * @param meetingId
82
+ * @returns
83
+ */
84
+ }, {
85
+ key: "getOrigin",
86
+ value: function getOrigin(options, meetingId) {
87
+ var _this$webex$meetings$, _this$webex$meetings$2, _this$webex$meetings$3, _this$webex$meetings$4;
88
+ var defaultClientType = // @ts-ignore
89
+ (_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;
90
+ var defaultSubClientType = // @ts-ignore
91
+ (_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;
92
+ if (defaultClientType && defaultSubClientType || options.clientType && options.subClientType) {
93
+ var _this$webex$meetings, _this$webex$meetings$5, _this$webex$meetings$6;
94
+ var origin = {
95
+ name: 'endpoint',
96
+ networkType: (options === null || options === void 0 ? void 0 : options.networkType) || 'unknown',
97
+ userAgent: (0, _callDiagnosticMetrics.userAgentToString)({
98
+ // @ts-ignore
99
+ clientName: (_this$webex$meetings = this.webex.meetings) === null || _this$webex$meetings === void 0 ? void 0 : (_this$webex$meetings$5 = _this$webex$meetings.metrics) === null || _this$webex$meetings$5 === void 0 ? void 0 : _this$webex$meetings$5.clientName,
100
+ // @ts-ignore
101
+ webexVersion: this.webex.version
102
+ }),
103
+ clientInfo: {
104
+ clientType: (options === null || options === void 0 ? void 0 : options.clientType) || defaultClientType,
105
+ // @ts-ignore
106
+ clientVersion: "".concat(_config.CLIENT_NAME, "/").concat(this.webex.version),
107
+ localNetworkPrefix:
108
+ // @ts-ignore
109
+ (0, _callDiagnosticMetrics.anonymizeIPAddress)((_this$webex$meetings$6 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$6 === void 0 ? void 0 : _this$webex$meetings$6.clientAddress) || undefined,
110
+ osVersion: getOSVersion() || 'unknown',
111
+ subClientType: (options === null || options === void 0 ? void 0 : options.subClientType) || defaultSubClientType,
112
+ os: (0, _internalPluginMetrics.getOSNameInternal)(),
113
+ browser: getBrowserName(),
114
+ browserVersion: getBrowserVersion()
115
+ }
116
+ };
117
+ if (meetingId) {
118
+ // @ts-ignore
119
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
120
+ if (meeting !== null && meeting !== void 0 && meeting.environment) {
121
+ origin.environment = meeting.environment;
122
+ }
123
+ }
124
+ return origin;
125
+ }
126
+ throw new Error("ClientType and SubClientType can't be undefined");
127
+ }
128
+
129
+ /**
130
+ * Gather identifier details for call diagnostic payload.
131
+ * @throws Error if initialization fails.
132
+ * @param options
133
+ */
134
+ }, {
135
+ key: "getIdentifiers",
136
+ value: function getIdentifiers(options) {
137
+ var _meeting$locusInfo;
138
+ var meeting = options.meeting,
139
+ mediaConnections = options.mediaConnections,
140
+ correlationId = options.correlationId;
141
+ var identifiers = {
142
+ correlationId: 'unknown'
143
+ };
144
+ if (meeting) {
145
+ identifiers.correlationId = meeting.correlationId;
146
+ }
147
+ if (correlationId) {
148
+ identifiers.correlationId = correlationId;
149
+ }
150
+ // @ts-ignore
151
+ if (this.webex.internal) {
152
+ // @ts-ignore
153
+ var device = this.webex.internal.device;
154
+ identifiers.userId = device.userId;
155
+ identifiers.deviceId = device.url;
156
+ identifiers.orgId = device.orgId;
157
+ // @ts-ignore
158
+ identifiers.locusUrl = this.webex.internal.services.get('locus');
159
+ }
160
+ if (meeting !== null && meeting !== void 0 && (_meeting$locusInfo = meeting.locusInfo) !== null && _meeting$locusInfo !== void 0 && _meeting$locusInfo.fullState) {
161
+ identifiers.locusUrl = meeting.locusUrl;
162
+ identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();
163
+ identifiers.locusStartTime = meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;
164
+ }
165
+ if (mediaConnections) {
166
+ var _mediaConnections$, _mediaConnections$2;
167
+ identifiers.mediaAgentAlias = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$ = mediaConnections[0]) === null || _mediaConnections$ === void 0 ? void 0 : _mediaConnections$.mediaAgentAlias;
168
+ identifiers.mediaAgentGroupId = mediaConnections === null || mediaConnections === void 0 ? void 0 : (_mediaConnections$2 = mediaConnections[0]) === null || _mediaConnections$2 === void 0 ? void 0 : _mediaConnections$2.mediaAgentGroupId;
169
+ }
170
+ if (identifiers.correlationId === undefined) {
171
+ throw new Error('Identifiers initialization failed.');
172
+ }
173
+ return identifiers;
174
+ }
175
+
176
+ /**
177
+ * Create diagnostic event, which can hold client event, feature event or MQE event data.
178
+ * This just initiates the shared properties that are required for all the 3 event categories.
179
+ * @param eventData
180
+ * @param options
181
+ * @returns
182
+ */
183
+ }, {
184
+ key: "prepareDiagnosticEvent",
185
+ value: function prepareDiagnosticEvent(eventData, options) {
186
+ var _this$webex$meetings$7;
187
+ var meetingId = options.meetingId;
188
+ var origin = this.getOrigin(options, meetingId);
189
+ var event = {
190
+ eventId: _uuid.default.v4(),
191
+ version: 1,
192
+ origin: origin,
193
+ originTime: {
194
+ triggered: new Date().toISOString(),
195
+ // is overridden in prepareRequest batcher
196
+ sent: 'not_defined_yet'
197
+ },
198
+ // @ts-ignore
199
+ senderCountryCode: (_this$webex$meetings$7 = this.webex.meetings.geoHintInfo) === null || _this$webex$meetings$7 === void 0 ? void 0 : _this$webex$meetings$7.countryCode,
200
+ event: eventData
201
+ };
202
+
203
+ // sanitize (remove empty properties, CA requires it)
204
+ // but we don't want to sanitize MQE as most of the times
205
+ // values will be 0, [] etc, and they are required.
206
+ if (eventData.name !== 'client.mediaquality.event') {
207
+ (0, _callDiagnosticMetrics.clearEmptyKeysRecursively)(event);
208
+ }
209
+ return event;
210
+ }
211
+
212
+ /**
213
+ * TODO: NOT IMPLEMENTED
214
+ * Submit Feature Event
215
+ * @returns
216
+ */
217
+ }, {
218
+ key: "submitFeatureEvent",
219
+ value: function submitFeatureEvent() {
220
+ throw Error('Not implemented');
221
+ }
222
+
223
+ /**
224
+ * Submit Media Quality Event
225
+ * @param args - submit params
226
+ * @param arg.name - event key
227
+ * @param arg.payload - additional payload to be merge with the default payload
228
+ * @param arg.options - options
229
+ */
230
+ }, {
231
+ key: "submitMQE",
232
+ value: function submitMQE(_ref) {
233
+ var name = _ref.name,
234
+ payload = _ref.payload,
235
+ options = _ref.options;
236
+ var meetingId = options.meetingId,
237
+ mediaConnections = options.mediaConnections;
238
+
239
+ // events that will most likely happen in join phase
240
+ if (meetingId) {
241
+ // @ts-ignore
242
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
243
+ if (!meeting) {
244
+ console.warn('Attempt to send MQE but no meeting was found...', "event: ".concat(name, ", meetingId: ").concat(meetingId));
245
+ // @ts-ignore
246
+ this.webex.internal.metrics.submitClientMetrics(_config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {
247
+ fields: {
248
+ meetingId: meetingId,
249
+ name: name
250
+ }
251
+ });
252
+ return;
253
+ }
254
+
255
+ // merge identifiers
256
+ var identifiers = this.getIdentifiers({
257
+ meeting: meeting,
258
+ mediaConnections: meeting.mediaConnections || mediaConnections
259
+ });
260
+
261
+ // create media quality event object
262
+ var clientEventObject = {
263
+ name: name,
264
+ canProceed: true,
265
+ identifiers: identifiers,
266
+ eventData: {
267
+ webClientDomain: window.location.hostname
268
+ },
269
+ intervals: payload.intervals,
270
+ sourceMetadata: {
271
+ applicationSoftwareType: _config.CLIENT_NAME,
272
+ // @ts-ignore
273
+ applicationSoftwareVersion: this.webex.version,
274
+ mediaEngineSoftwareType: getBrowserName() || 'browser',
275
+ mediaEngineSoftwareVersion: getOSVersion() || 'unknown',
276
+ startTime: new Date().toISOString()
277
+ }
278
+ };
279
+
280
+ // merge any new properties, or override existing ones
281
+ clientEventObject = (0, _merge2.default)(clientEventObject, payload);
282
+
283
+ // append media quality event data to the call diagnostic event
284
+ var diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);
285
+ this.submitToCallDiagnostics(diagnosticEvent);
286
+ } else {
287
+ throw new Error('Media quality events cant be sent outside the context of a meeting. Meeting id is required.');
288
+ }
289
+ }
290
+
291
+ /**
292
+ * Return Client Event payload by client error code
293
+ * @param arg - get error arg
294
+ * @param arg.clientErrorCode
295
+ * @param arg.serviceErrorCode
296
+ * @returns
297
+ */
298
+ }, {
299
+ key: "getErrorPayloadForClientErrorCode",
300
+ value: function getErrorPayloadForClientErrorCode(_ref2) {
301
+ var clientErrorCode = _ref2.clientErrorCode,
302
+ serviceErrorCode = _ref2.serviceErrorCode;
303
+ var error;
304
+ if (clientErrorCode) {
305
+ var partialParsedError = _config2.CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];
306
+ if (partialParsedError) {
307
+ error = (0, _merge2.default)({
308
+ fatal: true,
309
+ shownToUser: false,
310
+ name: 'other',
311
+ category: 'other'
312
+ },
313
+ // default values
314
+ {
315
+ errorCode: clientErrorCode
316
+ }, {
317
+ serviceErrorCode: serviceErrorCode
318
+ }, partialParsedError);
319
+ return error;
320
+ }
321
+ }
322
+ return undefined;
323
+ }
324
+
325
+ /**
326
+ * Generate error payload for Client Event
327
+ * @param rawError
328
+ */
329
+ }, {
330
+ key: "generateClientEventErrorPayload",
331
+ value: function generateClientEventErrorPayload(rawError) {
332
+ var _rawError$body, _rawError$body2;
333
+ var serviceErrorCode = (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);
334
+ if (serviceErrorCode) {
335
+ var clientErrorCode = _config2.SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];
336
+ if (clientErrorCode) {
337
+ return this.getErrorPayloadForClientErrorCode({
338
+ clientErrorCode: clientErrorCode,
339
+ serviceErrorCode: serviceErrorCode
340
+ });
341
+ }
342
+
343
+ // by default, if it is locus error, return nre locus err
344
+ if ((0, _callDiagnosticMetrics.isLocusServiceErrorCode)(serviceErrorCode)) {
345
+ return this.getErrorPayloadForClientErrorCode({
346
+ clientErrorCode: _config2.NEW_LOCUS_ERROR_CLIENT_CODE,
347
+ serviceErrorCode: serviceErrorCode
348
+ });
349
+ }
350
+
351
+ // otherwise return meeting info
352
+ return this.getErrorPayloadForClientErrorCode({
353
+ clientErrorCode: _config2.MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,
354
+ serviceErrorCode: serviceErrorCode
355
+ });
356
+ }
357
+ return undefined;
358
+ }
359
+
360
+ /**
361
+ * Create client event object for in meeting events
362
+ * @param arg - create args
363
+ * @param arg.event - event key
364
+ * @param arg.options - options
365
+ * @returns object
366
+ */
367
+ }, {
368
+ key: "createClientEventObjectInMeeting",
369
+ value: function createClientEventObjectInMeeting(_ref3) {
370
+ var name = _ref3.name,
371
+ options = _ref3.options;
372
+ var meetingId = options.meetingId,
373
+ mediaConnections = options.mediaConnections,
374
+ rawError = options.rawError;
375
+
376
+ // @ts-ignore
377
+ var meeting = this.webex.meetings.meetingCollection.get(meetingId);
378
+ if (!meeting) {
379
+ console.warn('Attempt to send client event but no meeting was found...', "event: ".concat(name, ", meetingId: ").concat(meetingId));
380
+ // @ts-ignore
381
+ this.webex.internal.metrics.submitClientMetrics(_config2.CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {
382
+ fields: {
383
+ meetingId: meetingId,
384
+ name: name
385
+ }
386
+ });
387
+ return undefined;
388
+ }
389
+
390
+ // grab identifiers
391
+ var identifiers = this.getIdentifiers({
392
+ meeting: meeting,
393
+ mediaConnections: (meeting === null || meeting === void 0 ? void 0 : meeting.mediaConnections) || mediaConnections
394
+ });
395
+
396
+ // check if we need to generate errors
397
+ var errors = [];
398
+ if (rawError) {
399
+ var generatedError = this.generateClientEventErrorPayload(rawError);
400
+ if (generatedError) {
401
+ errors.push(generatedError);
402
+ }
403
+ }
404
+
405
+ // create client event object
406
+ var clientEventObject = {
407
+ name: name,
408
+ canProceed: true,
409
+ identifiers: identifiers,
410
+ errors: errors,
411
+ eventData: {
412
+ webClientDomain: window.location.hostname
413
+ },
414
+ userType: meeting.getCurUserType(),
415
+ loginType: this.getCurLoginType()
416
+ };
417
+ return clientEventObject;
418
+ }
419
+
420
+ /**
421
+ * Create client event object for pre meeting events
422
+ * @param arg - create args
423
+ * @param arg.event - event key
424
+ * @param arg.options - payload
425
+ * @returns object
426
+ */
427
+ }, {
428
+ key: "createClientEventObjectPreMeeting",
429
+ value: function createClientEventObjectPreMeeting(_ref4) {
430
+ var name = _ref4.name,
431
+ options = _ref4.options;
432
+ var correlationId = options.correlationId;
433
+
434
+ // grab identifiers
435
+ var identifiers = this.getIdentifiers({
436
+ correlationId: correlationId
437
+ });
438
+
439
+ // create client event object
440
+ var clientEventObject = {
441
+ name: name,
442
+ canProceed: true,
443
+ identifiers: identifiers,
444
+ eventData: {
445
+ webClientDomain: window.location.hostname
446
+ },
447
+ loginType: this.getCurLoginType()
448
+ };
449
+ return clientEventObject;
450
+ }
451
+
452
+ /**
453
+ * Prepare Client Event CA event.
454
+ * @param arg - submit params
455
+ * @param arg.event - event key
456
+ * @param arg.payload - additional payload to be merged with default payload
457
+ * @param arg.options - payload
458
+ * @returns {any} options to be with fetch
459
+ * @throws
460
+ */
461
+ }, {
462
+ key: "prepareClientEvent",
463
+ value: function prepareClientEvent(_ref5) {
464
+ var name = _ref5.name,
465
+ payload = _ref5.payload,
466
+ options = _ref5.options;
467
+ var meetingId = options.meetingId,
468
+ correlationId = options.correlationId;
469
+ var clientEventObject;
470
+
471
+ // events that will most likely happen in join phase
472
+ if (meetingId) {
473
+ clientEventObject = this.createClientEventObjectInMeeting({
474
+ name: name,
475
+ options: options
476
+ });
477
+ } else if (correlationId) {
478
+ // any pre join events or events that are outside the meeting.
479
+ clientEventObject = this.createClientEventObjectPreMeeting({
480
+ name: name,
481
+ options: options
482
+ });
483
+ } else {
484
+ throw new Error('Not implemented');
485
+ }
486
+
487
+ // merge any new properties, or override existing ones
488
+ clientEventObject = (0, _merge2.default)(clientEventObject, payload);
489
+
490
+ // append client event data to the call diagnostic event
491
+ var diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);
492
+ return diagnosticEvent;
493
+ }
494
+
495
+ /**
496
+ * Submit Client Event CA event.
497
+ * @param arg - submit params
498
+ * @param arg.event - event key
499
+ * @param arg.payload - additional payload to be merged with default payload
500
+ * @param arg.options - payload
501
+ * @throws
502
+ */
503
+ }, {
504
+ key: "submitClientEvent",
505
+ value: function submitClientEvent(_ref6) {
506
+ var name = _ref6.name,
507
+ payload = _ref6.payload,
508
+ options = _ref6.options;
509
+ var diagnosticEvent = this.prepareClientEvent({
510
+ name: name,
511
+ payload: payload,
512
+ options: options
513
+ });
514
+ return this.submitToCallDiagnostics(diagnosticEvent);
515
+ }
516
+
517
+ /**
518
+ * Prepare the event and send the request to metrics-a service.
519
+ * @param event
520
+ * @returns promise
521
+ */
522
+ }, {
523
+ key: "submitToCallDiagnostics",
524
+ value: function submitToCallDiagnostics(event) {
525
+ // build metrics-a event type
526
+ var finalEvent = {
527
+ eventPayload: event,
528
+ type: ['diagnostic-event']
529
+ };
530
+ return this.callDiagnosticEventsBatcher.request(finalEvent);
531
+ }
532
+
533
+ /**
534
+ * Builds a request options object to later be passed to fetch().
535
+ * @param arg - submit params
536
+ * @param arg.event - event key
537
+ * @param arg.payload - additional payload to be merged with default payload
538
+ * @param arg.options - client event options
539
+ * @returns {Promise<any>}
540
+ * @throws
541
+ */
542
+ }, {
543
+ key: "buildClientEventFetchRequestOptions",
544
+ value: function () {
545
+ var _buildClientEventFetchRequestOptions = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref7) {
546
+ var name, payload, options, clientEvent, diagnosticEvent;
547
+ return _regenerator.default.wrap(function _callee$(_context) {
548
+ while (1) switch (_context.prev = _context.next) {
549
+ case 0:
550
+ name = _ref7.name, payload = _ref7.payload, options = _ref7.options;
551
+ clientEvent = this.prepareClientEvent({
552
+ name: name,
553
+ payload: payload,
554
+ options: options
555
+ }); // build metrics-a event type
556
+ // @ts-ignore
557
+ diagnosticEvent = (0, _callDiagnosticMetrics.prepareDiagnosticMetricItem)(this.webex, {
558
+ eventPayload: clientEvent,
559
+ type: ['diagnostic-event']
560
+ }); // @ts-ignore
561
+ return _context.abrupt("return", this.webex.prepareFetchOptions({
562
+ method: 'POST',
563
+ service: 'metrics',
564
+ resource: 'clientmetrics',
565
+ body: {
566
+ metrics: [diagnosticEvent]
567
+ }
568
+ }));
569
+ case 4:
570
+ case "end":
571
+ return _context.stop();
572
+ }
573
+ }, _callee, this);
574
+ }));
575
+ function buildClientEventFetchRequestOptions(_x) {
576
+ return _buildClientEventFetchRequestOptions.apply(this, arguments);
577
+ }
578
+ return buildClientEventFetchRequestOptions;
579
+ }()
580
+ }]);
581
+ return CallDiagnosticMetrics;
582
+ }(_webexCore.StatelessWebexPlugin);
583
+ exports.default = CallDiagnosticMetrics;
584
+ //# sourceMappingURL=call-diagnostic-metrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["BrowserDetection","getOSVersion","getBrowserName","getBrowserVersion","CallDiagnosticMetrics","args","callDiagnosticEventsBatcher","CallDiagnosticEventsBatcher","parent","webex","canAuthorize","credentials","isUnverifiedGuest","options","meetingId","defaultClientType","meetings","config","metrics","clientType","defaultSubClientType","subClientType","origin","name","networkType","userAgent","userAgentToString","clientName","webexVersion","version","clientInfo","clientVersion","CLIENT_NAME","localNetworkPrefix","anonymizeIPAddress","geoHintInfo","clientAddress","undefined","osVersion","os","getOSNameInternal","browser","browserVersion","meeting","meetingCollection","get","environment","Error","mediaConnections","correlationId","identifiers","internal","device","userId","deviceId","url","orgId","locusUrl","services","locusInfo","fullState","locusId","split","pop","locusStartTime","lastActive","mediaAgentAlias","mediaAgentGroupId","eventData","getOrigin","event","eventId","uuid","v4","originTime","triggered","Date","toISOString","sent","senderCountryCode","countryCode","clearEmptyKeysRecursively","payload","console","warn","submitClientMetrics","CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND","fields","getIdentifiers","clientEventObject","canProceed","webClientDomain","window","location","hostname","intervals","sourceMetadata","applicationSoftwareType","applicationSoftwareVersion","mediaEngineSoftwareType","mediaEngineSoftwareVersion","startTime","diagnosticEvent","prepareDiagnosticEvent","submitToCallDiagnostics","clientErrorCode","serviceErrorCode","error","partialParsedError","CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD","fatal","shownToUser","category","errorCode","rawError","body","code","SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP","getErrorPayloadForClientErrorCode","isLocusServiceErrorCode","NEW_LOCUS_ERROR_CLIENT_CODE","MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE","errors","generatedError","generateClientEventErrorPayload","push","userType","getCurUserType","loginType","getCurLoginType","createClientEventObjectInMeeting","createClientEventObjectPreMeeting","prepareClientEvent","finalEvent","eventPayload","type","request","clientEvent","prepareDiagnosticMetricItem","prepareFetchOptions","method","service","resource","StatelessWebexPlugin"],"sources":["call-diagnostic-metrics.ts"],"sourcesContent":["/* eslint-disable @typescript-eslint/no-unused-vars */\n/* eslint-disable class-methods-use-this */\n/* eslint-disable valid-jsdoc */\nimport {getOSNameInternal} from '@webex/internal-plugin-metrics';\nimport {BrowserDetection} from '@webex/common';\nimport uuid from 'uuid';\nimport {merge} from 'lodash';\nimport {StatelessWebexPlugin} from '@webex/webex-core';\n\nimport {\n anonymizeIPAddress,\n clearEmptyKeysRecursively,\n isLocusServiceErrorCode,\n prepareDiagnosticMetricItem,\n userAgentToString,\n} from './call-diagnostic-metrics.util';\nimport {CLIENT_NAME} from '../config';\nimport {\n RecursivePartial,\n Event,\n ClientType,\n SubClientType,\n NetworkType,\n ClientEvent,\n SubmitClientEventOptions,\n MediaQualityEvent,\n SubmitMQEOptions,\n SubmitMQEPayload,\n ClientEventError,\n ClientEventPayload,\n} from '../metrics.types';\nimport CallDiagnosticEventsBatcher from './call-diagnostic-metrics-batcher';\nimport {\n CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD,\n CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND,\n MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,\n NEW_LOCUS_ERROR_CLIENT_CODE,\n SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP,\n} from './config';\n\nconst {getOSVersion, getBrowserName, getBrowserVersion} = BrowserDetection();\n\ntype GetOriginOptions = {\n clientType: ClientType;\n subClientType: SubClientType;\n networkType?: NetworkType;\n};\n\ntype GetIdentifiersOptions = {\n meeting?: any;\n mediaConnections?: any[];\n correlationId?: string;\n};\n\n/**\n * @description Util class to handle Call Analyzer Metrics\n * @export\n * @class CallDiagnosticMetrics\n */\nexport default class CallDiagnosticMetrics extends StatelessWebexPlugin {\n // @ts-ignore\n private callDiagnosticEventsBatcher: CallDiagnosticEventsBatcher;\n\n /**\n * Constructor\n * @param args\n */\n constructor(...args) {\n super(...args);\n // @ts-ignore\n this.callDiagnosticEventsBatcher = new CallDiagnosticEventsBatcher({}, {parent: this.webex});\n }\n\n /**\n * Returns the login type of the current user\n * @returns one of 'login-ci','unverified-guest', null\n */\n getCurLoginType() {\n // @ts-ignore\n if (this.webex.canAuthorize) {\n // @ts-ignore\n return this.webex.credentials.isUnverifiedGuest ? 'unverified-guest' : 'login-ci';\n }\n\n return null;\n }\n\n /**\n * Get origin object for Call Diagnostic Event payload.\n * @param options\n * @param meetingId\n * @returns\n */\n getOrigin(options: GetOriginOptions, meetingId?: string) {\n const defaultClientType: ClientType =\n // @ts-ignore\n this.webex.meetings.config?.metrics?.clientType;\n const defaultSubClientType: SubClientType =\n // @ts-ignore\n this.webex.meetings.config?.metrics?.subClientType;\n\n if (\n (defaultClientType && defaultSubClientType) ||\n (options.clientType && options.subClientType)\n ) {\n const origin: Event['origin'] = {\n name: 'endpoint',\n networkType: options?.networkType || 'unknown',\n userAgent: userAgentToString({\n // @ts-ignore\n clientName: this.webex.meetings?.metrics?.clientName,\n // @ts-ignore\n webexVersion: this.webex.version,\n }),\n clientInfo: {\n clientType: options?.clientType || defaultClientType,\n // @ts-ignore\n clientVersion: `${CLIENT_NAME}/${this.webex.version}`,\n localNetworkPrefix:\n // @ts-ignore\n anonymizeIPAddress(this.webex.meetings.geoHintInfo?.clientAddress) || undefined,\n osVersion: getOSVersion() || 'unknown',\n subClientType: options?.subClientType || defaultSubClientType,\n os: getOSNameInternal(),\n browser: getBrowserName(),\n browserVersion: getBrowserVersion(),\n },\n };\n\n if (meetingId) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n if (meeting?.environment) {\n origin.environment = meeting.environment;\n }\n }\n\n return origin;\n }\n\n throw new Error(\"ClientType and SubClientType can't be undefined\");\n }\n\n /**\n * Gather identifier details for call diagnostic payload.\n * @throws Error if initialization fails.\n * @param options\n */\n getIdentifiers(options: GetIdentifiersOptions) {\n const {meeting, mediaConnections, correlationId} = options;\n const identifiers: Event['event']['identifiers'] = {correlationId: 'unknown'};\n\n if (meeting) {\n identifiers.correlationId = meeting.correlationId;\n }\n\n if (correlationId) {\n identifiers.correlationId = correlationId;\n }\n // @ts-ignore\n if (this.webex.internal) {\n // @ts-ignore\n const {device} = this.webex.internal;\n identifiers.userId = device.userId;\n identifiers.deviceId = device.url;\n identifiers.orgId = device.orgId;\n // @ts-ignore\n identifiers.locusUrl = this.webex.internal.services.get('locus');\n }\n\n if (meeting?.locusInfo?.fullState) {\n identifiers.locusUrl = meeting.locusUrl;\n identifiers.locusId = meeting.locusUrl && meeting.locusUrl.split('/').pop();\n identifiers.locusStartTime =\n meeting.locusInfo.fullState && meeting.locusInfo.fullState.lastActive;\n }\n\n if (mediaConnections) {\n identifiers.mediaAgentAlias = mediaConnections?.[0]?.mediaAgentAlias;\n identifiers.mediaAgentGroupId = mediaConnections?.[0]?.mediaAgentGroupId;\n }\n\n if (identifiers.correlationId === undefined) {\n throw new Error('Identifiers initialization failed.');\n }\n\n return identifiers;\n }\n\n /**\n * Create diagnostic event, which can hold client event, feature event or MQE event data.\n * This just initiates the shared properties that are required for all the 3 event categories.\n * @param eventData\n * @param options\n * @returns\n */\n prepareDiagnosticEvent(eventData: Event['event'], options: any) {\n const {meetingId} = options;\n const origin = this.getOrigin(options, meetingId);\n\n const event: Event = {\n eventId: uuid.v4(),\n version: 1,\n origin,\n originTime: {\n triggered: new Date().toISOString(),\n // is overridden in prepareRequest batcher\n sent: 'not_defined_yet',\n },\n // @ts-ignore\n senderCountryCode: this.webex.meetings.geoHintInfo?.countryCode,\n event: eventData,\n };\n\n // sanitize (remove empty properties, CA requires it)\n // but we don't want to sanitize MQE as most of the times\n // values will be 0, [] etc, and they are required.\n if (eventData.name !== 'client.mediaquality.event') {\n clearEmptyKeysRecursively(event);\n }\n\n return event;\n }\n\n /**\n * TODO: NOT IMPLEMENTED\n * Submit Feature Event\n * @returns\n */\n public submitFeatureEvent() {\n throw Error('Not implemented');\n }\n\n /**\n * Submit Media Quality Event\n * @param args - submit params\n * @param arg.name - event key\n * @param arg.payload - additional payload to be merge with the default payload\n * @param arg.options - options\n */\n submitMQE({\n name,\n payload,\n options,\n }: {\n name: MediaQualityEvent['name'];\n payload: SubmitMQEPayload;\n options: SubmitMQEOptions;\n }) {\n const {meetingId, mediaConnections} = options;\n\n // events that will most likely happen in join phase\n if (meetingId) {\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n\n if (!meeting) {\n console.warn(\n 'Attempt to send MQE but no meeting was found...',\n `event: ${name}, meetingId: ${meetingId}`\n );\n // @ts-ignore\n this.webex.internal.metrics.submitClientMetrics(CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {\n fields: {\n meetingId,\n name,\n },\n });\n\n return;\n }\n\n // merge identifiers\n const identifiers = this.getIdentifiers({\n meeting,\n mediaConnections: meeting.mediaConnections || mediaConnections,\n });\n\n // create media quality event object\n let clientEventObject: MediaQualityEvent['payload'] = {\n name,\n canProceed: true,\n identifiers,\n eventData: {\n webClientDomain: window.location.hostname,\n },\n intervals: payload.intervals,\n sourceMetadata: {\n applicationSoftwareType: CLIENT_NAME,\n // @ts-ignore\n applicationSoftwareVersion: this.webex.version,\n mediaEngineSoftwareType: getBrowserName() || 'browser',\n mediaEngineSoftwareVersion: getOSVersion() || 'unknown',\n startTime: new Date().toISOString(),\n },\n };\n\n // merge any new properties, or override existing ones\n clientEventObject = merge(clientEventObject, payload);\n\n // append media quality event data to the call diagnostic event\n const diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);\n this.submitToCallDiagnostics(diagnosticEvent);\n } else {\n throw new Error(\n 'Media quality events cant be sent outside the context of a meeting. Meeting id is required.'\n );\n }\n }\n\n /**\n * Return Client Event payload by client error code\n * @param arg - get error arg\n * @param arg.clientErrorCode\n * @param arg.serviceErrorCode\n * @returns\n */\n public getErrorPayloadForClientErrorCode({\n clientErrorCode,\n serviceErrorCode,\n }: {\n clientErrorCode: number;\n serviceErrorCode: any;\n }): ClientEventError {\n let error: ClientEventError;\n\n if (clientErrorCode) {\n const partialParsedError = CLIENT_ERROR_CODE_TO_ERROR_PAYLOAD[clientErrorCode];\n\n if (partialParsedError) {\n error = merge(\n {fatal: true, shownToUser: false, name: 'other', category: 'other'}, // default values\n {errorCode: clientErrorCode},\n {serviceErrorCode},\n partialParsedError\n );\n\n return error;\n }\n }\n\n return undefined;\n }\n\n /**\n * Generate error payload for Client Event\n * @param rawError\n */\n generateClientEventErrorPayload(rawError: any) {\n const serviceErrorCode = rawError?.body?.errorCode || rawError?.body?.code;\n if (serviceErrorCode) {\n const clientErrorCode = SERVICE_ERROR_CODES_TO_CLIENT_ERROR_CODES_MAP[serviceErrorCode];\n if (clientErrorCode) {\n return this.getErrorPayloadForClientErrorCode({clientErrorCode, serviceErrorCode});\n }\n\n // by default, if it is locus error, return nre locus err\n if (isLocusServiceErrorCode(serviceErrorCode)) {\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: NEW_LOCUS_ERROR_CLIENT_CODE,\n serviceErrorCode,\n });\n }\n\n // otherwise return meeting info\n return this.getErrorPayloadForClientErrorCode({\n clientErrorCode: MEETING_INFO_LOOKUP_ERROR_CLIENT_CODE,\n serviceErrorCode,\n });\n }\n\n return undefined;\n }\n\n /**\n * Create client event object for in meeting events\n * @param arg - create args\n * @param arg.event - event key\n * @param arg.options - options\n * @returns object\n */\n private createClientEventObjectInMeeting({\n name,\n options,\n }: {\n name: ClientEvent['name'];\n options?: SubmitClientEventOptions;\n }) {\n const {meetingId, mediaConnections, rawError} = options;\n\n // @ts-ignore\n const meeting = this.webex.meetings.meetingCollection.get(meetingId);\n\n if (!meeting) {\n console.warn(\n 'Attempt to send client event but no meeting was found...',\n `event: ${name}, meetingId: ${meetingId}`\n );\n // @ts-ignore\n this.webex.internal.metrics.submitClientMetrics(CALL_DIAGNOSTIC_EVENT_FAILED_TO_SEND, {\n fields: {\n meetingId,\n name,\n },\n });\n\n return undefined;\n }\n\n // grab identifiers\n const identifiers = this.getIdentifiers({\n meeting,\n mediaConnections: meeting?.mediaConnections || mediaConnections,\n });\n\n // check if we need to generate errors\n const errors: ClientEvent['payload']['errors'] = [];\n\n if (rawError) {\n const generatedError = this.generateClientEventErrorPayload(rawError);\n if (generatedError) {\n errors.push(generatedError);\n }\n }\n\n // create client event object\n const clientEventObject: ClientEvent['payload'] = {\n name,\n canProceed: true,\n identifiers,\n errors,\n eventData: {\n webClientDomain: window.location.hostname,\n },\n userType: meeting.getCurUserType(),\n loginType: this.getCurLoginType(),\n };\n\n return clientEventObject;\n }\n\n /**\n * Create client event object for pre meeting events\n * @param arg - create args\n * @param arg.event - event key\n * @param arg.options - payload\n * @returns object\n */\n private createClientEventObjectPreMeeting({\n name,\n options,\n }: {\n name: ClientEvent['name'];\n options?: SubmitClientEventOptions;\n }) {\n const {correlationId} = options;\n\n // grab identifiers\n const identifiers = this.getIdentifiers({\n correlationId,\n });\n\n // create client event object\n const clientEventObject: ClientEvent['payload'] = {\n name,\n canProceed: true,\n identifiers,\n eventData: {\n webClientDomain: window.location.hostname,\n },\n loginType: this.getCurLoginType(),\n };\n\n return clientEventObject;\n }\n\n /**\n * Prepare Client Event CA event.\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - payload\n * @returns {any} options to be with fetch\n * @throws\n */\n private prepareClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: ClientEventPayload;\n options?: SubmitClientEventOptions;\n }) {\n const {meetingId, correlationId} = options;\n let clientEventObject: ClientEvent['payload'];\n\n // events that will most likely happen in join phase\n if (meetingId) {\n clientEventObject = this.createClientEventObjectInMeeting({name, options});\n } else if (correlationId) {\n // any pre join events or events that are outside the meeting.\n clientEventObject = this.createClientEventObjectPreMeeting({name, options});\n } else {\n throw new Error('Not implemented');\n }\n\n // merge any new properties, or override existing ones\n clientEventObject = merge(clientEventObject, payload);\n\n // append client event data to the call diagnostic event\n const diagnosticEvent = this.prepareDiagnosticEvent(clientEventObject, options);\n\n return diagnosticEvent;\n }\n\n /**\n * Submit Client Event CA event.\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - payload\n * @throws\n */\n public submitClientEvent({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: ClientEventPayload;\n options?: SubmitClientEventOptions;\n }) {\n const diagnosticEvent = this.prepareClientEvent({name, payload, options});\n\n return this.submitToCallDiagnostics(diagnosticEvent);\n }\n\n /**\n * Prepare the event and send the request to metrics-a service.\n * @param event\n * @returns promise\n */\n submitToCallDiagnostics(event: Event): Promise<any> {\n // build metrics-a event type\n const finalEvent = {\n eventPayload: event,\n type: ['diagnostic-event'],\n };\n\n return this.callDiagnosticEventsBatcher.request(finalEvent);\n }\n\n /**\n * Builds a request options object to later be passed to fetch().\n * @param arg - submit params\n * @param arg.event - event key\n * @param arg.payload - additional payload to be merged with default payload\n * @param arg.options - client event options\n * @returns {Promise<any>}\n * @throws\n */\n public async buildClientEventFetchRequestOptions({\n name,\n payload,\n options,\n }: {\n name: ClientEvent['name'];\n payload?: ClientEventPayload;\n options?: SubmitClientEventOptions;\n }): Promise<any> {\n const clientEvent = this.prepareClientEvent({name, payload, options});\n\n // build metrics-a event type\n // @ts-ignore\n const diagnosticEvent = prepareDiagnosticMetricItem(this.webex, {\n eventPayload: clientEvent,\n type: ['diagnostic-event'],\n });\n\n // @ts-ignore\n return this.webex.prepareFetchOptions({\n method: 'POST',\n service: 'metrics',\n resource: 'clientmetrics',\n body: {\n metrics: [diagnosticEvent],\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAGA;AACA;AACA;AAEA;AAEA;AAOA;AAeA;AACA;AAMkB;AAAA;AAElB,wBAA0D,IAAAA,wBAAgB,GAAE;EAArEC,YAAY,qBAAZA,YAAY;EAAEC,cAAc,qBAAdA,cAAc;EAAEC,iBAAiB,qBAAjBA,iBAAiB;AActD;AACA;AACA;AACA;AACA;AAJA,IAKqBC,qBAAqB;EAAA;EAAA;EACxC;;EAGA;AACF;AACA;AACA;EACE,iCAAqB;IAAA;IAAA;IAAA,kCAANC,IAAI;MAAJA,IAAI;IAAA;IACjB,gDAASA,IAAI;IACb;IAAA;IACA,MAAKC,2BAA2B,GAAG,IAAIC,qCAA2B,C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