@webex/calling 3.9.0-next.7 → 3.9.0-next.9

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 (171) 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 +142 -85
  24. package/dist/CallingClient/CallingClient.js.map +1 -1
  25. package/dist/CallingClient/CallingClient.test.js +184 -173
  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 +343 -320
  34. package/dist/CallingClient/calling/call.js.map +1 -1
  35. package/dist/CallingClient/calling/call.test.js +405 -406
  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 +2 -1
  45. package/dist/CallingClient/constants.js.map +1 -1
  46. package/dist/CallingClient/line/index.js +7 -7
  47. package/dist/CallingClient/line/index.js.map +1 -1
  48. package/dist/CallingClient/line/line.test.js +6 -6
  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 +239 -230
  53. package/dist/CallingClient/registration/register.js.map +1 -1
  54. package/dist/CallingClient/registration/register.test.js +172 -173
  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 +5 -4
  59. package/dist/CallingClient/registration/webWorker.js.map +1 -1
  60. package/dist/CallingClient/registration/webWorker.test.js +14 -14
  61. package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
  62. package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
  63. package/dist/CallingClient/types.js.map +1 -1
  64. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +2 -6
  65. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
  66. package/dist/Contacts/ContactsClient.js +244 -238
  67. package/dist/Contacts/ContactsClient.js.map +1 -1
  68. package/dist/Contacts/ContactsClient.test.js +89 -90
  69. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  70. package/dist/Contacts/constants.js +2 -2
  71. package/dist/Contacts/constants.js.map +1 -1
  72. package/dist/Contacts/contactFixtures.js.map +1 -1
  73. package/dist/Contacts/types.js.map +1 -1
  74. package/dist/Errors/catalog/CallError.js +2 -2
  75. package/dist/Errors/catalog/CallError.js.map +1 -1
  76. package/dist/Errors/catalog/CallingDeviceError.js +2 -2
  77. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  78. package/dist/Errors/catalog/ExtendedError.js +3 -3
  79. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  80. package/dist/Errors/catalog/LineError.js +2 -2
  81. package/dist/Errors/catalog/LineError.js.map +1 -1
  82. package/dist/Errors/index.js.map +1 -1
  83. package/dist/Errors/types.js.map +1 -1
  84. package/dist/Events/impl/index.js +2 -2
  85. package/dist/Events/impl/index.js.map +1 -1
  86. package/dist/Events/types.js.map +1 -1
  87. package/dist/Logger/index.js.map +1 -1
  88. package/dist/Logger/index.test.js.map +1 -1
  89. package/dist/Logger/types.js.map +1 -1
  90. package/dist/Metrics/index.js +109 -46
  91. package/dist/Metrics/index.js.map +1 -1
  92. package/dist/Metrics/index.test.js.map +1 -1
  93. package/dist/Metrics/types.js +8 -1
  94. package/dist/Metrics/types.js.map +1 -1
  95. package/dist/SDKConnector/index.js +0 -1
  96. package/dist/SDKConnector/index.js.map +1 -1
  97. package/dist/SDKConnector/index.test.js.map +1 -1
  98. package/dist/SDKConnector/types.js.map +1 -1
  99. package/dist/SDKConnector/utils.js.map +1 -1
  100. package/dist/SDKConnector/utils.test.js.map +1 -1
  101. package/dist/Voicemail/BroadworksBackendConnector.js +42 -39
  102. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  103. package/dist/Voicemail/BroadworksBackendConnector.test.js +119 -120
  104. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  105. package/dist/Voicemail/UcmBackendConnector.js +54 -47
  106. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  107. package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
  108. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  109. package/dist/Voicemail/Voicemail.js +12 -11
  110. package/dist/Voicemail/Voicemail.js.map +1 -1
  111. package/dist/Voicemail/Voicemail.test.js +2 -2
  112. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  113. package/dist/Voicemail/WxCallBackendConnector.js +78 -70
  114. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  115. package/dist/Voicemail/WxCallBackendConnector.test.js +184 -185
  116. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  117. package/dist/Voicemail/constants.js.map +1 -1
  118. package/dist/Voicemail/types.js.map +1 -1
  119. package/dist/Voicemail/voicemailFixture.js.map +1 -1
  120. package/dist/api.js.map +1 -1
  121. package/dist/common/Utils.js +80 -63
  122. package/dist/common/Utils.js.map +1 -1
  123. package/dist/common/Utils.test.js +95 -104
  124. package/dist/common/Utils.test.js.map +1 -1
  125. package/dist/common/constants.js.map +1 -1
  126. package/dist/common/index.js.map +1 -1
  127. package/dist/common/testUtil.js +1 -1
  128. package/dist/common/testUtil.js.map +1 -1
  129. package/dist/common/types.js.map +1 -1
  130. package/dist/index.js +5 -5
  131. package/dist/index.js.map +1 -1
  132. package/dist/module/CallHistory/CallHistory.js +4 -0
  133. package/dist/module/CallSettings/UcmBackendConnector.js +1 -0
  134. package/dist/module/CallSettings/WxCallBackendConnector.js +7 -0
  135. package/dist/module/CallingClient/CallingClient.js +62 -20
  136. package/dist/module/CallingClient/calling/call.js +66 -43
  137. package/dist/module/CallingClient/constants.js +2 -1
  138. package/dist/module/CallingClient/registration/register.js +6 -3
  139. package/dist/module/CallingClient/registration/webWorker.js +2 -1
  140. package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +1 -4
  141. package/dist/module/Contacts/ContactsClient.js +23 -17
  142. package/dist/module/Contacts/constants.js +1 -1
  143. package/dist/module/Metrics/index.js +42 -0
  144. package/dist/module/Metrics/types.js +7 -0
  145. package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -0
  146. package/dist/module/Voicemail/UcmBackendConnector.js +6 -0
  147. package/dist/module/Voicemail/WxCallBackendConnector.js +8 -0
  148. package/dist/module/common/Utils.js +22 -8
  149. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  150. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  151. package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
  152. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  153. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  154. package/dist/types/CallingClient/constants.d.ts +2 -1
  155. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  156. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  157. package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
  158. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
  159. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +2 -4
  160. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -1
  161. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  162. package/dist/types/Contacts/constants.d.ts +1 -1
  163. package/dist/types/Contacts/constants.d.ts.map +1 -1
  164. package/dist/types/Metrics/index.d.ts.map +1 -1
  165. package/dist/types/Metrics/types.d.ts +10 -2
  166. package/dist/types/Metrics/types.d.ts.map +1 -1
  167. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
  168. package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
  169. package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
  170. package/dist/types/common/Utils.d.ts.map +1 -1
  171. package/package.json +9 -7
