@webex/calling 3.9.0-webinar5k.1 → 3.10.0

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 (184) hide show
  1. package/dist/CallHistory/CallHistory.js +51 -46
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +146 -147
  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 +9 -10
  15. package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
  16. package/dist/CallSettings/WxCallBackendConnector.js +66 -59
  17. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  18. package/dist/CallSettings/WxCallBackendConnector.test.js +108 -109
  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 +457 -201
  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 +369 -333
  34. package/dist/CallingClient/calling/call.js.map +1 -1
  35. package/dist/CallingClient/calling/call.test.js +411 -410
  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 +67 -68
  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 +280 -201
  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 -238
  68. package/dist/Contacts/ContactsClient.js.map +1 -1
  69. package/dist/Contacts/ContactsClient.test.js +89 -90
  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 +2 -2
  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.map +1 -1
  89. package/dist/Logger/index.test.js.map +1 -1
  90. package/dist/Logger/types.js.map +1 -1
  91. package/dist/Metrics/index.js +221 -104
  92. package/dist/Metrics/index.js.map +1 -1
  93. package/dist/Metrics/index.test.js +112 -23
  94. package/dist/Metrics/index.test.js.map +1 -1
  95. package/dist/Metrics/types.js +15 -1
  96. package/dist/Metrics/types.js.map +1 -1
  97. package/dist/SDKConnector/index.js +0 -1
  98. package/dist/SDKConnector/index.js.map +1 -1
  99. package/dist/SDKConnector/index.test.js.map +1 -1
  100. package/dist/SDKConnector/types.js.map +1 -1
  101. package/dist/SDKConnector/utils.js.map +1 -1
  102. package/dist/SDKConnector/utils.test.js.map +1 -1
  103. package/dist/Voicemail/BroadworksBackendConnector.js +42 -39
  104. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  105. package/dist/Voicemail/BroadworksBackendConnector.test.js +119 -120
  106. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  107. package/dist/Voicemail/UcmBackendConnector.js +54 -47
  108. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  109. package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
  110. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  111. package/dist/Voicemail/Voicemail.js +12 -11
  112. package/dist/Voicemail/Voicemail.js.map +1 -1
  113. package/dist/Voicemail/Voicemail.test.js +2 -2
  114. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  115. package/dist/Voicemail/WxCallBackendConnector.js +78 -70
  116. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  117. package/dist/Voicemail/WxCallBackendConnector.test.js +184 -185
  118. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  119. package/dist/Voicemail/constants.js.map +1 -1
  120. package/dist/Voicemail/types.js.map +1 -1
  121. package/dist/Voicemail/voicemailFixture.js.map +1 -1
  122. package/dist/api.js.map +1 -1
  123. package/dist/common/Utils.js +84 -65
  124. package/dist/common/Utils.js.map +1 -1
  125. package/dist/common/Utils.test.js +111 -117
  126. package/dist/common/Utils.test.js.map +1 -1
  127. package/dist/common/constants.js.map +1 -1
  128. package/dist/common/index.js.map +1 -1
  129. package/dist/common/testUtil.js +1 -1
  130. package/dist/common/testUtil.js.map +1 -1
  131. package/dist/common/types.js.map +1 -1
  132. package/dist/index.js +5 -5
  133. package/dist/index.js.map +1 -1
  134. package/dist/module/CallHistory/CallHistory.js +4 -0
  135. package/dist/module/CallSettings/UcmBackendConnector.js +1 -0
  136. package/dist/module/CallSettings/WxCallBackendConnector.js +7 -0
  137. package/dist/module/CallingClient/CallingClient.js +174 -32
  138. package/dist/module/CallingClient/calling/call.js +79 -43
  139. package/dist/module/CallingClient/constants.js +8 -4
  140. package/dist/module/CallingClient/line/index.js +3 -3
  141. package/dist/module/CallingClient/registration/register.js +34 -10
  142. package/dist/module/CallingClient/registration/webWorker.js +17 -3
  143. package/dist/module/CallingClient/registration/webWorkerStr.js +19 -3
  144. package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +59 -0
  145. package/dist/module/Contacts/ContactsClient.js +23 -17
  146. package/dist/module/Contacts/constants.js +1 -1
  147. package/dist/module/Metrics/index.js +142 -55
  148. package/dist/module/Metrics/types.js +14 -0
  149. package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -0
  150. package/dist/module/Voicemail/UcmBackendConnector.js +6 -0
  151. package/dist/module/Voicemail/WxCallBackendConnector.js +8 -0
  152. package/dist/module/common/Utils.js +27 -10
  153. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  154. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  155. package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
  156. package/dist/types/CallingClient/CallingClient.d.ts +12 -1
  157. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  158. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  159. package/dist/types/CallingClient/calling/types.d.ts +2 -1
  160. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  161. package/dist/types/CallingClient/constants.d.ts +8 -4
  162. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  163. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  164. package/dist/types/CallingClient/registration/register.d.ts +1 -0
  165. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  166. package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
  167. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
  168. package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
  169. package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
  170. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +5 -0
  171. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
  172. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  173. package/dist/types/Contacts/constants.d.ts +1 -1
  174. package/dist/types/Contacts/constants.d.ts.map +1 -1
  175. package/dist/types/Metrics/index.d.ts.map +1 -1
  176. package/dist/types/Metrics/types.d.ts +18 -3
  177. package/dist/types/Metrics/types.d.ts.map +1 -1
  178. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
  179. package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
  180. package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
  181. package/dist/types/common/Utils.d.ts.map +1 -1
  182. package/dist/types/common/types.d.ts +1 -0
  183. package/dist/types/common/types.d.ts.map +1 -1
  184. package/package.json +10 -8
