@webex/calling 3.9.0 → 3.10.0-multi-llms.1

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 (192) hide show
  1. package/dist/CallHistory/CallHistory.js +43 -43
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +157 -152
  4. package/dist/CallHistory/CallHistory.test.js.map +1 -1
  5. package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
  6. package/dist/CallHistory/constants.js.map +1 -1
  7. package/dist/CallHistory/types.js.map +1 -1
  8. package/dist/CallSettings/CallSettings.js +8 -8
  9. package/dist/CallSettings/CallSettings.js.map +1 -1
  10. package/dist/CallSettings/CallSettings.test.js +1 -1
  11. package/dist/CallSettings/CallSettings.test.js.map +1 -1
  12. package/dist/CallSettings/UcmBackendConnector.js +12 -11
  13. package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
  14. package/dist/CallSettings/UcmBackendConnector.test.js +11 -11
  15. package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
  16. package/dist/CallSettings/WxCallBackendConnector.js +53 -52
  17. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  18. package/dist/CallSettings/WxCallBackendConnector.test.js +112 -110
  19. package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
  20. package/dist/CallSettings/constants.js.map +1 -1
  21. package/dist/CallSettings/testFixtures.js.map +1 -1
  22. package/dist/CallSettings/types.js.map +1 -1
  23. package/dist/CallingClient/CallingClient.js +458 -203
  24. package/dist/CallingClient/CallingClient.js.map +1 -1
  25. package/dist/CallingClient/CallingClient.test.js +458 -315
  26. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  27. package/dist/CallingClient/callRecordFixtures.js.map +1 -1
  28. package/dist/CallingClient/calling/CallerId/index.js +2 -2
  29. package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
  30. package/dist/CallingClient/calling/CallerId/index.test.js +8 -7
  31. package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
  32. package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
  33. package/dist/CallingClient/calling/call.js +406 -373
  34. package/dist/CallingClient/calling/call.js.map +1 -1
  35. package/dist/CallingClient/calling/call.test.js +482 -415
  36. package/dist/CallingClient/calling/call.test.js.map +1 -1
  37. package/dist/CallingClient/calling/callManager.js +3 -4
  38. package/dist/CallingClient/calling/callManager.js.map +1 -1
  39. package/dist/CallingClient/calling/callManager.test.js +68 -69
  40. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  41. package/dist/CallingClient/calling/index.js.map +1 -1
  42. package/dist/CallingClient/calling/types.js.map +1 -1
  43. package/dist/CallingClient/callingClientFixtures.js.map +1 -1
  44. package/dist/CallingClient/constants.js +9 -6
  45. package/dist/CallingClient/constants.js.map +1 -1
  46. package/dist/CallingClient/line/index.js +10 -11
  47. package/dist/CallingClient/line/index.js.map +1 -1
  48. package/dist/CallingClient/line/line.test.js +10 -9
  49. package/dist/CallingClient/line/line.test.js.map +1 -1
  50. package/dist/CallingClient/line/types.js.map +1 -1
  51. package/dist/CallingClient/registration/index.js.map +1 -1
  52. package/dist/CallingClient/registration/register.js +285 -205
  53. package/dist/CallingClient/registration/register.js.map +1 -1
  54. package/dist/CallingClient/registration/register.test.js +251 -180
  55. package/dist/CallingClient/registration/register.test.js.map +1 -1
  56. package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
  57. package/dist/CallingClient/registration/types.js.map +1 -1
  58. package/dist/CallingClient/registration/webWorker.js +25 -10
  59. package/dist/CallingClient/registration/webWorker.js.map +1 -1
  60. package/dist/CallingClient/registration/webWorker.test.js +85 -38
  61. package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
  62. package/dist/CallingClient/registration/webWorkerStr.js +1 -1
  63. package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
  64. package/dist/CallingClient/types.js.map +1 -1
  65. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +142 -0
  66. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
  67. package/dist/Contacts/ContactsClient.js +244 -247
  68. package/dist/Contacts/ContactsClient.js.map +1 -1
  69. package/dist/Contacts/ContactsClient.test.js +93 -93
  70. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  71. package/dist/Contacts/constants.js +2 -2
  72. package/dist/Contacts/constants.js.map +1 -1
  73. package/dist/Contacts/contactFixtures.js.map +1 -1
  74. package/dist/Contacts/types.js.map +1 -1
  75. package/dist/Errors/catalog/CallError.js +2 -2
  76. package/dist/Errors/catalog/CallError.js.map +1 -1
  77. package/dist/Errors/catalog/CallingDeviceError.js +2 -2
  78. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  79. package/dist/Errors/catalog/ExtendedError.js +3 -3
  80. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  81. package/dist/Errors/catalog/LineError.js +2 -2
  82. package/dist/Errors/catalog/LineError.js.map +1 -1
  83. package/dist/Errors/index.js.map +1 -1
  84. package/dist/Errors/types.js.map +1 -1
  85. package/dist/Events/impl/index.js +3 -3
  86. package/dist/Events/impl/index.js.map +1 -1
  87. package/dist/Events/types.js.map +1 -1
  88. package/dist/Logger/index.js +3 -3
  89. package/dist/Logger/index.js.map +1 -1
  90. package/dist/Logger/index.test.js +1 -1
  91. package/dist/Logger/index.test.js.map +1 -1
  92. package/dist/Logger/types.js.map +1 -1
  93. package/dist/Metrics/index.js +221 -104
  94. package/dist/Metrics/index.js.map +1 -1
  95. package/dist/Metrics/index.test.js +112 -23
  96. package/dist/Metrics/index.test.js.map +1 -1
  97. package/dist/Metrics/types.js +15 -1
  98. package/dist/Metrics/types.js.map +1 -1
  99. package/dist/SDKConnector/index.js +0 -1
  100. package/dist/SDKConnector/index.js.map +1 -1
  101. package/dist/SDKConnector/index.test.js.map +1 -1
  102. package/dist/SDKConnector/types.js.map +1 -1
  103. package/dist/SDKConnector/utils.js.map +1 -1
  104. package/dist/SDKConnector/utils.test.js.map +1 -1
  105. package/dist/Voicemail/BroadworksBackendConnector.js +55 -61
  106. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  107. package/dist/Voicemail/BroadworksBackendConnector.test.js +129 -122
  108. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  109. package/dist/Voicemail/UcmBackendConnector.js +53 -50
  110. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  111. package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
  112. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  113. package/dist/Voicemail/Voicemail.js +89 -113
  114. package/dist/Voicemail/Voicemail.js.map +1 -1
  115. package/dist/Voicemail/Voicemail.test.js +2 -2
  116. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  117. package/dist/Voicemail/WxCallBackendConnector.js +87 -92
  118. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  119. package/dist/Voicemail/WxCallBackendConnector.test.js +228 -203
  120. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  121. package/dist/Voicemail/constants.js.map +1 -1
  122. package/dist/Voicemail/types.js.map +1 -1
  123. package/dist/Voicemail/voicemailFixture.js.map +1 -1
  124. package/dist/api.js.map +1 -1
  125. package/dist/common/Utils.js +85 -66
  126. package/dist/common/Utils.js.map +1 -1
  127. package/dist/common/Utils.test.js +113 -123
  128. package/dist/common/Utils.test.js.map +1 -1
  129. package/dist/common/constants.js.map +1 -1
  130. package/dist/common/index.js.map +1 -1
  131. package/dist/common/testUtil.js +1 -1
  132. package/dist/common/testUtil.js.map +1 -1
  133. package/dist/common/types.js.map +1 -1
  134. package/dist/index.js +5 -5
  135. package/dist/index.js.map +1 -1
  136. package/dist/module/CallHistory/CallHistory.js +17 -8
  137. package/dist/module/CallSettings/UcmBackendConnector.js +2 -2
  138. package/dist/module/CallSettings/WxCallBackendConnector.js +14 -14
  139. package/dist/module/CallingClient/CallingClient.js +176 -36
  140. package/dist/module/CallingClient/calling/call.js +92 -62
  141. package/dist/module/CallingClient/constants.js +8 -4
  142. package/dist/module/CallingClient/line/index.js +3 -3
  143. package/dist/module/CallingClient/registration/register.js +37 -13
  144. package/dist/module/CallingClient/registration/webWorker.js +17 -3
  145. package/dist/module/CallingClient/registration/webWorkerStr.js +19 -3
  146. package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +59 -0
  147. package/dist/module/Contacts/ContactsClient.js +33 -37
  148. package/dist/module/Contacts/constants.js +1 -1
  149. package/dist/module/Events/impl/index.js +1 -1
  150. package/dist/module/Logger/index.js +2 -2
  151. package/dist/module/Metrics/index.js +142 -55
  152. package/dist/module/Metrics/types.js +14 -0
  153. package/dist/module/Voicemail/BroadworksBackendConnector.js +10 -17
  154. package/dist/module/Voicemail/UcmBackendConnector.js +11 -10
  155. package/dist/module/Voicemail/Voicemail.js +42 -68
  156. package/dist/module/Voicemail/WxCallBackendConnector.js +22 -28
  157. package/dist/module/common/Utils.js +29 -12
  158. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  159. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  160. package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
  161. package/dist/types/CallingClient/CallingClient.d.ts +12 -1
  162. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  163. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  164. package/dist/types/CallingClient/calling/types.d.ts +2 -1
  165. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  166. package/dist/types/CallingClient/constants.d.ts +8 -4
  167. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  168. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  169. package/dist/types/CallingClient/registration/register.d.ts +1 -0
  170. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  171. package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
  172. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
  173. package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
  174. package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
  175. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +5 -0
  176. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
  177. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  178. package/dist/types/Contacts/constants.d.ts +1 -1
  179. package/dist/types/Contacts/constants.d.ts.map +1 -1
  180. package/dist/types/Logger/index.d.ts +1 -2
  181. package/dist/types/Logger/index.d.ts.map +1 -1
  182. package/dist/types/Metrics/index.d.ts.map +1 -1
  183. package/dist/types/Metrics/types.d.ts +18 -3
  184. package/dist/types/Metrics/types.d.ts.map +1 -1
  185. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
  186. package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
  187. package/dist/types/Voicemail/Voicemail.d.ts.map +1 -1
  188. package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
  189. package/dist/types/common/Utils.d.ts.map +1 -1
  190. package/dist/types/common/types.d.ts +1 -0
  191. package/dist/types/common/types.d.ts.map +1 -1
  192. package/package.json +10 -8
