@webex/calling 3.10.0 → 3.11.0-next.10

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 (158) hide show
  1. package/dist/CallHistory/CallHistory.js +128 -133
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +289 -186
  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 +72 -25
  10. package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
  11. package/dist/CallSettings/UcmBackendConnector.test.js +138 -48
  12. package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
  13. package/dist/CallSettings/WxCallBackendConnector.js +138 -145
  14. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  15. package/dist/CallSettings/WxCallBackendConnector.test.js +149 -150
  16. package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
  17. package/dist/CallingClient/CallingClient.js +407 -359
  18. package/dist/CallingClient/CallingClient.js.map +1 -1
  19. package/dist/CallingClient/CallingClient.test.js +378 -401
  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 +666 -624
  26. package/dist/CallingClient/calling/call.js.map +1 -1
  27. package/dist/CallingClient/calling/call.test.js +908 -556
  28. package/dist/CallingClient/calling/call.test.js.map +1 -1
  29. package/dist/CallingClient/calling/callManager.js +22 -18
  30. package/dist/CallingClient/calling/callManager.js.map +1 -1
  31. package/dist/CallingClient/calling/callManager.test.js +114 -114
  32. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  33. package/dist/CallingClient/constants.js +7 -1
  34. package/dist/CallingClient/constants.js.map +1 -1
  35. package/dist/CallingClient/line/index.js +57 -74
  36. package/dist/CallingClient/line/index.js.map +1 -1
  37. package/dist/CallingClient/line/line.test.js +22 -22
  38. package/dist/CallingClient/line/line.test.js.map +1 -1
  39. package/dist/CallingClient/registration/register.js +675 -527
  40. package/dist/CallingClient/registration/register.js.map +1 -1
  41. package/dist/CallingClient/registration/register.test.js +657 -309
  42. package/dist/CallingClient/registration/register.test.js.map +1 -1
  43. package/dist/CallingClient/registration/types.js.map +1 -1
  44. package/dist/CallingClient/registration/webWorker.js +24 -24
  45. package/dist/CallingClient/registration/webWorker.js.map +1 -1
  46. package/dist/CallingClient/registration/webWorker.test.js +20 -20
  47. package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
  48. package/dist/CallingClient/registration/webWorkerStr.js +1 -1
  49. package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
  50. package/dist/CallingClient/types.js.map +1 -1
  51. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +28 -28
  52. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
  53. package/dist/Contacts/ContactsClient.js +259 -268
  54. package/dist/Contacts/ContactsClient.js.map +1 -1
  55. package/dist/Contacts/ContactsClient.test.js +64 -63
  56. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  57. package/dist/Errors/catalog/CallError.js +7 -10
  58. package/dist/Errors/catalog/CallError.js.map +1 -1
  59. package/dist/Errors/catalog/CallingDeviceError.js +6 -9
  60. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  61. package/dist/Errors/catalog/ExtendedError.js +6 -8
  62. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  63. package/dist/Errors/catalog/LineError.js +6 -9
  64. package/dist/Errors/catalog/LineError.js.map +1 -1
  65. package/dist/Events/impl/index.js +12 -14
  66. package/dist/Events/impl/index.js.map +1 -1
  67. package/dist/Logger/index.js +3 -3
  68. package/dist/Logger/index.js.map +1 -1
  69. package/dist/Logger/index.test.js +1 -1
  70. package/dist/Logger/index.test.js.map +1 -1
  71. package/dist/Metrics/index.js +1 -2
  72. package/dist/Metrics/index.js.map +1 -1
  73. package/dist/SDKConnector/index.js +1 -2
  74. package/dist/SDKConnector/index.js.map +1 -1
  75. package/dist/SDKConnector/types.js.map +1 -1
  76. package/dist/Voicemail/BroadworksBackendConnector.js +131 -139
  77. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  78. package/dist/Voicemail/BroadworksBackendConnector.test.js +106 -98
  79. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  80. package/dist/Voicemail/UcmBackendConnector.js +88 -92
  81. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  82. package/dist/Voicemail/UcmBackendConnector.test.js +72 -72
  83. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  84. package/dist/Voicemail/Voicemail.js +103 -131
  85. package/dist/Voicemail/Voicemail.js.map +1 -1
  86. package/dist/Voicemail/Voicemail.test.js +20 -20
  87. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  88. package/dist/Voicemail/WxCallBackendConnector.js +117 -131
  89. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  90. package/dist/Voicemail/WxCallBackendConnector.test.js +180 -154
  91. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  92. package/dist/common/Utils.js +198 -166
  93. package/dist/common/Utils.js.map +1 -1
  94. package/dist/common/Utils.test.js +436 -191
  95. package/dist/common/Utils.test.js.map +1 -1
  96. package/dist/common/constants.js +3 -1
  97. package/dist/common/constants.js.map +1 -1
  98. package/dist/common/testUtil.js +5 -4
  99. package/dist/common/testUtil.js.map +1 -1
  100. package/dist/common/types.js.map +1 -1
  101. package/dist/module/CallHistory/CallHistory.js +20 -11
  102. package/dist/module/CallSettings/UcmBackendConnector.js +21 -8
  103. package/dist/module/CallSettings/WxCallBackendConnector.js +10 -15
  104. package/dist/module/CallingClient/CallingClient.js +125 -123
  105. package/dist/module/CallingClient/calling/call.js +76 -60
  106. package/dist/module/CallingClient/calling/callManager.js +7 -0
  107. package/dist/module/CallingClient/constants.js +5 -0
  108. package/dist/module/CallingClient/registration/register.js +93 -5
  109. package/dist/module/CallingClient/registration/webWorker.js +2 -2
  110. package/dist/module/CallingClient/registration/webWorkerStr.js +2 -2
  111. package/dist/module/Contacts/ContactsClient.js +19 -25
  112. package/dist/module/Events/impl/index.js +1 -1
  113. package/dist/module/Logger/index.js +2 -2
  114. package/dist/module/Voicemail/BroadworksBackendConnector.js +10 -18
  115. package/dist/module/Voicemail/UcmBackendConnector.js +7 -11
  116. package/dist/module/Voicemail/Voicemail.js +42 -68
  117. package/dist/module/Voicemail/WxCallBackendConnector.js +14 -28
  118. package/dist/module/common/Utils.js +31 -5
  119. package/dist/module/common/constants.js +2 -0
  120. package/dist/module/common/testUtil.js +1 -0
  121. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  122. package/dist/types/CallSettings/UcmBackendConnector.d.ts +1 -0
  123. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  124. package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
  125. package/dist/types/CallingClient/CallingClient.d.ts +2 -1
  126. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  127. package/dist/types/CallingClient/calling/call.d.ts +4 -0
  128. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  129. package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
  130. package/dist/types/CallingClient/constants.d.ts +5 -0
  131. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  132. package/dist/types/CallingClient/registration/register.d.ts +6 -1
  133. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  134. package/dist/types/CallingClient/registration/types.d.ts +8 -1
  135. package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
  136. package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
  137. package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
  138. package/dist/types/CallingClient/types.d.ts +2 -1
  139. package/dist/types/CallingClient/types.d.ts.map +1 -1
  140. package/dist/types/Contacts/ContactsClient.d.ts +1 -0
  141. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  142. package/dist/types/Logger/index.d.ts +1 -2
  143. package/dist/types/Logger/index.d.ts.map +1 -1
  144. package/dist/types/SDKConnector/types.d.ts +16 -0
  145. package/dist/types/SDKConnector/types.d.ts.map +1 -1
  146. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
  147. package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
  148. package/dist/types/Voicemail/Voicemail.d.ts.map +1 -1
  149. package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
  150. package/dist/types/common/Utils.d.ts +1 -1
  151. package/dist/types/common/Utils.d.ts.map +1 -1
  152. package/dist/types/common/constants.d.ts +2 -0
  153. package/dist/types/common/constants.d.ts.map +1 -1
  154. package/dist/types/common/testUtil.d.ts +1 -0
  155. package/dist/types/common/testUtil.d.ts.map +1 -1
  156. package/dist/types/common/types.d.ts +4 -0
  157. package/dist/types/common/types.d.ts.map +1 -1
  158. package/package.json +4 -4