@@ -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) {
@@ -108,7 +107,7 @@ describe('Call history tests', function () {
108
107
  }
109
108
  }, _callee2);
110
109
  })));
111
- it('verify device not found call history case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
110
+ it('verify device not found call history case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
112
111
  var failurePayload, callHistoryPayload, response;
113
112
  return _regenerator.default.wrap(function _callee3$(_context3) {
114
113
  while (1) switch (_context3.prev = _context3.next) {
@@ -139,7 +138,7 @@ describe('Call history tests', function () {
139
138
  }, _callee3);
140
139
  })));
141
140
  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() {
141
+ it('Array should be sort.ASC by START TIME ', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
143
142
  var callHistoryPayload, response, responseDetails;
144
143
  return _regenerator.default.wrap(function _callee4$(_context4) {
145
144
  while (1) switch (_context4.prev = _context4.next) {
@@ -197,7 +196,7 @@ describe('Call history tests', function () {
197
196
  var callSessionCallback = mockOn.mock.calls[1][1];
198
197
  callSessionCallback(_callHistoryFixtures.MOCK_SESSION_EVENT_LEGACY);
199
198
  });
200
- it('verify the user viewed session event for missed calls update', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
199
+ it('verify the user viewed session event for missed calls update', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
201
200
  return _regenerator.default.wrap(function _callee5$(_context5) {
202
201
  while (1) switch (_context5.prev = _context5.next) {
203
202
  case 0:
@@ -217,7 +216,7 @@ describe('Call history tests', function () {
217
216
  }
218
217
  }, _callee5);
219
218
  })));
220
- it('verify the user sessions deleted event for deleting the call history records', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
219
+ it('verify the user sessions deleted event for deleting the call history records', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
221
220
  return _regenerator.default.wrap(function _callee6$(_context6) {
222
221
  while (1) switch (_context6.prev = _context6.next) {
223
222
  case 0:
@@ -246,7 +245,7 @@ describe('Call history tests', function () {
246
245
  afterEach(function () {
247
246
  jest.clearAllMocks();
248
247
  });
249
- beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
248
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
250
249
  return _regenerator.default.wrap(function _callee7$(_context7) {
251
250
  while (1) switch (_context7.prev = _context7.next) {
252
251
  case 0:
@@ -267,7 +266,7 @@ describe('Call history tests', function () {
267
266
  }
268
267
  }, _callee7);
269
268
  })));
270
- it('successfully updates missed calls', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
269
+ it('successfully updates missed calls', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
271
270
  var endTimeSessionIds, response, convertedEndTimeSessionIds;
272
271
  return _regenerator.default.wrap(function _callee8$(_context8) {
273
272
  while (1) switch (_context8.prev = _context8.next) {
@@ -317,7 +316,7 @@ describe('Call history tests', function () {
317
316
  }
318
317
  }, _callee8);
319
318
  })));
320
- it('Error: updateMissedCalls throw 400 error', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
319
+ it('Error: updateMissedCalls throw 400 error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
321
320
  var endTimeSessionIds, response, convertedEndTimeSessionIds;
322
321
  return _regenerator.default.wrap(function _callee9$(_context9) {
323
322
  while (1) switch (_context9.prev = _context9.next) {
@@ -370,10 +369,10 @@ describe('Call history tests', function () {
370
369
  }
371
370
  }, _callee9);
372
371
  })));
373
- it('Error: updateMissedCalls throw 401 error', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
372
+ it('Error: updateMissedCalls throw 401 error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
374
373
  var endTimeSessionIds, response, convertedEndTimeSessionIds;
375
- return _regenerator.default.wrap(function _callee10$(_context10) {
376
- while (1) switch (_context10.prev = _context10.next) {
374
+ return _regenerator.default.wrap(function _callee0$(_context0) {
375
+ while (1) switch (_context0.prev = _context0.next) {
377
376
  case 0:
378
377
  endTimeSessionIds = [];
379
378
  global.fetch = jest.fn(function () {
@@ -382,10 +381,10 @@ describe('Call history tests', function () {
382
381
  ok: false
383
382
  });
384
383
  });
385
- _context10.next = 4;
384
+ _context0.next = 4;
386
385
  return callHistory.updateMissedCalls(endTimeSessionIds);
387
386
  case 4:
388
- response = _context10.sent;
387
+ response = _context0.sent;
389
388
  convertedEndTimeSessionIds = endTimeSessionIds.map(function (session) {
390
389
  return _objectSpread(_objectSpread({}, session), {}, {
391
390
  endTime: new Date(session.endTime).getTime()
@@ -393,25 +392,25 @@ describe('Call history tests', function () {
393
392
  });
394
393
  expect(response).toStrictEqual(_callHistoryFixtures.ERROR_DETAILS_401);
395
394
  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;
395
+ _context0.t0 = expect(global.fetch);
396
+ _context0.t1 = _callHistoryFixtures.janusSetReadStateUrl;
397
+ _context0.t2 = _types2.HTTP_METHODS.POST;
398
+ _context0.t3 = _defineProperty2.default;
399
+ _context0.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
400
+ _context0.next = 15;
402
401
  return webex.credentials.getUserToken();
403
402
  case 15:
404
- _context10.t5 = _context10.sent;
405
- _context10.t6 = (0, _context10.t3)(_context10.t4, "Authorization", _context10.t5);
406
- _context10.t7 = (0, _stringify.default)({
403
+ _context0.t5 = _context0.sent;
404
+ _context0.t6 = (0, _context0.t3)(_context0.t4, "Authorization", _context0.t5);
405
+ _context0.t7 = (0, _stringify.default)({
407
406
  endTimeSessionIds: convertedEndTimeSessionIds
408
407
  });
409
- _context10.t8 = {
410
- method: _context10.t2,
411
- headers: _context10.t6,
412
- body: _context10.t7
408
+ _context0.t8 = {
409
+ method: _context0.t2,
410
+ headers: _context0.t6,
411
+ body: _context0.t7
413
412
  };
414
- _context10.t0.toBeCalledOnceWith.call(_context10.t0, _context10.t1, _context10.t8);
413
+ _context0.t0.toBeCalledOnceWith.call(_context0.t0, _context0.t1, _context0.t8);
415
414
  expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
416
415
  statusCode: 401
417
416
  }, methodDetails);
@@ -419,26 +418,26 @@ describe('Call history tests', function () {
419
418
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
420
419
  case 23:
421
420
  case "end":
422
- return _context10.stop();
421
+ return _context0.stop();
423
422
  }
424
- }, _callee10);
423
+ }, _callee0);
425
424
  })));
426
425
  });
427
426
  describe('fetchUCMLinesData test', function () {
428
427
  beforeEach(function () {
429
428
  uploadLogsSpy = jest.spyOn(utils, 'uploadLogs').mockResolvedValue();
430
429
  });
431
- it('verify successful UCM lines API case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
430
+ it('verify successful UCM lines API case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
432
431
  var ucmLinesAPIPayload, response;
433
- return _regenerator.default.wrap(function _callee11$(_context11) {
434
- while (1) switch (_context11.prev = _context11.next) {
432
+ return _regenerator.default.wrap(function _callee1$(_context1) {
433
+ while (1) switch (_context1.prev = _context1.next) {
435
434
  case 0:
436
435
  ucmLinesAPIPayload = _callHistoryFixtures.MOCK_LINES_API_CALL_RESPONSE;
437
436
  webex.request.mockResolvedValue(ucmLinesAPIPayload);
438
- _context11.next = 4;
437
+ _context1.next = 4;
439
438
  return callHistory['fetchUCMLinesData']();
440
439
  case 4:
441
- response = _context11.sent;
440
+ response = _context1.sent;
442
441
  expect(response.statusCode).toBe(200);
443
442
  expect(response.message).toBe('SUCCESS');
444
443
 
@@ -455,24 +454,24 @@ describe('Call history tests', function () {
455
454
  expect(uploadLogsSpy).not.toHaveBeenCalled();
456
455
  case 11:
457
456
  case "end":
458
- return _context11.stop();
457
+ return _context1.stop();
459
458
  }
460
- }, _callee11);
459
+ }, _callee1);
461
460
  })));
462
- it('verify bad request failed UCM lines API case', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
461
+ it('verify bad request failed UCM lines API case', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
463
462
  var failurePayload, ucmLinesAPIPayload, response;
464
- return _regenerator.default.wrap(function _callee12$(_context12) {
465
- while (1) switch (_context12.prev = _context12.next) {
463
+ return _regenerator.default.wrap(function _callee10$(_context10) {
464
+ while (1) switch (_context10.prev = _context10.next) {
466
465
  case 0:
467
466
  failurePayload = {
468
467
  statusCode: 400
469
468
  };
470
469
  ucmLinesAPIPayload = failurePayload;
471
470
  webex.request.mockRejectedValue(ucmLinesAPIPayload);
472
- _context12.next = 5;
471
+ _context10.next = 5;
473
472
  return callHistory['fetchUCMLinesData']();
474
473
  case 5:
475
- response = _context12.sent;
474
+ response = _context10.sent;
476
475
  expect(response).toStrictEqual(_callHistoryFixtures.ERROR_DETAILS_400);
477
476
  expect(response.data.error).toEqual(_callHistoryFixtures.ERROR_DETAILS_400.data.error);
478
477
  expect(response.statusCode).toBe(400);
@@ -493,14 +492,14 @@ describe('Call history tests', function () {
493
492
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
494
493
  case 14:
495
494
  case "end":
496
- return _context12.stop();
495
+ return _context10.stop();
497
496
  }
498
- }, _callee12);
497
+ }, _callee10);
499
498
  })));
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() {
499
+ 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
500
  var fetchUCMLinesDataSpy, mockCallHistoryPayload, response;
502
- return _regenerator.default.wrap(function _callee13$(_context13) {
503
- while (1) switch (_context13.prev = _context13.next) {
501
+ return _regenerator.default.wrap(function _callee11$(_context11) {
502
+ while (1) switch (_context11.prev = _context11.next) {
504
503
  case 0:
505
504
  jest.spyOn(utils, 'getCallingBackEnd').mockReturnValue(_types2.CALLING_BACKEND.UCM);
506
505
  // Since fetchUCMLinesData is a private method, TypeScript restricts direct access to it.
@@ -508,23 +507,23 @@ describe('Call history tests', function () {
508
507
  fetchUCMLinesDataSpy = jest.spyOn(callHistory, 'fetchUCMLinesData').mockResolvedValue(_callHistoryFixtures.MOCK_LINES_API_CALL_RESPONSE);
509
508
  mockCallHistoryPayload = _callHistoryFixtures.MOCK_CALL_HISTORY_WITH_UCM_LINE_NUMBER;
510
509
  webex.request.mockResolvedValue(mockCallHistoryPayload);
511
- _context13.next = 6;
510
+ _context11.next = 6;
512
511
  return callHistory.getCallHistoryData(7, 10, _types2.SORT.DEFAULT, _types2.SORT_BY.DEFAULT);
513
512
  case 6:
514
- response = _context13.sent;
513
+ response = _context11.sent;
515
514
  expect(fetchUCMLinesDataSpy).toHaveBeenCalledTimes(1);
516
515
  expect(response.statusCode).toBe(200);
517
516
  expect(response.data.userSessions && response.data.userSessions[0].self.ucmLineNumber).toEqual(1);
518
517
  case 10:
519
518
  case "end":
520
- return _context13.stop();
519
+ return _context11.stop();
521
520
  }
522
- }, _callee13);
521
+ }, _callee11);
523
522
  })));
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() {
523
+ 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
524
  var fetchUCMLinesDataSpy, mockCallHistoryPayload, response;
526
- return _regenerator.default.wrap(function _callee14$(_context14) {
527
- while (1) switch (_context14.prev = _context14.next) {
525
+ return _regenerator.default.wrap(function _callee12$(_context12) {
526
+ while (1) switch (_context12.prev = _context12.next) {
528
527
  case 0:
529
528
  jest.spyOn(utils, 'getCallingBackEnd').mockReturnValue(_types2.CALLING_BACKEND.UCM);
530
529
 
@@ -533,24 +532,24 @@ describe('Call history tests', function () {
533
532
  fetchUCMLinesDataSpy = jest.spyOn(callHistory, 'fetchUCMLinesData').mockResolvedValue(_callHistoryFixtures.MOCK_LINES_API_CALL_RESPONSE_WITH_NO_LINEDATA);
534
533
  mockCallHistoryPayload = _callHistoryFixtures.MOCK_CALL_HISTORY_WITHOUT_UCM_LINE_NUMBER;
535
534
  webex.request.mockResolvedValue(mockCallHistoryPayload);
536
- _context14.next = 6;
535
+ _context12.next = 6;
537
536
  return callHistory.getCallHistoryData(7, 10, _types2.SORT.DEFAULT, _types2.SORT_BY.DEFAULT);
538
537
  case 6:
539
- response = _context14.sent;
538
+ response = _context12.sent;
540
539
  expect(fetchUCMLinesDataSpy).toHaveBeenCalledTimes(1);
541
540
  expect(response.statusCode).toBe(200);
542
541
  expect(response.data.userSessions && response.data.userSessions[0].self.cucmDN).toBeDefined();
543
542
  expect(response.data.userSessions && response.data.userSessions[0].self.ucmLineNumber).toEqual(undefined);
544
543
  case 11:
545
544
  case "end":
546
- return _context14.stop();
545
+ return _context12.stop();
547
546
  }
548
- }, _callee14);
547
+ }, _callee12);
549
548
  })));
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() {
549
+ 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
550
  var fetchUCMLinesDataSpy, callHistoryPayload;
552
- return _regenerator.default.wrap(function _callee15$(_context15) {
553
- while (1) switch (_context15.prev = _context15.next) {
551
+ return _regenerator.default.wrap(function _callee13$(_context13) {
552
+ while (1) switch (_context13.prev = _context13.next) {
554
553
  case 0:
555
554
  jest.spyOn(utils, 'getCallingBackEnd').mockReturnValue(_types2.CALLING_BACKEND.UCM);
556
555
  // Since fetchUCMLinesData is a private method, TypeScript restricts direct access to it.
@@ -558,20 +557,20 @@ describe('Call history tests', function () {
558
557
  fetchUCMLinesDataSpy = jest.spyOn(callHistory, 'fetchUCMLinesData').mockResolvedValue({});
559
558
  callHistoryPayload = _callHistoryFixtures.mockCallHistoryBody;
560
559
  webex.request.mockResolvedValue(callHistoryPayload);
561
- _context15.next = 6;
560
+ _context13.next = 6;
562
561
  return callHistory.getCallHistoryData(7, 10, _types2.SORT.DEFAULT, _types2.SORT_BY.DEFAULT);
563
562
  case 6:
564
563
  expect(fetchUCMLinesDataSpy).not.toHaveBeenCalled();
565
564
  case 7:
566
565
  case "end":
567
- return _context15.stop();
566
+ return _context13.stop();
568
567
  }
569
- }, _callee15);
568
+ }, _callee13);
570
569
  })));
571
- it('should not call fetchUCMLinesData when calling backend is not UCM', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
570
+ it('should not call fetchUCMLinesData when calling backend is not UCM', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
572
571
  var fetchUCMLinesDataSpy, callHistoryPayload;
573
- return _regenerator.default.wrap(function _callee16$(_context16) {
574
- while (1) switch (_context16.prev = _context16.next) {
572
+ return _regenerator.default.wrap(function _callee14$(_context14) {
573
+ while (1) switch (_context14.prev = _context14.next) {
575
574
  case 0:
576
575
  jest.spyOn(utils, 'getCallingBackEnd').mockReturnValue(_types2.CALLING_BACKEND.WXC);
577
576
  // Since fetchUCMLinesData is a private method, TypeScript restricts direct access to it.
@@ -579,15 +578,15 @@ describe('Call history tests', function () {
579
578
  fetchUCMLinesDataSpy = jest.spyOn(callHistory, 'fetchUCMLinesData').mockResolvedValue({});
580
579
  callHistoryPayload = _callHistoryFixtures.mockCallHistoryBody;
581
580
  webex.request.mockResolvedValue(callHistoryPayload);
582
- _context16.next = 6;
581
+ _context14.next = 6;
583
582
  return callHistory.getCallHistoryData(7, 10, _types2.SORT.DEFAULT, _types2.SORT_BY.DEFAULT);
584
583
  case 6:
585
584
  expect(fetchUCMLinesDataSpy).not.toHaveBeenCalled(); // Check that fetchUCMLinesData was not called
586
585
  case 7:
587
586
  case "end":
588
- return _context16.stop();
587
+ return _context14.stop();
589
588
  }
590
- }, _callee16);
589
+ }, _callee14);
591
590
  })));
592
591
  });
593
592
  describe('Delete call history records test', function () {
@@ -598,9 +597,9 @@ describe('Call history tests', function () {
598
597
  afterEach(function () {
599
598
  jest.clearAllMocks();
600
599
  });
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) {
600
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
601
+ return _regenerator.default.wrap(function _callee15$(_context15) {
602
+ while (1) switch (_context15.prev = _context15.next) {
604
603
  case 0:
605
604
  serviceErrorCodeHandlerSpy = jest.spyOn(utils, 'serviceErrorCodeHandler');
606
605
  uploadLogsSpy = jest.spyOn(utils, 'uploadLogs').mockResolvedValue();
@@ -615,23 +614,23 @@ describe('Call history tests', function () {
615
614
  });
616
615
  case 3:
617
616
  case "end":
618
- return _context17.stop();
617
+ return _context15.stop();
619
618
  }
620
- }, _callee17);
619
+ }, _callee15);
621
620
  })));
622
- it('successfully deletes the call history records', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
621
+ it('successfully deletes the call history records', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
623
622
  var deleteSessionIds, response, convertedEndTimeSessionIds;
624
- return _regenerator.default.wrap(function _callee18$(_context18) {
625
- while (1) switch (_context18.prev = _context18.next) {
623
+ return _regenerator.default.wrap(function _callee16$(_context16) {
624
+ while (1) switch (_context16.prev = _context16.next) {
626
625
  case 0:
627
626
  deleteSessionIds = [{
628
627
  endTime: '2024-10-22T08:50:48.603Z',
629
628
  sessionId: '123'
630
629
  }];
631
- _context18.next = 3;
630
+ _context16.next = 3;
632
631
  return callHistory.deleteCallHistoryRecords(deleteSessionIds);
633
632
  case 3:
634
- response = _context18.sent;
633
+ response = _context16.sent;
635
634
  convertedEndTimeSessionIds = deleteSessionIds.map(function (session) {
636
635
  return _objectSpread(_objectSpread({}, session), {}, {
637
636
  endTime: new Date(session.endTime).getTime()
@@ -639,25 +638,25 @@ describe('Call history tests', function () {
639
638
  });
640
639
  expect(response.statusCode).toEqual(200);
641
640
  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;
641
+ _context16.t0 = expect(global.fetch);
642
+ _context16.t1 = _callHistoryFixtures.janusMarkAsDeletedUrl;
643
+ _context16.t2 = _types2.HTTP_METHODS.POST;
644
+ _context16.t3 = _defineProperty2.default;
645
+ _context16.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
646
+ _context16.next = 14;
648
647
  return webex.credentials.getUserToken();
649
648
  case 14:
650
- _context18.t5 = _context18.sent;
651
- _context18.t6 = (0, _context18.t3)(_context18.t4, "Authorization", _context18.t5);
652
- _context18.t7 = (0, _stringify.default)({
649
+ _context16.t5 = _context16.sent;
650
+ _context16.t6 = (0, _context16.t3)(_context16.t4, "Authorization", _context16.t5);
651
+ _context16.t7 = (0, _stringify.default)({
653
652
  deleteSessionIds: convertedEndTimeSessionIds
654
653
  });
655
- _context18.t8 = {
656
- method: _context18.t2,
657
- headers: _context18.t6,
658
- body: _context18.t7
654
+ _context16.t8 = {
655
+ method: _context16.t2,
656
+ headers: _context16.t6,
657
+ body: _context16.t7
659
658
  };
660
- _context18.t0.toBeCalledOnceWith.call(_context18.t0, _context18.t1, _context18.t8);
659
+ _context16.t0.toBeCalledOnceWith.call(_context16.t0, _context16.t1, _context16.t8);
661
660
  // Verify logs were called with correct information
662
661
  expect(infoSpy).toHaveBeenCalledWith("".concat(_constants2.METHOD_START_MESSAGE, " with sessions: ").concat((0, _stringify.default)(deleteSessionIds)), methodDetails);
663
662
  expect(logSpy).toHaveBeenCalledWith("Successfully deleted ".concat(deleteSessionIds.length, " call history records"), methodDetails);
@@ -665,14 +664,14 @@ describe('Call history tests', function () {
665
664
  expect(uploadLogsSpy).not.toHaveBeenCalled();
666
665
  case 23:
667
666
  case "end":
668
- return _context18.stop();
667
+ return _context16.stop();
669
668
  }
670
- }, _callee18);
669
+ }, _callee16);
671
670
  })));
672
- it('Error: deleteCallHistoryRecords throw 400 error', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
671
+ it('Error: deleteCallHistoryRecords throw 400 error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
673
672
  var deleteSessionIds, response, convertedEndTimeSessionIds;
674
- return _regenerator.default.wrap(function _callee19$(_context19) {
675
- while (1) switch (_context19.prev = _context19.next) {
673
+ return _regenerator.default.wrap(function _callee17$(_context17) {
674
+ while (1) switch (_context17.prev = _context17.next) {
676
675
  case 0:
677
676
  deleteSessionIds = [];
678
677
  global.fetch = jest.fn(function () {
@@ -681,10 +680,10 @@ describe('Call history tests', function () {
681
680
  ok: false
682
681
  });
683
682
  });
684
- _context19.next = 4;
683
+ _context17.next = 4;
685
684
  return callHistory.deleteCallHistoryRecords(deleteSessionIds);
686
685
  case 4:
687
- response = _context19.sent;
686
+ response = _context17.sent;
688
687
  convertedEndTimeSessionIds = deleteSessionIds.map(function (session) {
689
688
  return _objectSpread(_objectSpread({}, session), {}, {
690
689
  endTime: new Date(session.endTime).getTime()
@@ -692,25 +691,25 @@ describe('Call history tests', function () {
692
691
  });
693
692
  expect(response).toStrictEqual(_callHistoryFixtures.ERROR_DETAILS_400);
694
693
  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;
694
+ _context17.t0 = expect(global.fetch);
695
+ _context17.t1 = _callHistoryFixtures.janusMarkAsDeletedUrl;
696
+ _context17.t2 = _types2.HTTP_METHODS.POST;
697
+ _context17.t3 = _defineProperty2.default;
698
+ _context17.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
699
+ _context17.next = 15;
701
700
  return webex.credentials.getUserToken();
702
701
  case 15:
703
- _context19.t5 = _context19.sent;
704
- _context19.t6 = (0, _context19.t3)(_context19.t4, "Authorization", _context19.t5);
705
- _context19.t7 = (0, _stringify.default)({
702
+ _context17.t5 = _context17.sent;
703
+ _context17.t6 = (0, _context17.t3)(_context17.t4, "Authorization", _context17.t5);
704
+ _context17.t7 = (0, _stringify.default)({
706
705
  deleteSessionIds: convertedEndTimeSessionIds
707
706
  });
708
- _context19.t8 = {
709
- method: _context19.t2,
710
- headers: _context19.t6,
711
- body: _context19.t7
707
+ _context17.t8 = {
708
+ method: _context17.t2,
709
+ headers: _context17.t6,
710
+ body: _context17.t7
712
711
  };
713
- _context19.t0.toBeCalledOnceWith.call(_context19.t0, _context19.t1, _context19.t8);
712
+ _context17.t0.toBeCalledOnceWith.call(_context17.t0, _context17.t1, _context17.t8);
714
713
  expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
715
714
  statusCode: 400
716
715
  }, methodDetails);
@@ -718,14 +717,14 @@ describe('Call history tests', function () {
718
717
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
719
718
  case 23:
720
719
  case "end":
721
- return _context19.stop();
720
+ return _context17.stop();
722
721
  }
723
- }, _callee19);
722
+ }, _callee17);
724
723
  })));
725
- it('Error: deleteCallHistoryRecords throw 401 error', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
724
+ it('Error: deleteCallHistoryRecords throw 401 error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
726
725
  var deleteSessionIds, response, convertedEndTimeSessionIds;
727
- return _regenerator.default.wrap(function _callee20$(_context20) {
728
- while (1) switch (_context20.prev = _context20.next) {
726
+ return _regenerator.default.wrap(function _callee18$(_context18) {
727
+ while (1) switch (_context18.prev = _context18.next) {
729
728
  case 0:
730
729
  deleteSessionIds = [];
731
730
  global.fetch = jest.fn(function () {
@@ -734,10 +733,10 @@ describe('Call history tests', function () {
734
733
  ok: false
735
734
  });
736
735
  });
737
- _context20.next = 4;
736
+ _context18.next = 4;
738
737
  return callHistory.deleteCallHistoryRecords(deleteSessionIds);
739
738
  case 4:
740
- response = _context20.sent;
739
+ response = _context18.sent;
741
740
  convertedEndTimeSessionIds = deleteSessionIds.map(function (session) {
742
741
  return _objectSpread(_objectSpread({}, session), {}, {
743
742
  endTime: new Date(session.endTime).getTime()
@@ -745,25 +744,25 @@ describe('Call history tests', function () {
745
744
  });
746
745
  expect(response).toStrictEqual(_callHistoryFixtures.ERROR_DETAILS_401);
747
746
  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;
747
+ _context18.t0 = expect(global.fetch);
748
+ _context18.t1 = _callHistoryFixtures.janusMarkAsDeletedUrl;
749
+ _context18.t2 = _types2.HTTP_METHODS.POST;
750
+ _context18.t3 = _defineProperty2.default;
751
+ _context18.t4 = (0, _defineProperty2.default)({}, _constants.CONTENT_TYPE, _constants.APPLICATION_JSON);
752
+ _context18.next = 15;
754
753
  return webex.credentials.getUserToken();
755
754
  case 15:
756
- _context20.t5 = _context20.sent;
757
- _context20.t6 = (0, _context20.t3)(_context20.t4, "Authorization", _context20.t5);
758
- _context20.t7 = (0, _stringify.default)({
755
+ _context18.t5 = _context18.sent;
756
+ _context18.t6 = (0, _context18.t3)(_context18.t4, "Authorization", _context18.t5);
757
+ _context18.t7 = (0, _stringify.default)({
759
758
  deleteSessionIds: convertedEndTimeSessionIds
760
759
  });
761
- _context20.t8 = {
762
- method: _context20.t2,
763
- headers: _context20.t6,
764
- body: _context20.t7
760
+ _context18.t8 = {
761
+ method: _context18.t2,
762
+ headers: _context18.t6,
763
+ body: _context18.t7
765
764
  };
766
- _context20.t0.toBeCalledOnceWith.call(_context20.t0, _context20.t1, _context20.t8);
765
+ _context18.t0.toBeCalledOnceWith.call(_context18.t0, _context18.t1, _context18.t8);
767
766
  expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
768
767
  statusCode: 401
769
768
  }, methodDetails);
@@ -774,14 +773,14 @@ describe('Call history tests', function () {
774
773
  expect(uploadLogsSpy).toHaveBeenCalledTimes(1);
775
774
  case 23:
776
775
  case "end":
777
- return _context20.stop();
776
+ return _context18.stop();
778
777
  }
779
- }, _callee20);
778
+ }, _callee18);
780
779
  })));
781
- it('handles invalid date formats gracefully', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
780
+ it('handles invalid date formats gracefully', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
782
781
  var deleteSessionIds, response;
783
- return _regenerator.default.wrap(function _callee21$(_context21) {
784
- while (1) switch (_context21.prev = _context21.next) {
782
+ return _regenerator.default.wrap(function _callee19$(_context19) {
783
+ while (1) switch (_context19.prev = _context19.next) {
785
784
  case 0:
786
785
  deleteSessionIds = [{
787
786
  endTime: 'invalid-date',
@@ -793,10 +792,10 @@ describe('Call history tests', function () {
793
792
  ok: false
794
793
  });
795
794
  });
796
- _context21.next = 4;
795
+ _context19.next = 4;
797
796
  return callHistory.deleteCallHistoryRecords(deleteSessionIds);
798
797
  case 4:
799
- response = _context21.sent;
798
+ response = _context19.sent;
800
799
  expect(response.statusCode).toBe(400);
801
800
  expect(response).toEqual(_callHistoryFixtures.MOCK_DELETE_CALL_HISTORY_INVALID_DATE_RESPONSE);
802
801
 
@@ -805,9 +804,9 @@ describe('Call history tests', function () {
805
804
  expect(uploadLogsSpy).not.toHaveBeenCalled();
806
805
  case 9:
807
806
  case "end":
808
- return _context21.stop();
807
+ return _context19.stop();
809
808
  }
810
- }, _callee21);
809
+ }, _callee19);
811
810
  })));
812
811
  });
813
812
  });