@@ -9,8 +9,8 @@ var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/de
9
9
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
10
10
  var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
11
11
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
12
- var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
13
12
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
13
+ var _promise = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/promise"));
14
14
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
15
15
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
16
16
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
@@ -24,8 +24,7 @@ var _constants = require("./constants");
24
24
  var utils = _interopRequireWildcard(require("../common/Utils"));
25
25
  var _Logger = _interopRequireDefault(require("../Logger"));
26
26
  var _constants2 = require("../common/constants");
27
- 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); }
28
- 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; }
27
+ function _interopRequireWildcard(e, t) { if ("function" == typeof _WeakMap) var r = new _WeakMap(), n = new _WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
29
28
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
30
29
  function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable @typescript-eslint/no-unused-vars */ /* eslint-disable dot-notation */ /* eslint-disable @typescript-eslint/no-shadow */
31
30
  var webex = (0, _testUtil.getTestUtilsWebex)();
@@ -42,7 +41,7 @@ describe('Call history tests', function () {
42
41
  });
43
42
  uploadLogsSpy = jest.spyOn(utils, 'uploadLogs').mockResolvedValue();
44
43
  });
45
- it('verify successful call history case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
44
+ it('verify successful call history case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
46
45
  var callHistoryPayload, response;
47
46
  return _regenerator.default.wrap(function _callee$(_context) {
48
47
  while (1) switch (_context.prev = _context.next) {
@@ -78,7 +77,7 @@ describe('Call history tests', function () {
78
77
  }
79
78
  }, _callee);
80
79
  })));
