roboto-js 1.6.15 → 1.6.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.cjs +1 -1
- package/dist/cjs/rbt_metrics_api.cjs +7 -6
- package/dist/esm/index.js +1 -1
- package/dist/esm/rbt_metrics_api.js +3 -2
- package/package.json +1 -1
- package/src/index.js +1 -1
- package/src/rbt_metrics_api.js +4 -3
package/dist/cjs/index.cjs
CHANGED
|
@@ -150,15 +150,16 @@ var RbtMetricsApi = exports["default"] = /*#__PURE__*/function (_EventEmitter) {
|
|
|
150
150
|
/**
|
|
151
151
|
* Count-based metric event (requires `count` param).
|
|
152
152
|
* Example:
|
|
153
|
-
* roboto.metrics.
|
|
153
|
+
* roboto.metrics.countEvents("PGPT.Tool.SendSMS", { count: 4, agentId: "ABC" })
|
|
154
|
+
*
|
|
154
155
|
* is equivalent to:
|
|
155
156
|
* roboto.metrics.sendEvent("PGPT.Tool.SendSMS", { count: 4, agentId: "ABC" })
|
|
156
157
|
*/
|
|
157
158
|
)
|
|
158
159
|
}, {
|
|
159
|
-
key: "
|
|
160
|
+
key: "countEvents",
|
|
160
161
|
value: (function () {
|
|
161
|
-
var
|
|
162
|
+
var _countEvents = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime().mark(function _callee2(eventOrObj) {
|
|
162
163
|
var paramsObj,
|
|
163
164
|
_args2 = arguments;
|
|
164
165
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -178,10 +179,10 @@ var RbtMetricsApi = exports["default"] = /*#__PURE__*/function (_EventEmitter) {
|
|
|
178
179
|
}
|
|
179
180
|
}, _callee2, this);
|
|
180
181
|
}));
|
|
181
|
-
function
|
|
182
|
-
return
|
|
182
|
+
function countEvents(_x2) {
|
|
183
|
+
return _countEvents.apply(this, arguments);
|
|
183
184
|
}
|
|
184
|
-
return
|
|
185
|
+
return countEvents;
|
|
185
186
|
}())
|
|
186
187
|
}]);
|
|
187
188
|
return RbtMetricsApi;
|
package/dist/esm/index.js
CHANGED
|
@@ -86,11 +86,12 @@ export default class RbtMetricsApi extends EventEmitter {
|
|
|
86
86
|
/**
|
|
87
87
|
* Count-based metric event (requires `count` param).
|
|
88
88
|
* Example:
|
|
89
|
-
* roboto.metrics.
|
|
89
|
+
* roboto.metrics.countEvents("PGPT.Tool.SendSMS", { count: 4, agentId: "ABC" })
|
|
90
|
+
*
|
|
90
91
|
* is equivalent to:
|
|
91
92
|
* roboto.metrics.sendEvent("PGPT.Tool.SendSMS", { count: 4, agentId: "ABC" })
|
|
92
93
|
*/
|
|
93
|
-
async
|
|
94
|
+
async countEvents(eventOrObj, paramsObj = {}) {
|
|
94
95
|
if (!paramsObj || typeof paramsObj.count !== 'number') {
|
|
95
96
|
throw new Error('countEvent requires a count param (number)');
|
|
96
97
|
}
|
package/package.json
CHANGED
package/src/index.js
CHANGED
package/src/rbt_metrics_api.js
CHANGED
|
@@ -92,15 +92,16 @@ export default class RbtMetricsApi extends EventEmitter {
|
|
|
92
92
|
/**
|
|
93
93
|
* Count-based metric event (requires `count` param).
|
|
94
94
|
* Example:
|
|
95
|
-
* roboto.metrics.
|
|
95
|
+
* roboto.metrics.countEvents("PGPT.Tool.SendSMS", { count: 4, agentId: "ABC" })
|
|
96
|
+
*
|
|
96
97
|
* is equivalent to:
|
|
97
98
|
* roboto.metrics.sendEvent("PGPT.Tool.SendSMS", { count: 4, agentId: "ABC" })
|
|
98
99
|
*/
|
|
99
|
-
async
|
|
100
|
+
async countEvents(eventOrObj, paramsObj = {}) {
|
|
100
101
|
if (!paramsObj || typeof paramsObj.count !== 'number') {
|
|
101
102
|
throw new Error('countEvent requires a count param (number)');
|
|
102
103
|
}
|
|
103
104
|
return this.sendEvent(eventOrObj, paramsObj);
|
|
104
105
|
}
|
|
105
|
-
|
|
106
|
+
|
|
106
107
|
}
|