@@ -29,8 +29,7 @@ var _constants = require("../constants");
29
29
  var _types4 = require("../line/types");
30
30
  var _LineError = require("../../Errors/catalog/LineError");
31
31
  var _types5 = require("../../Metrics/types");
32
- 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); }
33
- 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; }
32
+ 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); }
34
33
  function ownKeys(e, r) { var t = _Object$keys2(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; }
35
34
  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-shadow */
36
35
  var webex = (0, _testUtil.getTestUtilsWebex)();
@@ -143,7 +142,7 @@ describe('Registration Tests', function () {
143
142
  jest.clearAllMocks();
144
143
  jest.useRealTimers();
145
144
  });
146
- it('verify successful registration', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
145
+ it('verify successful registration', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
147
146
  return _regenerator.default.wrap(function _callee$(_context) {
148
147
  while (1) switch (_context.prev = _context.next) {
149
148
  case 0:
@@ -165,9 +164,9 @@ describe('Registration Tests', function () {
165
164
  expect(lineEmitter).toBeCalledWith(_types4.LINE_EVENTS.REGISTERED, _registerFixtures.mockPostResponse);
166
165
 
167
166
  // Check that log.log was called for successful registration
168
- expect(logSpy).toBeCalledWith("Registration successful for deviceId: ".concat(_registerFixtures.mockPostResponse.device.deviceId, " userId: ").concat(_registerFixtures.mockPostResponse.userId), expect.objectContaining({
167
+ expect(logSpy).toBeCalledWith("Registration successful for deviceId: ".concat(_registerFixtures.mockPostResponse.device.deviceId, " userId: ").concat(_registerFixtures.mockPostResponse.userId, " responseTrackingId: webex-js-sdk_06bafdd0-2f9b-4cd7-b438-9c0d95ecec9b_15"), expect.objectContaining({
169
168
  file: _constants.REGISTRATION_FILE,
170
- method: expect.any(String)
169
+ method: 'register'
171
170
  }));
172
171
  expect(metricSpy).toBeCalledWith(_types5.METRIC_EVENT.REGISTRATION, _types5.REG_ACTION.REGISTER, _types5.METRIC_TYPE.BEHAVIORAL, _constants.REGISTRATION_UTIL, 'PRIMARY', 'webex-js-sdk_06bafdd0-2f9b-4cd7-b438-9c0d95ecec9b_15', undefined, undefined);
173
172
  case 10:
@@ -176,7 +175,7 @@ describe('Registration Tests', function () {
176
175
  }
177
176
  }, _callee);
178
177
  })));
179
- it('verify failure registration', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
178
+ it('verify failure registration', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
180
179
  var error;
181
180
  return _regenerator.default.wrap(function _callee2$(_context2) {
182
181
  while (1) switch (_context2.prev = _context2.next) {
@@ -204,7 +203,7 @@ describe('Registration Tests', function () {
204
203
  }
205
204
  }, _callee2);
206
205
  })));
207
- it('verify failure registration 403-101', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
206
+ it('verify failure registration 403-101', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
208
207
  return _regenerator.default.wrap(function _callee3$(_context3) {
209
208
  while (1) switch (_context3.prev = _context3.next) {
210
209
  case 0:
@@ -270,7 +269,7 @@ describe('Registration Tests', function () {
270
269
  mobiusUris.backup.push(_registerFixtures.URL);
271
270
  jest.clearAllMocks();
272
271
  });
273
- it('handle 429 received during initial registration failure and first attempt with primary', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
272
+ it('handle 429 received during initial registration failure and first attempt with primary', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
274
273
  return _regenerator.default.wrap(function _callee4$(_context4) {
275
274
  while (1) switch (_context4.prev = _context4.next) {
276
275
  case 0:
@@ -332,7 +331,7 @@ describe('Registration Tests', function () {
332
331
  }
333
332
  }, _callee4);
334
333
  })));
335
- it('handle 429 received with higher retryAfter than the interval when interval with elapsedTime is already reaching threshold timer so we failover immediately', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
334
+ it('handle 429 received with higher retryAfter than the interval when interval with elapsedTime is already reaching threshold timer so we failover immediately', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
336
335
  return _regenerator.default.wrap(function _callee5$(_context5) {
337
336
  while (1) switch (_context5.prev = _context5.next) {
338
337
  case 0:
@@ -388,7 +387,7 @@ describe('Registration Tests', function () {
388
387
  }
389
388
  }, _callee5);
390
389
  })));
391
- it('handle 429 received while the last attempt for primary', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
390
+ it('handle 429 received while the last attempt for primary', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
392
391
  return _regenerator.default.wrap(function _callee6$(_context6) {
393
392
  while (1) switch (_context6.prev = _context6.next) {
394
393
  case 0:
@@ -459,7 +458,7 @@ describe('Registration Tests', function () {
459
458
  }
460
459
  }, _callee6);
461
460
  })));
462
- it('handle 429 received while failing over to backup server for CC flow', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
461
+ it('handle 429 received while failing over to backup server for CC flow', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
463
462
  return _regenerator.default.wrap(function _callee7$(_context7) {
464
463
  while (1) switch (_context7.prev = _context7.next) {
465
464
  case 0:
@@ -508,7 +507,7 @@ describe('Registration Tests', function () {
508
507
  }
509
508
  }, _callee7);
510
509
  })));
511
- it('checking the retryAfter exceeding the threshold timers in first attempt itself', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
510
+ it('checking the retryAfter exceeding the threshold timers in first attempt itself', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
512
511
  return _regenerator.default.wrap(function _callee8$(_context8) {
513
512
  while (1) switch (_context8.prev = _context8.next) {
514
513
  case 0:
@@ -538,7 +537,7 @@ describe('Registration Tests', function () {
538
537
  }
539
538
  }, _callee8);
540
539
  })));
541
- it('checking the retryAfter exceeding the threshold timers in later attempts', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
540
+ it('checking the retryAfter exceeding the threshold timers in later attempts', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
542
541
  return _regenerator.default.wrap(function _callee9$(_context9) {
543
542
  while (1) switch (_context9.prev = _context9.next) {
544
543
  case 0:
@@ -583,19 +582,19 @@ describe('Registration Tests', function () {
583
582
  })));
584
583
  });
585
584
  describe('Registration failover tests', function () {
586
- it('verify unreachable primary with reachable backup servers', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
587
- return _regenerator.default.wrap(function _callee10$(_context10) {
588
- while (1) switch (_context10.prev = _context10.next) {
585
+ it('verify unreachable primary with reachable backup servers', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
586
+ return _regenerator.default.wrap(function _callee0$(_context0) {
587
+ while (1) switch (_context0.prev = _context0.next) {
589
588
  case 0:
590
589
  jest.useFakeTimers();
591
590
  // try the primary twice and register successfully with backup servers
592
591
  webex.request.mockRejectedValueOnce(failurePayload).mockRejectedValueOnce(failurePayload).mockResolvedValueOnce(successPayload);
593
592
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.IDLE);
594
- _context10.next = 5;
593
+ _context0.next = 5;
595
594
  return reg.triggerRegistration();
596
595
  case 5:
597
596
  jest.advanceTimersByTime(_constants.REG_TRY_BACKUP_TIMER_VAL_IN_SEC * _constants.SEC_TO_MSEC_MFACTOR);
598
- _context10.next = 8;
597
+ _context0.next = 8;
599
598
  return flushPromises();
600
599
  case 8:
601
600
  expect(webex.request).toBeCalledTimes(3);
@@ -613,13 +612,13 @@ describe('Registration Tests', function () {
613
612
  expect(metricSpy).toHaveBeenNthCalledWith(3, _types5.METRIC_EVENT.REGISTRATION, _types5.REG_ACTION.REGISTER, _types5.METRIC_TYPE.BEHAVIORAL, _constants.FAILOVER_UTIL, 'BACKUP', 'webex-js-sdk_06bafdd0-2f9b-4cd7-b438-9c0d95ecec9b_15', undefined, undefined);
614
613
  case 14:
615
614
  case "end":
616
- return _context10.stop();
615
+ return _context0.stop();
617
616
  }
618
- }, _callee10);
617
+ }, _callee0);
619
618
  })));
620
- it('cc: verify unreachable primary with reachable backup server', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
621
- return _regenerator.default.wrap(function _callee11$(_context11) {
622
- while (1) switch (_context11.prev = _context11.next) {
619
+ it('cc: verify unreachable primary with reachable backup server', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
620
+ return _regenerator.default.wrap(function _callee1$(_context1) {
621
+ while (1) switch (_context1.prev = _context1.next) {
623
622
  case 0:
624
623
  setupRegistration(_objectSpread(_objectSpread({}, MockServiceData), {}, {
625
624
  indicator: _types.ServiceIndicator.CONTACT_CENTER
@@ -627,11 +626,11 @@ describe('Registration Tests', function () {
627
626
  jest.useFakeTimers();
628
627
  webex.request.mockRejectedValueOnce(failurePayload).mockRejectedValueOnce(failurePayload).mockResolvedValueOnce(successPayload);
629
628
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.IDLE);
630
- _context11.next = 6;
629
+ _context1.next = 6;
631
630
  return reg.triggerRegistration();
632
631
  case 6:
633
632
  jest.advanceTimersByTime(_constants.REG_TRY_BACKUP_TIMER_VAL_IN_SEC * _constants.SEC_TO_MSEC_MFACTOR);
634
- _context11.next = 9;
633
+ _context1.next = 9;
635
634
  return flushPromises();
636
635
  case 9:
637
636
  expect(webex.request).toBeCalledTimes(3);
@@ -648,27 +647,27 @@ describe('Registration Tests', function () {
648
647
  expect(reg.getActiveMobiusUrl()).toEqual(mobiusUris.backup[0]);
649
648
  case 14:
650
649
  case "end":
651
- return _context11.stop();
650
+ return _context1.stop();
652
651
  }
653
- }, _callee11);
652
+ }, _callee1);
654
653
  })));
655
- it('verify unreachable primary and backup servers', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
656
- return _regenerator.default.wrap(function _callee12$(_context12) {
657
- while (1) switch (_context12.prev = _context12.next) {
654
+ it('verify unreachable primary and backup servers', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
655
+ return _regenerator.default.wrap(function _callee10$(_context10) {
656
+ while (1) switch (_context10.prev = _context10.next) {
658
657
  case 0:
659
658
  jest.useFakeTimers();
660
659
  // try the primary twice and register successfully with backup servers
661
660
  webex.request.mockRejectedValue(failurePayload);
662
661
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.IDLE);
663
- _context12.next = 5;
662
+ _context10.next = 5;
664
663
  return reg.triggerRegistration();
665
664
  case 5:
666
665
  jest.advanceTimersByTime(_constants.REG_TRY_BACKUP_TIMER_VAL_IN_SEC * _constants.SEC_TO_MSEC_MFACTOR);
667
- _context12.next = 8;
666
+ _context10.next = 8;
668
667
  return flushPromises();
669
668
  case 8:
670
669
  jest.advanceTimersByTime(_constants.REG_TRY_BACKUP_TIMER_VAL_IN_SEC * _constants.SEC_TO_MSEC_MFACTOR);
671
- _context12.next = 11;
670
+ _context10.next = 11;
672
671
  return flushPromises();
673
672
  case 11:
674
673
  /*
@@ -693,27 +692,27 @@ describe('Registration Tests', function () {
693
692
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.INACTIVE);
694
693
  case 17:
695
694
  case "end":
696
- return _context12.stop();
695
+ return _context10.stop();
697
696
  }
698
- }, _callee12);
697
+ }, _callee10);
699
698
  })));
700
699
  });
701
700
  describe('Registration failback tests', function () {
702
701
  var isPrimaryActiveSpy;
703
- beforeEach( /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
704
- return _regenerator.default.wrap(function _callee13$(_context13) {
705
- while (1) switch (_context13.prev = _context13.next) {
702
+ beforeEach(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
703
+ return _regenerator.default.wrap(function _callee11$(_context11) {
704
+ while (1) switch (_context11.prev = _context11.next) {
706
705
  case 0:
707
706
  isPrimaryActiveSpy = jest.spyOn(reg, 'isPrimaryActive');
708
707
  isPrimaryActiveSpy.mockReturnValue(true);
709
708
  /* keep keepalive as active so that it wont interfere with the failback tests */
710
709
  jest.useFakeTimers();
711
710
  postRegistrationSpy.mockRejectedValueOnce(failurePayload).mockRejectedValueOnce(failurePayload).mockResolvedValueOnce(successPayload);
712
- _context13.next = 6;
711
+ _context11.next = 6;
713
712
  return reg.triggerRegistration();
714
713
  case 6:
715
714
  jest.advanceTimersByTime(_constants.REG_TRY_BACKUP_TIMER_VAL_IN_SEC * _constants.SEC_TO_MSEC_MFACTOR);
716
- _context13.next = 9;
715
+ _context11.next = 9;
717
716
  return flushPromises();
718
717
  case 9:
719
718
  reg.rehomingIntervalMin = _constants.DEFAULT_REHOMING_INTERVAL_MIN;
@@ -727,17 +726,17 @@ describe('Registration Tests', function () {
727
726
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.ACTIVE);
728
727
  case 14:
729
728
  case "end":
730
- return _context13.stop();
729
+ return _context11.stop();
731
730
  }
732
- }, _callee13);
731
+ }, _callee11);
733
732
  })));
734
733
  afterEach(function () {
735
734
  jest.clearAllTimers();
736
735
  jest.clearAllMocks();
737
736
  });
738
- it('verify 429 error with failback to primary after initial registration with backup: Restore failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
739
- return _regenerator.default.wrap(function _callee14$(_context14) {
740
- while (1) switch (_context14.prev = _context14.next) {
737
+ it('verify 429 error with failback to primary after initial registration with backup: Restore failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
738
+ return _regenerator.default.wrap(function _callee12$(_context12) {
739
+ while (1) switch (_context12.prev = _context12.next) {
741
740
  case 0:
742
741
  // delete should be successful
743
742
  global.fetch = jest.fn(function () {
@@ -751,7 +750,7 @@ describe('Registration Tests', function () {
751
750
 
752
751
  /* Wait for failback to be triggered. */
753
752
  jest.advanceTimersByTime(reg.rehomingIntervalMax * _constants.MINUTES_TO_SEC_MFACTOR * _constants.SEC_TO_MSEC_MFACTOR);
754
- _context14.next = 5;
753
+ _context12.next = 5;
755
754
  return flushPromises();
756
755
  case 5:
757
756
  expect(infoSpy).toBeCalledWith("Attempting failback to primary.", {
@@ -759,7 +758,7 @@ describe('Registration Tests', function () {
759
758
  file: _constants.REGISTRATION_FILE
760
759
  });
761
760
  jest.advanceTimersByTime(10000);
762
- _context14.next = 9;
761
+ _context12.next = 9;
763
762
  return flushPromises();
764
763
  case 9:
765
764
  expect(retry429Spy).toBeCalledWith(failurePayload429Two.headers['retry-after'], 'executeFailback');
@@ -772,19 +771,19 @@ describe('Registration Tests', function () {
772
771
  expect(reg.rehomingIntervalMax).toBe(_constants.DEFAULT_REHOMING_INTERVAL_MAX);
773
772
  case 17:
774
773
  case "end":
775
- return _context14.stop();
774
+ return _context12.stop();
776
775
  }
777
- }, _callee14);
776
+ }, _callee12);
778
777
  })));
779
- it('verify unsuccessful failback to primary after initial registration with backup: Restore failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
780
- return _regenerator.default.wrap(function _callee15$(_context15) {
781
- while (1) switch (_context15.prev = _context15.next) {
778
+ it('verify unsuccessful failback to primary after initial registration with backup: Restore failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
779
+ return _regenerator.default.wrap(function _callee13$(_context13) {
780
+ while (1) switch (_context13.prev = _context13.next) {
782
781
  case 0:
783
782
  postRegistrationSpy.mockRejectedValue(failurePayload);
784
783
 
785
784
  /* Wait for failback to be triggered. */
786
785
  jest.advanceTimersByTime(reg.rehomingIntervalMax * _constants.MINUTES_TO_SEC_MFACTOR * _constants.SEC_TO_MSEC_MFACTOR);
787
- _context15.next = 4;
786
+ _context13.next = 4;
788
787
  return flushPromises();
789
788
  case 4:
790
789
  expect(infoSpy).toBeCalledWith("Attempting failback to primary.", {
@@ -799,14 +798,14 @@ describe('Registration Tests', function () {
799
798
  expect(reg.rehomingIntervalMax).toBe(_constants.DEFAULT_REHOMING_INTERVAL_MAX);
800
799
  case 11:
801
800
  case "end":
802
- return _context15.stop();
801
+ return _context13.stop();
803
802
  }
804
- }, _callee15);
803
+ }, _callee13);
805
804
  })));
806
- it('verify unsuccessful failback to primary after initial registration with backup: Restore failure with final error', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
805
+ it('verify unsuccessful failback to primary after initial registration with backup: Restore failure with final error', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
807
806
  var finalErrorPayload;
808
- return _regenerator.default.wrap(function _callee16$(_context16) {
809
- while (1) switch (_context16.prev = _context16.next) {
807
+ return _regenerator.default.wrap(function _callee14$(_context14) {
808
+ while (1) switch (_context14.prev = _context14.next) {
810
809
  case 0:
811
810
  finalErrorPayload = {
812
811
  statusCode: 401,
@@ -816,7 +815,7 @@ describe('Registration Tests', function () {
816
815
  postRegistrationSpy.mockRejectedValue(finalErrorPayload).mockRejectedValueOnce(failurePayload);
817
816
  /* Wait for failback to be triggered. */
818
817
  jest.advanceTimersByTime(reg.rehomingIntervalMax * _constants.MINUTES_TO_SEC_MFACTOR * _constants.SEC_TO_MSEC_MFACTOR);
819
- _context16.next = 6;
818
+ _context14.next = 6;
820
819
  return flushPromises();
821
820
  case 6:
822
821
  expect(infoSpy).toBeCalledWith("Attempting failback to primary.", {
@@ -831,19 +830,19 @@ describe('Registration Tests', function () {
831
830
  expect(reg.rehomingIntervalMax).toBe(_constants.DEFAULT_REHOMING_INTERVAL_MAX);
832
831
  case 13:
833
832
  case "end":
834
- return _context16.stop();
833
+ return _context14.stop();
835
834
  }
836
- }, _callee16);
835
+ }, _callee14);
837
836
  })));
838
- it('verify unsuccessful failback to primary after initial registration with backup: Restore success', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
839
- return _regenerator.default.wrap(function _callee17$(_context17) {
840
- while (1) switch (_context17.prev = _context17.next) {
837
+ it('verify unsuccessful failback to primary after initial registration with backup: Restore success', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
838
+ return _regenerator.default.wrap(function _callee15$(_context15) {
839
+ while (1) switch (_context15.prev = _context15.next) {
841
840
  case 0:
842
841
  postRegistrationSpy.mockRejectedValueOnce(failurePayload).mockResolvedValue(successPayload);
843
842
 
844
843
  /* Wait for failback to be triggered. */
845
844
  jest.advanceTimersByTime(reg.rehomingIntervalMax * _constants.MINUTES_TO_SEC_MFACTOR * _constants.SEC_TO_MSEC_MFACTOR);
846
- _context17.next = 4;
845
+ _context15.next = 4;
847
846
  return flushPromises();
848
847
  case 4:
849
848
  expect(infoSpy).toBeCalledWith("Attempting failback to primary.", {
@@ -859,19 +858,19 @@ describe('Registration Tests', function () {
859
858
  expect(reg.rehomingIntervalMax).toBe(_constants.DEFAULT_REHOMING_INTERVAL_MAX);
860
859
  case 11:
861
860
  case "end":
862
- return _context17.stop();
861
+ return _context15.stop();
863
862
  }
864
- }, _callee17);
863
+ }, _callee15);
865
864
  })));
866
- it('verify successful failback to primary after initial registration with backup', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
867
- return _regenerator.default.wrap(function _callee18$(_context18) {
868
- while (1) switch (_context18.prev = _context18.next) {
865
+ it('verify successful failback to primary after initial registration with backup', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
866
+ return _regenerator.default.wrap(function _callee16$(_context16) {
867
+ while (1) switch (_context16.prev = _context16.next) {
869
868
  case 0:
870
869
  postRegistrationSpy.mockResolvedValue(successPayload);
871
870
 
872
871
  /* Wait for failback to be triggered. */
873
872
  jest.advanceTimersByTime(reg.rehomingIntervalMax * _constants.MINUTES_TO_SEC_MFACTOR * _constants.SEC_TO_MSEC_MFACTOR);
874
- _context18.next = 4;
873
+ _context16.next = 4;
875
874
  return flushPromises();
876
875
  case 4:
877
876
  expect(infoSpy).toBeCalledWith("Attempting failback to primary.", {
@@ -889,13 +888,13 @@ describe('Registration Tests', function () {
889
888
  expect(reg.rehomingIntervalMax).toBe(_registerFixtures.mockPostResponse.rehomingIntervalMax);
890
889
  case 12:
891
890
  case "end":
892
- return _context18.stop();
891
+ return _context16.stop();
893
892
  }
894
- }, _callee18);
893
+ }, _callee16);
895
894
  })));
896
- it('verify unsuccessful failback attempt due to active call', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19() {
897
- return _regenerator.default.wrap(function _callee19$(_context19) {
898
- while (1) switch (_context19.prev = _context19.next) {
895
+ it('verify unsuccessful failback attempt due to active call', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
896
+ return _regenerator.default.wrap(function _callee17$(_context17) {
897
+ while (1) switch (_context17.prev = _context17.next) {
899
898
  case 0:
900
899
  /** create a new call */
901
900
  reg.callManager.createCall();
@@ -904,7 +903,7 @@ describe('Registration Tests', function () {
904
903
 
905
904
  /* Wait for failback to be triggered. */
906
905
  jest.advanceTimersByTime(reg.rehomingIntervalMax * _constants.MINUTES_TO_SEC_MFACTOR * _constants.SEC_TO_MSEC_MFACTOR);
907
- _context19.next = 6;
906
+ _context17.next = 6;
908
907
  return flushPromises();
909
908
  case 6:
910
909
  expect(infoSpy).toBeCalledWith("Active calls present or primary Mobius is down, deferring failback to next cycle.", {
@@ -926,19 +925,19 @@ describe('Registration Tests', function () {
926
925
  expect(reg.rehomingIntervalMax).toBe(_constants.DEFAULT_REHOMING_INTERVAL_MAX);
927
926
  case 15:
928
927
  case "end":
929
- return _context19.stop();
928
+ return _context17.stop();
930
929
  }
931
- }, _callee19);
930
+ }, _callee17);
932
931
  })));
933
- it('verify unsuccessful failback attempt due to primary server being down', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee20() {
934
- return _regenerator.default.wrap(function _callee20$(_context20) {
935
- while (1) switch (_context20.prev = _context20.next) {
932
+ it('verify unsuccessful failback attempt due to primary server being down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
933
+ return _regenerator.default.wrap(function _callee18$(_context18) {
934
+ while (1) switch (_context18.prev = _context18.next) {
936
935
  case 0:
937
936
  isPrimaryActiveSpy.mockReturnValue(false);
938
937
 
939
938
  /* Wait for failback to be triggered. */
940
939
  jest.advanceTimersByTime(reg.rehomingIntervalMax * _constants.MINUTES_TO_SEC_MFACTOR * _constants.SEC_TO_MSEC_MFACTOR);
941
- _context20.next = 4;
940
+ _context18.next = 4;
942
941
  return flushPromises();
943
942
  case 4:
944
943
  expect(infoSpy).toBeCalledWith("Active calls present or primary Mobius is down, deferring failback to next cycle.", {
@@ -952,34 +951,34 @@ describe('Registration Tests', function () {
952
951
  expect(reg.getStatus()).toBe(_types.RegistrationStatus.ACTIVE);
953
952
  case 8:
954
953
  case "end":
955
- return _context20.stop();
954
+ return _context18.stop();
956
955
  }
957
- }, _callee20);
956
+ }, _callee18);
958
957
  })));
959
958
  });
960
959
 
961
960
  // Keep-alive related test cases
962
961
  describe('Keep-alive Tests', function () {
963
962
  var beforeEachSetupForKeepalive = /*#__PURE__*/function () {
964
- var _ref21 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee21() {
965
- return _regenerator.default.wrap(function _callee21$(_context21) {
966
- while (1) switch (_context21.prev = _context21.next) {
963
+ var _ref19 = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
964
+ return _regenerator.default.wrap(function _callee19$(_context19) {
965
+ while (1) switch (_context19.prev = _context19.next) {
967
966
  case 0:
968
967
  postRegistrationSpy.mockResolvedValueOnce(successPayload);
969
968
  jest.useFakeTimers();
970
- _context21.next = 4;
969
+ _context19.next = 4;
971
970
  return reg.triggerRegistration();
972
971
  case 4:
973
972
  expect(reg.getStatus()).toBe(_types.RegistrationStatus.ACTIVE);
974
973
  expect(reg.webWorker).toBeDefined();
975
974
  case 6:
976
975
  case "end":
977
- return _context21.stop();
976
+ return _context19.stop();
978
977
  }
979
- }, _callee21);
978
+ }, _callee19);
980
979
  }));
981
980
  return function beforeEachSetupForKeepalive() {
982
- return _ref21.apply(this, arguments);
981
+ return _ref19.apply(this, arguments);
983
982
  };
984
983
  }();
985
984
  afterEach(function () {
@@ -992,13 +991,13 @@ describe('Registration Tests', function () {
992
991
  call.end();
993
992
  });
994
993
  });
995
- it('verify successful keep-alive cases', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee22() {
994
+ it('verify successful keep-alive cases', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
996
995
  var postMessageSpy;
997
- return _regenerator.default.wrap(function _callee22$(_context22) {
998
- while (1) switch (_context22.prev = _context22.next) {
996
+ return _regenerator.default.wrap(function _callee20$(_context20) {
997
+ while (1) switch (_context20.prev = _context20.next) {
999
998
  case 0:
1000
999
  postMessageSpy = jest.spyOn(Worker.prototype, 'postMessage');
1001
- _context22.next = 3;
1000
+ _context20.next = 3;
1002
1001
  return beforeEachSetupForKeepalive();
1003
1002
  case 3:
1004
1003
  expect(reg.webWorker).toBeDefined();
@@ -1019,16 +1018,16 @@ describe('Registration Tests', function () {
1019
1018
  expect(lineEmitter).toBeCalledWith(_types4.LINE_EVENTS.RECONNECTED);
1020
1019
  case 7:
1021
1020
  case "end":
1022
- return _context22.stop();
1021
+ return _context20.stop();
1023
1022
  }
1024
- }, _callee22);
1023
+ }, _callee20);
1025
1024
  })));
1026
- it('verify failure keep-alive cases: Retry Success', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23() {
1025
+ it('verify failure keep-alive cases: Retry Success', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
1027
1026
  var worker;
1028
- return _regenerator.default.wrap(function _callee23$(_context23) {
1029
- while (1) switch (_context23.prev = _context23.next) {
1027
+ return _regenerator.default.wrap(function _callee21$(_context21) {
1028
+ while (1) switch (_context21.prev = _context21.next) {
1030
1029
  case 0:
1031
- _context23.next = 2;
1030
+ _context21.next = 2;
1032
1031
  return beforeEachSetupForKeepalive();
1033
1032
  case 2:
1034
1033
  worker = reg.webWorker;
@@ -1051,16 +1050,16 @@ describe('Registration Tests', function () {
1051
1050
  expect(lineEmitter).toHaveBeenCalledWith(_types4.LINE_EVENTS.RECONNECTED);
1052
1051
  case 7:
1053
1052
  case "end":
1054
- return _context23.stop();
1053
+ return _context21.stop();
1055
1054
  }
1056
- }, _callee23);
1055
+ }, _callee21);
1057
1056
  })));
1058
- it('verify failure keep-alive cases: Restore failure', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee24() {
1057
+ it('verify failure keep-alive cases: Restore failure', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
1059
1058
  var reconnectSpy, restoreSpy, restartRegSpy, RETRY_COUNT_THRESHOLD, failureEvent;
1060
- return _regenerator.default.wrap(function _callee24$(_context24) {
1061
- while (1) switch (_context24.prev = _context24.next) {
1059
+ return _regenerator.default.wrap(function _callee22$(_context22) {
1060
+ while (1) switch (_context22.prev = _context22.next) {
1062
1061
  case 0:
1063
- _context24.next = 2;
1062
+ _context22.next = 2;
1064
1063
  return beforeEachSetupForKeepalive();
1065
1064
  case 2:
1066
1065
  reconnectSpy = jest.spyOn(reg, 'reconnectOnFailure');
@@ -1087,7 +1086,7 @@ describe('Registration Tests', function () {
1087
1086
  }
1088
1087
  };
1089
1088
  reg.webWorker.onmessage(failureEvent);
1090
- _context24.next = 14;
1089
+ _context22.next = 14;
1091
1090
  return flushPromises();
1092
1091
  case 14:
1093
1092
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.INACTIVE);
@@ -1102,16 +1101,16 @@ describe('Registration Tests', function () {
1102
1101
  }));
1103
1102
  case 21:
1104
1103
  case "end":
1105
- return _context24.stop();
1104
+ return _context22.stop();
1106
1105
  }
1107
- }, _callee24);
1106
+ }, _callee22);
1108
1107
  })));
1109
- it('verify failure keep-alive cases: Restore Success', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee25() {
1108
+ it('verify failure keep-alive cases: Restore Success', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
1110
1109
  var reconnectSpy, url;
1111
- return _regenerator.default.wrap(function _callee25$(_context25) {
1112
- while (1) switch (_context25.prev = _context25.next) {
1110
+ return _regenerator.default.wrap(function _callee23$(_context23) {
1111
+ while (1) switch (_context23.prev = _context23.next) {
1113
1112
  case 0:
1114
- _context25.next = 2;
1113
+ _context23.next = 2;
1115
1114
  return beforeEachSetupForKeepalive();
1116
1115
  case 2:
1117
1116
  expect(reg.webWorker).toBeDefined();
@@ -1127,16 +1126,16 @@ describe('Registration Tests', function () {
1127
1126
  }
1128
1127
  });
1129
1128
  jest.advanceTimersByTime(1000);
1130
- _context25.next = 9;
1129
+ _context23.next = 9;
1131
1130
  return flushPromises();
1132
1131
  case 9:
1133
1132
  expect(reg.webWorker).toBeUndefined();
1134
1133
  expect(reconnectSpy).toBeCalledOnceWith(reg.startKeepaliveTimer.name);
1135
1134
  webex.request.mockResolvedValueOnce(successPayload);
1136
- _context25.next = 14;
1135
+ _context23.next = 14;
1137
1136
  return reg.triggerRegistration();
1138
1137
  case 14:
1139
- _context25.next = 16;
1138
+ _context23.next = 16;
1140
1139
  return flushPromises();
1141
1140
  case 16:
1142
1141
  expect(reg.webWorker).toBeDefined();
@@ -1149,7 +1148,7 @@ describe('Registration Tests', function () {
1149
1148
 
1150
1149
  // Advance timers and flush any remaining promises.
1151
1150
  jest.advanceTimersByTime(1000);
1152
- _context25.next = 21;
1151
+ _context23.next = 21;
1153
1152
  return flushPromises();
1154
1153
  case 21:
1155
1154
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.ACTIVE);
@@ -1161,15 +1160,15 @@ describe('Registration Tests', function () {
1161
1160
  expect(reg.getActiveMobiusUrl()).toStrictEqual(url);
1162
1161
  case 26:
1163
1162
  case "end":
1164
- return _context25.stop();
1163
+ return _context23.stop();
1165
1164
  }
1166
- }, _callee25);
1165
+ }, _callee23);
1167
1166
  })));
1168
- it('verify failure followed by recovery of keepalive', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee26() {
1169
- return _regenerator.default.wrap(function _callee26$(_context26) {
1170
- while (1) switch (_context26.prev = _context26.next) {
1167
+ it('verify failure followed by recovery of keepalive', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
1168
+ return _regenerator.default.wrap(function _callee24$(_context24) {
1169
+ while (1) switch (_context24.prev = _context24.next) {
1171
1170
  case 0:
1172
- _context26.next = 2;
1171
+ _context24.next = 2;
1173
1172
  return beforeEachSetupForKeepalive();
1174
1173
  case 2:
1175
1174
  expect(reg.getStatus()).toBe(_types.RegistrationStatus.ACTIVE);
@@ -1182,15 +1181,15 @@ describe('Registration Tests', function () {
1182
1181
  keepAliveRetryCount: reg.isCCFlow ? 4 : 5
1183
1182
  }
1184
1183
  });
1185
- _context26.next = 8;
1184
+ _context24.next = 8;
1186
1185
  return flushPromises();
1187
1186
  case 8:
1188
1187
  expect(reg.webWorker).toBeUndefined();
1189
1188
  expect(handleErrorSpy).toBeCalledTimes(3);
1190
- _context26.next = 12;
1189
+ _context24.next = 12;
1191
1190
  return reg.triggerRegistration();
1192
1191
  case 12:
1193
- _context26.next = 14;
1192
+ _context24.next = 14;
1194
1193
  return flushPromises();
1195
1194
  case 14:
1196
1195
  expect(reg.webWorker).toBeDefined();
@@ -1200,7 +1199,7 @@ describe('Registration Tests', function () {
1200
1199
  statusCode: 200
1201
1200
  }
1202
1201
  });
1203
- _context26.next = 18;
1202
+ _context24.next = 18;
1204
1203
  return flushPromises();
1205
1204
  case 18:
1206
1205
  // In a complete failure‐then-recovery scenario, we expect another failure event to have been handled.
@@ -1212,16 +1211,16 @@ describe('Registration Tests', function () {
1212
1211
  keepAliveRetryCount: reg.isCCFlow ? 4 : 5
1213
1212
  }
1214
1213
  });
1215
- _context26.next = 21;
1214
+ _context24.next = 21;
1216
1215
  return flushPromises();
1217
1216
  case 21:
1218
1217
  expect(handleErrorSpy).toBeCalledTimes(4);
1219
1218
 
1220
1219
  // And then re-register successfully:
1221
- _context26.next = 24;
1220
+ _context24.next = 24;
1222
1221
  return reg.triggerRegistration();
1223
1222
  case 24:
1224
- _context26.next = 26;
1223
+ _context24.next = 26;
1225
1224
  return flushPromises();
1226
1225
  case 26:
1227
1226
  expect(reg.webWorker).toBeDefined();
@@ -1231,31 +1230,31 @@ describe('Registration Tests', function () {
1231
1230
  statusCode: 200
1232
1231
  }
1233
1232
  });
1234
- _context26.next = 30;
1233
+ _context24.next = 30;
1235
1234
  return flushPromises();
1236
1235
  case 30:
1237
1236
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.ACTIVE);
1238
1237
  expect(reg.webWorker).toBeDefined();
1239
1238
  case 32:
1240
1239
  case "end":
1241
- return _context26.stop();
1240
+ return _context24.stop();
1242
1241
  }
1243
- }, _callee26);
1242
+ }, _callee24);
1244
1243
  })));
1245
- it('cc: verify failover to backup server after 4 keep alive failure with primary server', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee27() {
1244
+ it('cc: verify failover to backup server after 4 keep alive failure with primary server', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
1246
1245
  var clearKeepaliveSpy, reconnectSpy;
1247
- return _regenerator.default.wrap(function _callee27$(_context27) {
1248
- while (1) switch (_context27.prev = _context27.next) {
1246
+ return _regenerator.default.wrap(function _callee25$(_context25) {
1247
+ while (1) switch (_context25.prev = _context25.next) {
1249
1248
  case 0:
1250
1249
  // Register with contact center service
1251
1250
  setupRegistration(_objectSpread(_objectSpread({}, MockServiceData), {}, {
1252
1251
  indicator: _types.ServiceIndicator.CONTACT_CENTER
1253
1252
  }));
1254
- _context27.next = 3;
1253
+ _context25.next = 3;
1255
1254
  return beforeEachSetupForKeepalive();
1256
1255
  case 3:
1257
1256
  webex.request.mockResolvedValueOnce(successPayload);
1258
- _context27.next = 6;
1257
+ _context25.next = 6;
1259
1258
  return reg.triggerRegistration();
1260
1259
  case 6:
1261
1260
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.ACTIVE);
@@ -1275,7 +1274,7 @@ describe('Registration Tests', function () {
1275
1274
  });
1276
1275
 
1277
1276
  // Wait for any asynchronous actions to complete
1278
- _context27.next = 13;
1277
+ _context25.next = 13;
1279
1278
  return flushPromises();
1280
1279
  case 13:
1281
1280
  // Verify that the keepalive timer was cleared and reconnectOnFailure was triggered
@@ -1287,16 +1286,16 @@ describe('Registration Tests', function () {
1287
1286
  expect(reg.getStatus()).toEqual(_types.RegistrationStatus.ACTIVE);
1288
1287
  case 17:
1289
1288
  case "end":
1290
- return _context27.stop();
1289
+ return _context25.stop();
1291
1290
  }
1292
- }, _callee27);
1291
+ }, _callee25);
1293
1292
  })));
1294
- it('verify failure keep-alive case with active call present: Restore Success after call ends', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee28() {
1293
+ it('verify failure keep-alive case with active call present: Restore Success after call ends', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1295
1294
  var reconnectSpy, restoreSpy, restartRegSpy, clearTimerSpy, threshold, failureEvent;
1296
- return _regenerator.default.wrap(function _callee28$(_context28) {
1297
- while (1) switch (_context28.prev = _context28.next) {
1295
+ return _regenerator.default.wrap(function _callee26$(_context26) {
1296
+ while (1) switch (_context26.prev = _context26.next) {
1298
1297
  case 0:
1299
- _context28.next = 2;
1298
+ _context26.next = 2;
1300
1299
  return beforeEachSetupForKeepalive();
1301
1300
  case 2:
1302
1301
  reconnectSpy = jest.spyOn(reg, 'reconnectOnFailure');
@@ -1316,7 +1315,7 @@ describe('Registration Tests', function () {
1316
1315
  }
1317
1316
  };
1318
1317
  reg.webWorker.onmessage(failureEvent);
1319
- _context28.next = 13;
1318
+ _context26.next = 13;
1320
1319
  return flushPromises();
1321
1320
  case 13:
1322
1321
  // At this point, clearKeepaliveTimer was called so the worker is terminated.
@@ -1341,10 +1340,10 @@ describe('Registration Tests', function () {
1341
1340
  webex.request.mockResolvedValueOnce(successPayload);
1342
1341
 
1343
1342
  // Call reconnectOnFailure manually. With no active calls, this should trigger re-registration.
1344
- _context28.next = 29;
1343
+ _context26.next = 29;
1345
1344
  return reg.reconnectOnFailure(_constants.CALLS_CLEARED_HANDLER_UTIL);
1346
1345
  case 29:
1347
- _context28.next = 31;
1346
+ _context26.next = 31;
1348
1347
  return flushPromises();
1349
1348
  case 31:
1350
1349
  expect((0, _keys.default)(reg.callManager.getActiveCalls()).length).toBe(0);
@@ -1357,16 +1356,16 @@ describe('Registration Tests', function () {
1357
1356
  expect(reg.reconnectPending).toStrictEqual(false);
1358
1357
  case 38:
1359
1358
  case "end":
1360
- return _context28.stop();
1359
+ return _context26.stop();
1361
1360
  }
1362
- }, _callee28);
1361
+ }, _callee26);
1363
1362
  })));
1364
- it('checks for keep-alive failure with final error: 404', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee29() {
1363
+ it('checks for keep-alive failure with final error: 404', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1365
1364
  var reconnectSpy, restoreSpy, restartRegSpy, clearTimerSpy;
1366
- return _regenerator.default.wrap(function _callee29$(_context29) {
1367
- while (1) switch (_context29.prev = _context29.next) {
1365
+ return _regenerator.default.wrap(function _callee27$(_context27) {
1366
+ while (1) switch (_context27.prev = _context27.next) {
1368
1367
  case 0:
1369
- _context29.next = 2;
1368
+ _context27.next = 2;
1370
1369
  return beforeEachSetupForKeepalive();
1371
1370
  case 2:
1372
1371
  reconnectSpy = jest.spyOn(reg, 'reconnectOnFailure');
@@ -1383,7 +1382,7 @@ describe('Registration Tests', function () {
1383
1382
  keepAliveRetryCount: 1
1384
1383
  }
1385
1384
  });
1386
- _context29.next = 10;
1385
+ _context27.next = 10;
1387
1386
  return flushPromises();
1388
1387
  case 10:
1389
1388
  expect(warnSpy).toBeCalledWith('Keep-alive missed 1 times. Status -> 404 ', expect.objectContaining({
@@ -1407,25 +1406,25 @@ describe('Registration Tests', function () {
1407
1406
  expect(reg.webWorker).toBeUndefined();
1408
1407
  case 21:
1409
1408
  case "end":
1410
- return _context29.stop();
1409
+ return _context27.stop();
1411
1410
  }
1412
- }, _callee29);
1411
+ }, _callee27);
1413
1412
  })));
1414
1413
  });
1415
1414
  describe('Primary server status checks', function () {
1416
- it('success: primary server status to be up', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee30() {
1415
+ it('success: primary server status to be up', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1417
1416
  var pingSuccessPayload, status;
1418
- return _regenerator.default.wrap(function _callee30$(_context30) {
1419
- while (1) switch (_context30.prev = _context30.next) {
1417
+ return _regenerator.default.wrap(function _callee28$(_context28) {
1418
+ while (1) switch (_context28.prev = _context28.next) {
1420
1419
  case 0:
1421
1420
  pingSuccessPayload = {
1422
1421
  statusCode: 200
1423
1422
  };
1424
1423
  webex.request.mockResolvedValue(pingSuccessPayload);
1425
- _context30.next = 4;
1424
+ _context28.next = 4;
1426
1425
  return reg.isPrimaryActive();
1427
1426
  case 4:
1428
- status = _context30.sent;
1427
+ status = _context28.sent;
1429
1428
  expect(webex.request).toBeCalledWith(_objectSpread({
1430
1429
  method: 'GET',
1431
1430
  uri: "https://mobius-dfw.webex.com/api/v1/ping"
@@ -1433,23 +1432,23 @@ describe('Registration Tests', function () {
1433
1432
  expect(status).toEqual(true);
1434
1433
  case 7:
1435
1434
  case "end":
1436
- return _context30.stop();
1435
+ return _context28.stop();
1437
1436
  }
1438
- }, _callee30);
1437
+ }, _callee28);
1439
1438
  })));
1440
- it('failed: primary server status to be down', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee31() {
1439
+ it('failed: primary server status to be down', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1441
1440
  var pingFailurePayload, status;
1442
- return _regenerator.default.wrap(function _callee31$(_context31) {
1443
- while (1) switch (_context31.prev = _context31.next) {
1441
+ return _regenerator.default.wrap(function _callee29$(_context29) {
1442
+ while (1) switch (_context29.prev = _context29.next) {
1444
1443
  case 0:
1445
1444
  pingFailurePayload = {
1446
1445
  statusCode: 500
1447
1446
  };
1448
1447
  webex.request.mockResolvedValue(pingFailurePayload);
1449
- _context31.next = 4;
1448
+ _context29.next = 4;
1450
1449
  return reg.isPrimaryActive();
1451
1450
  case 4:
1452
- status = _context31.sent;
1451
+ status = _context29.sent;
1453
1452
  expect(webex.request).toBeCalledWith(_objectSpread({
1454
1453
  method: 'GET',
1455
1454
  uri: "https://mobius-dfw.webex.com/api/v1/ping"
@@ -1457,9 +1456,9 @@ describe('Registration Tests', function () {
1457
1456
  expect(status).toEqual(false);
1458
1457
  case 7:
1459
1458
  case "end":
1460
- return _context31.stop();
1459
+ return _context29.stop();
1461
1460
  }
1462
- }, _callee31);
1461
+ }, _callee29);
1463
1462
  })));
1464
1463
  });
1465
1464
  });