81
- it('verify bad request failed call history case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
80
+ it('verify bad request failed call history case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
82
81
  var failurePayload, callHistoryPayload, response;
83
82
  return _regenerator.default.wrap(function _callee2$(_context2) {
84
83
  while (1) switch (_context2.prev = _context2.next) {
@@ -100,7 +99,10 @@ describe('Call history tests', function () {
100
99
  file: _constants.CALL_HISTORY_FILE,
101
100
  method: _constants.METHODS.GET_CALL_HISTORY_DATA
102
101
  });
103
- expect(errorSpy).toHaveBeenCalled();
102
+ expect(errorSpy).toHaveBeenCalledWith("Failed to get call history: ".concat((0, _stringify.default)(failurePayload)), {
103
+ file: _constants.CALL_HISTORY_FILE,
104
+ method: _constants.METHODS.GET_CALL_HISTORY_DATA
105
+ });
104
106
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
105
107
  case 11:
106
108
  case "end":
@@ -108,7 +110,7 @@ describe('Call history tests', function () {
108
110
  }
109
111
  }, _callee2);
110
112
  })));
111
- it('verify device not found call history case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
113
+ it('verify device not found call history case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
112
114
  var failurePayload, callHistoryPayload, response;
113
115
  return _regenerator.default.wrap(function _callee3$(_context3) {
114
116
  while (1) switch (_context3.prev = _context3.next) {
@@ -130,7 +132,10 @@ describe('Call history tests', function () {
130
132
  file: _constants.CALL_HISTORY_FILE,
131
133
  method: _constants.METHODS.GET_CALL_HISTORY_DATA
132
134
  });
133
- expect(errorSpy).toHaveBeenCalled();
135
+ expect(errorSpy).toHaveBeenCalledWith("Failed to get call history: ".concat((0, _stringify.default)(failurePayload)), {
136
+ file: _constants.CALL_HISTORY_FILE,
137
+ method: _constants.METHODS.GET_CALL_HISTORY_DATA
138
+ });
134
139
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
135
140
  case 11:
136
141
  case "end":
@@ -139,7 +144,7 @@ describe('Call history tests', function () {
139
144
  }, _callee3);
140
145
  })));
141
146
  describe('sorting user session response data by sortby', function () {
142
- it('Array should be sort.ASC by START TIME ', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
147
+ it('Array should be sort.ASC by START TIME ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
143
148
  var callHistoryPayload, response, responseDetails;
144
149
  return _regenerator.default.wrap(function _callee4$(_context4) {
145
150
  while (1) switch (_context4.prev = _context4.next) {
@@ -197,7 +202,7 @@ describe('Call history tests', function () {
197
202
  var callSessionCallback = mockOn.mock.calls[1][1];
198
203
  callSessionCallback(_callHistoryFixtures.MOCK_SESSION_EVENT_LEGACY);
199
204
  });
200
- it('verify the user viewed session event for missed calls update', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
205
+ it('verify the user viewed session event for missed calls update', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
201
206
  return _regenerator.default.wrap(function _callee5$(_context5) {
202
207
  while (1) switch (_context5.prev = _context5.next) {
203
208
  case 0:
@@ -217,7 +222,7 @@ describe('Call history tests', function () {
217
222
  }
218
223
  }, _callee5);
219
224
  })));
220
- it('verify the user sessions deleted event for deleting the call history records', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
225
+ it('verify the user sessions deleted event for deleting the call history records', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
221
226
  return _regenerator.default.wrap(function _callee6$(_context6) {
222
227
  while (1) switch (_context6.prev = _context6.next) {
223
228
  case 0:
@@ -246,7 +251,7 @@ describe('Call history tests', function () {
246
251
  afterEach(function () {
247
252
  jest.clearAllMocks();
248
253
  });
249
- beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
254
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
250
255
  return _regenerator.default.wrap(function _callee7$(_context7) {
251
256
  while (1) switch (_context7.prev = _context7.next) {
252
257
  case 0:
@@ -267,7 +272,7 @@ describe('Call history tests', function () {
267
272
  }
268
273
  }, _callee7);
269
274
  })));
270
- it('successfully updates missed calls', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
275
+ it('successfully updates missed calls', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
271
276
  var endTimeSessionIds, response, convertedEndTimeSessionIds;
272
277
  return _regenerator.default.wrap(function _callee8$(_context8) {
273
278
  while (1) switch (_context8.prev = _context8.next) {
@@ -317,7 +322,7 @@ describe('Call history tests', function () {
317
322
  }
318
323
  }, _callee8);
319
324
  })));
320
- it('Error: updateMissedCalls throw 400 error', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
325
+ it('Error: updateMissedCalls throw 400 error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
321
326
  var endTimeSessionIds, response, convertedEndTimeSessionIds;
322
327
  return _regenerator.default.wrap(function _callee9$(_context9) {
323
328
  while (1) switch (_context9.prev = _context9.next) {
@@ -362,7 +367,7 @@ describe('Call history tests', function () {
362
367
  expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
363
368
  statusCode: 400
364
369
  }, methodDetails);
365
- expect(errorSpy).toHaveBeenCalled();
370
+ expect(errorSpy).toBeCalledWith(expect.stringContaining('Failed to update missed calls'), methodDetails);
366
371
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
367
372
  case 23:
368
373
  case "end":
@@ -370,10 +375,10 @@ describe('Call history tests', function () {
370
375
  }
371
376
  }, _callee9);
372
377
  })));
373
- it('Error: updateMissedCalls throw 401 error', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
378
+ it('Error: updateMissedCalls throw 401 error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
374
379
  var endTimeSessionIds, response, convertedEndTimeSessionIds;
375
- return _regenerator.default.wrap(function _callee10$(_context10) {
376
- while (1) switch (_context10.prev = _context10.next) {
380
+ return _regenerator.default.wrap(function _callee0$(_context0) {
381
+ while (1) switch (_context0.prev = _context0.next) {
377
382
  case 0:
378
383
  endTimeSessionIds = [];
379
384
  global.fetch = jest.fn(function () {
@@ -382,10 +387,10 @@ describe('Call history tests', function () {
382
387
  ok: false
383
388
  });
384
389
  });
385
- _context10.next = 4;
390
+ _context0.next = 4;
386
391
  return callHistory.updateMissedCalls(endTimeSessionIds);
387
392
  case 4:
388
- response = _context10.sent;
393
+ response = _context0.sent;
389
394
  convertedEndTimeSessionIds = endTimeSessionIds.map(function (session) {
390
395
  return _objectSpread(_objectSpread({}, session), {}, {
391
396
  endTime: new Date(session.endTime).getTime()
@@ -393,25 +398,25 @@ describe('Call history tests', function () {
393
398
  });
394
399
  expect(response).toStrictEqual(_callHistoryFixtures.ERROR_DETAILS_401);
395
400
  expect(response.statusCode).toBe(401);
396
- _context10.t0 = expect(global.fetch);
397
- _context10.t1 = _callHistoryFixtures.janusSetReadStateUrl;
398
- _context10.t2 = _types2.HTTP_METHODS.POST;
399
- _context10.t3 = _defineProperty2.default;
400
- _context10.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
401
- _context10.next = 15;
401
+ _context0.t0 = expect(global.fetch);
402
+ _context0.t1 = _callHistoryFixtures.janusSetReadStateUrl;
403
+ _context0.t2 = _types2.HTTP_METHODS.POST;
404
+ _context0.t3 = _defineProperty2.default;
405
+ _context0.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
406
+ _context0.next = 15;
402
407
  return webex.credentials.getUserToken();
403
408
  case 15:
404
- _context10.t5 = _context10.sent;
405
- _context10.t6 = (0, _context10.t3)(_context10.t4, "Authorization", _context10.t5);
406
- _context10.t7 = (0, _stringify.default)({
409
+ _context0.t5 = _context0.sent;
410
+ _context0.t6 = (0, _context0.t3)(_context0.t4, "Authorization", _context0.t5);
411
+ _context0.t7 = (0, _stringify.default)({
407
412
  endTimeSessionIds: convertedEndTimeSessionIds
408
413
  });
409
- _context10.t8 = {
410
- method: _context10.t2,
411
- headers: _context10.t6,
412
- body: _context10.t7
414
+ _context0.t8 = {
415
+ method: _context0.t2,
416
+ headers: _context0.t6,
417
+ body: _context0.t7
413
418
  };
414
- _context10.t0.toBeCalledOnceWith.call(_context10.t0, _context10.t1, _context10.t8);
419
+ _context0.t0.toBeCalledOnceWith.call(_context0.t0, _context0.t1, _context0.t8);
415
420
  expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
416
421
  statusCode: 401
417
422
  }, methodDetails);
@@ -419,26 +424,26 @@ describe('Call history tests', function () {
419
424
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
420
425
  case 23:
421
426
  case "end":
422
- return _context10.stop();
427
+ return _context0.stop();
423
428
  }
424
- }, _callee10);
429
+ }, _callee0);
425
430
  })));
426
431
  });
427
432
  describe('fetchUCMLinesData test', function () {
428
433
  beforeEach(function () {
429
434
  uploadLogsSpy = jest.spyOn(utils, 'uploadLogs').mockResolvedValue();
430
435
  });
431
- it('verify successful UCM lines API case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
436
+ it('verify successful UCM lines API case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
432
437
  var ucmLinesAPIPayload, response;
433
- return _regenerator.default.wrap(function _callee11$(_context11) {
434
- while (1) switch (_context11.prev = _context11.next) {
438
+ return _regenerator.default.wrap(function _callee1$(_context1) {
439
+ while (1) switch (_context1.prev = _context1.next) {
435
440
  case 0:
436
441
  ucmLinesAPIPayload = _callHistoryFixtures.MOCK_LINES_API_CALL_RESPONSE;
437
442
  webex.request.mockResolvedValue(ucmLinesAPIPayload);
438
- _context11.next = 4;
443
+ _context1.next = 4;
439
444
  return callHistory['fetchUCMLinesData']();
440
445
  case 4:
441
- response = _context11.sent;
446
+ response = _context1.sent;
442
447
  expect(response.statusCode).toBe(200);
443
448
  expect(response.message).toBe('SUCCESS');
444
449
 
@@ -455,24 +460,24 @@ describe('Call history tests', function () {
455
460
  expect(uploadLogsSpy).not.toHaveBeenCalled();
456
461
  case 11:
457
462
  case "end":
458
- return _context11.stop();
463
+ return _context1.stop();
459
464
  }
460
- }, _callee11);
465
+ }, _callee1);
461
466
  })));
462
- it('verify bad request failed UCM lines API case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
467
+ it('verify bad request failed UCM lines API case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
463
468
  var failurePayload, ucmLinesAPIPayload, response;
464
- return _regenerator.default.wrap(function _callee12$(_context12) {
465
- while (1) switch (_context12.prev = _context12.next) {
469
+ return _regenerator.default.wrap(function _callee10$(_context10) {
470
+ while (1) switch (_context10.prev = _context10.next) {
466
471
  case 0:
467
472
  failurePayload = {
468
473
  statusCode: 400
469
474
  };
470
475
  ucmLinesAPIPayload = failurePayload;
471
476
  webex.request.mockRejectedValue(ucmLinesAPIPayload);
472
- _context12.next = 5;
477
+ _context10.next = 5;
473
478
  return callHistory['fetchUCMLinesData']();
474
479
  case 5:
475
- response = _context12.sent;
480
+ response = _context10.sent;
476
481
  expect(response).toStrictEqual(_callHistoryFixtures.ERROR_DETAILS_400);
477
482
  expect(response.data.error).toEqual(_callHistoryFixtures.ERROR_DETAILS_400.data.error);
478
483
  expect(response.statusCode).toBe(400);
@@ -493,14 +498,14 @@ describe('Call history tests', function () {
493
498
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
494
499
  case 14:
495
500
  case "end":
496
- return _context12.stop();
501
+ return _context10.stop();
497
502
  }
498
- }, _callee12);
503
+ }, _callee10);
499
504
  })));
500
- it('should call fetchUCMLinesData when calling backend is UCM and userSessions contain valid cucmDN', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
505
+ it('should call fetchUCMLinesData when calling backend is UCM and userSessions contain valid cucmDN', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
501
506
  var fetchUCMLinesDataSpy, mockCallHistoryPayload, response;
502
- return _regenerator.default.wrap(function _callee13$(_context13) {
503
- while (1) switch (_context13.prev = _context13.next) {
507
+ return _regenerator.default.wrap(function _callee11$(_context11) {
508
+ while (1) switch (_context11.prev = _context11.next) {
504
509
  case 0:
505
510
  jest.spyOn(utils, 'getCallingBackEnd').mockReturnValue(_types2.CALLING_BACKEND.UCM);
506
511
  // Since fetchUCMLinesData is a private method, TypeScript restricts direct access to it.
@@ -508,23 +513,23 @@ describe('Call history tests', function () {
508
513
  fetchUCMLinesDataSpy = jest.spyOn(callHistory, 'fetchUCMLinesData').mockResolvedValue(_callHistoryFixtures.MOCK_LINES_API_CALL_RESPONSE);
509
514
  mockCallHistoryPayload = _callHistoryFixtures.MOCK_CALL_HISTORY_WITH_UCM_LINE_NUMBER;
510
515
  webex.request.mockResolvedValue(mockCallHistoryPayload);
511
- _context13.next = 6;
516
+ _context11.next = 6;
512
517
  return callHistory.getCallHistoryData(7, 10, _types2.SORT.DEFAULT, _types2.SORT_BY.DEFAULT);
513
518
  case 6:
514
- response = _context13.sent;
519
+ response = _context11.sent;
515
520
  expect(fetchUCMLinesDataSpy).toHaveBeenCalledTimes(1);
516
521
  expect(response.statusCode).toBe(200);
517
522
  expect(response.data.userSessions && response.data.userSessions[0].self.ucmLineNumber).toEqual(1);
518
523
  case 10:
519
524
  case "end":
520
- return _context13.stop();
525
+ return _context11.stop();
521
526
  }
522
- }, _callee13);
527
+ }, _callee11);
523
528
  })));
524
- it('should fetchUCMLinesData but not assign ucmLineNumber when UCM backend has no line data', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
529
+ it('should fetchUCMLinesData but not assign ucmLineNumber when UCM backend has no line data', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
525
530
  var fetchUCMLinesDataSpy, mockCallHistoryPayload, response;
526
- return _regenerator.default.wrap(function _callee14$(_context14) {
527
- while (1) switch (_context14.prev = _context14.next) {
531
+ return _regenerator.default.wrap(function _callee12$(_context12) {
532
+ while (1) switch (_context12.prev = _context12.next) {
528
533
  case 0:
529
534
  jest.spyOn(utils, 'getCallingBackEnd').mockReturnValue(_types2.CALLING_BACKEND.UCM);
530
535
 
@@ -533,24 +538,24 @@ describe('Call history tests', function () {
533
538
  fetchUCMLinesDataSpy = jest.spyOn(callHistory, 'fetchUCMLinesData').mockResolvedValue(_callHistoryFixtures.MOCK_LINES_API_CALL_RESPONSE_WITH_NO_LINEDATA);
534
539
  mockCallHistoryPayload = _callHistoryFixtures.MOCK_CALL_HISTORY_WITHOUT_UCM_LINE_NUMBER;
535
540
  webex.request.mockResolvedValue(mockCallHistoryPayload);
536
- _context14.next = 6;
541
+ _context12.next = 6;
537
542
  return callHistory.getCallHistoryData(7, 10, _types2.SORT.DEFAULT, _types2.SORT_BY.DEFAULT);
538
543
  case 6:
539
- response = _context14.sent;
544
+ response = _context12.sent;
540
545
  expect(fetchUCMLinesDataSpy).toHaveBeenCalledTimes(1);
541
546
  expect(response.statusCode).toBe(200);
542
547
  expect(response.data.userSessions && response.data.userSessions[0].self.cucmDN).toBeDefined();
543
548
  expect(response.data.userSessions && response.data.userSessions[0].self.ucmLineNumber).toEqual(undefined);
544
549
  case 11:
545
550
  case "end":
546
- return _context14.stop();
551
+ return _context12.stop();
547
552
  }
548
- }, _callee14);
553
+ }, _callee12);
549
554
  })));
550
- it('should not call fetchUCMLinesData when calling backend is UCM but no valid cucmDN is present', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
555
+ it('should not call fetchUCMLinesData when calling backend is UCM but no valid cucmDN is present', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
551
556
  var fetchUCMLinesDataSpy, callHistoryPayload;
552
- return _regenerator.default.wrap(function _callee15$(_context15) {
553
- while (1) switch (_context15.prev = _context15.next) {
557
+ return _regenerator.default.wrap(function _callee13$(_context13) {
558
+ while (1) switch (_context13.prev = _context13.next) {
554
559
  case 0:
555
560
  jest.spyOn(utils, 'getCallingBackEnd').mockReturnValue(_types2.CALLING_BACKEND.UCM);
556
561
  // Since fetchUCMLinesData is a private method, TypeScript restricts direct access to it.
@@ -558,20 +563,20 @@ describe('Call history tests', function () {
558
563
  fetchUCMLinesDataSpy = jest.spyOn(callHistory, 'fetchUCMLinesData').mockResolvedValue({});
559
564
  callHistoryPayload = _callHistoryFixtures.mockCallHistoryBody;
560
565
  webex.request.mockResolvedValue(callHistoryPayload);
561
- _context15.next = 6;
566
+ _context13.next = 6;
562
567
  return callHistory.getCallHistoryData(7, 10, _types2.SORT.DEFAULT, _types2.SORT_BY.DEFAULT);
563
568
  case 6:
564
569
  expect(fetchUCMLinesDataSpy).not.toHaveBeenCalled();
565
570
  case 7:
566
571
  case "end":
567
- return _context15.stop();
572
+ return _context13.stop();
568
573
  }
569
- }, _callee15);
574
+ }, _callee13);
570
575
  })));
571
- it('should not call fetchUCMLinesData when calling backend is not UCM', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
576
+ it('should not call fetchUCMLinesData when calling backend is not UCM', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
572
577
  var fetchUCMLinesDataSpy, callHistoryPayload;
573
- return _regenerator.default.wrap(function _callee16$(_context16) {
574
- while (1) switch (_context16.prev = _context16.next) {
578
+ return _regenerator.default.wrap(function _callee14$(_context14) {
579
+ while (1) switch (_context14.prev = _context14.next) {
575
580
  case 0:
576
581
  jest.spyOn(utils, 'getCallingBackEnd').mockReturnValue(_types2.CALLING_BACKEND.WXC);
577
582
  // Since fetchUCMLinesData is a private method, TypeScript restricts direct access to it.
@@ -579,15 +584,15 @@ describe('Call history tests', function () {
579
584
  fetchUCMLinesDataSpy = jest.spyOn(callHistory, 'fetchUCMLinesData').mockResolvedValue({});
580
585
  callHistoryPayload = _callHistoryFixtures.mockCallHistoryBody;
581
586
  webex.request.mockResolvedValue(callHistoryPayload);
582
- _context16.next = 6;
587
+ _context14.next = 6;
583
588
  return callHistory.getCallHistoryData(7, 10, _types2.SORT.DEFAULT, _types2.SORT_BY.DEFAULT);
584
589
  case 6:
585
590
  expect(fetchUCMLinesDataSpy).not.toHaveBeenCalled(); // Check that fetchUCMLinesData was not called
586
591
  case 7:
587
592
  case "end":
588
- return _context16.stop();
593
+ return _context14.stop();
589
594
  }
590
- }, _callee16);
595
+ }, _callee14);
591
596
  })));
592
597
  });
593
598
  describe('Delete call history records test', function () {
@@ -598,9 +603,9 @@ describe('Call history tests', function () {
598
603
  afterEach(function () {
599
604
  jest.clearAllMocks();
600
605
  });
601
- beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
602
- return _regenerator.default.wrap(function _callee17$(_context17) {
603
- while (1) switch (_context17.prev = _context17.next) {
606
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
607
+ return _regenerator.default.wrap(function _callee15$(_context15) {
608
+ while (1) switch (_context15.prev = _context15.next) {
604
609
  case 0:
605
610
  serviceErrorCodeHandlerSpy = jest.spyOn(utils, 'serviceErrorCodeHandler');
606
611
  uploadLogsSpy = jest.spyOn(utils, 'uploadLogs').mockResolvedValue();
@@ -615,23 +620,23 @@ describe('Call history tests', function () {
615
620
  });
616
621
  case 3:
617
622
  case "end":
618
- return _context17.stop();
623
+ return _context15.stop();
619
624
  }
620
- }, _callee17);
625
+ }, _callee15);
621
626
  })));
622
- it('successfully deletes the call history records', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
627
+ it('successfully deletes the call history records', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
623
628
  var deleteSessionIds, response, convertedEndTimeSessionIds;
624
- return _regenerator.default.wrap(function _callee18$(_context18) {
625
- while (1) switch (_context18.prev = _context18.next) {
629
+ return _regenerator.default.wrap(function _callee16$(_context16) {
630
+ while (1) switch (_context16.prev = _context16.next) {
626
631
  case 0:
627
632
  deleteSessionIds = [{
628
633
  endTime: '2024-10-22T08:50:48.603Z',
629
634
  sessionId: '123'
630
635
  }];
631
- _context18.next = 3;
636
+ _context16.next = 3;
632
637
  return callHistory.deleteCallHistoryRecords(deleteSessionIds);
633
638
  case 3:
634
- response = _context18.sent;
639
+ response = _context16.sent;
635
640
  convertedEndTimeSessionIds = deleteSessionIds.map(function (session) {
636
641
  return _objectSpread(_objectSpread({}, session), {}, {
637
642
  endTime: new Date(session.endTime).getTime()
@@ -639,25 +644,25 @@ describe('Call history tests', function () {
639
644
  });
640
645
  expect(response.statusCode).toEqual(200);
641
646
  expect(response).toEqual(_callHistoryFixtures.MOCK_DELETE_CALL_HISTORY_RECORDS_RESPONSE);
642
- _context18.t0 = expect(global.fetch);
643
- _context18.t1 = _callHistoryFixtures.janusMarkAsDeletedUrl;
644
- _context18.t2 = _types2.HTTP_METHODS.POST;
645
- _context18.t3 = _defineProperty2.default;
646
- _context18.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
647
- _context18.next = 14;
647
+ _context16.t0 = expect(global.fetch);
648
+ _context16.t1 = _callHistoryFixtures.janusMarkAsDeletedUrl;
649
+ _context16.t2 = _types2.HTTP_METHODS.POST;
650
+ _context16.t3 = _defineProperty2.default;
651
+ _context16.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
652
+ _context16.next = 14;
648
653
  return webex.credentials.getUserToken();
649
654
  case 14:
650
- _context18.t5 = _context18.sent;
651
- _context18.t6 = (0, _context18.t3)(_context18.t4, "Authorization", _context18.t5);
652
- _context18.t7 = (0, _stringify.default)({
655
+ _context16.t5 = _context16.sent;
656
+ _context16.t6 = (0, _context16.t3)(_context16.t4, "Authorization", _context16.t5);
657
+ _context16.t7 = (0, _stringify.default)({
653
658
  deleteSessionIds: convertedEndTimeSessionIds
654
659
  });
655
- _context18.t8 = {
656
- method: _context18.t2,
657
- headers: _context18.t6,
658
- body: _context18.t7
660
+ _context16.t8 = {
661
+ method: _context16.t2,
662
+ headers: _context16.t6,
663
+ body: _context16.t7
659
664
  };
660
- _context18.t0.toBeCalledOnceWith.call(_context18.t0, _context18.t1, _context18.t8);
665
+ _context16.t0.toBeCalledOnceWith.call(_context16.t0, _context16.t1, _context16.t8);
661
666
  // Verify logs were called with correct information
662
667
  expect(infoSpy).toHaveBeenCalledWith("".concat(_constants2.METHOD_START_MESSAGE, " with sessions: ").concat((0, _stringify.default)(deleteSessionIds)), methodDetails);
663
668
  expect(logSpy).toHaveBeenCalledWith("Successfully deleted ".concat(deleteSessionIds.length, " call history records"), methodDetails);
@@ -665,14 +670,14 @@ describe('Call history tests', function () {
665
670
  expect(uploadLogsSpy).not.toHaveBeenCalled();
666
671
  case 23:
667
672
  case "end":
668
- return _context18.stop();
673
+ return _context16.stop();
669
674
  }
670
- }, _callee18);
675
+ }, _callee16);
671
676
  })));
672
- it('Error: deleteCallHistoryRecords throw 400 error', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
677
+ it('Error: deleteCallHistoryRecords throw 400 error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
673
678
  var deleteSessionIds, response, convertedEndTimeSessionIds;
674
- return _regenerator.default.wrap(function _callee19$(_context19) {
675
- while (1) switch (_context19.prev = _context19.next) {
679
+ return _regenerator.default.wrap(function _callee17$(_context17) {
680
+ while (1) switch (_context17.prev = _context17.next) {
676
681
  case 0:
677
682
  deleteSessionIds = [];
678
683
  global.fetch = jest.fn(function () {
@@ -681,10 +686,10 @@ describe('Call history tests', function () {
681
686
  ok: false
682
687
  });
683
688
  });
684
- _context19.next = 4;
689
+ _context17.next = 4;
685
690
  return callHistory.deleteCallHistoryRecords(deleteSessionIds);
686
691
  case 4:
687
- response = _context19.sent;
692
+ response = _context17.sent;
688
693
  convertedEndTimeSessionIds = deleteSessionIds.map(function (session) {
689
694
  return _objectSpread(_objectSpread({}, session), {}, {
690
695
  endTime: new Date(session.endTime).getTime()
@@ -692,25 +697,25 @@ describe('Call history tests', function () {
692
697
  });
693
698
  expect(response).toStrictEqual(_callHistoryFixtures.ERROR_DETAILS_400);
694
699
  expect(response.statusCode).toBe(400);
695
- _context19.t0 = expect(global.fetch);
696
- _context19.t1 = _callHistoryFixtures.janusMarkAsDeletedUrl;
697
- _context19.t2 = _types2.HTTP_METHODS.POST;
698
- _context19.t3 = _defineProperty2.default;
699
- _context19.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
700
- _context19.next = 15;
700
+ _context17.t0 = expect(global.fetch);
701
+ _context17.t1 = _callHistoryFixtures.janusMarkAsDeletedUrl;
702
+ _context17.t2 = _types2.HTTP_METHODS.POST;
703
+ _context17.t3 = _defineProperty2.default;
704
+ _context17.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
705
+ _context17.next = 15;
701
706
  return webex.credentials.getUserToken();
702
707
  case 15:
703
- _context19.t5 = _context19.sent;
704
- _context19.t6 = (0, _context19.t3)(_context19.t4, "Authorization", _context19.t5);
705
- _context19.t7 = (0, _stringify.default)({
708
+ _context17.t5 = _context17.sent;
709
+ _context17.t6 = (0, _context17.t3)(_context17.t4, "Authorization", _context17.t5);
710
+ _context17.t7 = (0, _stringify.default)({
706
711
  deleteSessionIds: convertedEndTimeSessionIds
707
712
  });
708
- _context19.t8 = {
709
- method: _context19.t2,
710
- headers: _context19.t6,
711
- body: _context19.t7
713
+ _context17.t8 = {
714
+ method: _context17.t2,
715
+ headers: _context17.t6,
716
+ body: _context17.t7
712
717
  };
713
- _context19.t0.toBeCalledOnceWith.call(_context19.t0, _context19.t1, _context19.t8);
718
+ _context17.t0.toBeCalledOnceWith.call(_context17.t0, _context17.t1, _context17.t8);
714
719
  expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
715
720
  statusCode: 400
716
721
  }, methodDetails);
@@ -718,14 +723,14 @@ describe('Call history tests', function () {
718
723
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
719
724
  case 23:
720
725
  case "end":
721
- return _context19.stop();
726
+ return _context17.stop();
722
727
  }
723
- }, _callee19);
728
+ }, _callee17);
724
729
  })));
725
- it('Error: deleteCallHistoryRecords throw 401 error', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
730
+ it('Error: deleteCallHistoryRecords throw 401 error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
726
731
  var deleteSessionIds, response, convertedEndTimeSessionIds;
727
- return _regenerator.default.wrap(function _callee20$(_context20) {
728
- while (1) switch (_context20.prev = _context20.next) {
732
+ return _regenerator.default.wrap(function _callee18$(_context18) {
733
+ while (1) switch (_context18.prev = _context18.next) {
729
734
  case 0:
730
735
  deleteSessionIds = [];
731
736
  global.fetch = jest.fn(function () {
@@ -734,10 +739,10 @@ describe('Call history tests', function () {
734
739
  ok: false
735
740
  });
736
741
  });
737
- _context20.next = 4;
742
+ _context18.next = 4;
738
743
  return callHistory.deleteCallHistoryRecords(deleteSessionIds);
739
744
  case 4:
740
- response = _context20.sent;
745
+ response = _context18.sent;
741
746
  convertedEndTimeSessionIds = deleteSessionIds.map(function (session) {
742
747
  return _objectSpread(_objectSpread({}, session), {}, {
743
748
  endTime: new Date(session.endTime).getTime()
@@ -745,43 +750,43 @@ describe('Call history tests', function () {
745
750
  });
746
751
  expect(response).toStrictEqual(_callHistoryFixtures.ERROR_DETAILS_401);
747
752
  expect(response.statusCode).toBe(401);
748
- _context20.t0 = expect(global.fetch);
749
- _context20.t1 = _callHistoryFixtures.janusMarkAsDeletedUrl;
750
- _context20.t2 = _types2.HTTP_METHODS.POST;
751
- _context20.t3 = _defineProperty2.default;
752
- _context20.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
753
- _context20.next = 15;
753
+ _context18.t0 = expect(global.fetch);
754
+ _context18.t1 = _callHistoryFixtures.janusMarkAsDeletedUrl;
755
+ _context18.t2 = _types2.HTTP_METHODS.POST;
756
+ _context18.t3 = _defineProperty2.default;
757
+ _context18.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
758
+ _context18.next = 15;
754
759
  return webex.credentials.getUserToken();
755
760
  case 15:
756
- _context20.t5 = _context20.sent;
757
- _context20.t6 = (0, _context20.t3)(_context20.t4, "Authorization", _context20.t5);
758
- _context20.t7 = (0, _stringify.default)({
761
+ _context18.t5 = _context18.sent;
762
+ _context18.t6 = (0, _context18.t3)(_context18.t4, "Authorization", _context18.t5);
763
+ _context18.t7 = (0, _stringify.default)({
759
764
  deleteSessionIds: convertedEndTimeSessionIds
760
765
  });
761
- _context20.t8 = {
762
- method: _context20.t2,
763
- headers: _context20.t6,
764
- body: _context20.t7
766
+ _context18.t8 = {
767
+ method: _context18.t2,
768
+ headers: _context18.t6,
769
+ body: _context18.t7
765
770
  };
766
- _context20.t0.toBeCalledOnceWith.call(_context20.t0, _context20.t1, _context20.t8);
771
+ _context18.t0.toBeCalledOnceWith.call(_context18.t0, _context18.t1, _context18.t8);
767
772
  expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
768
773
  statusCode: 401
769
774
  }, methodDetails);
770
- expect(errorSpy).toHaveBeenCalledWith(expect.any(Error), {
775
+ expect(errorSpy).toBeCalledWith(expect.stringContaining('Failed to delete call history records'), {
771
776
  file: _constants.CALL_HISTORY_FILE,
772
777
  method: _constants.METHODS.DELETE_CALL_HISTORY_RECORDS
773
778
  });
774
779
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
775
780
  case 23:
776
781
  case "end":
777
- return _context20.stop();
782
+ return _context18.stop();
778
783
  }
779
- }, _callee20);
784
+ }, _callee18);
780
785
  })));
781
- it('handles invalid date formats gracefully', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
786
+ it('handles invalid date formats gracefully', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
782
787
  var deleteSessionIds, response;
783
- return _regenerator.default.wrap(function _callee21$(_context21) {
784
- while (1) switch (_context21.prev = _context21.next) {
788
+ return _regenerator.default.wrap(function _callee19$(_context19) {
789
+ while (1) switch (_context19.prev = _context19.next) {
785
790
  case 0:
786
791
  deleteSessionIds = [{
787
792
  endTime: 'invalid-date',
@@ -793,10 +798,10 @@ describe('Call history tests', function () {
793
798
  ok: false
794
799
  });
795
800
  });
796
- _context21.next = 4;
801
+ _context19.next = 4;
797
802
  return callHistory.deleteCallHistoryRecords(deleteSessionIds);
798
803
  case 4:
799
- response = _context21.sent;
804
+ response = _context19.sent;
800
805
  expect(response.statusCode).toBe(400);
801
806
  expect(response).toEqual(_callHistoryFixtures.MOCK_DELETE_CALL_HISTORY_INVALID_DATE_RESPONSE);
802
807
 
@@ -805,9 +810,9 @@ describe('Call history tests', function () {
805
810
  expect(uploadLogsSpy).not.toHaveBeenCalled();
806
811
  case 9:
807
812
  case "end":
808
- return _context21.stop();
813
+ return _context19.stop();
809
814
  }
810
- }, _callee21);
815
+ }, _callee19);
811
816
  })));
812
817
  });
813
818
  });