@webex/calling 3.10.0-next.13 → 3.10.0-next.15

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 (95) hide show
  1. package/dist/CallHistory/CallHistory.js +118 -124
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +189 -201
  4. package/dist/CallHistory/CallHistory.test.js.map +1 -1
  5. package/dist/CallSettings/CallSettings.js +17 -18
  6. package/dist/CallSettings/CallSettings.js.map +1 -1
  7. package/dist/CallSettings/CallSettings.test.js +14 -14
  8. package/dist/CallSettings/CallSettings.test.js.map +1 -1
  9. package/dist/CallSettings/UcmBackendConnector.js +71 -24
  10. package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
  11. package/dist/CallSettings/UcmBackendConnector.test.js +136 -47
  12. package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
  13. package/dist/CallSettings/WxCallBackendConnector.js +135 -137
  14. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  15. package/dist/CallSettings/WxCallBackendConnector.test.js +145 -149
  16. package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
  17. package/dist/CallingClient/CallingClient.js +198 -201
  18. package/dist/CallingClient/CallingClient.js.map +1 -1
  19. package/dist/CallingClient/CallingClient.test.js +168 -168
  20. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  21. package/dist/CallingClient/calling/CallerId/index.js +7 -8
  22. package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
  23. package/dist/CallingClient/calling/CallerId/index.test.js +24 -24
  24. package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
  25. package/dist/CallingClient/calling/call.js +364 -366
  26. package/dist/CallingClient/calling/call.js.map +1 -1
  27. package/dist/CallingClient/calling/call.test.js +340 -340
  28. package/dist/CallingClient/calling/call.test.js.map +1 -1
  29. package/dist/CallingClient/calling/callManager.js +15 -18
  30. package/dist/CallingClient/calling/callManager.js.map +1 -1
  31. package/dist/CallingClient/calling/callManager.test.js +113 -113
  32. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  33. package/dist/CallingClient/line/index.js +57 -74
  34. package/dist/CallingClient/line/index.js.map +1 -1
  35. package/dist/CallingClient/line/line.test.js +22 -22
  36. package/dist/CallingClient/line/line.test.js.map +1 -1
  37. package/dist/CallingClient/registration/register.js +293 -300
  38. package/dist/CallingClient/registration/register.js.map +1 -1
  39. package/dist/CallingClient/registration/register.test.js +246 -246
  40. package/dist/CallingClient/registration/register.test.js.map +1 -1
  41. package/dist/CallingClient/registration/webWorker.js +24 -24
  42. package/dist/CallingClient/registration/webWorker.js.map +1 -1
  43. package/dist/CallingClient/registration/webWorker.test.js +20 -20
  44. package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
  45. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +28 -28
  46. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
  47. package/dist/Contacts/ContactsClient.js +250 -253
  48. package/dist/Contacts/ContactsClient.js.map +1 -1
  49. package/dist/Contacts/ContactsClient.test.js +60 -60
  50. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  51. package/dist/Errors/catalog/CallError.js +7 -10
  52. package/dist/Errors/catalog/CallError.js.map +1 -1
  53. package/dist/Errors/catalog/CallingDeviceError.js +6 -9
  54. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  55. package/dist/Errors/catalog/ExtendedError.js +6 -8
  56. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  57. package/dist/Errors/catalog/LineError.js +6 -9
  58. package/dist/Errors/catalog/LineError.js.map +1 -1
  59. package/dist/Events/impl/index.js +11 -13
  60. package/dist/Events/impl/index.js.map +1 -1
  61. package/dist/Metrics/index.js +1 -2
  62. package/dist/Metrics/index.js.map +1 -1
  63. package/dist/SDKConnector/index.js +1 -2
  64. package/dist/SDKConnector/index.js.map +1 -1
  65. package/dist/Voicemail/BroadworksBackendConnector.js +126 -127
  66. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  67. package/dist/Voicemail/BroadworksBackendConnector.test.js +98 -98
  68. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  69. package/dist/Voicemail/UcmBackendConnector.js +84 -85
  70. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  71. package/dist/Voicemail/UcmBackendConnector.test.js +72 -72
  72. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  73. package/dist/Voicemail/Voicemail.js +58 -61
  74. package/dist/Voicemail/Voicemail.js.map +1 -1
  75. package/dist/Voicemail/Voicemail.test.js +20 -20
  76. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  77. package/dist/Voicemail/WxCallBackendConnector.js +116 -117
  78. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  79. package/dist/Voicemail/WxCallBackendConnector.test.js +140 -140
  80. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  81. package/dist/common/Utils.js +168 -167
  82. package/dist/common/Utils.js.map +1 -1
  83. package/dist/common/Utils.test.js +120 -120
  84. package/dist/common/Utils.test.js.map +1 -1
  85. package/dist/common/constants.js +3 -1
  86. package/dist/common/constants.js.map +1 -1
  87. package/dist/common/testUtil.js +3 -3
  88. package/dist/common/testUtil.js.map +1 -1
  89. package/dist/module/CallSettings/UcmBackendConnector.js +20 -6
  90. package/dist/module/common/constants.js +2 -0
  91. package/dist/types/CallSettings/UcmBackendConnector.d.ts +1 -0
  92. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  93. package/dist/types/common/constants.d.ts +2 -0
  94. package/dist/types/common/constants.d.ts.map +1 -1
  95. package/package.json +2 -2
@@ -59,7 +59,7 @@ var _constants = require("../CallingClient/constants");
59
59
  var _constants2 = require("./constants");
60
60
  var _SDKConnector = _interopRequireDefault(require("../SDKConnector"));
61
61
  var _LineError = require("../Errors/catalog/LineError");
62
- 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); }
62
+ 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 _t1 in e) "default" !== _t1 && {}.hasOwnProperty.call(e, _t1) && ((i = (o = _Object$defineProperty) && _Object$getOwnPropertyDescriptor(e, _t1)) && (i.get || i.set) ? o(f, _t1, i) : f[_t1] = e[_t1]); return f; })(e, t); }
63
63
  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; }
64
64
  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; }