@@ -13,6 +13,7 @@ var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regene
13
13
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
14
14
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
15
15
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
16
+ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
16
17
  var _types = require("../common/types");
17
18
  var _testUtil = require("../common/testUtil");
18
19
  var _types2 = require("../Logger/types");
@@ -173,7 +174,7 @@ describe('ContactClient Tests', function () {
173
174
  it.each(errorCodes)('%s', /*#__PURE__*/function () {
174
175
  var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(codeObj) {
175
176
  var respPayload, contactsResponse;
176
- return _regenerator.default.wrap(function _callee$(_context) {
177
+ return _regenerator.default.wrap(function (_context) {
177
178
  while (1) switch (_context.prev = _context.next) {
178
179
  case 0:
179
180
  respPayload = {
@@ -193,9 +194,9 @@ describe('ContactClient Tests', function () {
193
194
  respPayload['data'] = codeObj.payloadData;
194
195
  webex.request.mockRejectedValueOnce(respPayload);
195
196
  }
196
- _context.next = 4;
197
+ _context.next = 1;
197
198
  return contactClient.getContacts();
198
- case 4:
199
+ case 1:
199
200
  contactsResponse = _context.sent;
200
201
  if (codeObj.inputStatusCode === 200) {
201
202
  if (codeObj.cloudContactPresent) {
@@ -253,7 +254,7 @@ describe('ContactClient Tests', function () {
253
254
  method: _constants2.METHODS.GET_CONTACTS
254
255
  });
255
256
  }
256
- case 8:
257
+ case 2:
257
258
  case "end":
258
259
  return _context.stop();
259
260
  }
@@ -266,7 +267,7 @@ describe('ContactClient Tests', function () {
266
267
  it('create a contact group without encryptionKey', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
267
268
  var _contactsResponse$dat;
268
269
  var successResponsePayload, contactsResponse;
269
- return _regenerator.default.wrap(function _callee2$(_context2) {
270
+ return _regenerator.default.wrap(function (_context2) {
270
271
  while (1) switch (_context2.prev = _context2.next) {
271
272
  case 0:
272
273
  successResponsePayload = {
@@ -279,9 +280,9 @@ describe('ContactClient Tests', function () {
279
280
  webex.internal.encryption.kms.createUnboundKeys.mockResolvedValue([_contactFixtures.mockKmsKey]);
280
281
  webex.internal.encryption.kms.createResource.mockResolvedValue(_contactFixtures.mockKmsKey);
281
282
  webex.internal.encryption.encryptText.mockResolvedValueOnce('Encrypted Other').mockResolvedValueOnce('Encrypted Top');
282
- _context2.next = 9;
283
+ _context2.next = 1;
283
284
  return contactClient.createContactGroup('Top Contacts');
284
- case 9:
285
+ case 1:
285
286
  contactsResponse = _context2.sent;
286
287
  expect(contactsResponse.statusCode).toEqual(201);
287
288
  expect((_contactsResponse$dat = contactsResponse.data.group) === null || _contactsResponse$dat === void 0 ? void 0 : _contactsResponse$dat.groupId).toBe(mockGroupResponse.groupId);
@@ -334,7 +335,7 @@ describe('ContactClient Tests', function () {
334
335
  file: _constants2.CONTACTS_CLIENT,
335
336
  method: _constants2.METHODS.CREATE_CONTACT_GROUP
336
337
  });
337
- case 24:
338
+ case 2:
338
339
  case "end":
339
340
  return _context2.stop();
340
341
  }
@@ -343,7 +344,7 @@ describe('ContactClient Tests', function () {
343
344
  it('create a contact group with existing key info', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
344
345
  var _contactsResponse$dat2;
345
346
  var successResponsePayload, infoSpy, contactsResponse;
346
- return _regenerator.default.wrap(function _callee3$(_context3) {
347
+ return _regenerator.default.wrap(function (_context3) {
347
348
  while (1) switch (_context3.prev = _context3.next) {
348
349
  case 0:
349
350
  successResponsePayload = {
@@ -354,9 +355,9 @@ describe('ContactClient Tests', function () {
354
355
  webex.request.mockResolvedValue(successResponsePayload);
355
356
  webex.internal.encryption.encryptText.mockResolvedValue('Encrypted Top Contacts');
356
357
  infoSpy = jest.spyOn(_Logger.default, 'info');
357
- _context3.next = 7;
358
+ _context3.next = 1;
358
359
  return contactClient.createContactGroup('Top Contacts');
359
- case 7:
360
+ case 1:
360
361
  contactsResponse = _context3.sent;
361
362
  expect(contactsResponse.statusCode).toEqual(201);
362
363
  expect((_contactsResponse$dat2 = contactsResponse.data.group) === null || _contactsResponse$dat2 === void 0 ? void 0 : _contactsResponse$dat2.groupId).toBe(mockGroupResponse.groupId);
@@ -384,7 +385,7 @@ describe('ContactClient Tests', function () {
384
385
  });
385
386
  expect(contactClient['groups'].length).toEqual(2);
386
387
  expect(contactClient['groups'][1].displayName).toEqual('Top Contacts');
387
- case 16:
388
+ case 2:
388
389
  case "end":
389
390
  return _context3.stop();
390
391
  }
@@ -392,16 +393,16 @@ describe('ContactClient Tests', function () {
392
393
  })));
393
394
  it('create a contact group with same displayName', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
394
395
  var logSpy, contactsResponse;
395
- return _regenerator.default.wrap(function _callee4$(_context4) {
396
+ return _regenerator.default.wrap(function (_context4) {
396
397
  while (1) switch (_context4.prev = _context4.next) {
397
398
  case 0:
398
399
  contactClient['groups'] = _contactFixtures.mockContactResponseBodyOne.groups;
399
400
  webex.internal.encryption.kms.createUnboundKeys.mockResolvedValue([_contactFixtures.mockKmsKey]);
400
401
  webex.internal.encryption.kms.createResource.mockResolvedValue(_contactFixtures.mockKmsKey);
401
402
  logSpy = jest.spyOn(_Logger.default, 'warn');
402
- _context4.next = 6;
403
+ _context4.next = 1;
403
404
  return contactClient.createContactGroup(mockGroupResponse.displayName);
404
- case 6:
405
+ case 1:
405
406
  contactsResponse = _context4.sent;
406
407
  expect(webex.request).not.toBeCalled();
407
408
  expect(contactsResponse.statusCode).toBe(400);
@@ -414,7 +415,7 @@ describe('ContactClient Tests', function () {
414
415
  method: _constants2.METHODS.CREATE_CONTACT_GROUP
415
416
  });
416
417
  expect(contactClient['groups']).toEqual(_contactFixtures.mockContactResponseBodyOne.groups);
417
- case 12:
418
+ case 2:
418
419
  case "end":
419
420
  return _context4.stop();
420
421
  }
@@ -422,7 +423,7 @@ describe('ContactClient Tests', function () {
422
423
  })));
423
424
  it('create a contact group - service unavailable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
424
425
  var loggerContext, warnSpy, errorSpy, contactsResponse;
425
- return _regenerator.default.wrap(function _callee5$(_context5) {
426
+ return _regenerator.default.wrap(function (_context5) {
426
427
  while (1) switch (_context5.prev = _context5.next) {
427
428
  case 0:
428
429
  loggerContext = {
@@ -436,9 +437,9 @@ describe('ContactClient Tests', function () {
436
437
  webex.internal.encryption.encryptText.mockResolvedValueOnce('Encrypted group name');
437
438
  warnSpy = jest.spyOn(_Logger.default, 'warn');
438
439
  errorSpy = jest.spyOn(_Logger.default, 'error');
439
- _context5.next = 10;
440
+ _context5.next = 1;
440
441
  return contactClient.createContactGroup('New group');
441
- case 10:
442
+ case 1:
442
443
  contactsResponse = _context5.sent;
443
444
  expect(contactsResponse.statusCode).toBe(503);
444
445
  expect(webex.request).toBeCalledOnceWith({
@@ -455,10 +456,10 @@ describe('ContactClient Tests', function () {
455
456
  expect(warnSpy).toBeCalledTimes(1);
456
457
  expect(warnSpy).toHaveBeenNthCalledWith(1, '503 Unable to establish a connection with the server', loggerContext);
457
458
  expect(errorSpy).toBeCalledTimes(1);
458
- expect(errorSpy).toHaveBeenNthCalledWith(1, Error("Unable to create contact group: ".concat(failureResponsePayload)), loggerContext);
459
+ expect(errorSpy).toHaveBeenNthCalledWith(1, "Unable to create contact group: ".concat((0, _stringify.default)(failureResponsePayload)), loggerContext);
459
460
  expect(contactClient['groups']).toEqual(_contactFixtures.mockContactGroupListOne);
460
461
  expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith(failureResponsePayload, loggerContext);
461
- case 20:
462
+ case 2:
462
463
  case "end":
463
464
  return _context5.stop();
464
465
  }
@@ -466,7 +467,7 @@ describe('ContactClient Tests', function () {
466
467
  })));
467
468
  it('delete a contact group - service unavailable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
468
469
  var loggerContext, warnSpy, errorSpy, contactsResponse;
469
- return _regenerator.default.wrap(function _callee6$(_context6) {
470
+ return _regenerator.default.wrap(function (_context6) {
470
471
  while (1) switch (_context6.prev = _context6.next) {
471
472
  case 0:
472
473
  loggerContext = {
@@ -479,9 +480,9 @@ describe('ContactClient Tests', function () {
479
480
  webex.internal.encryption.kms.createResource.mockResolvedValue(_contactFixtures.mockKmsKey);
480
481
  warnSpy = jest.spyOn(_Logger.default, 'warn');
481
482
  errorSpy = jest.spyOn(_Logger.default, 'error');
482
- _context6.next = 9;
483
+ _context6.next = 1;
483
484
  return contactClient.deleteContactGroup(mockGroupResponse.groupId);
484
- case 9:
485
+ case 1:
485
486
  contactsResponse = _context6.sent;
486
487
  expect(contactsResponse.statusCode).toBe(503);
487
488
  expect(webex.request).toBeCalledOnceWith({
@@ -493,11 +494,11 @@ describe('ContactClient Tests', function () {
493
494
  expect(warnSpy).toBeCalledTimes(1);
494
495
  expect(errorSpy).toBeCalledTimes(1);
495
496
  expect(uploadLogsSpy).toBeCalledTimes(1);
496
- expect(errorSpy).toHaveBeenNthCalledWith(1, Error("Unable to delete contact group ".concat(mockGroupResponse.groupId, ": ").concat(failureResponsePayload)), loggerContext);
497
+ expect(errorSpy).toHaveBeenNthCalledWith(1, "Unable to delete contact group ".concat(mockGroupResponse.groupId, ": ").concat((0, _stringify.default)(failureResponsePayload)), loggerContext);
497
498
  expect(warnSpy).toHaveBeenNthCalledWith(1, '503 Unable to establish a connection with the server', loggerContext);
498
499
  expect(contactClient['groups']).toEqual(_contactFixtures.mockContactGroupListOne);
499
500
  expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith(failureResponsePayload, loggerContext);
500
- case 21:
501
+ case 2:
501
502
  case "end":
502
503
  return _context6.stop();
503
504
  }
@@ -505,7 +506,7 @@ describe('ContactClient Tests', function () {
505
506
  })));
506
507
  it('successful deletion of contact group', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
507
508
  var successResponsePayload, response;
508
- return _regenerator.default.wrap(function _callee7$(_context7) {
509
+ return _regenerator.default.wrap(function (_context7) {
509
510
  while (1) switch (_context7.prev = _context7.next) {
510
511
  case 0:
511
512
  successResponsePayload = {
@@ -513,9 +514,9 @@ describe('ContactClient Tests', function () {
513
514
  };
514
515
  contactClient['groups'] = [_contactFixtures.mockContactGroupListOne[0]];
515
516
  webex.request.mockResolvedValue(successResponsePayload);
516
- _context7.next = 5;
517
+ _context7.next = 1;
517
518
  return contactClient.deleteContactGroup(_contactFixtures.mockContactGroupListOne[0].groupId);
518
- case 5:
519
+ case 1:
519
520
  response = _context7.sent;
520
521
  expect(response.statusCode).toEqual(204);
521
522
  expect(webex.request).toBeCalledOnceWith({
@@ -531,7 +532,7 @@ describe('ContactClient Tests', function () {
531
532
  file: _constants2.CONTACTS_CLIENT,
532
533
  method: 'deleteContactGroup'
533
534
  });
534
- case 11:
535
+ case 2:
535
536
  case "end":
536
537
  return _context7.stop();
537
538
  }
@@ -540,7 +541,7 @@ describe('ContactClient Tests', function () {
540
541
  it('create a contact with an existing group', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
541
542
  var _res$data$contact, _result$data$contact;
542
543
  var mockContactResponse, successResponsePayload, infoSpy, logSpy, contact, res, result;
543
- return _regenerator.default.wrap(function _callee8$(_context8) {
544
+ return _regenerator.default.wrap(function (_context8) {
544
545
  while (1) switch (_context8.prev = _context8.next) {
545
546
  case 0:
546
547
  mockContactResponse = _contactFixtures.mockContactResponseBodyTwo.contacts[0];
@@ -556,9 +557,9 @@ describe('ContactClient Tests', function () {
556
557
  contactClient['encryptionKeyUrl'] = _contactFixtures.mockContactGroupListOne[0].encryptionKeyUrl;
557
558
  contact = _contactFixtures.mockContactListTwo.slice()[0];
558
559
  contact.groups = [];
559
- _context8.next = 12;
560
+ _context8.next = 1;
560
561
  return contactClient.createContact(contact);
561
- case 12:
562
+ case 1:
562
563
  res = _context8.sent;
563
564
  expect(res.statusCode).toEqual(201);
564
565
  expect((_res$data$contact = res.data.contact) === null || _res$data$contact === void 0 ? void 0 : _res$data$contact.contactId).toBe(mockContactResponse.contactId);
@@ -595,16 +596,16 @@ describe('ContactClient Tests', function () {
595
596
  logSpy.mockClear();
596
597
 
597
598
  /* for coverage */
598
- _context8.next = 25;
599
+ _context8.next = 2;
599
600
  return contactClient.createContact(contact);
600
- case 25:
601
+ case 2:
601
602
  result = _context8.sent;
602
603
  expect((_result$data$contact = result.data.contact) === null || _result$data$contact === void 0 ? void 0 : _result$data$contact.contactId).toBe(mockContactResponse.contactId);
603
604
  expect(logSpy).not.toBeCalledWith("Creating a default group: ".concat(_constants2.DEFAULT_GROUP_NAME), {
604
605
  file: _constants2.CONTACTS_CLIENT,
605
606
  method: 'fetchEncryptionKeyUrl'
606
607
  });
607
- case 28:
608
+ case 3:
608
609
  case "end":
609
610
  return _context8.stop();
610
611
  }
@@ -613,7 +614,7 @@ describe('ContactClient Tests', function () {
613
614
  it('create a contact without a group and encryptionKey', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
614
615
  var _res$data$contact2;
615
616
  var mockContactResponse, successContactGroupResponsePayload, successContactResponsePayload, contact, res;
616
- return _regenerator.default.wrap(function _callee9$(_context9) {
617
+ return _regenerator.default.wrap(function (_context9) {
617
618
  while (1) switch (_context9.prev = _context9.next) {
618
619
  case 0:
619
620
  mockContactResponse = _contactFixtures.mockContactResponseBodyOne.contacts[1];
@@ -635,9 +636,9 @@ describe('ContactClient Tests', function () {
635
636
  contact = {
636
637
  contactType: 'CUSTOM'
637
638
  };
638
- _context9.next = 13;
639
+ _context9.next = 1;
639
640
  return contactClient.createContact(contact);
640
- case 13:
641
+ case 1:
641
642
  res = _context9.sent;
642
643
  expect(res.statusCode).toEqual(201);
643
644
  expect(webex.request).toBeCalledTimes(2);
@@ -688,7 +689,7 @@ describe('ContactClient Tests', function () {
688
689
  file: _constants2.CONTACTS_CLIENT,
689
690
  method: 'createContact'
690
691
  });
691
- case 26:
692
+ case 2:
692
693
  case "end":
693
694
  return _context9.stop();
694
695
  }
@@ -697,7 +698,7 @@ describe('ContactClient Tests', function () {
697
698
  it('create a cloud contact with no existing groups', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
698
699
  var _res$data$contact3;
699
700
  var mockContactResponse, successResponsePayload, successResponsePayloadGroup, contact, res;
700
- return _regenerator.default.wrap(function _callee0$(_context0) {
701
+ return _regenerator.default.wrap(function (_context0) {
701
702
  while (1) switch (_context0.prev = _context0.next) {
702
703
  case 0:
703
704
  mockContactResponse = _contactFixtures.mockContactResponseBodyOne.contacts[0];
@@ -717,9 +718,9 @@ describe('ContactClient Tests', function () {
717
718
  contactType: 'CLOUD'
718
719
  };
719
720
  contact.groups = [];
720
- _context0.next = 11;
721
+ _context0.next = 1;
721
722
  return contactClient.createContact(contact);
722
- case 11:
723
+ case 1:
723
724
  res = _context0.sent;
724
725
  expect(res.statusCode).toEqual(400);
725
726
  expect(res.data.error).toEqual('contactId is required for contactType:CLOUD.');
@@ -728,9 +729,9 @@ describe('ContactClient Tests', function () {
728
729
  method: _constants2.METHODS.CREATE_CONTACT
729
730
  });
730
731
  contact.contactId = mockContactResponse.contactId;
731
- _context0.next = 18;
732
+ _context0.next = 2;
732
733
  return contactClient.createContact(contact);
733
- case 18:
734
+ case 2:
734
735
  res = _context0.sent;
735
736
  expect(res.statusCode).toEqual(201);
736
737
  expect((_res$data$contact3 = res.data.contact) === null || _res$data$contact3 === void 0 ? void 0 : _res$data$contact3.contactId).toBe(mockContactResponse.contactId);
@@ -768,7 +769,7 @@ describe('ContactClient Tests', function () {
768
769
  file: _constants2.CONTACTS_CLIENT,
769
770
  method: 'createContact'
770
771
  });
771
- case 26:
772
+ case 3:
772
773
  case "end":
773
774
  return _context0.stop();
774
775
  }
@@ -776,7 +777,7 @@ describe('ContactClient Tests', function () {
776
777
  })));
777
778
  it('create a contact - service unavailable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
778
779
  var contact, res;
779
- return _regenerator.default.wrap(function _callee1$(_context1) {
780
+ return _regenerator.default.wrap(function (_context1) {
780
781
  while (1) switch (_context1.prev = _context1.next) {
781
782
  case 0:
782
783
  webex.request.mockRejectedValue(failureResponsePayload);
@@ -786,9 +787,9 @@ describe('ContactClient Tests', function () {
786
787
  contactType: 'CLOUD',
787
788
  contactId: '801bb994-343b-4f6b-97ae-d13c91d4b877'
788
789
  };
789
- _context1.next = 6;
790
+ _context1.next = 1;
790
791
  return contactClient.createContact(contact);
791
- case 6:
792
+ case 1:
792
793
  res = _context1.sent;
793
794
  expect(webex.request).toBeCalledOnceWith({
794
795
  uri: contactServiceUrl,
@@ -808,11 +809,11 @@ describe('ContactClient Tests', function () {
808
809
  file: _constants2.CONTACTS_CLIENT,
809
810
  method: _constants2.METHODS.CREATE_CONTACT
810
811
  });
811
- expect(_Logger.default.error).toBeCalledWith(Error("Failed to create contact: ".concat(failureResponsePayload)), {
812
+ expect(_Logger.default.error).toBeCalledWith("Failed to create contact: ".concat((0, _stringify.default)(failureResponsePayload)), {
812
813
  file: _constants2.CONTACTS_CLIENT,
813
814
  method: _constants2.METHODS.CREATE_CONTACT
814
815
  });
815
- case 12:
816
+ case 2:
816
817
  case "end":
817
818
  return _context1.stop();
818
819
  }
@@ -820,7 +821,7 @@ describe('ContactClient Tests', function () {
820
821
  })));
821
822
  it('successful deletion of contacts', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
822
823
  var successResponsePayload, response;
823
- return _regenerator.default.wrap(function _callee10$(_context10) {
824
+ return _regenerator.default.wrap(function (_context10) {
824
825
  while (1) switch (_context10.prev = _context10.next) {
825
826
  case 0:
826
827
  successResponsePayload = {
@@ -828,9 +829,9 @@ describe('ContactClient Tests', function () {
828
829
  };
829
830
  contactClient['contacts'] = [_contactFixtures.mockContactListOne[0]];
830
831
  webex.request.mockResolvedValue(successResponsePayload);
831
- _context10.next = 5;
832
+ _context10.next = 1;
832
833
  return contactClient.deleteContact(_contactFixtures.mockContactListOne[0].contactId);
833
- case 5:
834
+ case 1:
834
835
  response = _context10.sent;
835
836
  expect(response.statusCode).toEqual(204);
836
837
  expect(webex.request).toBeCalledOnceWith({
@@ -846,7 +847,7 @@ describe('ContactClient Tests', function () {
846
847
  file: _constants2.CONTACTS_CLIENT,
847
848
  method: _constants2.METHODS.DELETE_CONTACT
848
849
  });
849
- case 11:
850
+ case 2:
850
851
  case "end":
851
852
  return _context10.stop();
852
853
  }
@@ -854,14 +855,14 @@ describe('ContactClient Tests', function () {
854
855
  })));
855
856
  it('delete a contact - service unavailable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
856
857
  var response;
857
- return _regenerator.default.wrap(function _callee11$(_context11) {
858
+ return _regenerator.default.wrap(function (_context11) {
858
859
  while (1) switch (_context11.prev = _context11.next) {
859
860
  case 0:
860
861
  contactClient['contacts'] = _contactFixtures.mockContactListOne;
861
862
  webex.request.mockRejectedValue(failureResponsePayload);
862
- _context11.next = 4;
863
+ _context11.next = 1;
863
864
  return contactClient.deleteContact(_contactFixtures.mockContactListOne[0].contactId);
864
- case 4:
865
+ case 1:
865
866
  response = _context11.sent;
866
867
  expect(response.statusCode).toEqual(503);
867
868
  expect(webex.request).toBeCalledOnceWith({
@@ -881,7 +882,7 @@ describe('ContactClient Tests', function () {
881
882
  file: _constants2.CONTACTS_CLIENT,
882
883
  method: _constants2.METHODS.DELETE_CONTACT
883
884
  });
884
- case 11:
885
+ case 2:
885
886
  case "end":
886
887
  return _context11.stop();
887
888
  }
@@ -957,7 +958,7 @@ describe('ContactClient Tests', function () {
957
958
  });
958
959
  it('logs error for chunk when scimQuery API call fails in the loop for getContacts', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
959
960
  var mockData, respPayload, warnSpy, infoSpy, logSpy;
960
- return _regenerator.default.wrap(function _callee12$(_context12) {
961
+ return _regenerator.default.wrap(function (_context12) {
961
962
  while (1) switch (_context12.prev = _context12.next) {
962
963
  case 0:
963
964
  mockData = errorCodes[0];
@@ -976,9 +977,9 @@ describe('ContactClient Tests', function () {
976
977
  warnSpy = jest.spyOn(_Logger.default, 'warn');
977
978
  infoSpy = jest.spyOn(_Logger.default, 'info');
978
979
  logSpy = jest.spyOn(_Logger.default, 'log');
979
- _context12.next = 9;
980
+ _context12.next = 1;
980
981
  return contactClient.getContacts();
981
- case 9:
982
+ case 1:
982
983
  expect(webex.request).toBeCalledTimes(2);
983
984
  expect(warnSpy).toBeCalledTimes(1);
984
985
  expect(warnSpy).toBeCalledWith('Error processing contact chunk 0-50', {
@@ -993,7 +994,7 @@ describe('ContactClient Tests', function () {
993
994
  file: _constants2.CONTACTS_CLIENT,
994
995
  method: _constants2.METHODS.GET_CONTACTS
995
996
  });
996
- case 14:
997
+ case 2:
997
998
  case "end":
998
999
  return _context12.stop();
999
1000
  }