@webex/internal-plugin-metrics 3.4.0-next.1 → 3.4.0-next.3

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 (40) hide show
  1. package/dist/behavioral-metrics.js +63 -0
  2. package/dist/behavioral-metrics.js.map +1 -0
  3. package/dist/business-metrics.js +62 -0
  4. package/dist/business-metrics.js.map +1 -0
  5. package/dist/{behavioral/behavioral-metrics.js → generic-metrics.js} +77 -92
  6. package/dist/generic-metrics.js.map +1 -0
  7. package/dist/index.js +15 -1
  8. package/dist/index.js.map +1 -1
  9. package/dist/metrics.js +1 -1
  10. package/dist/metrics.types.js.map +1 -1
  11. package/dist/new-metrics.js +92 -24
  12. package/dist/new-metrics.js.map +1 -1
  13. package/dist/operational-metrics.js +56 -0
  14. package/dist/operational-metrics.js.map +1 -0
  15. package/dist/types/behavioral-metrics.d.ts +25 -0
  16. package/dist/types/business-metrics.d.ts +19 -0
  17. package/dist/types/call-diagnostic/call-diagnostic-metrics.d.ts +2 -2
  18. package/dist/types/generic-metrics.d.ts +63 -0
  19. package/dist/types/index.d.ts +4 -2
  20. package/dist/types/metrics.types.d.ts +25 -14
  21. package/dist/types/new-metrics.d.ts +29 -9
  22. package/dist/types/operational-metrics.d.ts +19 -0
  23. package/package.json +11 -11
  24. package/src/behavioral-metrics.ts +40 -0
  25. package/src/business-metrics.ts +30 -0
  26. package/src/generic-metrics.ts +146 -0
  27. package/src/index.ts +5 -1
  28. package/src/metrics.types.ts +29 -16
  29. package/src/new-metrics.ts +68 -17
  30. package/src/operational-metrics.ts +24 -0
  31. package/test/unit/spec/behavioral/behavioral-metrics.ts +51 -10
  32. package/test/unit/spec/business/business-metrics.ts +120 -0
  33. package/test/unit/spec/operational/operational-metrics.ts +115 -0
  34. package/dist/behavioral/behavioral-metrics.js.map +0 -1
  35. package/dist/behavioral/config.js +0 -11
  36. package/dist/behavioral/config.js.map +0 -1
  37. package/dist/types/behavioral/behavioral-metrics.d.ts +0 -63
  38. package/dist/types/behavioral/config.d.ts +0 -1
  39. package/src/behavioral/behavioral-metrics.ts +0 -179
  40. package/src/behavioral/config.ts +0 -3