65
65
  function _createForOfIteratorHelper(r, e) { var t = "undefined" != typeof _Symbol && r[_Symbol$iterator] || r["@@iterator"]; if (!t) { if (_Array$isArray(r) || (t = _unsupportedIterableToArray(r)) || e && r && "number" == typeof r.length) { t && (r = t); var _n = 0, F = function F() {}; return { s: F, n: function n() { return _n >= r.length ? { done: !0 } : { done: !1, value: r[_n++] }; }, e: function e(r) { throw r; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var o, a = !0, u = !1; return { s: function s() { t = t.call(r); }, n: function n() { var r = t.next(); return a = r.done, r; }, e: function e(r) { u = !0, o = r; }, f: function f() { try { a || null == t.return || t.return(); } finally { if (u) throw o; } } }; }
@@ -230,37 +230,37 @@ function handleRegistrationErrors(_x, _x2, _x3, _x4, _x5) {
230
230
  */
231
231
  function _handleRegistrationErrors() {
232
232
  _handleRegistrationErrors = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(err, emitterCb, loggerContext, retry429Cb, restoreRegCb) {
233
- var lineError, errorCode, finalError, caller, retryAfter, errorBody, code, errorMessage, _caller, _errorMessage, _errorMessage2, _errorMessage3;
234
- return _regenerator.default.wrap(function _callee$(_context) {
233
+ var lineError, errorCode, finalError, caller, retryAfter, errorBody, code, errorMessage, _caller, _errorMessage, _errorMessage2, _errorMessage3, _t, _t2;
234
+ return _regenerator.default.wrap(function (_context) {
235
235
  while (1) switch (_context.prev = _context.next) {
236
236
  case 0:
237
237
  lineError = (0, _LineError.createLineError)('', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
238
238
  errorCode = Number(err.statusCode);
239
239
  finalError = false;
240
240
  _Logger.default.warn("Status code: -> ".concat(errorCode), loggerContext);
241
- _context.t0 = errorCode;
242
- _context.next = _context.t0 === _types2.ERROR_CODE.BAD_REQUEST ? 7 : _context.t0 === _types2.ERROR_CODE.UNAUTHORIZED ? 12 : _context.t0 === _types2.ERROR_CODE.DEVICE_NOT_FOUND ? 17 : _context.t0 === _types2.ERROR_CODE.TOO_MANY_REQUESTS ? 22 : _context.t0 === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 27 : _context.t0 === _types2.ERROR_CODE.SERVICE_UNAVAILABLE ? 31 : _context.t0 === _types2.ERROR_CODE.FORBIDDEN ? 35 : 70;
241
+ _t = errorCode;
242
+ _context.next = _t === _types2.ERROR_CODE.BAD_REQUEST ? 1 : _t === _types2.ERROR_CODE.UNAUTHORIZED ? 2 : _t === _types2.ERROR_CODE.DEVICE_NOT_FOUND ? 3 : _t === _types2.ERROR_CODE.TOO_MANY_REQUESTS ? 4 : _t === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 5 : _t === _types2.ERROR_CODE.SERVICE_UNAVAILABLE ? 6 : _t === _types2.ERROR_CODE.FORBIDDEN ? 7 : 15;
243
243
  break;
244
- case 7:
244
+ case 1:
245
245
  finalError = true;
246
246
  _Logger.default.warn("400 Bad Request", loggerContext);
247
247
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.BAD_REQUEST, 'Invalid input. Please verify the required parameters, sign out and then sign back in with the valid data', _types3.RegistrationStatus.INACTIVE, lineError);
248
248
  emitterCb(lineError, finalError);
249
- return _context.abrupt("break", 73);
250
- case 12:
249
+ return _context.abrupt("continue", 16);
250
+ case 2:
251
251
  // Return it to the Caller
252
252
  finalError = true;
253
253
  _Logger.default.warn("401 Unauthorized", loggerContext);
254
254
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.TOKEN_ERROR, 'User is unauthorized due to an expired token. Sign out, then sign back in.', _types3.RegistrationStatus.INACTIVE, lineError);
255
255
  emitterCb(lineError, finalError);
256
- return _context.abrupt("break", 73);
257
- case 17:
256
+ return _context.abrupt("continue", 16);
257
+ case 3:
258
258
  finalError = true;
259
259
  _Logger.default.warn("404 Device Not Found", loggerContext);
260
260
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.NOT_FOUND, 'Webex Calling is unable to find your device. Sign out, then sign back in', _types3.RegistrationStatus.INACTIVE, lineError);
261
261
  emitterCb(lineError, finalError);
262
- return _context.abrupt("break", 73);
263
- case 22:
262
+ return _context.abrupt("continue", 16);
263
+ case 4:
264
264
  _Logger.default.warn("429 Too Many Requests", loggerContext);
265
265
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.TOO_MANY_REQUESTS, 'Server is handling too many request at the time. Wait a moment and try again', _types3.RegistrationStatus.INACTIVE, lineError);
266
266
  caller = loggerContext.method || 'handleErrors';
@@ -268,73 +268,73 @@ function _handleRegistrationErrors() {
268
268
  retryAfter = Number(err.headers['retry-after']);
269
269
  retry429Cb(retryAfter, caller);
270
270
  }
271
- return _context.abrupt("break", 73);
272
- case 27:
271
+ return _context.abrupt("continue", 16);
272
+ case 5:
273
273
  _Logger.default.warn("500 Internal Server Error", loggerContext);
274
274
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.SERVER_ERROR, 'An unknown error occurred while placing the request. Wait a moment and try again.', _types3.RegistrationStatus.INACTIVE, lineError);
275
275
  emitterCb(lineError, finalError);
276
- return _context.abrupt("break", 73);
277
- case 31:
276
+ return _context.abrupt("continue", 16);
277
+ case 6:
278
278
  _Logger.default.warn("503 Service Unavailable", loggerContext);
279
279
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.SERVICE_UNAVAILABLE, 'An error occurred on the server while processing the request. Wait a moment and try again.', _types3.RegistrationStatus.INACTIVE, lineError);
280
280
  emitterCb(lineError, finalError);
281
- return _context.abrupt("break", 73);
282
- case 35:
281
+ return _context.abrupt("continue", 16);
282
+ case 7:
283
283
  _Logger.default.warn("403 Forbidden", loggerContext);
284
284
  errorBody = err.body;
285
285
  if (errorBody) {
286
- _context.next = 42;
286
+ _context.next = 8;
287
287
  break;
288
288
  }
289
289
  _Logger.default.warn('Error response has no body, throwing default error', loggerContext);
290
290
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, 'An unauthorized action has been received. This action has been blocked. Please contact the administrator if this persists.', _types3.RegistrationStatus.INACTIVE, lineError);
291
291
  emitterCb(lineError, finalError);
292
292
  return _context.abrupt("return", finalError);
293
- case 42:
293
+ case 8:
294
294
  code = Number(errorBody.errorCode);
295
295
  _Logger.default.warn("Error code found : ".concat(code), loggerContext);
296
- _context.t1 = code;
297
- _context.next = _context.t1 === _types2.DEVICE_ERROR_CODE.DEVICE_LIMIT_EXCEEDED ? 47 : _context.t1 === _types2.DEVICE_ERROR_CODE.DEVICE_CREATION_DISABLED ? 54 : _context.t1 === _types2.DEVICE_ERROR_CODE.DEVICE_CREATION_FAILED ? 60 : 65;
296
+ _t2 = code;
297
+ _context.next = _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_LIMIT_EXCEEDED ? 9 : _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_CREATION_DISABLED ? 11 : _t2 === _types2.DEVICE_ERROR_CODE.DEVICE_CREATION_FAILED ? 12 : 13;
298
298
  break;
299
- case 47:
299
+ case 9:
300
300
  errorMessage = 'User device limit exceeded';
301
301
  _Logger.default.warn(errorMessage, loggerContext);
302
302
  if (!restoreRegCb) {
303
- _context.next = 53;
303
+ _context.next = 10;
304
304
  break;
305
305
  }
306
306
  _caller = loggerContext.method || 'handleErrors';
307
- _context.next = 53;
307
+ _context.next = 10;
308
308
  return restoreRegCb(errorBody, _caller);
309
- case 53:
310
- return _context.abrupt("break", 69);
311
- case 54:
309
+ case 10:
310
+ return _context.abrupt("continue", 14);
311
+ case 11:
312
312
  _errorMessage = 'User is not configured for WebRTC calling. Please contact the administrator to resolve this issue.';
313
313
  finalError = true;
314
314
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage, _types3.RegistrationStatus.INACTIVE, lineError);
315
315
  _Logger.default.warn(_errorMessage, loggerContext);
316
316
  emitterCb(lineError, true);
317
- return _context.abrupt("break", 69);
318
- case 60:
317
+ return _context.abrupt("continue", 14);
318
+ case 12:
319
319
  _errorMessage2 = 'An unknown error occurred while provisioning the device. Wait a moment and try again.';
320
320
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage2, _types3.RegistrationStatus.INACTIVE, lineError);
321
321
  _Logger.default.warn(_errorMessage2, loggerContext);
322
322
  emitterCb(lineError, finalError);
323
- return _context.abrupt("break", 69);
324
- case 65:
323
+ return _context.abrupt("continue", 14);
324
+ case 13:
325
325
  _errorMessage3 = 'An unknown error occurred. Wait a moment and try again. Please contact the administrator if the problem persists.';
326
326
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, _errorMessage3, _types3.RegistrationStatus.INACTIVE, lineError);
327
327
  _Logger.default.warn(_errorMessage3, loggerContext);
328
328
  emitterCb(lineError, finalError);
329
- case 69:
330
- return _context.abrupt("break", 73);
331
- case 70:
329
+ case 14:
330
+ return _context.abrupt("continue", 16);
331
+ case 15:
332
332
  updateLineErrorContext(loggerContext, _types2.ERROR_TYPE.DEFAULT, 'Unknown error', _types3.RegistrationStatus.INACTIVE, lineError);
333
333
  _Logger.default.warn("Unknown Error", loggerContext);
334
334
  emitterCb(lineError, finalError);
335
- case 73:
335
+ case 16:
336
336
  return _context.abrupt("return", finalError);
337
- case 74:
337
+ case 17:
338
338
  case "end":
339
339
  return _context.stop();
340
340
  }
@@ -361,38 +361,38 @@ function handleCallingClientErrors(_x6, _x7, _x8) {
361
361
  */
362
362
  function _handleCallingClientErrors() {
363
363
  _handleCallingClientErrors = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2(err, emitterCb, loggerContext) {
364
- var clientError, errorCode, finalError;
365
- return _regenerator.default.wrap(function _callee2$(_context2) {
364
+ var clientError, errorCode, finalError, _t3;
365
+ return _regenerator.default.wrap(function (_context2) {
366
366
  while (1) switch (_context2.prev = _context2.next) {
367
367
  case 0:
368
368
  clientError = (0, _CallingDeviceError.createClientError)('', {}, _types2.ERROR_TYPE.DEFAULT, _types3.RegistrationStatus.INACTIVE);
369
369
  errorCode = Number(err.statusCode);
370
370
  finalError = false;
371
371
  _Logger.default.warn("Status code: -> ".concat(errorCode), loggerContext);
372
- _context2.t0 = errorCode;
373
- _context2.next = _context2.t0 === _types2.ERROR_CODE.UNAUTHORIZED ? 7 : _context2.t0 === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 12 : 16;
372
+ _t3 = errorCode;
373
+ _context2.next = _t3 === _types2.ERROR_CODE.UNAUTHORIZED ? 1 : _t3 === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 2 : 3;
374
374
  break;
375
- case 7:
375
+ case 1:
376
376
  finalError = true;
377
377
  _Logger.default.warn("401 Unauthorized", loggerContext);
378
378
  updateErrorContext(loggerContext, _types2.ERROR_TYPE.TOKEN_ERROR, 'User is unauthorized due to an expired token.', clientError);
379
379
  emitterCb(clientError, finalError);
380
- return _context2.abrupt("break", 19);
381
- case 12:
380
+ return _context2.abrupt("continue", 4);
381
+ case 2:
382
382
  _Logger.default.warn("500 Internal Server Error", loggerContext);
383
383
  updateErrorContext(loggerContext, _types2.ERROR_TYPE.SERVER_ERROR, 'An unknown error occurred while placing the request. Wait a moment and try again.', clientError);
384
384
  emitterCb(clientError, finalError);
385
- return _context2.abrupt("break", 19);
386
- case 16:
385
+ return _context2.abrupt("continue", 4);
386
+ case 3:
387
387
  updateErrorContext(loggerContext, _types2.ERROR_TYPE.DEFAULT, 'Unknown error', clientError);
388
388
  _Logger.default.warn("Unknown Error", loggerContext);
389
389
  emitterCb(clientError, finalError);
390
- case 19:
391
- _context2.next = 21;
390
+ case 4:
391
+ _context2.next = 5;
392
392
  return uploadLogs();
393
- case 21:
393
+ case 5:
394
394
  return _context2.abrupt("return", finalError);
395
- case 22:
395
+ case 6:
396
396
  case "end":
397
397
  return _context2.stop();
398
398
  }
@@ -413,8 +413,8 @@ function handleCallErrors(_x9, _x0, _x1, _x10, _x11, _x12, _x13) {
413
413
  */
414
414
  function _handleCallErrors() {
415
415
  _handleCallErrors = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3(emitterCb, errorLayer, retryCb, correlationId, err, caller, file) {
416
- var abort, loggerContext, callError, errorCode, isKeepalive, errorBody, retryInterval, code, message, _retryInterval;
417
- return _regenerator.default.wrap(function _callee3$(_context3) {
416
+ var abort, loggerContext, callError, errorCode, isKeepalive, errorBody, retryInterval, code, message, _retryInterval, _t4, _t5;
417
+ return _regenerator.default.wrap(function (_context3) {
418
418
  while (1) switch (_context3.prev = _context3.next) {
419
419
  case 0:
420
420
  abort = false;
@@ -426,99 +426,99 @@ function _handleCallErrors() {
426
426
  errorCode = Number(err.statusCode);
427
427
  _Logger.default.warn("Status code: ->".concat(errorCode), loggerContext);
428
428
  isKeepalive = caller === _constants.METHODS.HANDLE_CALL_ESTABLISHED;
429
- _context3.t0 = errorCode;
430
- _context3.next = _context3.t0 === _types2.ERROR_CODE.UNAUTHORIZED ? 9 : _context3.t0 === _types2.ERROR_CODE.FORBIDDEN ? 14 : _context3.t0 === _types2.ERROR_CODE.SERVICE_UNAVAILABLE ? 19 : _context3.t0 === _types2.ERROR_CODE.DEVICE_NOT_FOUND ? 57 : _context3.t0 === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 62 : 67;
429
+ _t4 = errorCode;
430
+ _context3.next = _t4 === _types2.ERROR_CODE.UNAUTHORIZED ? 1 : _t4 === _types2.ERROR_CODE.FORBIDDEN ? 2 : _t4 === _types2.ERROR_CODE.SERVICE_UNAVAILABLE ? 3 : _t4 === _types2.ERROR_CODE.DEVICE_NOT_FOUND ? 17 : _t4 === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 18 : 19;
431
431
  break;
432
- case 9:
432
+ case 1:
433
433
  _Logger.default.warn("401 Unauthorized", loggerContext);
434
434
  updateCallErrorContext(loggerContext, _types2.ERROR_TYPE.TOKEN_ERROR, 'User is unauthorized due to an expired token. Sign out, then sign back in.', correlationId, callError);
435
435
  emitterCb(callError);
436
436
  if (isKeepalive) {
437
437
  abort = true;
438
438
  }
439
- return _context3.abrupt("break", 68);
440
- case 14:
439
+ return _context3.abrupt("continue", 20);
440
+ case 2:
441
441
  if (!isKeepalive) {
442
- _context3.next = 19;
442
+ _context3.next = 3;
443
443
  break;
444
444
  }
445
445
  abort = true;
446
446
  updateCallErrorContext(loggerContext, _types2.ERROR_TYPE.FORBIDDEN_ERROR, 'An unauthorized action has been received. This action has been blocked. Please contact the administrator if this persists.', correlationId, callError);
447
447
  emitterCb(callError);
448
- return _context3.abrupt("break", 68);
449
- case 19:
448
+ return _context3.abrupt("continue", 20);
449
+ case 3:
450
450
  errorBody = err.body;
451
451
  if (errorBody) {
452
- _context3.next = 25;
452
+ _context3.next = 4;
453
453
  break;
454
454
  }
455
455
  _Logger.default.warn('Error response has no body, throwing default error', loggerContext);
456
456
  updateCallErrorContext(loggerContext, err.statusCode === 403 ? _types2.ERROR_TYPE.FORBIDDEN_ERROR : _types2.ERROR_TYPE.SERVICE_UNAVAILABLE, err.statusCode === 403 ? 'An unauthorized action has been received. This action has been blocked. Please contact the administrator if this persists.' : 'An error occurred on the server while processing the request. Wait a moment and try again.', correlationId, callError);
457
457
  emitterCb(callError);
458
458
  return _context3.abrupt("return", abort);
459
- case 25:
459
+ case 4:
460
460
  if (!(err.headers && 'retry-after' in err.headers && retryCb)) {
461
- _context3.next = 30;
461
+ _context3.next = 5;
462
462
  break;
463
463
  }
464
464
  retryInterval = Number(err.headers['retry-after']);
465
465
  _Logger.default.warn("Retry Interval received: ".concat(retryInterval), loggerContext);
466
466
  retryCb(retryInterval);
467
467
  return _context3.abrupt("return", abort);
468
- case 30:
468
+ case 5:
469
469
  if (isKeepalive) {
470
470
  retryCb(_constants.DEFAULT_KEEPALIVE_INTERVAL); // This is applicable only for the keepalive scenario
471
471
  }
472
472
 
473
473
  /* Handling various Error codes */
474
474
  code = Number(errorBody.errorCode);
475
- _context3.t1 = code;
476
- _context3.next = _context3.t1 === _types2.CALL_ERROR_CODE.INVALID_STATUS_UPDATE ? 35 : _context3.t1 === _types2.CALL_ERROR_CODE.DEVICE_NOT_REGISTERED ? 37 : _context3.t1 === _types2.CALL_ERROR_CODE.CALL_NOT_FOUND ? 39 : _context3.t1 === _types2.CALL_ERROR_CODE.ERROR_PROCESSING ? 41 : _context3.t1 === _types2.CALL_ERROR_CODE.USER_BUSY ? 43 : _context3.t1 === _types2.CALL_ERROR_CODE.PARSING_ERROR ? 45 : _context3.t1 === _types2.CALL_ERROR_CODE.NOT_ACCEPTABLE ? 47 : _context3.t1 === _types2.CALL_ERROR_CODE.CALL_REJECTED ? 49 : _context3.t1 === _types2.CALL_ERROR_CODE.NOT_AVAILABLE ? 51 : 53;
475
+ _t5 = code;
476
+ _context3.next = _t5 === _types2.CALL_ERROR_CODE.INVALID_STATUS_UPDATE ? 6 : _t5 === _types2.CALL_ERROR_CODE.DEVICE_NOT_REGISTERED ? 7 : _t5 === _types2.CALL_ERROR_CODE.CALL_NOT_FOUND ? 8 : _t5 === _types2.CALL_ERROR_CODE.ERROR_PROCESSING ? 9 : _t5 === _types2.CALL_ERROR_CODE.USER_BUSY ? 10 : _t5 === _types2.CALL_ERROR_CODE.PARSING_ERROR ? 11 : _t5 === _types2.CALL_ERROR_CODE.NOT_ACCEPTABLE ? 12 : _t5 === _types2.CALL_ERROR_CODE.CALL_REJECTED ? 13 : _t5 === _types2.CALL_ERROR_CODE.NOT_AVAILABLE ? 14 : 15;
477
477
  break;
478
- case 35:
478
+ case 6:
479
479
  message = 'An invalid status update has been received for the call. Wait a moment and try again.';
480
- return _context3.abrupt("break", 54);
481
- case 37:
480
+ return _context3.abrupt("continue", 16);
481
+ case 7:
482
482
  message = 'The client has unregistered. Please wait for the client to register before attempting the call. If error persists, sign out, sign back in and attempt the call.';
483
- return _context3.abrupt("break", 54);
484
- case 39:
483
+ return _context3.abrupt("continue", 16);
484
+ case 8:
485
485
  message = 'Call is not found on the server. Wait a moment and try again.';
486
- return _context3.abrupt("break", 54);
487
- case 41:
486
+ return _context3.abrupt("continue", 16);
487
+ case 9:
488
488
  message = 'An error occurred while processing the call on the server. Wait a moment and try again.';
489
- return _context3.abrupt("break", 54);
490
- case 43:
489
+ return _context3.abrupt("continue", 16);
490
+ case 10:
491
491
  message = 'Called user is busy.';
492
- return _context3.abrupt("break", 54);
493
- case 45:
492
+ return _context3.abrupt("continue", 16);
493
+ case 11:
494
494
  message = 'An error occurred while parsing the provided information. Wait a moment and try again.';
495
- return _context3.abrupt("break", 54);
496
- case 47:
495
+ return _context3.abrupt("continue", 16);
496
+ case 12:
497
497
  message = 'An error occurred on the server while accepting the call. Wait a moment and try again. Please contact the administrator if this persists.';
498
- return _context3.abrupt("break", 54);
499
- case 49:
498
+ return _context3.abrupt("continue", 16);
499
+ case 13:
500
500
  message = 'Call rejected by the server. Wait a moment and try again. Please contact the administrator if this persists.';
501
- return _context3.abrupt("break", 54);
502
- case 51:
501
+ return _context3.abrupt("continue", 16);
502
+ case 14:
503
503
  message = 'Calling services not available. Wait a moment and try again. Please contact the administrator if this persists.';
504
- return _context3.abrupt("break", 54);
505
- case 53:
504
+ return _context3.abrupt("continue", 16);
505
+ case 15:
506
506
  message = 'An unknown error occurred. Wait a moment and try again.';
507
- case 54:
507
+ case 16:
508
508
  /* We just emit the errors to the app */
509
509
 
510
510
  updateCallErrorContext(loggerContext, err.statusCode === 403 ? _types2.ERROR_TYPE.FORBIDDEN_ERROR : _types2.ERROR_TYPE.SERVICE_UNAVAILABLE, message, correlationId, callError);
511
511
  emitterCb(callError);
512
- return _context3.abrupt("break", 68);
513
- case 57:
512
+ return _context3.abrupt("continue", 20);
513
+ case 17:
514
514
  _Logger.default.warn("404 Call Not Found", loggerContext);
515
515
  updateCallErrorContext(loggerContext, _types2.ERROR_TYPE.NOT_FOUND, 'Call is no longer active. Wait a moment and try again.', correlationId, callError);
516
516
  emitterCb(callError);
517
517
  if (isKeepalive) {
518
518
  abort = true;
519
519
  }
520
- return _context3.abrupt("break", 68);
521
- case 62:
520
+ return _context3.abrupt("continue", 20);
521
+ case 18:
522
522
  _Logger.default.warn("500 Internal Server Error", loggerContext);
523
523
  updateCallErrorContext(loggerContext, _types2.ERROR_TYPE.SERVER_ERROR, 'An unknown error occurred in the call. Wait a moment and try again.', correlationId, callError);
524
524
  emitterCb(callError);
@@ -526,12 +526,12 @@ function _handleCallErrors() {
526
526
  _retryInterval = err.headers && 'retry-after' in err.headers ? Number(err.headers['retry-after']) : _constants.DEFAULT_KEEPALIVE_INTERVAL;
527
527
  retryCb(_retryInterval);
528
528
  }
529
- return _context3.abrupt("break", 68);
530
- case 67:
529
+ return _context3.abrupt("continue", 20);
530
+ case 19:
531
531
  _Logger.default.warn("Unknown Error", loggerContext);
532
- case 68:
532
+ case 20:
533
533
  return _context3.abrupt("return", abort);
534
- case 69:
534
+ case 21:
535
535
  case "end":
536
536
  return _context3.stop();
537
537
  }
@@ -548,16 +548,16 @@ function serviceErrorCodeHandler(_x14, _x15) {
548
548
  */
549
549
  function _serviceErrorCodeHandler() {
550
550
  _serviceErrorCodeHandler = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4(err, loggerContext) {
551
- var errorCode, failureMessage, errorDetails, _errorDetails, _errorDetails2, _errorDetails3, _errorDetails4, _errorDetails5, _errorDetails6, _errorDetails7, _errorDetails8;
552
- return _regenerator.default.wrap(function _callee4$(_context4) {
551
+ var errorCode, failureMessage, errorDetails, _errorDetails, _errorDetails2, _errorDetails3, _errorDetails4, _errorDetails5, _errorDetails6, _errorDetails7, _errorDetails8, _t6;
552
+ return _regenerator.default.wrap(function (_context4) {
553
553
  while (1) switch (_context4.prev = _context4.next) {
554
554
  case 0:
555
555
  errorCode = Number(err.statusCode);
556
556
  failureMessage = 'FAILURE';
557
- _context4.t0 = errorCode;
558
- _context4.next = _context4.t0 === _types2.ERROR_CODE.BAD_REQUEST ? 5 : _context4.t0 === _types2.ERROR_CODE.UNAUTHORIZED ? 8 : _context4.t0 === _types2.ERROR_CODE.FORBIDDEN ? 11 : _context4.t0 === _types2.ERROR_CODE.DEVICE_NOT_FOUND ? 14 : _context4.t0 === _types2.ERROR_CODE.REQUEST_TIMEOUT ? 17 : _context4.t0 === _types2.ERROR_CODE.NOT_IMPLEMENTED ? 20 : _context4.t0 === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 23 : _context4.t0 === _types2.ERROR_CODE.SERVICE_UNAVAILABLE ? 26 : 29;
557
+ _t6 = errorCode;
558
+ _context4.next = _t6 === _types2.ERROR_CODE.BAD_REQUEST ? 1 : _t6 === _types2.ERROR_CODE.UNAUTHORIZED ? 2 : _t6 === _types2.ERROR_CODE.FORBIDDEN ? 3 : _t6 === _types2.ERROR_CODE.DEVICE_NOT_FOUND ? 4 : _t6 === _types2.ERROR_CODE.REQUEST_TIMEOUT ? 5 : _t6 === _types2.ERROR_CODE.NOT_IMPLEMENTED ? 6 : _t6 === _types2.ERROR_CODE.INTERNAL_SERVER_ERROR ? 7 : _t6 === _types2.ERROR_CODE.SERVICE_UNAVAILABLE ? 8 : 9;
559
559
  break;
560
- case 5:
560
+ case 1:
561
561
  _Logger.default.warn("400 Bad request", loggerContext);
562
562
  errorDetails = {
563
563
  statusCode: 400,
@@ -567,7 +567,7 @@ function _serviceErrorCodeHandler() {
567
567
  message: failureMessage
568
568
  };
569
569
  return _context4.abrupt("return", errorDetails);
570
- case 8:
570
+ case 2:
571
571
  _Logger.default.warn("401 User is unauthorised, possible token expiry", loggerContext);
572
572
  _errorDetails = {
573
573
  statusCode: 401,
@@ -577,7 +577,7 @@ function _serviceErrorCodeHandler() {
577
577
  message: failureMessage
578
578
  };
579
579
  return _context4.abrupt("return", _errorDetails);
580
- case 11:
580
+ case 3:
581
581
  _Logger.default.warn("403 User request is forbidden", loggerContext);
582
582
  _errorDetails2 = {
583
583
  statusCode: 403,
@@ -587,7 +587,7 @@ function _serviceErrorCodeHandler() {
587
587
  message: failureMessage
588
588
  };
589
589
  return _context4.abrupt("return", _errorDetails2);
590
- case 14:
590
+ case 4:
591
591
  _Logger.default.warn("404 User info not found", loggerContext);
592
592
  _errorDetails3 = {
593
593
  statusCode: 404,
@@ -597,7 +597,7 @@ function _serviceErrorCodeHandler() {
597
597
  message: failureMessage
598
598
  };
599
599
  return _context4.abrupt("return", _errorDetails3);
600
- case 17:
600
+ case 5:
601
601
  _Logger.default.warn("408 Request to the server timedout", loggerContext);
602
602
  _errorDetails4 = {
603
603
  statusCode: 408,
@@ -607,7 +607,7 @@ function _serviceErrorCodeHandler() {
607
607
  message: failureMessage
608
608
  };
609
609
  return _context4.abrupt("return", _errorDetails4);
610
- case 20:
610
+ case 6:
611
611
  _Logger.default.warn("501 Not Implemented error occurred", loggerContext);
612
612
  _errorDetails5 = {
613
613
  statusCode: 501,
@@ -617,7 +617,7 @@ function _serviceErrorCodeHandler() {
617
617
  message: failureMessage
618
618
  };
619
619
  return _context4.abrupt("return", _errorDetails5);
620
- case 23:
620
+ case 7:
621
621
  _Logger.default.warn("500 Internal server error occurred", loggerContext);
622
622
  _errorDetails6 = {
623
623
  statusCode: 500,
@@ -627,7 +627,7 @@ function _serviceErrorCodeHandler() {
627
627
  message: failureMessage
628
628
  };
629
629
  return _context4.abrupt("return", _errorDetails6);
630
- case 26:
630
+ case 8:
631
631
  _Logger.default.warn("503 Unable to establish a connection with the server", loggerContext);
632
632
  _errorDetails7 = {
633
633
  statusCode: 503,
@@ -637,7 +637,7 @@ function _serviceErrorCodeHandler() {
637
637
  message: failureMessage
638
638
  };
639
639
  return _context4.abrupt("return", _errorDetails7);
640
- case 29:
640
+ case 9:
641
641
  _Logger.default.warn("".concat(errorCode || 422, " Exception has occurred"), loggerContext);
642
642
  _errorDetails8 = {
643
643
  statusCode: errorCode || 422,
@@ -647,7 +647,7 @@ function _serviceErrorCodeHandler() {
647
647
  message: failureMessage
648
648
  };
649
649
  return _context4.abrupt("return", _errorDetails8);
650
- case 32:
650
+ case 10:
651
651
  case "end":
652
652
  return _context4.stop();
653
653
  }
@@ -922,21 +922,21 @@ function getXsiActionEndpoint(_x16, _x17, _x18) {
922
922
  */
923
923
  function _getXsiActionEndpoint() {
924
924
  _getXsiActionEndpoint = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5(webex, loggerContext, callingBackend) {
925
- var _userIdResponse$heade, userIdResponse, response, xsiEndpoint, _bwTokenResponse$head, bwTokenResponse, _response, _xsiEndpoint, xsiUrl, errorInfo;
926
- return _regenerator.default.wrap(function _callee5$(_context5) {
925
+ var _userIdResponse$heade, userIdResponse, response, xsiEndpoint, _bwTokenResponse$head, bwTokenResponse, _response, _xsiEndpoint, xsiUrl, errorInfo, _t7, _t8;
926
+ return _regenerator.default.wrap(function (_context5) {
927
927
  while (1) switch (_context5.prev = _context5.next) {
928
928
  case 0:
929
929
  _context5.prev = 0;
930
- _context5.t0 = callingBackend;
931
- _context5.next = _context5.t0 === _types3.CALLING_BACKEND.WXC ? 4 : _context5.t0 === _types3.CALLING_BACKEND.BWRKS ? 11 : 20;
930
+ _t7 = callingBackend;
931
+ _context5.next = _t7 === _types3.CALLING_BACKEND.WXC ? 1 : _t7 === _types3.CALLING_BACKEND.BWRKS ? 3 : 5;
932
932
  break;
933
- case 4:
934
- _context5.next = 6;
933
+ case 1:
934
+ _context5.next = 2;
935
935
  return webex.request({
936
936
  uri: "".concat(webex.internal.services._serviceUrls.hydra, "/").concat(_constants2.XSI_ACTION_ENDPOINT_ORG_URL_PARAM),
937
937
  method: _types3.HTTP_METHODS.GET
938
938
  });
939
- case 6:
939
+ case 2:
940
940
  userIdResponse = _context5.sent;
941
941
  _Logger.default.log("Response code: ".concat(userIdResponse.statusCode, ", Response trackingid: ").concat(userIdResponse === null || userIdResponse === void 0 ? void 0 : (_userIdResponse$heade = userIdResponse.headers) === null || _userIdResponse$heade === void 0 ? void 0 : _userIdResponse$heade.trackingid), {
942
942
  file: _constants.UTILS_FILE,
@@ -945,13 +945,13 @@ function _getXsiActionEndpoint() {
945
945
  response = userIdResponse.body;
946
946
  xsiEndpoint = response[_constants2.ITEMS][0][_constants2.XSI_ACTION_ENDPOINT];
947
947
  return _context5.abrupt("return", xsiEndpoint);
948
- case 11:
949
- _context5.next = 13;
948
+ case 3:
949
+ _context5.next = 4;
950
950
  return webex.request({
951
951
  uri: "".concat(webex.internal.services._serviceUrls.wdm, "/").concat(_constants2.DEVICES),
952
952
  method: _types3.HTTP_METHODS.GET
953
953
  });
954
- case 13:
954
+ case 4:
955
955
  bwTokenResponse = _context5.sent;
956
956
  _Logger.default.log("Response code: ".concat(bwTokenResponse.statusCode, ", Response trackingid: ").concat(bwTokenResponse === null || bwTokenResponse === void 0 ? void 0 : (_bwTokenResponse$head = bwTokenResponse.headers) === null || _bwTokenResponse$head === void 0 ? void 0 : _bwTokenResponse$head.trackingid), {
957
957
  file: _constants.UTILS_FILE,
@@ -966,22 +966,22 @@ function _getXsiActionEndpoint() {
966
966
  _xsiEndpoint = xsiUrl.slice(0, -6); // Remove 'v2.0/'
967
967
  }
968
968
  return _context5.abrupt("return", _xsiEndpoint);
969
- case 20:
969
+ case 5:
970
970
  throw new Error('Calling backend is not identified, exiting....');
971
- case 21:
972
- _context5.next = 28;
971
+ case 6:
972
+ _context5.next = 8;
973
973
  break;
974
- case 23:
975
- _context5.prev = 23;
976
- _context5.t1 = _context5["catch"](0);
977
- errorInfo = _context5.t1;
974
+ case 7:
975
+ _context5.prev = 7;
976
+ _t8 = _context5["catch"](0);
977
+ errorInfo = _t8;
978
978
  serviceErrorCodeHandler(errorInfo, loggerContext);
979
979
  return _context5.abrupt("return", errorInfo);
980
- case 28:
980
+ case 8:
981
981
  case "end":
982
982
  return _context5.stop();
983
983
  }
984
- }, _callee5, null, [[0, 23]]);
984
+ }, _callee5, null, [[0, 7]]);
985
985
  }));
986
986
  return _getXsiActionEndpoint.apply(this, arguments);
987
987
  }
@@ -1036,7 +1036,7 @@ function _scimQuery() {
1036
1036
  _scimQuery = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6(filter) {
1037
1037
  var _response$headers;
1038
1038
  var sdkConnector, webex, isProd, webexHost, scimUrl, query, response;
1039
- return _regenerator.default.wrap(function _callee6$(_context6) {
1039
+ return _regenerator.default.wrap(function (_context6) {
1040
1040
  while (1) switch (_context6.prev = _context6.next) {
1041
1041
  case 0:
1042
1042
  _Logger.default.info("Starting resolution for filter:- ".concat(filter), {
@@ -1049,20 +1049,20 @@ function _scimQuery() {
1049
1049
  webexHost = isProd ? _constants2.WEBEX_API_PROD : _constants2.WEBEX_API_BTS;
1050
1050
  scimUrl = "".concat(webexHost, "/").concat(_constants2.IDENTITY_ENDPOINT_RESOURCE, "/").concat(_constants2.SCIM_ENDPOINT_RESOURCE, "/").concat(webex.internal.device.orgId, "/").concat(_constants2.SCIM_USER_FILTER);
1051
1051
  query = scimUrl + encodeURIComponent(filter);
1052
- _context6.next = 9;
1052
+ _context6.next = 1;
1053
1053
  return webex.request({
1054
1054
  uri: query,
1055
1055
  method: _types3.HTTP_METHODS.GET,
1056
1056
  headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.CISCO_DEVICE_URL, webex.internal.device.url), _constants.SPARK_USER_AGENT, _constants.CALLING_USER_AGENT)
1057
1057
  });
1058
- case 9:
1058
+ case 1:
1059
1059
  response = _context6.sent;
1060
1060
  _Logger.default.log("Response code: ".concat(response.statusCode, ", Response trackingid: ").concat(response === null || response === void 0 ? void 0 : (_response$headers = response.headers) === null || _response$headers === void 0 ? void 0 : _response$headers.trackingid), {
1061
1061
  file: _constants.UTILS_FILE,
1062
1062
  method: 'scimQuery'
1063
1063
  });
1064
1064
  return _context6.abrupt("return", response);
1065
- case 12:
1065
+ case 2:
1066
1066
  case "end":
1067
1067
  return _context6.stop();
1068
1068
  }
@@ -1081,32 +1081,32 @@ function resolveCallerIdDisplay(_x20) {
1081
1081
  function _resolveCallerIdDisplay() {
1082
1082
  _resolveCallerIdDisplay = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7(filter) {
1083
1083
  var _resolution;
1084
- var resolution, displayResult, response, res, _scimResource$phoneNu, _scimResource$phoneNu2, _scimResource$photos, scimResource, numberObj, photo;
1085
- return _regenerator.default.wrap(function _callee7$(_context7) {
1084
+ var resolution, displayResult, response, res, _scimResource$phoneNu, _scimResource$phoneNu2, _scimResource$photos, scimResource, numberObj, photo, _t9;
1085
+ return _regenerator.default.wrap(function (_context7) {
1086
1086
  while (1) switch (_context7.prev = _context7.next) {
1087
1087
  case 0:
1088
1088
  displayResult = {};
1089
1089
  _context7.prev = 1;
1090
- _context7.next = 4;
1090
+ _context7.next = 2;
1091
1091
  return scimQuery(filter);
1092
- case 4:
1092
+ case 2:
1093
1093
  response = _context7.sent;
1094
1094
  resolution = response.body;
1095
1095
  _Logger.default.info("Number of records found for this user :- ".concat(resolution.totalResults), {
1096
1096
  file: _constants.UTILS_FILE,
1097
1097
  method: 'resolveCallerIdDisplay'
1098
1098
  });
1099
- _context7.next = 13;
1099
+ _context7.next = 4;
1100
1100
  break;
1101
- case 9:
1102
- _context7.prev = 9;
1103
- _context7.t0 = _context7["catch"](1);
1104
- res = _context7.t0;
1101
+ case 3:
1102
+ _context7.prev = 3;
1103
+ _t9 = _context7["catch"](1);
1104
+ res = _t9;
1105
1105
  _Logger.default.warn("Error response: - ".concat(res.statusCode), {
1106
1106
  file: _constants.UTILS_FILE,
1107
1107
  method: 'resolveCallerIdDisplay'
1108
1108
  });
1109
- case 13:
1109
+ case 4:
1110
1110
  if ((_resolution = resolution) !== null && _resolution !== void 0 && _resolution.totalResults && resolution.totalResults > 0) {
1111
1111
  /* Every user has single resource from what we have discussed. May need to revisit this later
1112
1112
  * for shared-line use-cases.
@@ -1139,11 +1139,11 @@ function _resolveCallerIdDisplay() {
1139
1139
  displayResult.id = scimResource.id;
1140
1140
  }
1141
1141
  return _context7.abrupt("return", displayResult);
1142
- case 15:
1142
+ case 5:
1143
1143
  case "end":
1144
1144
  return _context7.stop();
1145
1145
  }
1146
- }, _callee7, null, [[1, 9]]);
1146
+ }, _callee7, null, [[1, 3]]);
1147
1147
  }));
1148
1148
  return _resolveCallerIdDisplay.apply(this, arguments);
1149
1149
  }
@@ -1158,7 +1158,7 @@ function resolveCallerIdByName(_x21) {
1158
1158
  function _resolveCallerIdByName() {
1159
1159
  _resolveCallerIdByName = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8(name) {
1160
1160
  var displayResult, sdkConnector, webex, searchDirectory;
1161
- return _regenerator.default.wrap(function _callee8$(_context8) {
1161
+ return _regenerator.default.wrap(function (_context8) {
1162
1162
  while (1) switch (_context8.prev = _context8.next) {
1163
1163
  case 0:
1164
1164
  displayResult = {};
@@ -1172,7 +1172,7 @@ function _resolveCallerIdByName() {
1172
1172
  displayName: query
1173
1173
  });
1174
1174
  };
1175
- _context8.next = 6;
1175
+ _context8.next = 1;
1176
1176
  return searchDirectory(name).then(function (results) {
1177
1177
  _Logger.default.info("DS Result: ".concat(results), {
1178
1178
  file: _constants.UTILS_FILE,
@@ -1201,9 +1201,9 @@ function _resolveCallerIdByName() {
1201
1201
  });
1202
1202
  }
1203
1203
  });
1204
- case 6:
1204
+ case 1:
1205
1205
  return _context8.abrupt("return", displayResult);
1206
- case 7:
1206
+ case 2:
1207
1207
  case "end":
1208
1208
  return _context8.stop();
1209
1209
  }
@@ -1222,23 +1222,23 @@ function resolveContact(_x22) {
1222
1222
  */
1223
1223
  function _resolveContact() {
1224
1224
  _resolveContact = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9(callingPartyInfo) {
1225
- return _regenerator.default.wrap(function _callee9$(_context9) {
1225
+ return _regenerator.default.wrap(function (_context9) {
1226
1226
  while (1) switch (_context9.prev = _context9.next) {
1227
1227
  case 0:
1228
1228
  if (!(callingPartyInfo.userExternalId && callingPartyInfo.userExternalId.$)) {
1229
- _context9.next = 2;
1229
+ _context9.next = 1;
1230
1230
  break;
1231
1231
  }
1232
1232
  return _context9.abrupt("return", resolveCallerIdDisplay("id eq \"".concat(callingPartyInfo.userExternalId.$, "\"")));
1233
- case 2:
1233
+ case 1:
1234
1234
  if (!(callingPartyInfo.name && callingPartyInfo.name.$)) {
1235
- _context9.next = 4;
1235
+ _context9.next = 2;
1236
1236
  break;
1237
1237
  }
1238
1238
  return _context9.abrupt("return", resolveCallerIdByName(callingPartyInfo.name.$));
1239
- case 4:
1239
+ case 2:
1240
1240
  return _context9.abrupt("return", null);
1241
- case 5:
1241
+ case 3:
1242
1242
  case "end":
1243
1243
  return _context9.stop();
1244
1244
  }
@@ -1415,16 +1415,17 @@ function _uploadLogs() {
1415
1415
  feedbackId,
1416
1416
  response,
1417
1417
  errorLog,
1418
- _args0 = arguments;
1419
- return _regenerator.default.wrap(function _callee0$(_context0) {
1418
+ _args0 = arguments,
1419
+ _t0;
1420
+ return _regenerator.default.wrap(function (_context0) {
1420
1421
  while (1) switch (_context0.prev = _context0.next) {
1421
1422
  case 0:
1422
1423
  metaData = _args0.length > 0 && _args0[0] !== undefined ? _args0[0] : {};
1423
1424
  throwError = _args0.length > 1 && _args0[1] !== undefined ? _args0[1] : false;
1424
1425
  webex = _SDKConnector.default.getWebex(); // const feedbackId = crypto.randomUUID();
1425
1426
  feedbackId = (0, _uuid.v4)();
1426
- _context0.prev = 4;
1427
- _context0.next = 7;
1427
+ _context0.prev = 1;
1428
+ _context0.next = 2;
1428
1429
  return webex.internal.support.submitLogs(_objectSpread(_objectSpread({}, metaData), {}, {
1429
1430
  feedbackId: feedbackId
1430
1431
  }), undefined,
@@ -1433,7 +1434,7 @@ function _uploadLogs() {
1433
1434
  type: 'diff'
1434
1435
  } // this is to take the diff logs from previous upload
1435
1436
  );
1436
- case 7:
1437
+ case 2:
1437
1438
  response = _context0.sent;
1438
1439
  _Logger.default.info("Logs uploaded successfully with feedbackId: ".concat(feedbackId), {
1439
1440
  file: _constants.UTILS_FILE,
@@ -1453,27 +1454,27 @@ function _uploadLogs() {
1453
1454
  } : {}), {}, {
1454
1455
  feedbackId: feedbackId
1455
1456
  }));
1456
- case 13:
1457
- _context0.prev = 13;
1458
- _context0.t0 = _context0["catch"](4);
1459
- errorLog = new Error("Failed to upload Logs ".concat((0, _stringify.default)(_context0.t0)));
1457
+ case 3:
1458
+ _context0.prev = 3;
1459
+ _t0 = _context0["catch"](1);
1460
+ errorLog = new Error("Failed to upload Logs ".concat((0, _stringify.default)(_t0)));
1460
1461
  _Logger.default.error(errorLog.message, {
1461
1462
  file: _constants.UTILS_FILE,
1462
1463
  method: 'uploadLogs'
1463
1464
  });
1464
1465
  (0, _Metrics.getMetricManager)().submitUploadLogsMetric(_types.METRIC_EVENT.UPLOAD_LOGS_FAILED, _types.UPLOAD_LOGS_ACTION, _types.METRIC_TYPE.BEHAVIORAL, undefined, feedbackId, metaData === null || metaData === void 0 ? void 0 : metaData.correlationId, errorLog.message, metaData === null || metaData === void 0 ? void 0 : metaData.callId, metaData === null || metaData === void 0 ? void 0 : metaData.broadworksCorrelationInfo);
1465
1466
  if (!throwError) {
1466
- _context0.next = 20;
1467
+ _context0.next = 4;
1467
1468
  break;
1468
1469
  }
1469
- throw _context0.t0;
1470
- case 20:
1470
+ throw _t0;
1471
+ case 4:
1471
1472
  return _context0.abrupt("return", undefined);
1472
- case 21:
1473
+ case 5:
1473
1474
  case "end":
1474
1475
  return _context0.stop();
1475
1476
  }
1476
- }, _callee0, null, [[4, 13]]);
1477
+ }, _callee0, null, [[1, 3]]);
1477
1478
  }));
1478
1479
  return _uploadLogs.apply(this, arguments);
1479
1480
  }