@webex/calling 3.10.0-next.2 → 3.10.0-next.21
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.
- package/dist/CallHistory/CallHistory.js +128 -128
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +278 -181
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallSettings/CallSettings.js +17 -18
- package/dist/CallSettings/CallSettings.js.map +1 -1
- package/dist/CallSettings/CallSettings.test.js +14 -14
- package/dist/CallSettings/CallSettings.test.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.js +71 -24
- package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +136 -47
- package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.js +137 -138
- package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +145 -149
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +297 -345
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +267 -405
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +7 -8
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +24 -24
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +655 -611
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +762 -551
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +15 -18
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +113 -113
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/constants.js +5 -1
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +57 -74
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +22 -22
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/registration/register.js +657 -526
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +657 -309
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/registration/types.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.js +24 -24
- package/dist/CallingClient/registration/webWorker.js.map +1 -1
- package/dist/CallingClient/registration/webWorker.test.js +20 -20
- package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +28 -28
- package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +258 -258
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Contacts/ContactsClient.test.js +60 -60
- package/dist/Contacts/ContactsClient.test.js.map +1 -1
- package/dist/Errors/catalog/CallError.js +7 -10
- package/dist/Errors/catalog/CallError.js.map +1 -1
- package/dist/Errors/catalog/CallingDeviceError.js +6 -9
- package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
- package/dist/Errors/catalog/ExtendedError.js +6 -8
- package/dist/Errors/catalog/ExtendedError.js.map +1 -1
- package/dist/Errors/catalog/LineError.js +6 -9
- package/dist/Errors/catalog/LineError.js.map +1 -1
- package/dist/Events/impl/index.js +11 -13
- package/dist/Events/impl/index.js.map +1 -1
- package/dist/Metrics/index.js +1 -2
- package/dist/Metrics/index.js.map +1 -1
- package/dist/SDKConnector/index.js +1 -2
- package/dist/SDKConnector/index.js.map +1 -1
- package/dist/SDKConnector/types.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +129 -128
- package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +98 -98
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.js +86 -86
- package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +72 -72
- package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
- package/dist/Voicemail/Voicemail.js +58 -61
- package/dist/Voicemail/Voicemail.js.map +1 -1
- package/dist/Voicemail/Voicemail.test.js +20 -20
- package/dist/Voicemail/Voicemail.test.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.js +116 -117
- package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +140 -140
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
- package/dist/common/Utils.js +195 -165
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +432 -183
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js +3 -1
- package/dist/common/constants.js.map +1 -1
- package/dist/common/testUtil.js +5 -4
- package/dist/common/testUtil.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +7 -3
- package/dist/module/CallSettings/UcmBackendConnector.js +20 -6
- package/dist/module/CallSettings/WxCallBackendConnector.js +3 -1
- package/dist/module/CallingClient/CallingClient.js +83 -121
- package/dist/module/CallingClient/calling/call.js +60 -39
- package/dist/module/CallingClient/constants.js +3 -0
- package/dist/module/CallingClient/registration/register.js +82 -2
- package/dist/module/Contacts/ContactsClient.js +9 -5
- package/dist/module/Voicemail/BroadworksBackendConnector.js +3 -1
- package/dist/module/Voicemail/UcmBackendConnector.js +2 -1
- package/dist/module/common/Utils.js +27 -3
- package/dist/module/common/constants.js +2 -0
- package/dist/module/common/testUtil.js +1 -0
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallSettings/UcmBackendConnector.d.ts +1 -0
- package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +4 -0
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +3 -0
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +4 -0
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/types.d.ts +6 -0
- package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +1 -0
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/SDKConnector/types.d.ts +16 -0
- package/dist/types/SDKConnector/types.d.ts.map +1 -1
- package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
- package/dist/types/common/Utils.d.ts +1 -1
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/constants.d.ts +2 -0
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/testUtil.d.ts +1 -0
- package/dist/types/common/testUtil.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -174,7 +174,7 @@ describe('ContactClient Tests', function () {
|
|
|
174
174
|
it.each(errorCodes)('%s', /*#__PURE__*/function () {
|
|
175
175
|
var _ref = (0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee(codeObj) {
|
|
176
176
|
var respPayload, contactsResponse;
|
|
177
|
-
return _regenerator.default.wrap(function
|
|
177
|
+
return _regenerator.default.wrap(function (_context) {
|
|
178
178
|
while (1) switch (_context.prev = _context.next) {
|
|
179
179
|
case 0:
|
|
180
180
|
respPayload = {
|
|
@@ -194,9 +194,9 @@ describe('ContactClient Tests', function () {
|
|
|
194
194
|
respPayload['data'] = codeObj.payloadData;
|
|
195
195
|
webex.request.mockRejectedValueOnce(respPayload);
|
|
196
196
|
}
|
|
197
|
-
_context.next =
|
|
197
|
+
_context.next = 1;
|
|
198
198
|
return contactClient.getContacts();
|
|
199
|
-
case
|
|
199
|
+
case 1:
|
|
200
200
|
contactsResponse = _context.sent;
|
|
201
201
|
if (codeObj.inputStatusCode === 200) {
|
|
202
202
|
if (codeObj.cloudContactPresent) {
|
|
@@ -254,7 +254,7 @@ describe('ContactClient Tests', function () {
|
|
|
254
254
|
method: _constants2.METHODS.GET_CONTACTS
|
|
255
255
|
});
|
|
256
256
|
}
|
|
257
|
-
case
|
|
257
|
+
case 2:
|
|
258
258
|
case "end":
|
|
259
259
|
return _context.stop();
|
|
260
260
|
}
|
|
@@ -267,7 +267,7 @@ describe('ContactClient Tests', function () {
|
|
|
267
267
|
it('create a contact group without encryptionKey', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
268
268
|
var _contactsResponse$dat;
|
|
269
269
|
var successResponsePayload, contactsResponse;
|
|
270
|
-
return _regenerator.default.wrap(function
|
|
270
|
+
return _regenerator.default.wrap(function (_context2) {
|
|
271
271
|
while (1) switch (_context2.prev = _context2.next) {
|
|
272
272
|
case 0:
|
|
273
273
|
successResponsePayload = {
|
|
@@ -280,9 +280,9 @@ describe('ContactClient Tests', function () {
|
|
|
280
280
|
webex.internal.encryption.kms.createUnboundKeys.mockResolvedValue([_contactFixtures.mockKmsKey]);
|
|
281
281
|
webex.internal.encryption.kms.createResource.mockResolvedValue(_contactFixtures.mockKmsKey);
|
|
282
282
|
webex.internal.encryption.encryptText.mockResolvedValueOnce('Encrypted Other').mockResolvedValueOnce('Encrypted Top');
|
|
283
|
-
_context2.next =
|
|
283
|
+
_context2.next = 1;
|
|
284
284
|
return contactClient.createContactGroup('Top Contacts');
|
|
285
|
-
case
|
|
285
|
+
case 1:
|
|
286
286
|
contactsResponse = _context2.sent;
|
|
287
287
|
expect(contactsResponse.statusCode).toEqual(201);
|
|
288
288
|
expect((_contactsResponse$dat = contactsResponse.data.group) === null || _contactsResponse$dat === void 0 ? void 0 : _contactsResponse$dat.groupId).toBe(mockGroupResponse.groupId);
|
|
@@ -335,7 +335,7 @@ describe('ContactClient Tests', function () {
|
|
|
335
335
|
file: _constants2.CONTACTS_CLIENT,
|
|
336
336
|
method: _constants2.METHODS.CREATE_CONTACT_GROUP
|
|
337
337
|
});
|
|
338
|
-
case
|
|
338
|
+
case 2:
|
|
339
339
|
case "end":
|
|
340
340
|
return _context2.stop();
|
|
341
341
|
}
|
|
@@ -344,7 +344,7 @@ describe('ContactClient Tests', function () {
|
|
|
344
344
|
it('create a contact group with existing key info', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
345
345
|
var _contactsResponse$dat2;
|
|
346
346
|
var successResponsePayload, infoSpy, contactsResponse;
|
|
347
|
-
return _regenerator.default.wrap(function
|
|
347
|
+
return _regenerator.default.wrap(function (_context3) {
|
|
348
348
|
while (1) switch (_context3.prev = _context3.next) {
|
|
349
349
|
case 0:
|
|
350
350
|
successResponsePayload = {
|
|
@@ -355,9 +355,9 @@ describe('ContactClient Tests', function () {
|
|
|
355
355
|
webex.request.mockResolvedValue(successResponsePayload);
|
|
356
356
|
webex.internal.encryption.encryptText.mockResolvedValue('Encrypted Top Contacts');
|
|
357
357
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
358
|
-
_context3.next =
|
|
358
|
+
_context3.next = 1;
|
|
359
359
|
return contactClient.createContactGroup('Top Contacts');
|
|
360
|
-
case
|
|
360
|
+
case 1:
|
|
361
361
|
contactsResponse = _context3.sent;
|
|
362
362
|
expect(contactsResponse.statusCode).toEqual(201);
|
|
363
363
|
expect((_contactsResponse$dat2 = contactsResponse.data.group) === null || _contactsResponse$dat2 === void 0 ? void 0 : _contactsResponse$dat2.groupId).toBe(mockGroupResponse.groupId);
|
|
@@ -385,7 +385,7 @@ describe('ContactClient Tests', function () {
|
|
|
385
385
|
});
|
|
386
386
|
expect(contactClient['groups'].length).toEqual(2);
|
|
387
387
|
expect(contactClient['groups'][1].displayName).toEqual('Top Contacts');
|
|
388
|
-
case
|
|
388
|
+
case 2:
|
|
389
389
|
case "end":
|
|
390
390
|
return _context3.stop();
|
|
391
391
|
}
|
|
@@ -393,16 +393,16 @@ describe('ContactClient Tests', function () {
|
|
|
393
393
|
})));
|
|
394
394
|
it('create a contact group with same displayName', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
395
395
|
var logSpy, contactsResponse;
|
|
396
|
-
return _regenerator.default.wrap(function
|
|
396
|
+
return _regenerator.default.wrap(function (_context4) {
|
|
397
397
|
while (1) switch (_context4.prev = _context4.next) {
|
|
398
398
|
case 0:
|
|
399
399
|
contactClient['groups'] = _contactFixtures.mockContactResponseBodyOne.groups;
|
|
400
400
|
webex.internal.encryption.kms.createUnboundKeys.mockResolvedValue([_contactFixtures.mockKmsKey]);
|
|
401
401
|
webex.internal.encryption.kms.createResource.mockResolvedValue(_contactFixtures.mockKmsKey);
|
|
402
402
|
logSpy = jest.spyOn(_Logger.default, 'warn');
|
|
403
|
-
_context4.next =
|
|
403
|
+
_context4.next = 1;
|
|
404
404
|
return contactClient.createContactGroup(mockGroupResponse.displayName);
|
|
405
|
-
case
|
|
405
|
+
case 1:
|
|
406
406
|
contactsResponse = _context4.sent;
|
|
407
407
|
expect(webex.request).not.toBeCalled();
|
|
408
408
|
expect(contactsResponse.statusCode).toBe(400);
|
|
@@ -415,7 +415,7 @@ describe('ContactClient Tests', function () {
|
|
|
415
415
|
method: _constants2.METHODS.CREATE_CONTACT_GROUP
|
|
416
416
|
});
|
|
417
417
|
expect(contactClient['groups']).toEqual(_contactFixtures.mockContactResponseBodyOne.groups);
|
|
418
|
-
case
|
|
418
|
+
case 2:
|
|
419
419
|
case "end":
|
|
420
420
|
return _context4.stop();
|
|
421
421
|
}
|
|
@@ -423,7 +423,7 @@ describe('ContactClient Tests', function () {
|
|
|
423
423
|
})));
|
|
424
424
|
it('create a contact group - service unavailable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
425
425
|
var loggerContext, warnSpy, errorSpy, contactsResponse;
|
|
426
|
-
return _regenerator.default.wrap(function
|
|
426
|
+
return _regenerator.default.wrap(function (_context5) {
|
|
427
427
|
while (1) switch (_context5.prev = _context5.next) {
|
|
428
428
|
case 0:
|
|
429
429
|
loggerContext = {
|
|
@@ -437,9 +437,9 @@ describe('ContactClient Tests', function () {
|
|
|
437
437
|
webex.internal.encryption.encryptText.mockResolvedValueOnce('Encrypted group name');
|
|
438
438
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
439
439
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
440
|
-
_context5.next =
|
|
440
|
+
_context5.next = 1;
|
|
441
441
|
return contactClient.createContactGroup('New group');
|
|
442
|
-
case
|
|
442
|
+
case 1:
|
|
443
443
|
contactsResponse = _context5.sent;
|
|
444
444
|
expect(contactsResponse.statusCode).toBe(503);
|
|
445
445
|
expect(webex.request).toBeCalledOnceWith({
|
|
@@ -459,7 +459,7 @@ describe('ContactClient Tests', function () {
|
|
|
459
459
|
expect(errorSpy).toHaveBeenNthCalledWith(1, "Unable to create contact group: ".concat((0, _stringify.default)(failureResponsePayload)), loggerContext);
|
|
460
460
|
expect(contactClient['groups']).toEqual(_contactFixtures.mockContactGroupListOne);
|
|
461
461
|
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith(failureResponsePayload, loggerContext);
|
|
462
|
-
case
|
|
462
|
+
case 2:
|
|
463
463
|
case "end":
|
|
464
464
|
return _context5.stop();
|
|
465
465
|
}
|
|
@@ -467,7 +467,7 @@ describe('ContactClient Tests', function () {
|
|
|
467
467
|
})));
|
|
468
468
|
it('delete a contact group - service unavailable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
469
469
|
var loggerContext, warnSpy, errorSpy, contactsResponse;
|
|
470
|
-
return _regenerator.default.wrap(function
|
|
470
|
+
return _regenerator.default.wrap(function (_context6) {
|
|
471
471
|
while (1) switch (_context6.prev = _context6.next) {
|
|
472
472
|
case 0:
|
|
473
473
|
loggerContext = {
|
|
@@ -480,9 +480,9 @@ describe('ContactClient Tests', function () {
|
|
|
480
480
|
webex.internal.encryption.kms.createResource.mockResolvedValue(_contactFixtures.mockKmsKey);
|
|
481
481
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
482
482
|
errorSpy = jest.spyOn(_Logger.default, 'error');
|
|
483
|
-
_context6.next =
|
|
483
|
+
_context6.next = 1;
|
|
484
484
|
return contactClient.deleteContactGroup(mockGroupResponse.groupId);
|
|
485
|
-
case
|
|
485
|
+
case 1:
|
|
486
486
|
contactsResponse = _context6.sent;
|
|
487
487
|
expect(contactsResponse.statusCode).toBe(503);
|
|
488
488
|
expect(webex.request).toBeCalledOnceWith({
|
|
@@ -498,7 +498,7 @@ describe('ContactClient Tests', function () {
|
|
|
498
498
|
expect(warnSpy).toHaveBeenNthCalledWith(1, '503 Unable to establish a connection with the server', loggerContext);
|
|
499
499
|
expect(contactClient['groups']).toEqual(_contactFixtures.mockContactGroupListOne);
|
|
500
500
|
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith(failureResponsePayload, loggerContext);
|
|
501
|
-
case
|
|
501
|
+
case 2:
|
|
502
502
|
case "end":
|
|
503
503
|
return _context6.stop();
|
|
504
504
|
}
|
|
@@ -506,7 +506,7 @@ describe('ContactClient Tests', function () {
|
|
|
506
506
|
})));
|
|
507
507
|
it('successful deletion of contact group', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
508
508
|
var successResponsePayload, response;
|
|
509
|
-
return _regenerator.default.wrap(function
|
|
509
|
+
return _regenerator.default.wrap(function (_context7) {
|
|
510
510
|
while (1) switch (_context7.prev = _context7.next) {
|
|
511
511
|
case 0:
|
|
512
512
|
successResponsePayload = {
|
|
@@ -514,9 +514,9 @@ describe('ContactClient Tests', function () {
|
|
|
514
514
|
};
|
|
515
515
|
contactClient['groups'] = [_contactFixtures.mockContactGroupListOne[0]];
|
|
516
516
|
webex.request.mockResolvedValue(successResponsePayload);
|
|
517
|
-
_context7.next =
|
|
517
|
+
_context7.next = 1;
|
|
518
518
|
return contactClient.deleteContactGroup(_contactFixtures.mockContactGroupListOne[0].groupId);
|
|
519
|
-
case
|
|
519
|
+
case 1:
|
|
520
520
|
response = _context7.sent;
|
|
521
521
|
expect(response.statusCode).toEqual(204);
|
|
522
522
|
expect(webex.request).toBeCalledOnceWith({
|
|
@@ -532,7 +532,7 @@ describe('ContactClient Tests', function () {
|
|
|
532
532
|
file: _constants2.CONTACTS_CLIENT,
|
|
533
533
|
method: 'deleteContactGroup'
|
|
534
534
|
});
|
|
535
|
-
case
|
|
535
|
+
case 2:
|
|
536
536
|
case "end":
|
|
537
537
|
return _context7.stop();
|
|
538
538
|
}
|
|
@@ -541,7 +541,7 @@ describe('ContactClient Tests', function () {
|
|
|
541
541
|
it('create a contact with an existing group', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
542
542
|
var _res$data$contact, _result$data$contact;
|
|
543
543
|
var mockContactResponse, successResponsePayload, infoSpy, logSpy, contact, res, result;
|
|
544
|
-
return _regenerator.default.wrap(function
|
|
544
|
+
return _regenerator.default.wrap(function (_context8) {
|
|
545
545
|
while (1) switch (_context8.prev = _context8.next) {
|
|
546
546
|
case 0:
|
|
547
547
|
mockContactResponse = _contactFixtures.mockContactResponseBodyTwo.contacts[0];
|
|
@@ -557,9 +557,9 @@ describe('ContactClient Tests', function () {
|
|
|
557
557
|
contactClient['encryptionKeyUrl'] = _contactFixtures.mockContactGroupListOne[0].encryptionKeyUrl;
|
|
558
558
|
contact = _contactFixtures.mockContactListTwo.slice()[0];
|
|
559
559
|
contact.groups = [];
|
|
560
|
-
_context8.next =
|
|
560
|
+
_context8.next = 1;
|
|
561
561
|
return contactClient.createContact(contact);
|
|
562
|
-
case
|
|
562
|
+
case 1:
|
|
563
563
|
res = _context8.sent;
|
|
564
564
|
expect(res.statusCode).toEqual(201);
|
|
565
565
|
expect((_res$data$contact = res.data.contact) === null || _res$data$contact === void 0 ? void 0 : _res$data$contact.contactId).toBe(mockContactResponse.contactId);
|
|
@@ -596,16 +596,16 @@ describe('ContactClient Tests', function () {
|
|
|
596
596
|
logSpy.mockClear();
|
|
597
597
|
|
|
598
598
|
/* for coverage */
|
|
599
|
-
_context8.next =
|
|
599
|
+
_context8.next = 2;
|
|
600
600
|
return contactClient.createContact(contact);
|
|
601
|
-
case
|
|
601
|
+
case 2:
|
|
602
602
|
result = _context8.sent;
|
|
603
603
|
expect((_result$data$contact = result.data.contact) === null || _result$data$contact === void 0 ? void 0 : _result$data$contact.contactId).toBe(mockContactResponse.contactId);
|
|
604
604
|
expect(logSpy).not.toBeCalledWith("Creating a default group: ".concat(_constants2.DEFAULT_GROUP_NAME), {
|
|
605
605
|
file: _constants2.CONTACTS_CLIENT,
|
|
606
606
|
method: 'fetchEncryptionKeyUrl'
|
|
607
607
|
});
|
|
608
|
-
case
|
|
608
|
+
case 3:
|
|
609
609
|
case "end":
|
|
610
610
|
return _context8.stop();
|
|
611
611
|
}
|
|
@@ -614,7 +614,7 @@ describe('ContactClient Tests', function () {
|
|
|
614
614
|
it('create a contact without a group and encryptionKey', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
615
615
|
var _res$data$contact2;
|
|
616
616
|
var mockContactResponse, successContactGroupResponsePayload, successContactResponsePayload, contact, res;
|
|
617
|
-
return _regenerator.default.wrap(function
|
|
617
|
+
return _regenerator.default.wrap(function (_context9) {
|
|
618
618
|
while (1) switch (_context9.prev = _context9.next) {
|
|
619
619
|
case 0:
|
|
620
620
|
mockContactResponse = _contactFixtures.mockContactResponseBodyOne.contacts[1];
|
|
@@ -636,9 +636,9 @@ describe('ContactClient Tests', function () {
|
|
|
636
636
|
contact = {
|
|
637
637
|
contactType: 'CUSTOM'
|
|
638
638
|
};
|
|
639
|
-
_context9.next =
|
|
639
|
+
_context9.next = 1;
|
|
640
640
|
return contactClient.createContact(contact);
|
|
641
|
-
case
|
|
641
|
+
case 1:
|
|
642
642
|
res = _context9.sent;
|
|
643
643
|
expect(res.statusCode).toEqual(201);
|
|
644
644
|
expect(webex.request).toBeCalledTimes(2);
|
|
@@ -689,7 +689,7 @@ describe('ContactClient Tests', function () {
|
|
|
689
689
|
file: _constants2.CONTACTS_CLIENT,
|
|
690
690
|
method: 'createContact'
|
|
691
691
|
});
|
|
692
|
-
case
|
|
692
|
+
case 2:
|
|
693
693
|
case "end":
|
|
694
694
|
return _context9.stop();
|
|
695
695
|
}
|
|
@@ -698,7 +698,7 @@ describe('ContactClient Tests', function () {
|
|
|
698
698
|
it('create a cloud contact with no existing groups', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
|
|
699
699
|
var _res$data$contact3;
|
|
700
700
|
var mockContactResponse, successResponsePayload, successResponsePayloadGroup, contact, res;
|
|
701
|
-
return _regenerator.default.wrap(function
|
|
701
|
+
return _regenerator.default.wrap(function (_context0) {
|
|
702
702
|
while (1) switch (_context0.prev = _context0.next) {
|
|
703
703
|
case 0:
|
|
704
704
|
mockContactResponse = _contactFixtures.mockContactResponseBodyOne.contacts[0];
|
|
@@ -718,9 +718,9 @@ describe('ContactClient Tests', function () {
|
|
|
718
718
|
contactType: 'CLOUD'
|
|
719
719
|
};
|
|
720
720
|
contact.groups = [];
|
|
721
|
-
_context0.next =
|
|
721
|
+
_context0.next = 1;
|
|
722
722
|
return contactClient.createContact(contact);
|
|
723
|
-
case
|
|
723
|
+
case 1:
|
|
724
724
|
res = _context0.sent;
|
|
725
725
|
expect(res.statusCode).toEqual(400);
|
|
726
726
|
expect(res.data.error).toEqual('contactId is required for contactType:CLOUD.');
|
|
@@ -729,9 +729,9 @@ describe('ContactClient Tests', function () {
|
|
|
729
729
|
method: _constants2.METHODS.CREATE_CONTACT
|
|
730
730
|
});
|
|
731
731
|
contact.contactId = mockContactResponse.contactId;
|
|
732
|
-
_context0.next =
|
|
732
|
+
_context0.next = 2;
|
|
733
733
|
return contactClient.createContact(contact);
|
|
734
|
-
case
|
|
734
|
+
case 2:
|
|
735
735
|
res = _context0.sent;
|
|
736
736
|
expect(res.statusCode).toEqual(201);
|
|
737
737
|
expect((_res$data$contact3 = res.data.contact) === null || _res$data$contact3 === void 0 ? void 0 : _res$data$contact3.contactId).toBe(mockContactResponse.contactId);
|
|
@@ -769,7 +769,7 @@ describe('ContactClient Tests', function () {
|
|
|
769
769
|
file: _constants2.CONTACTS_CLIENT,
|
|
770
770
|
method: 'createContact'
|
|
771
771
|
});
|
|
772
|
-
case
|
|
772
|
+
case 3:
|
|
773
773
|
case "end":
|
|
774
774
|
return _context0.stop();
|
|
775
775
|
}
|
|
@@ -777,7 +777,7 @@ describe('ContactClient Tests', function () {
|
|
|
777
777
|
})));
|
|
778
778
|
it('create a contact - service unavailable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
|
|
779
779
|
var contact, res;
|
|
780
|
-
return _regenerator.default.wrap(function
|
|
780
|
+
return _regenerator.default.wrap(function (_context1) {
|
|
781
781
|
while (1) switch (_context1.prev = _context1.next) {
|
|
782
782
|
case 0:
|
|
783
783
|
webex.request.mockRejectedValue(failureResponsePayload);
|
|
@@ -787,9 +787,9 @@ describe('ContactClient Tests', function () {
|
|
|
787
787
|
contactType: 'CLOUD',
|
|
788
788
|
contactId: '801bb994-343b-4f6b-97ae-d13c91d4b877'
|
|
789
789
|
};
|
|
790
|
-
_context1.next =
|
|
790
|
+
_context1.next = 1;
|
|
791
791
|
return contactClient.createContact(contact);
|
|
792
|
-
case
|
|
792
|
+
case 1:
|
|
793
793
|
res = _context1.sent;
|
|
794
794
|
expect(webex.request).toBeCalledOnceWith({
|
|
795
795
|
uri: contactServiceUrl,
|
|
@@ -813,7 +813,7 @@ describe('ContactClient Tests', function () {
|
|
|
813
813
|
file: _constants2.CONTACTS_CLIENT,
|
|
814
814
|
method: _constants2.METHODS.CREATE_CONTACT
|
|
815
815
|
});
|
|
816
|
-
case
|
|
816
|
+
case 2:
|
|
817
817
|
case "end":
|
|
818
818
|
return _context1.stop();
|
|
819
819
|
}
|
|
@@ -821,7 +821,7 @@ describe('ContactClient Tests', function () {
|
|
|
821
821
|
})));
|
|
822
822
|
it('successful deletion of contacts', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
823
823
|
var successResponsePayload, response;
|
|
824
|
-
return _regenerator.default.wrap(function
|
|
824
|
+
return _regenerator.default.wrap(function (_context10) {
|
|
825
825
|
while (1) switch (_context10.prev = _context10.next) {
|
|
826
826
|
case 0:
|
|
827
827
|
successResponsePayload = {
|
|
@@ -829,9 +829,9 @@ describe('ContactClient Tests', function () {
|
|
|
829
829
|
};
|
|
830
830
|
contactClient['contacts'] = [_contactFixtures.mockContactListOne[0]];
|
|
831
831
|
webex.request.mockResolvedValue(successResponsePayload);
|
|
832
|
-
_context10.next =
|
|
832
|
+
_context10.next = 1;
|
|
833
833
|
return contactClient.deleteContact(_contactFixtures.mockContactListOne[0].contactId);
|
|
834
|
-
case
|
|
834
|
+
case 1:
|
|
835
835
|
response = _context10.sent;
|
|
836
836
|
expect(response.statusCode).toEqual(204);
|
|
837
837
|
expect(webex.request).toBeCalledOnceWith({
|
|
@@ -847,7 +847,7 @@ describe('ContactClient Tests', function () {
|
|
|
847
847
|
file: _constants2.CONTACTS_CLIENT,
|
|
848
848
|
method: _constants2.METHODS.DELETE_CONTACT
|
|
849
849
|
});
|
|
850
|
-
case
|
|
850
|
+
case 2:
|
|
851
851
|
case "end":
|
|
852
852
|
return _context10.stop();
|
|
853
853
|
}
|
|
@@ -855,14 +855,14 @@ describe('ContactClient Tests', function () {
|
|
|
855
855
|
})));
|
|
856
856
|
it('delete a contact - service unavailable', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
857
857
|
var response;
|
|
858
|
-
return _regenerator.default.wrap(function
|
|
858
|
+
return _regenerator.default.wrap(function (_context11) {
|
|
859
859
|
while (1) switch (_context11.prev = _context11.next) {
|
|
860
860
|
case 0:
|
|
861
861
|
contactClient['contacts'] = _contactFixtures.mockContactListOne;
|
|
862
862
|
webex.request.mockRejectedValue(failureResponsePayload);
|
|
863
|
-
_context11.next =
|
|
863
|
+
_context11.next = 1;
|
|
864
864
|
return contactClient.deleteContact(_contactFixtures.mockContactListOne[0].contactId);
|
|
865
|
-
case
|
|
865
|
+
case 1:
|
|
866
866
|
response = _context11.sent;
|
|
867
867
|
expect(response.statusCode).toEqual(503);
|
|
868
868
|
expect(webex.request).toBeCalledOnceWith({
|
|
@@ -882,7 +882,7 @@ describe('ContactClient Tests', function () {
|
|
|
882
882
|
file: _constants2.CONTACTS_CLIENT,
|
|
883
883
|
method: _constants2.METHODS.DELETE_CONTACT
|
|
884
884
|
});
|
|
885
|
-
case
|
|
885
|
+
case 2:
|
|
886
886
|
case "end":
|
|
887
887
|
return _context11.stop();
|
|
888
888
|
}
|
|
@@ -958,7 +958,7 @@ describe('ContactClient Tests', function () {
|
|
|
958
958
|
});
|
|
959
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() {
|
|
960
960
|
var mockData, respPayload, warnSpy, infoSpy, logSpy;
|
|
961
|
-
return _regenerator.default.wrap(function
|
|
961
|
+
return _regenerator.default.wrap(function (_context12) {
|
|
962
962
|
while (1) switch (_context12.prev = _context12.next) {
|
|
963
963
|
case 0:
|
|
964
964
|
mockData = errorCodes[0];
|
|
@@ -977,9 +977,9 @@ describe('ContactClient Tests', function () {
|
|
|
977
977
|
warnSpy = jest.spyOn(_Logger.default, 'warn');
|
|
978
978
|
infoSpy = jest.spyOn(_Logger.default, 'info');
|
|
979
979
|
logSpy = jest.spyOn(_Logger.default, 'log');
|
|
980
|
-
_context12.next =
|
|
980
|
+
_context12.next = 1;
|
|
981
981
|
return contactClient.getContacts();
|
|
982
|
-
case
|
|
982
|
+
case 1:
|
|
983
983
|
expect(webex.request).toBeCalledTimes(2);
|
|
984
984
|
expect(warnSpy).toBeCalledTimes(1);
|
|
985
985
|
expect(warnSpy).toBeCalledWith('Error processing contact chunk 0-50', {
|
|
@@ -994,7 +994,7 @@ describe('ContactClient Tests', function () {
|
|
|
994
994
|
file: _constants2.CONTACTS_CLIENT,
|
|
995
995
|
method: _constants2.METHODS.GET_CONTACTS
|
|
996
996
|
});
|
|
997
|
-
case
|
|
997
|
+
case 2:
|
|
998
998
|
case "end":
|
|
999
999
|
return _context12.stop();
|
|
1000
1000
|
}
|