@@ -0,0 +1,63 @@
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 _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
11
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
12
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
13
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
14
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
15
+ var _genericMetrics = _interopRequireDefault(require("./generic-metrics"));
16
+ 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); }; }
17
+ 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; } }
18
+ /**
19
+ * @description Util class to handle Behavioral Metrics
20
+ * @export
21
+ * @class BehavioralMetrics
22
+ */
23
+ var BehavioralMetrics = exports.default = /*#__PURE__*/function (_GenericMetrics) {
24
+ (0, _inherits2.default)(BehavioralMetrics, _GenericMetrics);
25
+ var _super = _createSuper(BehavioralMetrics);
26
+ function BehavioralMetrics() {
27
+ (0, _classCallCheck2.default)(this, BehavioralMetrics);
28
+ return _super.apply(this, arguments);
29
+ }
30
+ (0, _createClass2.default)(BehavioralMetrics, [{
31
+ key: "submitBehavioralEvent",
32
+ value:
33
+ /**
34
+ * Submit a behavioral metric to our metrics endpoint.
35
+ * @param {MetricEventProduct} product the product from which the metric is being submitted, e.g. 'webex' web client, 'wxcc_desktop'
36
+ * @param {MetricEventAgent} agent the source of the action for this metric
37
+ * @param {string} target the 'thing' that this metric includes information about
38
+ * @param {MetricEventVerb} verb the action that this metric includes information about
39
+ * @param {EventPayload} payload information specific to this event. This should be flat, i.e. it should not include nested objects.
40
+ * @returns {Promise<any>}
41
+ */
42
+ function submitBehavioralEvent(_ref) {
43
+ var product = _ref.product,
44
+ agent = _ref.agent,
45
+ target = _ref.target,
46
+ verb = _ref.verb,
47
+ payload = _ref.payload;
48
+ var name = "".concat(product, ".").concat(agent, ".").concat(target, ".").concat(verb);
49
+ var event = this.createTaggedEventObject({
50
+ type: ['behavioral'],
51
+ name: name,
52
+ payload: payload
53
+ });
54
+ this.submitEvent({
55
+ kind: 'behavioral-events -> ',
56
+ name: name,
57
+ event: event
58
+ });
59
+ }
60
+ }]);
61
+ return BehavioralMetrics;
62
+ }(_genericMetrics.default);
63
+ //# sourceMappingURL=behavioral-metrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_genericMetrics","_interopRequireDefault","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","BehavioralMetrics","exports","_GenericMetrics","_inherits2","_super","_classCallCheck2","_createClass2","key","value","submitBehavioralEvent","_ref","product","agent","target","verb","payload","name","concat","event","createTaggedEventObject","type","submitEvent","kind","GenericMetrics"],"sources":["behavioral-metrics.ts"],"sourcesContent":["import {MetricEventProduct, MetricEventAgent, MetricEventVerb, EventPayload} from './metrics.types';\nimport GenericMetrics from './generic-metrics';\n\n/**\n * @description Util class to handle Behavioral Metrics\n * @export\n * @class BehavioralMetrics\n */\nexport default class BehavioralMetrics extends GenericMetrics {\n /**\n * Submit a behavioral metric to our metrics endpoint.\n * @param {MetricEventProduct} product the product from which the metric is being submitted, e.g. 'webex' web client, 'wxcc_desktop'\n * @param {MetricEventAgent} agent the source of the action for this metric\n * @param {string} target the 'thing' that this metric includes information about\n * @param {MetricEventVerb} verb the action that this metric includes information about\n * @param {EventPayload} payload information specific to this event. This should be flat, i.e. it should not include nested objects.\n * @returns {Promise<any>}\n */\n public submitBehavioralEvent({\n product,\n agent,\n target,\n verb,\n payload,\n }: {\n product: MetricEventProduct;\n agent: MetricEventAgent;\n target: string;\n verb: MetricEventVerb;\n payload?: EventPayload;\n }) {\n const name = `${product}.${agent}.${target}.${verb}`;\n const event = this.createTaggedEventObject({\n type: ['behavioral'],\n name,\n payload,\n });\n this.submitEvent({kind: 'behavioral-events -> ', name, event});\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AACA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+C,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ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IAChE;EAAC;EAAA,OAAAlB,iBAAA;AAAA,EA9B4CuB,uBAAc"}
@@ -0,0 +1,62 @@
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 _now = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/date/now"));
11
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/classCallCheck"));
12
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/createClass"));
13
+ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/inherits"));
14
+ var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
15
+ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
16
+ var _genericMetrics = _interopRequireDefault(require("./generic-metrics"));
17
+ 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); }; }
18
+ 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; } }
19
+ /**
20
+ * @description Util class to handle Buisness Metrics
21
+ * @export
22
+ * @class BusinessMetrics
23
+ */
24
+ var BusinessMetrics = exports.default = /*#__PURE__*/function (_GenericMetrics) {
25
+ (0, _inherits2.default)(BusinessMetrics, _GenericMetrics);
26
+ var _super = _createSuper(BusinessMetrics);
27
+ function BusinessMetrics() {
28
+ (0, _classCallCheck2.default)(this, BusinessMetrics);
29
+ return _super.apply(this, arguments);
30
+ }
31
+ (0, _createClass2.default)(BusinessMetrics, [{
32
+ key: "submitBusinessEvent",
33
+ value:
34
+ /**
35
+ * Submit a buisness metric to our metrics endpoint.
36
+ * @param {string} name of the metric
37
+ * @param {EventPayload} user payload of the metric
38
+ * @returns {Promise<any>}
39
+ */
40
+ function submitBusinessEvent(_ref) {
41
+ var name = _ref.name,
42
+ payload = _ref.payload;
43
+ var event = {
44
+ type: ['business'],
45
+ eventPayload: {
46
+ metricName: name,
47
+ timestamp: (0, _now.default)(),
48
+ context: this.getContext(),
49
+ browserDetails: this.getBrowserDetails(),
50
+ value: payload
51
+ }
52
+ };
53
+ this.submitEvent({
54
+ kind: 'buisness-events -> ',
55
+ name: name,
56
+ event: event
57
+ });
58
+ }
59
+ }]);
60
+ return BusinessMetrics;
61
+ }(_genericMetrics.default);
62
+ //# sourceMappingURL=business-metrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_genericMetrics","_interopRequireDefault","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","BusinessMetrics","exports","_GenericMetrics","_inherits2","_super","_classCallCheck2","_createClass2","key","value","submitBusinessEvent","_ref","name","payload","event","type","eventPayload","metricName","timestamp","_now","context","getContext","browserDetails","getBrowserDetails","submitEvent","kind","GenericMetrics"],"sources":["business-metrics.ts"],"sourcesContent":["import GenericMetrics from './generic-metrics';\nimport {EventPayload} from './metrics.types';\n\n/**\n * @description Util class to handle Buisness Metrics\n * @export\n * @class BusinessMetrics\n */\nexport default class BusinessMetrics extends GenericMetrics {\n /**\n * Submit a buisness metric to our metrics endpoint.\n * @param {string} name of the metric\n * @param {EventPayload} user payload of the metric\n * @returns {Promise<any>}\n */\n public submitBusinessEvent({name, payload}: {name: string; payload: EventPayload}) {\n const event = {\n type: ['business'],\n eventPayload: {\n metricName: name,\n timestamp: Date.now(),\n context: this.getContext(),\n browserDetails: this.getBrowserDetails(),\n value: payload,\n },\n };\n\n this.submitEvent({kind: 'buisness-events -> ', name, event});\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,sBAAA,CAAAC,OAAA;AAA+C,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,kBAAA,CAAAO,OAAA,8CAAAI,CAAA;AAG/C;AACA;AACA;AACA;AACA;AAJA,IAKqBC,eAAe,GAAAC,OAAA,CAAAjB,OAAA,0BAAAkB,eAAA;EAAA,IAAAC,UAAA,CAAAnB,OAAA,EAAAgB,eAAA,EAAAE,eAAA;EAAA,IAAAE,MAAA,GAAA3B,YAAA,CAAAuB,eAAA;EAAA,SAAAA,gBAAA;IAAA,IAAAK,gBAAA,CAAArB,OAAA,QAAAgB,eAAA;IAAA,OAAAI,MAAA,CAAAd,KAAA,OAAAD,SAAA;EAAA;EAAA,IAAAiB,aAAA,CAAAtB,OAAA,EAAAgB,eAAA;IAAAO,GAAA;IAAAC,KAAA;IAClC;AACF;AACA;AACA;AACA;AACA;IACE,SAAAC,oBAAAC,IAAA,EAAmF;MAAA,IAAvDC,IAAI,GAAAD,IAAA,CAAJC,IAAI;QAAEC,OAAO,GAAAF,IAAA,CAAPE,OAAO;MACvC,IAAMC,KAAK,GAAG;QACZC,IAAI,EAAE,CAAC,UAAU,CAAC;QAClBC,YAAY,EAAE;UACZC,UAAU,EAAEL,IAAI;UAChBM,SAAS,EAAE,IAAAC,IAAA,CAAAlC,OAAA,EAAS,CAAC;UACrBmC,OAAO,EAAE,IAAI,CAACC,UAAU,CAAC,CAAC;UAC1BC,cAAc,EAAE,IAAI,CAACC,iBAAiB,CAAC,CAAC;UACxCd,KAAK,EAAEI;QACT;MACF,CAAC;MAED,IAAI,CAACW,WAAW,CAAC;QAACC,IAAI,EAAE,qBAAqB;QAAEb,IAAI,EAAJA,IAAI;QAAEE,KAAK,EAALA;MAAK,CAAC,CAAC;IAC9D;EAAC;EAAA,OAAAb,eAAA;AAAA,EApB0CyB,uBAAc"}
@@ -15,12 +15,11 @@ var _inherits2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/
15
15
  var _possibleConstructorReturn2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/possibleConstructorReturn"));
16
16
  var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/getPrototypeOf"));
17
17
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
18
- var _lodash = require("lodash");
19
- var _common = require("@webex/common");
20
18
  var _webexCore = require("@webex/webex-core");
21
- var _metrics = require("../metrics");
22
- var _config = require("./config");
23
- var _clientMetricsBatcher = _interopRequireDefault(require("../client-metrics-batcher"));
19
+ var _common = require("@webex/common");
20
+ var _lodash = require("lodash");
21
+ var _clientMetricsBatcher = _interopRequireDefault(require("./client-metrics-batcher"));
22
+ var _metrics = require("./metrics");
24
23
  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); }; }
25
24
  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; } }
26
25
  var _BrowserDetection = (0, _common.BrowserDetection)(),
@@ -29,20 +28,20 @@ var _BrowserDetection = (0, _common.BrowserDetection)(),
29
28
  getBrowserVersion = _BrowserDetection.getBrowserVersion;
30
29
 
31
30
  /**
32
- * @description Util class to handle Behavioral Metrics
31
+ * @description top-level abstract class to handle Metrics and common routines.
33
32
  * @export
34
- * @class BehavioralMetrics
33
+ * @class GenericMetrics
35
34
  */
36
- var BehavioralMetrics = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
37
- (0, _inherits2.default)(BehavioralMetrics, _StatelessWebexPlugin);
38
- var _super = _createSuper(BehavioralMetrics);
35
+ var GenericMetrics = exports.default = /*#__PURE__*/function (_StatelessWebexPlugin) {
36
+ (0, _inherits2.default)(GenericMetrics, _StatelessWebexPlugin);
37
+ var _super = _createSuper(GenericMetrics);
39
38
  /**
40
39
  * Constructor
41
40
  * @param {any[]} args
42
41
  */
43
- function BehavioralMetrics() {
42
+ function GenericMetrics() {
44
43
  var _this;
45
- (0, _classCallCheck2.default)(this, BehavioralMetrics);
44
+ (0, _classCallCheck2.default)(this, GenericMetrics);
46
45
  for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
47
46
  args[_key] = arguments[_key];
48
47
  }
@@ -54,43 +53,63 @@ var BehavioralMetrics = exports.default = /*#__PURE__*/function (_StatelessWebex
54
53
  // to avoid adding @ts-ignore everywhere
55
54
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "device", void 0);
56
55
  (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "version", void 0);
56
+ (0, _defineProperty2.default)((0, _assertThisInitialized2.default)(_this), "deviceId", '');
57
57
  _this.logger = _this.webex.logger;
58
58
  // @ts-ignore
59
- _this.device = _this.webex.internal.device;
60
- // @ts-ignore
61
- _this.version = _this.webex.version;
62
- // @ts-ignore
63
59
  _this.clientMetricsBatcher = new _clientMetricsBatcher.default({}, {
64
60
  parent: _this.webex
65
61
  });
62
+ // @ts-ignore
63
+ _this.device = _this.webex.internal.device;
64
+ // @ts-ignore
65
+ _this.version = _this.webex.version;
66
66
  return _this;
67
67
  }
68
68
 
69
69
  /**
70
- * Returns the deviceId from our registration with WDM.
71
- * @returns {string} deviceId or empty string
70
+ * Submit a buisness metric to our metrics endpoint.
71
+ * @param {string} kind of metric for logging
72
+ * @param {string} name of the metric
73
+ * @param {object} event
74
+ * @returns {Promise<any>}
72
75
  */
73
- (0, _createClass2.default)(BehavioralMetrics, [{
76
+ (0, _createClass2.default)(GenericMetrics, [{
77
+ key: "submitEvent",
78
+ value: function submitEvent(_ref) {
79
+ var kind = _ref.kind,
80
+ name = _ref.name,
81
+ event = _ref.event;
82
+ this.logger.log(kind, "@submitEvent. Submit event: ".concat(name));
83
+ return this.clientMetricsBatcher.request(event);
84
+ }
85
+
86
+ /**
87
+ * Returns the deviceId from our registration with WDM.
88
+ * @returns {string} deviceId or empty string
89
+ */
90
+ }, {
74
91
  key: "getDeviceId",
75
92
  value: function getDeviceId() {
76
- var url = this.device.url;
77
- if (url && url.length !== 0) {
78
- var n = url.lastIndexOf('/');
79
- if (n !== -1) {
80
- return url.substring(n + 1);
93
+ if (this.deviceId === '') {
94
+ var url = this.device.url;
95
+ if (url && url.length !== 0) {
96
+ var n = url.lastIndexOf('/');
97
+ if (n !== -1) {
98
+ this.deviceId = url.substring(n + 1);
99
+ }
81
100
  }
82
101
  }
83
- return '';
102
+ return this.deviceId;
84
103
  }
85
104
 
86
105
  /**
87
- * Returns the context object to be submitted with all behavioral metrics.
88
- * @returns {BehavioralEventContext}
106
+ * Returns the context object to be submitted with all metrics.
107
+ * @returns {DeviceContext}
89
108
  */
90
109
  }, {
91
110
  key: "getContext",
92
111
  value: function getContext() {
93
- var context = {
112
+ return {
94
113
  app: {
95
114
  version: this.version
96
115
  },
@@ -103,17 +122,16 @@ var BehavioralMetrics = exports.default = /*#__PURE__*/function (_StatelessWebex
103
122
  version: getOSVersion()
104
123
  }
105
124
  };
106
- return context;
107
125
  }
108
126
 
109
127
  /**
110
- * Returns the default tags to be included with all behavioral metrics.
111
- * @returns {BehavioralEventPayload}
128
+ * Returns the browser details to be included with all metrics.
129
+ * @returns {object}
112
130
  */
113
131
  }, {
114
- key: "getDefaultTags",
115
- value: function getDefaultTags() {
116
- var tags = {
132
+ key: "getBrowserDetails",
133
+ value: function getBrowserDetails() {
134
+ return {
117
135
  browser: getBrowserName(),
118
136
  browserHeight: window.innerHeight,
119
137
  browserVersion: getBrowserVersion(),
@@ -123,77 +141,44 @@ var BehavioralMetrics = exports.default = /*#__PURE__*/function (_StatelessWebex
123
141
  locale: window.navigator.language,
124
142
  os: (0, _metrics.getOSNameInternal)()
125
143
  };
126
- return tags;
127
- }
128
-
129
- /**
130
- * Creates the object to send to our metrics endpoint for a behavioral event
131
- * @param {MetricEventProduct} product
132
- * @param {MetricEventAgent} agent
133
- * @param {string} target
134
- * @param {MetricEventVerb} verb
135
- * @returns {BehavioralEventPayload}
136
- */
137
- }, {
138
- key: "createEventObject",
139
- value: function createEventObject(_ref) {
140
- var product = _ref.product,
141
- agent = _ref.agent,
142
- target = _ref.target,
143
- verb = _ref.verb,
144
- payload = _ref.payload;
145
- var metricName = "".concat(product, ".").concat(agent, ".").concat(target, ".").concat(verb);
146
- var allTags = payload;
147
- allTags = (0, _lodash.merge)(allTags, this.getDefaultTags());
148
- var event = {
149
- context: this.getContext(),
150
- metricName: metricName,
151
- tags: allTags,
152
- timestamp: (0, _now.default)(),
153
- type: ['behavioral']
154
- };
155
- return event;
156
144
  }
157
145
 
158
146
  /**
159
- * Returns true once we're ready to submit behavioral metrics, after startup.
160
- * @returns {boolean} true when deviceId is defined and non-empty
147
+ * Returns true once we have the deviceId we need to submit behavioral/operational/buisness events
148
+ * @returns {boolean}
161
149
  */
162
150
  }, {
163
- key: "isReadyToSubmitBehavioralEvents",
164
- value: function isReadyToSubmitBehavioralEvents() {
151
+ key: "isReadyToSubmitEvents",
152
+ value: function isReadyToSubmitEvents() {
165
153
  var deviceId = this.getDeviceId();
166
154
  return deviceId && deviceId.length !== 0;
167
155
  }
168
156
 
169
157
  /**
170
- * Submit a behavioral metric to our metrics endpoint.
171
- * @param {MetricEventProduct} product the product from which the metric is being submitted, e.g. 'webex' web client, 'wxcc_desktop'
172
- * @param {MetricEventAgent} agent the source of the action for this metric
173
- * @param {string} target the 'thing' that this metric includes information about
174
- * @param {MetricEventVerb} verb the action that this metric includes information about
175
- * @param {BehavioralEventPayload} payload information specific to this event. This should be flat, i.e. it should not include nested objects.
176
- * @returns {Promise<any>}
158
+ * Creates the object to send to our metrics endpoint for a tagged event (i.e. behavoral or operational)
159
+ * @param {[MetricType]} list of event type (i.e. ['behavioral'], ['operational', 'behavioral'])
160
+ * @param {string} metric name
161
+ * @param {EventPayload} user payload
162
+ * @returns {EventPayload}
177
163
  */
178
164
  }, {
179
- key: "submitBehavioralEvent",
180
- value: function submitBehavioralEvent(_ref2) {
181
- var product = _ref2.product,
182
- agent = _ref2.agent,
183
- target = _ref2.target,
184
- verb = _ref2.verb,
165
+ key: "createTaggedEventObject",
166
+ value: function createTaggedEventObject(_ref2) {
167
+ var type = _ref2.type,
168
+ name = _ref2.name,
185
169
  payload = _ref2.payload;
186
- this.logger.log(_config.BEHAVIORAL_LOG_IDENTIFIER, "BehavioralMetrics: @submitBehavioralEvent. Submit Behavioral event: ".concat(product, ".").concat(agent, ".").concat(target, ".").concat(verb));
187
- var behavioralEvent = this.createEventObject({
188
- product: product,
189
- agent: agent,
190
- target: target,
191
- verb: verb,
192
- payload: payload
193
- });
194
- return this.clientMetricsBatcher.request(behavioralEvent);
170
+ var allTags = payload;
171
+ allTags = (0, _lodash.merge)(allTags, this.getBrowserDetails());
172
+ var event = {
173
+ context: this.getContext(),
174
+ metricName: name,
175
+ tags: allTags,
176
+ timestamp: (0, _now.default)(),
177
+ type: type
178
+ };
179
+ return event;
195
180
  }
196
181
  }]);
197
- return BehavioralMetrics;
182
+ return GenericMetrics;
198
183
  }(_webexCore.StatelessWebexPlugin);
199
- //# sourceMappingURL=behavioral-metrics.js.map
184
+ //# sourceMappingURL=generic-metrics.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["_webexCore","require","_common","_lodash","_clientMetricsBatcher","_interopRequireDefault","_metrics","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","_BrowserDetection","BrowserDetection","getOSVersion","getBrowserName","getBrowserVersion","GenericMetrics","exports","_StatelessWebexPlugin","_inherits2","_super","_this","_classCallCheck2","_len","length","args","Array","_key","concat","_defineProperty2","_assertThisInitialized2","logger","webex","clientMetricsBatcher","ClientMetricsBatcher","parent","device","internal","version","_createClass2","key","value","submitEvent","_ref","kind","name","event","log","request","getDeviceId","deviceId","url","n","lastIndexOf","substring","getContext","app","id","locale","window","navigator","language","os","getOSNameInternal","getBrowserDetails","browser","browserHeight","innerHeight","browserVersion","browserWidth","innerWidth","domain","location","hostname","inIframe","self","top","isReadyToSubmitEvents","createTaggedEventObject","_ref2","type","payload","allTags","merge","context","metricName","tags","timestamp","_now","StatelessWebexPlugin"],"sources":["generic-metrics.ts"],"sourcesContent":["import {StatelessWebexPlugin} from '@webex/webex-core';\nimport {BrowserDetection} from '@webex/common';\nimport {merge} from 'lodash';\nimport ClientMetricsBatcher from './client-metrics-batcher';\nimport {getOSNameInternal} from './metrics';\nimport {DeviceContext, TaggedEvent, EventPayload, MetricType} from './metrics.types';\n\nconst {getOSVersion, getBrowserName, getBrowserVersion} = BrowserDetection();\n\n/**\n * @description top-level abstract class to handle Metrics and common routines.\n * @export\n * @class GenericMetrics\n */\nexport default abstract class GenericMetrics extends StatelessWebexPlugin {\n // @ts-ignore\n private clientMetricsBatcher: ClientMetricsBatcher;\n private logger: any; // to avoid adding @ts-ignore everywhere\n private device: any;\n private version: string;\n private deviceId = '';\n\n /**\n * Constructor\n * @param {any[]} args\n */\n constructor(...args) {\n super(...args);\n // @ts-ignore\n this.logger = this.webex.logger;\n // @ts-ignore\n this.clientMetricsBatcher = new ClientMetricsBatcher({}, {parent: this.webex});\n // @ts-ignore\n this.device = this.webex.internal.device;\n // @ts-ignore\n this.version = this.webex.version;\n }\n\n /**\n * Submit a buisness metric to our metrics endpoint.\n * @param {string} kind of metric for logging\n * @param {string} name of the metric\n * @param {object} event\n * @returns {Promise<any>}\n */\n protected submitEvent({kind, name, event}: {kind: string; name: string; event: object}) {\n this.logger.log(kind, `@submitEvent. Submit event: ${name}`);\n\n return this.clientMetricsBatcher.request(event);\n }\n\n /**\n * Returns the deviceId from our registration with WDM.\n * @returns {string} deviceId or empty string\n */\n protected getDeviceId(): string {\n if (this.deviceId === '') {\n const {url} = this.device;\n if (url && url.length !== 0) {\n const n = url.lastIndexOf('/');\n if (n !== -1) {\n this.deviceId = url.substring(n + 1);\n }\n }\n }\n\n return this.deviceId;\n }\n\n /**\n * Returns the context object to be submitted with all metrics.\n * @returns {DeviceContext}\n */\n protected getContext(): DeviceContext {\n return {\n app: {\n version: this.version,\n },\n device: {\n id: this.getDeviceId(),\n },\n locale: window.navigator.language,\n os: {\n name: getOSNameInternal(),\n version: getOSVersion(),\n },\n };\n }\n\n /**\n * Returns the browser details to be included with all metrics.\n * @returns {object}\n */\n protected getBrowserDetails(): object {\n return {\n browser: getBrowserName(),\n browserHeight: window.innerHeight,\n browserVersion: getBrowserVersion(),\n browserWidth: window.innerWidth,\n domain: window.location.hostname,\n inIframe: window.self !== window.top,\n locale: window.navigator.language,\n os: getOSNameInternal(),\n };\n }\n\n /**\n * Returns true once we have the deviceId we need to submit behavioral/operational/buisness events\n * @returns {boolean}\n */\n public isReadyToSubmitEvents(): boolean {\n const deviceId = this.getDeviceId();\n\n return deviceId && deviceId.length !== 0;\n }\n\n /**\n * Creates the object to send to our metrics endpoint for a tagged event (i.e. behavoral or operational)\n * @param {[MetricType]} list of event type (i.e. ['behavioral'], ['operational', 'behavioral'])\n * @param {string} metric name\n * @param {EventPayload} user payload\n * @returns {EventPayload}\n */\n protected createTaggedEventObject({\n type,\n name,\n payload,\n }: {\n type: [MetricType];\n name: string;\n payload: EventPayload;\n }): TaggedEvent {\n let allTags: EventPayload = payload;\n allTags = merge(allTags, this.getBrowserDetails());\n\n const event = {\n context: this.getContext(),\n metricName: name,\n tags: allTags,\n timestamp: Date.now(),\n type,\n };\n\n return event;\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AAAA,IAAAA,UAAA,GAAAC,OAAA;AACA,IAAAC,OAAA,GAAAD,OAAA;AACA,IAAAE,OAAA,GAAAF,OAAA;AACA,IAAAG,qBAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,QAAA,GAAAL,OAAA;AAA4C,SAAAM,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,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IAEA;AACF;AACA;AACA;EAHE;IAAAvB,GAAA;IAAAC,KAAA,EAIA,SAAAoC,sBAAA,EAAwC;MACtC,IAAM3B,QAAQ,GAAG,IAAI,CAACD,WAAW,CAAC,CAAC;MAEnC,OAAOC,QAAQ,IAAIA,QAAQ,CAAC1B,MAAM,KAAK,CAAC;IAC1C;;IAEA;AACF;AACA;AACA;AACA;AACA;AACA;EANE;IAAAgB,GAAA;IAAAC,KAAA,EAOA,SAAAqC,wBAAAC,KAAA,EAQgB;MAAA,IAPdC,IAAI,GAAAD,KAAA,CAAJC,IAAI;QACJnC,IAAI,GAAAkC,KAAA,CAAJlC,IAAI;QACJoC,OAAO,GAAAF,KAAA,CAAPE,OAAO;MAMP,IAAIC,OAAqB,GAAGD,OAAO;MACnCC,OAAO,GAAG,IAAAC,aAAK,EAACD,OAAO,EAAE,IAAI,CAAClB,iBAAiB,CAAC,CAAC,CAAC;MAElD,IAAMlB,KAAK,GAAG;QACZsC,OAAO,EAAE,IAAI,CAAC7B,UAAU,CAAC,CAAC;QAC1B8B,UAAU,EAAExC,IAAI;QAChByC,IAAI,EAAEJ,OAAO;QACbK,SAAS,EAAE,IAAAC,IAAA,CAAA7F,OAAA,EAAS,CAAC;QACrBqF,IAAI,EAAJA;MACF,CAAC;MAED,OAAOlC,KAAK;IACd;EAAC;EAAA,OAAA9B,cAAA;AAAA,EAlIkDyE,+BAAoB"}
package/dist/index.js CHANGED
@@ -14,6 +14,12 @@ _Object$defineProperty(exports, "BehavioralMetrics", {
14
14
  return _behavioralMetrics.default;
15
15
  }
16
16
  });
17
+ _Object$defineProperty(exports, "BusinessMetrics", {
18
+ enumerable: true,
19
+ get: function get() {
20
+ return _businessMetrics.default;
21
+ }
22
+ });
17
23
  exports.CALL_DIAGNOSTIC_CONFIG = void 0;
18
24
  _Object$defineProperty(exports, "CallDiagnosticLatencies", {
19
25
  enumerable: true,
@@ -34,6 +40,12 @@ _Object$defineProperty(exports, "NewMetrics", {
34
40
  return _newMetrics.default;
35
41
  }
36
42
  });
43
+ _Object$defineProperty(exports, "OperationalMetrics", {
44
+ enumerable: true,
45
+ get: function get() {
46
+ return _operationalMetrics.default;
47
+ }
48
+ });
37
49
  exports.Utils = void 0;
38
50
  _Object$defineProperty(exports, "config", {
39
51
  enumerable: true,
@@ -65,7 +77,9 @@ var CallDiagnosticUtils = _interopRequireWildcard(require("./call-diagnostic/cal
65
77
  exports.CallDiagnosticUtils = CallDiagnosticUtils;
66
78
  var _callDiagnosticMetrics2 = _interopRequireDefault(require("./call-diagnostic/call-diagnostic-metrics"));
67
79
  var _callDiagnosticMetricsLatencies = _interopRequireDefault(require("./call-diagnostic/call-diagnostic-metrics-latencies"));
68
- var _behavioralMetrics = _interopRequireDefault(require("./behavioral/behavioral-metrics"));
80
+ var _behavioralMetrics = _interopRequireDefault(require("./behavioral-metrics"));
81
+ var _operationalMetrics = _interopRequireDefault(require("./operational-metrics"));
82
+ var _businessMetrics = _interopRequireDefault(require("./business-metrics"));
69
83
  function _getRequireWildcardCache(e) { if ("function" != typeof _WeakMap) return null; var r = new _WeakMap(), t = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(e) { return e ? t : r; })(e); }
70
84
  function _interopRequireWildcard(e, r) { if (!r && e && e.__esModule) return e; if (null === e || "object" != _typeof(e) && "function" != typeof e) return { default: e }; var t = _getRequireWildcardCache(r); if (t && t.has(e)) return t.get(e); var n = { __proto__: null }, a = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var u in e) if ("default" !== u && Object.prototype.hasOwnProperty.call(e, u)) { var i = a ? _Object$getOwnPropertyDescriptor(e, u) : null; i && (i.get || i.set) ? _Object$defineProperty(n, u, i) : n[u] = e[u]; } return n.default = e, t && t.set(e, n), n; }
71
85
  /*!
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["_webexCore","require","_metrics","_interopRequireWildcard","_config","_interopRequireDefault","_newMetrics","Utils","exports","CALL_DIAGNOSTIC_CONFIG","CallDiagnosticUtils","_callDiagnosticMetrics2","_callDiagnosticMetricsLatencies","_behavioralMetrics","_getRequireWildcardCache","e","_WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","_Object$defineProperty","_Object$getOwnPropertyDescriptor","u","Object","prototype","hasOwnProperty","call","i","set","registerInternalPlugin","Metrics","config","NewMetrics"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Metrics from './metrics';\nimport config from './config';\nimport NewMetrics from './new-metrics';\nimport * as Utils from './utils';\nimport {\n ClientEvent,\n ClientEventLeaveReason,\n SubmitBehavioralEvent,\n SubmitClientEvent,\n SubmitInternalEvent,\n SubmitOperationalEvent,\n SubmitMQE,\n PreComputedLatencies,\n} from './metrics.types';\nimport * as CALL_DIAGNOSTIC_CONFIG from './call-diagnostic/config';\nimport * as CallDiagnosticUtils from './call-diagnostic/call-diagnostic-metrics.util';\nimport CallDiagnosticMetrics from './call-diagnostic/call-diagnostic-metrics';\nimport CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-latencies';\nimport BehavioralMetrics from './behavioral/behavioral-metrics';\n\nregisterInternalPlugin('metrics', Metrics, {\n config,\n});\n\nregisterInternalPlugin('newMetrics', NewMetrics, {\n config,\n});\n\nexport {default, getOSNameInternal} from './metrics';\n\nexport {\n config,\n CALL_DIAGNOSTIC_CONFIG,\n NewMetrics,\n Utils,\n CallDiagnosticUtils,\n CallDiagnosticLatencies,\n CallDiagnosticMetrics,\n BehavioralMetrics,\n};\nexport type {\n ClientEvent,\n ClientEventLeaveReason,\n SubmitBehavioralEvent,\n SubmitClientEvent,\n SubmitInternalEvent,\n SubmitMQE,\n SubmitOperationalEvent,\n PreComputedLatencies,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OA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AAA,CAAAlB,CAAA,EAAAc,CAAA,SAAAK,CAAA,GAAAR,CAAA,GAAAE,gCAAA,CAAAb,CAAA,EAAAc,CAAA,UAAAK,CAAA,KAAAA,CAAA,CAAAX,GAAA,IAAAW,CAAA,CAAAC,GAAA,IAAAR,sBAAA,CAAAH,CAAA,EAAAK,CAAA,EAAAK,CAAA,IAAAV,CAAA,CAAAK,CAAA,IAAAd,CAAA,CAAAc,CAAA,YAAAL,CAAA,CAAAH,OAAA,GAAAN,CAAA,EAAAG,CAAA,IAAAA,CAAA,CAAAiB,GAAA,CAAApB,CAAA,EAAAS,CAAA,GAAAA,CAAA;AAxBhE;AACA;AACA;;AAwBA,IAAAY,iCAAsB,EAAC,SAAS,EAAEC,gBAAO,EAAE;EACzCC,MAAM,EAANA;AACF,CAAC,CAAC;AAEF,IAAAF,iCAAsB,EAAC,YAAY,EAAEG,mBAAU,EAAE;EAC/CD,MAAM,EAANA;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["_webexCore","require","_metrics","_interopRequireWildcard","_config","_interopRequireDefault","_newMetrics","Utils","exports","CALL_DIAGNOSTIC_CONFIG","CallDiagnosticUtils","_callDiagnosticMetrics2","_callDiagnosticMetricsLatencies","_behavioralMetrics","_operationalMetrics","_businessMetrics","_getRequireWildcardCache","e","_WeakMap","r","t","__esModule","_typeof","default","has","get","n","__proto__","a","_Object$defineProperty","_Object$getOwnPropertyDescriptor","u","Object","prototype","hasOwnProperty","call","i","set","registerInternalPlugin","Metrics","config","NewMetrics"],"sources":["index.ts"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Metrics from './metrics';\nimport config from './config';\nimport NewMetrics from './new-metrics';\nimport * as Utils from './utils';\nimport {\n ClientEvent,\n ClientEventLeaveReason,\n SubmitBehavioralEvent,\n SubmitClientEvent,\n SubmitInternalEvent,\n SubmitOperationalEvent,\n SubmitMQE,\n PreComputedLatencies,\n} from './metrics.types';\nimport * as CALL_DIAGNOSTIC_CONFIG from './call-diagnostic/config';\nimport * as CallDiagnosticUtils from './call-diagnostic/call-diagnostic-metrics.util';\nimport CallDiagnosticMetrics from './call-diagnostic/call-diagnostic-metrics';\nimport CallDiagnosticLatencies from './call-diagnostic/call-diagnostic-metrics-latencies';\nimport BehavioralMetrics from './behavioral-metrics';\nimport OperationalMetrics from './operational-metrics';\nimport BusinessMetrics from './business-metrics';\n\nregisterInternalPlugin('metrics', Metrics, {\n config,\n});\n\nregisterInternalPlugin('newMetrics', NewMetrics, {\n config,\n});\n\nexport {default, getOSNameInternal} from './metrics';\n\nexport {\n config,\n CALL_DIAGNOSTIC_CONFIG,\n NewMetrics,\n Utils,\n CallDiagnosticUtils,\n CallDiagnosticLatencies,\n CallDiagnosticMetrics,\n BehavioralMetrics,\n OperationalMetrics,\n BusinessMetrics,\n};\nexport type {\n ClientEvent,\n ClientEventLeaveReason,\n SubmitBehavioralEvent,\n SubmitClientEvent,\n SubmitInternalEvent,\n SubmitMQE,\n SubmitOperationalEvent,\n PreComputedLatencies,\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIA,IAAAA,UAAA,GAAAC,OAAA;AAEA,IAAAC,QAAA,GAAAC,uBAAA,CAAAF,OAAA;AACA,IAAAG,OAAA,GAAAC,sBAAA,CAAAJ,OAAA;AACA,IAAAK,WAAA,GAAAD,sBAAA,CAAAJ,OAAA;AACA,IAAAM,KAAA,GAAAJ,uBAAA,CAAAF,OAAA;AAAiCO,OAAA,CAAAD,KAAA,GAAAA,KAAA;AAWjC,IAAAE,sBAAA,GAAAN,uBAAA,CAAAF,OAAA;AAAmEO,OAAA,CAAAC,sBAAA,GAAAA,sBAAA;AACnE,IAAAC,mBAAA,GAAAP,uBAAA,CAAAF,OAAA;AAAsFO,OAAA,CAAAE,mBAAA,GAAAA,mBAAA;AACtF,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AAAA,CAAA,CAAAiB,GAAA,CAAApB,CAAA,EAAAS,CAAA,GAAAA,CAAA;AA1BjD;AACA;AACA;;AA0BA,IAAAY,iCAAsB,EAAC,SAAS,EAAEC,gBAAO,EAAE;EACzCC,MAAM,EAANA;AACF,CAAC,CAAC;AAEF,IAAAF,iCAAsB,EAAC,YAAY,EAAEG,mBAAU,EAAE;EAC/CD,MAAM,EAANA;AACF,CAAC,CAAC"}
package/dist/metrics.js CHANGED
@@ -148,7 +148,7 @@ var Metrics = _webexCore.WebexPlugin.extend({
148
148
  }
149
149
  });
150
150
  },
151
- version: "3.4.0-next.1"
151
+ version: "3.4.0-next.3"
152
152
  });
153
153
  var _default = exports.default = Metrics;
154
154
  //# sourceMappingURL=metrics.js.map
@@ -1 +1 @@
1
- {"version":3,"names":[],"sources":["metrics.types.ts"],"sourcesContent":["import {\n ClientEvent as RawClientEvent,\n Event as RawEvent,\n MediaQualityEvent as RawMediaQualityEvent,\n} from '@webex/event-dictionary-ts';\n\nexport type Event = Omit<RawEvent, 'event'> & {event: RawClientEvent | RawMediaQualityEvent};\n\nexport type ClientEventError = NonNullable<RawClientEvent['errors']>[0];\n\nexport type EnvironmentType = NonNullable<RawEvent['origin']['environment']>;\n\nexport type NewEnvironmentType = NonNullable<RawEvent['origin']['newEnvironment']>;\n\nexport type ClientLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['clientLaunchMethod'];\n\nexport type BrowserLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['browserLaunchMethod'];\n\nexport type MetricEventProduct = 'webex' | 'wxcc_desktop';\n\nexport type MetricEventAgent = 'user' | 'browser' | 'system' | 'sdk' | 'redux' | 'service';\n\nexport type MetricEventVerb =\n | 'create'\n | 'get'\n | 'fetch'\n | 'update'\n | 'list'\n | 'delete'\n | 'select'\n | 'view'\n | 'set'\n | 'toggle'\n | 'load'\n | 'reload'\n | 'click'\n | 'hover'\n | 'register'\n | 'unregister'\n | 'enable'\n | 'disable'\n | 'use'\n | 'complete'\n | 'submit'\n | 'apply'\n | 'cancel'\n | 'abort'\n | 'sync'\n | 'login'\n | 'logout'\n | 'answer'\n | 'activate'\n | 'deactivate';\n\nexport type SubmitClientEventOptions = {\n meetingId?: string;\n mediaConnections?: any[];\n rawError?: any;\n correlationId?: string;\n preLoginId?: string;\n environment?: EnvironmentType;\n newEnvironmentType?: NewEnvironmentType;\n clientLaunchMethod?: ClientLaunchMethodType;\n browserLaunchMethod?: BrowserLaunchMethodType;\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n};\n\nexport type SubmitMQEOptions = {\n meetingId: string;\n mediaConnections?: any[];\n networkType?: Event['origin']['networkType'];\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n};\n\nexport type InternalEvent = {\n name:\n | 'internal.client.meetinginfo.request'\n | 'internal.client.meetinginfo.response'\n | 'internal.register.device.request'\n | 'internal.register.device.response'\n | 'internal.reset.join.latencies'\n | 'internal.client.meeting.click.joinbutton'\n | 'internal.host.meeting.participant.admitted'\n | 'internal.client.meeting.interstitial-window.showed'\n | 'internal.client.interstitial-window.click.joinbutton'\n | 'internal.client.add-media.turn-discovery.start'\n | 'internal.client.add-media.turn-discovery.end';\n\n payload?: never;\n options?: never;\n};\n\nexport interface ClientEvent {\n name: RawClientEvent['name'];\n payload?: RawClientEvent;\n options?: SubmitClientEventOptions;\n}\n\nexport interface BehavioralEventContext {\n app: {version: string};\n device: {id: string};\n locale: string;\n os: {\n name: string;\n version: string;\n };\n}\n\nexport interface BehavioralEvent {\n context: BehavioralEventContext;\n metricName: string;\n tags: Record<string, string | number | boolean>;\n timestamp: number;\n type: string[];\n}\n\nexport type BehavioralEventPayload = BehavioralEvent['tags'];\n\nexport interface OperationalEvent {\n // TODO: not implemented\n name: never;\n payload?: never;\n options?: never;\n}\n\nexport interface FeatureEvent {\n // TODO: not implemented\n name: never;\n payload?: never;\n options?: never;\n}\n\nexport interface MediaQualityEvent {\n name: RawMediaQualityEvent['name'];\n payload?: RawMediaQualityEvent;\n options: SubmitMQEOptions;\n}\n\nexport type RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[]\n ? RecursivePartial<U>[]\n : T[P] extends object\n ? RecursivePartial<T[P]>\n : T[P];\n};\n\nexport type MetricEventNames =\n | InternalEvent['name']\n | ClientEvent['name']\n | BehavioralEvent['metricName']\n | OperationalEvent['name']\n | FeatureEvent['name']\n | MediaQualityEvent['name'];\n\nexport type ClientInfo = NonNullable<RawEvent['origin']['clientInfo']>;\nexport type ClientType = NonNullable<RawEvent['origin']['clientInfo']>['clientType'];\nexport type SubClientType = NonNullable<RawEvent['origin']['clientInfo']>['subClientType'];\nexport type NetworkType = NonNullable<RawEvent['origin']>['networkType'];\n\nexport type ClientSubServiceType = ClientEvent['payload']['webexSubServiceType'];\nexport type ClientEventPayload = RecursivePartial<ClientEvent['payload']>;\nexport type ClientEventLeaveReason = ClientEvent['payload']['leaveReason'];\nexport type ClientEventPayloadError = ClientEvent['payload']['errors'];\n\nexport type MediaQualityEventAudioSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['audioSetupDelay'];\nexport type MediaQualityEventVideoSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['videoSetupDelay'];\n\nexport type SubmitMQEPayload = RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: NonNullable<MediaQualityEvent['payload']>['intervals'];\n};\n\nexport type SubmitInternalEvent = (args: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitBehavioralEvent = (args: {\n product: MetricEventProduct;\n agent: MetricEventAgent;\n target: string;\n verb: MetricEventVerb;\n payload?: BehavioralEventPayload;\n}) => void;\n\nexport type SubmitClientEvent = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type SubmitOperationalEvent = (args: {\n name: OperationalEvent['name'];\n payload?: RecursivePartial<OperationalEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitMQE = (args: {\n name: MediaQualityEvent['name'];\n payload: SubmitMQEPayload;\n options: any;\n}) => void;\n\nexport type BuildClientEventFetchRequestOptions = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type PreComputedLatencies =\n | 'internal.client.pageJMT'\n | 'internal.download.time'\n | 'internal.get.cluster.time'\n | 'internal.click.to.interstitial'\n | 'internal.refresh.captcha.time'\n | 'internal.exchange.ci.token.time'\n | 'internal.get.u2c.time'\n | 'internal.call.init.join.req'\n | 'internal.other.app.api.time'\n | 'internal.api.fetch.intelligence.models';\n"],"mappings":""}
1
+ {"version":3,"names":[],"sources":["metrics.types.ts"],"sourcesContent":["import {\n ClientEvent as RawClientEvent,\n Event as RawEvent,\n MediaQualityEvent as RawMediaQualityEvent,\n} from '@webex/event-dictionary-ts';\n\nexport type Event = Omit<RawEvent, 'event'> & {event: RawClientEvent | RawMediaQualityEvent};\n\nexport type ClientEventError = NonNullable<RawClientEvent['errors']>[0];\n\nexport type EnvironmentType = NonNullable<RawEvent['origin']['environment']>;\n\nexport type NewEnvironmentType = NonNullable<RawEvent['origin']['newEnvironment']>;\n\nexport type ClientLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['clientLaunchMethod'];\n\nexport type BrowserLaunchMethodType = NonNullable<\n RawEvent['origin']['clientInfo']\n>['browserLaunchMethod'];\n\nexport type MetricEventProduct = 'webex' | 'wxcc_desktop';\n\nexport type MetricEventAgent = 'user' | 'browser' | 'system' | 'sdk' | 'redux' | 'service';\n\nexport type MetricEventVerb =\n | 'create'\n | 'get'\n | 'fetch'\n | 'update'\n | 'list'\n | 'delete'\n | 'select'\n | 'view'\n | 'set'\n | 'toggle'\n | 'load'\n | 'reload'\n | 'click'\n | 'hover'\n | 'register'\n | 'unregister'\n | 'enable'\n | 'disable'\n | 'use'\n | 'complete'\n | 'submit'\n | 'apply'\n | 'cancel'\n | 'abort'\n | 'sync'\n | 'login'\n | 'logout'\n | 'answer'\n | 'activate'\n | 'deactivate';\n\nexport type SubmitClientEventOptions = {\n meetingId?: string;\n mediaConnections?: any[];\n rawError?: any;\n correlationId?: string;\n preLoginId?: string;\n environment?: EnvironmentType;\n newEnvironmentType?: NewEnvironmentType;\n clientLaunchMethod?: ClientLaunchMethodType;\n browserLaunchMethod?: BrowserLaunchMethodType;\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n};\n\nexport type SubmitMQEOptions = {\n meetingId: string;\n mediaConnections?: any[];\n networkType?: Event['origin']['networkType'];\n webexConferenceIdStr?: string;\n globalMeetingId?: string;\n};\n\nexport type InternalEvent = {\n name:\n | 'internal.client.meetinginfo.request'\n | 'internal.client.meetinginfo.response'\n | 'internal.register.device.request'\n | 'internal.register.device.response'\n | 'internal.reset.join.latencies'\n | 'internal.client.meeting.click.joinbutton'\n | 'internal.host.meeting.participant.admitted'\n | 'internal.client.meeting.interstitial-window.showed'\n | 'internal.client.interstitial-window.click.joinbutton'\n | 'internal.client.add-media.turn-discovery.start'\n | 'internal.client.add-media.turn-discovery.end';\n\n payload?: never;\n options?: never;\n};\n\nexport interface ClientEvent {\n name: RawClientEvent['name'];\n payload?: RawClientEvent;\n options?: SubmitClientEventOptions;\n}\n\nexport interface DeviceContext {\n app: {version: string};\n device: {id: string};\n locale: string;\n os: {\n name: string;\n version: string;\n };\n}\n\nexport type MetricType = 'behavioral' | 'operational' | 'business';\n\ntype InternalEventPayload = string | number | boolean;\nexport type EventPayload = Record<string, InternalEventPayload>;\nexport type BehavioralEventPayload = EventPayload; // for compatibilty, can be remove after wxcc-desktop did change their imports.\n\nexport interface BusinessEventPayload {\n metricName: string;\n timestamp: number;\n context: DeviceContext;\n browserDetails: EventPayload;\n value: EventPayload;\n}\n\nexport interface BusinessEvent {\n type: string[];\n eventPayload: BusinessEventPayload;\n}\n\nexport interface TaggedEvent {\n context: DeviceContext;\n metricName: string;\n tags: EventPayload;\n timestamp: number;\n type: [MetricType];\n}\n\nexport type BehavioralEvent = TaggedEvent;\nexport type OperationalEvent = TaggedEvent;\n\nexport interface FeatureEvent {\n // TODO: not implemented\n name: never;\n payload?: never;\n options?: never;\n}\n\nexport interface MediaQualityEvent {\n name: RawMediaQualityEvent['name'];\n payload?: RawMediaQualityEvent;\n options: SubmitMQEOptions;\n}\n\nexport type RecursivePartial<T> = {\n [P in keyof T]?: T[P] extends (infer U)[]\n ? RecursivePartial<U>[]\n : T[P] extends object\n ? RecursivePartial<T[P]>\n : T[P];\n};\n\nexport type MetricEventNames =\n | InternalEvent['name']\n | ClientEvent['name']\n | BehavioralEvent['metricName']\n | OperationalEvent['metricName']\n | BusinessEvent['eventPayload']['metricName']\n | FeatureEvent['name']\n | MediaQualityEvent['name'];\n\nexport type ClientInfo = NonNullable<RawEvent['origin']['clientInfo']>;\nexport type ClientType = NonNullable<RawEvent['origin']['clientInfo']>['clientType'];\nexport type SubClientType = NonNullable<RawEvent['origin']['clientInfo']>['subClientType'];\nexport type NetworkType = NonNullable<RawEvent['origin']>['networkType'];\n\nexport type ClientSubServiceType = ClientEvent['payload']['webexSubServiceType'];\nexport type ClientEventPayload = RecursivePartial<ClientEvent['payload']>;\nexport type ClientEventLeaveReason = ClientEvent['payload']['leaveReason'];\nexport type ClientEventPayloadError = ClientEvent['payload']['errors'];\n\nexport type MediaQualityEventAudioSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['audioSetupDelay'];\nexport type MediaQualityEventVideoSetupDelayPayload = NonNullable<\n MediaQualityEvent['payload']\n>['videoSetupDelay'];\n\nexport type SubmitMQEPayload = RecursivePartial<MediaQualityEvent['payload']> & {\n intervals: NonNullable<MediaQualityEvent['payload']>['intervals'];\n};\n\nexport type SubmitInternalEvent = (args: {\n name: InternalEvent['name'];\n payload?: RecursivePartial<InternalEvent['payload']>;\n options?: any;\n}) => void;\n\nexport type SubmitBehavioralEvent = (args: {\n product: MetricEventProduct;\n agent: MetricEventAgent;\n target: string;\n verb: MetricEventVerb;\n payload?: EventPayload;\n}) => void;\n\nexport type SubmitClientEvent = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type SubmitOperationalEvent = (args: {\n name: OperationalEvent['metricName'];\n payload: EventPayload;\n}) => void;\n\nexport type SubmitMQE = (args: {\n name: MediaQualityEvent['name'];\n payload: SubmitMQEPayload;\n options: any;\n}) => void;\n\nexport type BuildClientEventFetchRequestOptions = (args: {\n name: ClientEvent['name'];\n payload?: RecursivePartial<ClientEvent['payload']>;\n options?: SubmitClientEventOptions;\n}) => Promise<any>;\n\nexport type PreComputedLatencies =\n | 'internal.client.pageJMT'\n | 'internal.download.time'\n | 'internal.get.cluster.time'\n | 'internal.click.to.interstitial'\n | 'internal.refresh.captcha.time'\n | 'internal.exchange.ci.token.time'\n | 'internal.get.u2c.time'\n | 'internal.call.init.join.req'\n | 'internal.other.app.api.time'\n | 'internal.api.fetch.intelligence.models';\n"],"mappings":""}