@webex/calling 3.0.0-next.2 → 3.0.0-next.4
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/CHANGELOG.md +1403 -0
- package/README.md +74 -74
- package/dist/module/CallHistory/CallHistory.js +81 -81
- package/dist/module/CallHistory/callHistoryFixtures.js +307 -307
- package/dist/module/CallHistory/constants.js +9 -9
- package/dist/module/CallHistory/types.js +1 -1
- package/dist/module/CallSettings/CallSettings.js +65 -65
- package/dist/module/CallSettings/UcmBackendConnector.js +100 -100
- package/dist/module/CallSettings/WxCallBackendConnector.js +287 -287
- package/dist/module/CallSettings/constants.js +11 -11
- package/dist/module/CallSettings/testFixtures.js +62 -62
- package/dist/module/CallSettings/types.js +1 -1
- package/dist/module/CallingClient/CallingClient.js +248 -248
- package/dist/module/CallingClient/callRecordFixtures.js +93 -93
- package/dist/module/CallingClient/calling/CallerId/index.js +169 -169
- package/dist/module/CallingClient/calling/CallerId/types.js +1 -1
- package/dist/module/CallingClient/calling/call.js +1658 -1658
- package/dist/module/CallingClient/calling/callManager.js +284 -284
- package/dist/module/CallingClient/calling/index.js +2 -2
- package/dist/module/CallingClient/calling/types.js +53 -53
- package/dist/module/CallingClient/callingClientFixtures.js +38 -38
- package/dist/module/CallingClient/constants.js +122 -122
- package/dist/module/CallingClient/line/index.js +158 -158
- package/dist/module/CallingClient/line/types.js +15 -15
- package/dist/module/CallingClient/registration/index.js +1 -1
- package/dist/module/CallingClient/registration/register.js +507 -507
- package/dist/module/CallingClient/registration/registerFixtures.js +28 -28
- package/dist/module/CallingClient/registration/types.js +1 -1
- package/dist/module/CallingClient/types.js +1 -1
- package/dist/module/Contacts/ContactsClient.js +484 -484
- package/dist/module/Contacts/constants.js +20 -20
- package/dist/module/Contacts/contactFixtures.js +284 -284
- package/dist/module/Contacts/types.js +10 -10
- package/dist/module/Errors/catalog/CallError.js +26 -26
- package/dist/module/Errors/catalog/CallingDeviceError.js +18 -18
- package/dist/module/Errors/catalog/ExtendedError.js +10 -10
- package/dist/module/Errors/catalog/LineError.js +24 -24
- package/dist/module/Errors/index.js +2 -2
- package/dist/module/Errors/types.js +48 -48
- package/dist/module/Events/impl/index.js +19 -19
- package/dist/module/Events/types.js +83 -83
- package/dist/module/Logger/index.js +114 -114
- package/dist/module/Logger/types.js +25 -25
- package/dist/module/Metrics/index.js +232 -232
- package/dist/module/Metrics/types.js +37 -37
- package/dist/module/SDKConnector/index.js +39 -39
- package/dist/module/SDKConnector/types.js +1 -1
- package/dist/module/SDKConnector/utils.js +12 -12
- package/dist/module/Voicemail/BroadworksBackendConnector.js +291 -291
- package/dist/module/Voicemail/UcmBackendConnector.js +279 -279
- package/dist/module/Voicemail/Voicemail.js +110 -110
- package/dist/module/Voicemail/WxCallBackendConnector.js +279 -279
- package/dist/module/Voicemail/constants.js +29 -29
- package/dist/module/Voicemail/types.js +1 -1
- package/dist/module/Voicemail/voicemailFixture.js +510 -510
- package/dist/module/api.js +6 -6
- package/dist/module/common/Utils.js +802 -802
- package/dist/module/common/constants.js +41 -41
- package/dist/module/common/index.js +1 -1
- package/dist/module/common/testUtil.js +938 -938
- package/dist/module/common/types.js +57 -57
- package/dist/module/index.js +8 -8
- package/dist/types/CallHistory/CallHistory.d.ts +17 -17
- package/dist/types/CallHistory/callHistoryFixtures.d.ts +94 -94
- package/dist/types/CallHistory/constants.d.ts +9 -9
- package/dist/types/CallHistory/types.d.ts +18 -18
- package/dist/types/CallSettings/CallSettings.d.ts +19 -19
- package/dist/types/CallSettings/UcmBackendConnector.d.ts +19 -19
- package/dist/types/CallSettings/WxCallBackendConnector.d.ts +21 -21
- package/dist/types/CallSettings/constants.d.ts +11 -11
- package/dist/types/CallSettings/testFixtures.d.ts +15 -15
- package/dist/types/CallSettings/types.d.ts +107 -107
- package/dist/types/CallingClient/CallingClient.d.ts +35 -35
- package/dist/types/CallingClient/callRecordFixtures.d.ts +3 -3
- package/dist/types/CallingClient/calling/CallerId/index.d.ts +17 -17
- package/dist/types/CallingClient/calling/CallerId/types.d.ts +41 -41
- package/dist/types/CallingClient/calling/call.d.ts +96 -96
- package/dist/types/CallingClient/calling/callManager.d.ts +25 -25
- package/dist/types/CallingClient/calling/index.d.ts +2 -2
- package/dist/types/CallingClient/calling/types.d.ts +206 -206
- package/dist/types/CallingClient/callingClientFixtures.d.ts +18 -18
- package/dist/types/CallingClient/constants.d.ts +122 -122
- package/dist/types/CallingClient/line/index.d.ts +43 -43
- package/dist/types/CallingClient/line/types.d.ts +55 -55
- package/dist/types/CallingClient/registration/index.d.ts +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +64 -64
- package/dist/types/CallingClient/registration/registerFixtures.d.ts +28 -28
- package/dist/types/CallingClient/registration/types.d.ts +20 -20
- package/dist/types/CallingClient/types.d.ts +29 -29
- package/dist/types/Contacts/ContactsClient.d.ts +26 -26
- package/dist/types/Contacts/constants.d.ts +19 -19
- package/dist/types/Contacts/contactFixtures.d.ts +280 -280
- package/dist/types/Contacts/types.d.ts +72 -72
- package/dist/types/Errors/catalog/CallError.d.ts +11 -11
- package/dist/types/Errors/catalog/CallingDeviceError.d.ts +10 -10
- package/dist/types/Errors/catalog/ExtendedError.d.ts +6 -6
- package/dist/types/Errors/catalog/LineError.d.ts +10 -10
- package/dist/types/Errors/index.d.ts +2 -2
- package/dist/types/Errors/types.d.ts +60 -60
- package/dist/types/Events/impl/index.d.ts +8 -8
- package/dist/types/Events/types.d.ts +288 -288
- package/dist/types/Logger/index.d.ts +12 -12
- package/dist/types/Logger/types.d.ts +25 -25
- package/dist/types/Metrics/index.d.ts +5 -5
- package/dist/types/Metrics/types.d.ts +42 -42
- package/dist/types/SDKConnector/index.d.ts +12 -12
- package/dist/types/SDKConnector/types.d.ts +128 -128
- package/dist/types/SDKConnector/utils.d.ts +5 -5
- package/dist/types/Voicemail/BroadworksBackendConnector.d.ts +27 -27
- package/dist/types/Voicemail/UcmBackendConnector.d.ts +34 -34
- package/dist/types/Voicemail/Voicemail.d.ts +27 -27
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +23 -23
- package/dist/types/Voicemail/constants.d.ts +29 -29
- package/dist/types/Voicemail/types.d.ts +133 -133
- package/dist/types/Voicemail/voicemailFixture.d.ts +417 -417
- package/dist/types/api.d.ts +16 -16
- package/dist/types/common/Utils.d.ts +34 -34
- package/dist/types/common/constants.d.ts +41 -41
- package/dist/types/common/index.d.ts +1 -1
- package/dist/types/common/testUtil.d.ts +3611 -3611
- package/dist/types/common/types.d.ts +191 -191
- package/dist/types/index.d.ts +8 -8
- package/package.json +4 -4
- package/dist/CallHistory/CallHistory.js +0 -203
- package/dist/CallHistory/CallHistory.js.map +0 -1
- package/dist/CallHistory/CallHistory.test.js +0 -133
- package/dist/CallHistory/CallHistory.test.js.map +0 -1
- package/dist/CallHistory/callHistoryFixtures.js +0 -310
- package/dist/CallHistory/callHistoryFixtures.js.map +0 -1
- package/dist/CallHistory/constants.js +0 -26
- package/dist/CallHistory/constants.js.map +0 -1
- package/dist/CallHistory/types.js +0 -7
- package/dist/CallHistory/types.js.map +0 -1
- package/dist/CallSettings/CallSettings.js +0 -276
- package/dist/CallSettings/CallSettings.js.map +0 -1
- package/dist/CallSettings/CallSettings.test.js +0 -122
- package/dist/CallSettings/CallSettings.test.js.map +0 -1
- package/dist/CallSettings/UcmBackendConnector.js +0 -217
- package/dist/CallSettings/UcmBackendConnector.js.map +0 -1
- package/dist/CallSettings/UcmBackendConnector.test.js +0 -227
- package/dist/CallSettings/UcmBackendConnector.test.js.map +0 -1
- package/dist/CallSettings/WxCallBackendConnector.js +0 -541
- package/dist/CallSettings/WxCallBackendConnector.js.map +0 -1
- package/dist/CallSettings/WxCallBackendConnector.test.js +0 -802
- package/dist/CallSettings/WxCallBackendConnector.test.js.map +0 -1
- package/dist/CallSettings/constants.js +0 -30
- package/dist/CallSettings/constants.js.map +0 -1
- package/dist/CallSettings/testFixtures.js +0 -72
- package/dist/CallSettings/testFixtures.js.map +0 -1
- package/dist/CallSettings/types.js +0 -7
- package/dist/CallSettings/types.js.map +0 -1
- package/dist/CallingClient/CallingClient.js +0 -572
- package/dist/CallingClient/CallingClient.js.map +0 -1
- package/dist/CallingClient/CallingClient.test.js +0 -931
- package/dist/CallingClient/CallingClient.test.js.map +0 -1
- package/dist/CallingClient/callRecordFixtures.js +0 -103
- package/dist/CallingClient/callRecordFixtures.js.map +0 -1
- package/dist/CallingClient/calling/CallerId/index.js +0 -287
- package/dist/CallingClient/calling/CallerId/index.js.map +0 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +0 -274
- package/dist/CallingClient/calling/CallerId/index.test.js.map +0 -1
- package/dist/CallingClient/calling/CallerId/types.js +0 -7
- package/dist/CallingClient/calling/CallerId/types.js.map +0 -1
- package/dist/CallingClient/calling/call.js +0 -2995
- package/dist/CallingClient/calling/call.js.map +0 -1
- package/dist/CallingClient/calling/call.test.js +0 -2614
- package/dist/CallingClient/calling/call.test.js.map +0 -1
- package/dist/CallingClient/calling/callManager.js +0 -443
- package/dist/CallingClient/calling/callManager.js.map +0 -1
- package/dist/CallingClient/calling/callManager.test.js +0 -683
- package/dist/CallingClient/calling/callManager.test.js.map +0 -1
- package/dist/CallingClient/calling/index.js +0 -30
- package/dist/CallingClient/calling/index.js.map +0 -1
- package/dist/CallingClient/calling/types.js +0 -71
- package/dist/CallingClient/calling/types.js.map +0 -1
- package/dist/CallingClient/callingClientFixtures.js +0 -53
- package/dist/CallingClient/callingClientFixtures.js.map +0 -1
- package/dist/CallingClient/constants.js +0 -226
- package/dist/CallingClient/constants.js.map +0 -1
- package/dist/CallingClient/line/index.js +0 -312
- package/dist/CallingClient/line/index.js.map +0 -1
- package/dist/CallingClient/line/line.test.js +0 -270
- package/dist/CallingClient/line/line.test.js.map +0 -1
- package/dist/CallingClient/line/types.js +0 -25
- package/dist/CallingClient/line/types.js.map +0 -1
- package/dist/CallingClient/registration/index.js +0 -19
- package/dist/CallingClient/registration/index.js.map +0 -1
- package/dist/CallingClient/registration/register.js +0 -1295
- package/dist/CallingClient/registration/register.js.map +0 -1
- package/dist/CallingClient/registration/register.test.js +0 -838
- package/dist/CallingClient/registration/register.test.js.map +0 -1
- package/dist/CallingClient/registration/registerFixtures.js +0 -41
- package/dist/CallingClient/registration/registerFixtures.js.map +0 -1
- package/dist/CallingClient/registration/types.js +0 -7
- package/dist/CallingClient/registration/types.js.map +0 -1
- package/dist/CallingClient/types.js +0 -7
- package/dist/CallingClient/types.js.map +0 -1
- package/dist/Contacts/ContactsClient.js +0 -1139
- package/dist/Contacts/ContactsClient.js.map +0 -1
- package/dist/Contacts/ContactsClient.test.js +0 -725
- package/dist/Contacts/ContactsClient.test.js.map +0 -1
- package/dist/Contacts/constants.js +0 -36
- package/dist/Contacts/constants.js.map +0 -1
- package/dist/Contacts/contactFixtures.js +0 -340
- package/dist/Contacts/contactFixtures.js.map +0 -1
- package/dist/Contacts/types.js +0 -20
- package/dist/Contacts/types.js.map +0 -1
- package/dist/Errors/catalog/CallError.js +0 -94
- package/dist/Errors/catalog/CallError.js.map +0 -1
- package/dist/Errors/catalog/CallingDeviceError.js +0 -88
- package/dist/Errors/catalog/CallingDeviceError.js.map +0 -1
- package/dist/Errors/catalog/ExtendedError.js +0 -45
- package/dist/Errors/catalog/ExtendedError.js.map +0 -1
- package/dist/Errors/catalog/LineError.js +0 -90
- package/dist/Errors/catalog/LineError.js.map +0 -1
- package/dist/Errors/index.js +0 -21
- package/dist/Errors/index.js.map +0 -1
- package/dist/Errors/types.js +0 -62
- package/dist/Errors/types.js.map +0 -1
- package/dist/Events/impl/index.js +0 -82
- package/dist/Events/impl/index.js.map +0 -1
- package/dist/Events/types.js +0 -111
- package/dist/Events/types.js.map +0 -1
- package/dist/Logger/index.js +0 -221
- package/dist/Logger/index.js.map +0 -1
- package/dist/Logger/index.test.js +0 -62
- package/dist/Logger/index.test.js.map +0 -1
- package/dist/Logger/types.js +0 -37
- package/dist/Logger/types.js.map +0 -1
- package/dist/Metrics/index.js +0 -329
- package/dist/Metrics/index.js.map +0 -1
- package/dist/Metrics/index.test.js +0 -291
- package/dist/Metrics/index.test.js.map +0 -1
- package/dist/Metrics/types.js +0 -50
- package/dist/Metrics/types.js.map +0 -1
- package/dist/SDKConnector/index.js +0 -105
- package/dist/SDKConnector/index.js.map +0 -1
- package/dist/SDKConnector/index.test.js +0 -9
- package/dist/SDKConnector/index.test.js.map +0 -1
- package/dist/SDKConnector/types.js +0 -7
- package/dist/SDKConnector/types.js.map +0 -1
- package/dist/SDKConnector/utils.js +0 -40
- package/dist/SDKConnector/utils.js.map +0 -1
- package/dist/SDKConnector/utils.test.js +0 -9
- package/dist/SDKConnector/utils.test.js.map +0 -1
- package/dist/Voicemail/BroadworksBackendConnector.js +0 -632
- package/dist/Voicemail/BroadworksBackendConnector.js.map +0 -1
- package/dist/Voicemail/BroadworksBackendConnector.test.js +0 -733
- package/dist/Voicemail/BroadworksBackendConnector.test.js.map +0 -1
- package/dist/Voicemail/UcmBackendConnector.js +0 -566
- package/dist/Voicemail/UcmBackendConnector.js.map +0 -1
- package/dist/Voicemail/UcmBackendConnector.test.js +0 -628
- package/dist/Voicemail/UcmBackendConnector.test.js.map +0 -1
- package/dist/Voicemail/Voicemail.js +0 -378
- package/dist/Voicemail/Voicemail.js.map +0 -1
- package/dist/Voicemail/Voicemail.test.js +0 -226
- package/dist/Voicemail/Voicemail.test.js.map +0 -1
- package/dist/Voicemail/WxCallBackendConnector.js +0 -540
- package/dist/Voicemail/WxCallBackendConnector.js.map +0 -1
- package/dist/Voicemail/WxCallBackendConnector.test.js +0 -942
- package/dist/Voicemail/WxCallBackendConnector.test.js.map +0 -1
- package/dist/Voicemail/constants.js +0 -66
- package/dist/Voicemail/constants.js.map +0 -1
- package/dist/Voicemail/types.js +0 -7
- package/dist/Voicemail/types.js.map +0 -1
- package/dist/Voicemail/voicemailFixture.js +0 -559
- package/dist/Voicemail/voicemailFixture.js.map +0 -1
- package/dist/api.js +0 -134
- package/dist/api.js.map +0 -1
- package/dist/common/Utils.js +0 -1264
- package/dist/common/Utils.js.map +0 -1
- package/dist/common/Utils.test.js +0 -1227
- package/dist/common/Utils.test.js.map +0 -1
- package/dist/common/constants.js +0 -90
- package/dist/common/constants.js.map +0 -1
- package/dist/common/index.js +0 -19
- package/dist/common/index.js.map +0 -1
- package/dist/common/testUtil.js +0 -968
- package/dist/common/testUtil.js.map +0 -1
- package/dist/common/types.js +0 -75
- package/dist/common/types.js.map +0 -1
- package/dist/index.js +0 -63
- package/dist/index.js.map +0 -1
|
@@ -1,628 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
|
|
3
|
-
var _typeof = require("@babel/runtime-corejs2/helpers/typeof");
|
|
4
|
-
var _Object$keys = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
5
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
6
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
7
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
8
|
-
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
9
|
-
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
10
|
-
var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
|
|
11
|
-
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
12
|
-
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
|
|
13
|
-
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
|
|
14
|
-
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
|
|
15
|
-
var _types = require("../Logger/types");
|
|
16
|
-
var _testUtil = require("../common/testUtil");
|
|
17
|
-
var _types2 = require("../common/types");
|
|
18
|
-
var _voicemailFixture = require("./voicemailFixture");
|
|
19
|
-
var _UcmBackendConnector = require("./UcmBackendConnector");
|
|
20
|
-
var utils = _interopRequireWildcard(require("../common/Utils"));
|
|
21
|
-
var _constants = require("../common/constants");
|
|
22
|
-
function _getRequireWildcardCache(nodeInterop) { if (typeof _WeakMap !== "function") return null; var cacheBabelInterop = new _WeakMap(); var cacheNodeInterop = new _WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
23
|
-
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = _Object$defineProperty && _Object$getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? _Object$getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { _Object$defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
24
|
-
function ownKeys(object, enumerableOnly) { var keys = _Object$keys(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
|
|
25
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor(source, key)); }); } return target; }
|
|
26
|
-
var ucmBackendConnector;
|
|
27
|
-
var webex = (0, _testUtil.getTestUtilsWebex)();
|
|
28
|
-
var voicemailPayload;
|
|
29
|
-
var serviceErrorCodeHandlerSpy;
|
|
30
|
-
var sdkConnector;
|
|
31
|
-
var messageId = _voicemailFixture.mockUCMVoicemailBody.body.items['messageId'];
|
|
32
|
-
describe('Voicemail UCM Backend Connector Test case', function () {
|
|
33
|
-
var responseDetails = {
|
|
34
|
-
statusCode: 200,
|
|
35
|
-
message: _constants.SUCCESS_MESSAGE,
|
|
36
|
-
data: {}
|
|
37
|
-
};
|
|
38
|
-
var voicemailResponseInfo = _voicemailFixture.getDescVoiceMailListJsonUCM.body.Message;
|
|
39
|
-
var listResponseDetails = {
|
|
40
|
-
statusCode: 200,
|
|
41
|
-
data: voicemailResponseInfo,
|
|
42
|
-
message: _constants.SUCCESS_MESSAGE
|
|
43
|
-
};
|
|
44
|
-
beforeAll(function () {
|
|
45
|
-
webex.version = '2.31.1';
|
|
46
|
-
webex.internal.device.version = '2.31.1';
|
|
47
|
-
webex.internal.device.features.entitlement.models = [{
|
|
48
|
-
_values: {
|
|
49
|
-
key: 'ucm-calling'
|
|
50
|
-
}
|
|
51
|
-
}];
|
|
52
|
-
webex.internal.device.callingBehavior = 'NATIVE_SIP_CALL_TO_UCM';
|
|
53
|
-
ucmBackendConnector = new _UcmBackendConnector.UcmBackendConnector(webex, {
|
|
54
|
-
level: _types.LOGGER.INFO
|
|
55
|
-
});
|
|
56
|
-
ucmBackendConnector.init();
|
|
57
|
-
sdkConnector = ucmBackendConnector.getSDKConnector();
|
|
58
|
-
voicemailPayload = _voicemailFixture.getVoiceMailListJsonUCM;
|
|
59
|
-
});
|
|
60
|
-
afterEach(function () {
|
|
61
|
-
jest.clearAllMocks();
|
|
62
|
-
});
|
|
63
|
-
it('verify UCM Backend Connector object', function () {
|
|
64
|
-
expect(ucmBackendConnector.getSDKConnector().getWebex()).toBeTruthy();
|
|
65
|
-
expect(ucmBackendConnector.getSDKConnector().getWebex().internal.device.userId).toBe('8a67806f-fc4d-446b-a131-31e71ea5b0e9');
|
|
66
|
-
});
|
|
67
|
-
it('verify fetching transcript returned null', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
|
|
68
|
-
var response;
|
|
69
|
-
return _regenerator.default.wrap(function _callee$(_context) {
|
|
70
|
-
while (1) switch (_context.prev = _context.next) {
|
|
71
|
-
case 0:
|
|
72
|
-
_context.next = 2;
|
|
73
|
-
return ucmBackendConnector.getVMTranscript('98099432-9d81-4224-bd04-00def73cd262');
|
|
74
|
-
case 2:
|
|
75
|
-
response = _context.sent;
|
|
76
|
-
expect(response).toBeNull();
|
|
77
|
-
case 4:
|
|
78
|
-
case "end":
|
|
79
|
-
return _context.stop();
|
|
80
|
-
}
|
|
81
|
-
}, _callee);
|
|
82
|
-
})));
|
|
83
|
-
it('verify successful voicemail list', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
|
|
84
|
-
var response;
|
|
85
|
-
return _regenerator.default.wrap(function _callee2$(_context2) {
|
|
86
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
87
|
-
case 0:
|
|
88
|
-
webex.request.mockResolvedValueOnce(voicemailPayload);
|
|
89
|
-
_context2.next = 3;
|
|
90
|
-
return ucmBackendConnector.getVoicemailList(0, 20, _types2.SORT.DESC);
|
|
91
|
-
case 3:
|
|
92
|
-
response = _context2.sent;
|
|
93
|
-
expect(response).toStrictEqual(listResponseDetails);
|
|
94
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
95
|
-
headers: {
|
|
96
|
-
orgId: _voicemailFixture.orgId
|
|
97
|
-
},
|
|
98
|
-
method: _types2.HTTP_METHODS.GET,
|
|
99
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl + _voicemailFixture.voicemailContent)
|
|
100
|
-
});
|
|
101
|
-
case 6:
|
|
102
|
-
case "end":
|
|
103
|
-
return _context2.stop();
|
|
104
|
-
}
|
|
105
|
-
}, _callee2);
|
|
106
|
-
})));
|
|
107
|
-
it('verify successful voicemailContent', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
|
|
108
|
-
var voiceMailPayload, response, voicemailContentResponse, vmResponseDetails;
|
|
109
|
-
return _regenerator.default.wrap(function _callee3$(_context3) {
|
|
110
|
-
while (1) switch (_context3.prev = _context3.next) {
|
|
111
|
-
case 0:
|
|
112
|
-
voiceMailPayload = _voicemailFixture.mockVoicemailContentResponse;
|
|
113
|
-
webex.request.mockResolvedValueOnce(voiceMailPayload);
|
|
114
|
-
_context3.next = 4;
|
|
115
|
-
return ucmBackendConnector.getVoicemailContent(messageId);
|
|
116
|
-
case 4:
|
|
117
|
-
response = _context3.sent.data;
|
|
118
|
-
voicemailContentResponse = _voicemailFixture.voicemailContent;
|
|
119
|
-
vmResponseDetails = {
|
|
120
|
-
voicemailContent: {
|
|
121
|
-
type: 'audio/wav',
|
|
122
|
-
content: voicemailContentResponse
|
|
123
|
-
}
|
|
124
|
-
};
|
|
125
|
-
expect(response).toStrictEqual(vmResponseDetails);
|
|
126
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
127
|
-
headers: {
|
|
128
|
-
orgId: _voicemailFixture.orgId,
|
|
129
|
-
deviceUrl: webex.internal.device.url,
|
|
130
|
-
mercuryHostname: webex.internal.services._serviceUrls.mercuryApi
|
|
131
|
-
},
|
|
132
|
-
method: _types2.HTTP_METHODS.GET,
|
|
133
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId, "/").concat(_constants.CONTENT)
|
|
134
|
-
});
|
|
135
|
-
case 9:
|
|
136
|
-
case "end":
|
|
137
|
-
return _context3.stop();
|
|
138
|
-
}
|
|
139
|
-
}, _callee3);
|
|
140
|
-
})));
|
|
141
|
-
it('verify successful voicemailMarkAsRead', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
|
|
142
|
-
var response;
|
|
143
|
-
return _regenerator.default.wrap(function _callee4$(_context4) {
|
|
144
|
-
while (1) switch (_context4.prev = _context4.next) {
|
|
145
|
-
case 0:
|
|
146
|
-
webex.request.mockResolvedValueOnce(voicemailPayload);
|
|
147
|
-
_context4.next = 3;
|
|
148
|
-
return ucmBackendConnector.voicemailMarkAsRead(messageId);
|
|
149
|
-
case 3:
|
|
150
|
-
response = _context4.sent;
|
|
151
|
-
expect(response).toStrictEqual(responseDetails);
|
|
152
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
153
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId),
|
|
154
|
-
method: _types2.HTTP_METHODS.PUT,
|
|
155
|
-
headers: {
|
|
156
|
-
orgId: _voicemailFixture.orgId
|
|
157
|
-
},
|
|
158
|
-
body: {
|
|
159
|
-
read: 'true'
|
|
160
|
-
}
|
|
161
|
-
});
|
|
162
|
-
case 6:
|
|
163
|
-
case "end":
|
|
164
|
-
return _context4.stop();
|
|
165
|
-
}
|
|
166
|
-
}, _callee4);
|
|
167
|
-
})));
|
|
168
|
-
it('verify successful voicemailMarkAsUnread', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
|
|
169
|
-
var response;
|
|
170
|
-
return _regenerator.default.wrap(function _callee5$(_context5) {
|
|
171
|
-
while (1) switch (_context5.prev = _context5.next) {
|
|
172
|
-
case 0:
|
|
173
|
-
webex.request.mockResolvedValueOnce(voicemailPayload);
|
|
174
|
-
_context5.next = 3;
|
|
175
|
-
return ucmBackendConnector.voicemailMarkAsUnread(messageId);
|
|
176
|
-
case 3:
|
|
177
|
-
response = _context5.sent;
|
|
178
|
-
expect(response).toStrictEqual(responseDetails);
|
|
179
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
180
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId),
|
|
181
|
-
method: _types2.HTTP_METHODS.PUT,
|
|
182
|
-
headers: {
|
|
183
|
-
orgId: _voicemailFixture.orgId
|
|
184
|
-
},
|
|
185
|
-
body: {
|
|
186
|
-
read: 'false'
|
|
187
|
-
}
|
|
188
|
-
});
|
|
189
|
-
case 6:
|
|
190
|
-
case "end":
|
|
191
|
-
return _context5.stop();
|
|
192
|
-
}
|
|
193
|
-
}, _callee5);
|
|
194
|
-
})));
|
|
195
|
-
it('verify successful deleteVoicemail', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
|
|
196
|
-
var response;
|
|
197
|
-
return _regenerator.default.wrap(function _callee6$(_context6) {
|
|
198
|
-
while (1) switch (_context6.prev = _context6.next) {
|
|
199
|
-
case 0:
|
|
200
|
-
webex.request.mockResolvedValueOnce(voicemailPayload);
|
|
201
|
-
_context6.next = 3;
|
|
202
|
-
return ucmBackendConnector.deleteVoicemail(messageId);
|
|
203
|
-
case 3:
|
|
204
|
-
response = _context6.sent;
|
|
205
|
-
expect(response).toStrictEqual(responseDetails);
|
|
206
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
207
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId),
|
|
208
|
-
method: _types2.HTTP_METHODS.DELETE,
|
|
209
|
-
headers: {
|
|
210
|
-
orgId: _voicemailFixture.orgId
|
|
211
|
-
}
|
|
212
|
-
});
|
|
213
|
-
case 6:
|
|
214
|
-
case "end":
|
|
215
|
-
return _context6.stop();
|
|
216
|
-
}
|
|
217
|
-
}, _callee6);
|
|
218
|
-
})));
|
|
219
|
-
it('verify resolution of contact to null', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
|
|
220
|
-
var response;
|
|
221
|
-
return _regenerator.default.wrap(function _callee7$(_context7) {
|
|
222
|
-
while (1) switch (_context7.prev = _context7.next) {
|
|
223
|
-
case 0:
|
|
224
|
-
_context7.next = 2;
|
|
225
|
-
return ucmBackendConnector.resolveContact(_voicemailFixture.resolveContactArgs);
|
|
226
|
-
case 2:
|
|
227
|
-
response = _context7.sent;
|
|
228
|
-
expect(response).toBeNull();
|
|
229
|
-
case 4:
|
|
230
|
-
case "end":
|
|
231
|
-
return _context7.stop();
|
|
232
|
-
}
|
|
233
|
-
}, _callee7);
|
|
234
|
-
})));
|
|
235
|
-
});
|
|
236
|
-
describe('Voicemail failure tests for UCM', function () {
|
|
237
|
-
var responseDetails = {
|
|
238
|
-
statusCode: 400,
|
|
239
|
-
data: {
|
|
240
|
-
error: '400 Bad request'
|
|
241
|
-
},
|
|
242
|
-
message: _constants.FAILURE_MESSAGE
|
|
243
|
-
};
|
|
244
|
-
var responseDetails401 = {
|
|
245
|
-
statusCode: 401,
|
|
246
|
-
data: {
|
|
247
|
-
error: 'User is unauthorised, possible token expiry'
|
|
248
|
-
},
|
|
249
|
-
message: _constants.FAILURE_MESSAGE
|
|
250
|
-
};
|
|
251
|
-
var failurePayload = {
|
|
252
|
-
statusCode: 400
|
|
253
|
-
};
|
|
254
|
-
var failurePayload401 = {
|
|
255
|
-
statusCode: 401
|
|
256
|
-
};
|
|
257
|
-
beforeAll(function () {
|
|
258
|
-
webex.version = '2.31.1';
|
|
259
|
-
webex.internal.device.version = '2.31.1';
|
|
260
|
-
webex.internal.device.features.entitlement.models = [{
|
|
261
|
-
_values: {
|
|
262
|
-
key: 'ucm-calling'
|
|
263
|
-
}
|
|
264
|
-
}];
|
|
265
|
-
webex.internal.device.callingBehavior = 'NATIVE_SIP_CALL_TO_UCM';
|
|
266
|
-
ucmBackendConnector = new _UcmBackendConnector.UcmBackendConnector(webex, {
|
|
267
|
-
level: _types.LOGGER.INFO
|
|
268
|
-
});
|
|
269
|
-
ucmBackendConnector.init();
|
|
270
|
-
voicemailPayload = _voicemailFixture.getVoiceMailListJsonUCM;
|
|
271
|
-
});
|
|
272
|
-
beforeEach(function () {
|
|
273
|
-
serviceErrorCodeHandlerSpy = jest.spyOn(utils, 'serviceErrorCodeHandler');
|
|
274
|
-
});
|
|
275
|
-
afterEach(function () {
|
|
276
|
-
jest.clearAllMocks();
|
|
277
|
-
});
|
|
278
|
-
it('verify failure voicemail listing when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
|
|
279
|
-
var response;
|
|
280
|
-
return _regenerator.default.wrap(function _callee8$(_context8) {
|
|
281
|
-
while (1) switch (_context8.prev = _context8.next) {
|
|
282
|
-
case 0:
|
|
283
|
-
webex.request.mockRejectedValueOnce(failurePayload);
|
|
284
|
-
_context8.next = 3;
|
|
285
|
-
return ucmBackendConnector.getVoicemailList(0, 20, _types2.SORT.DESC);
|
|
286
|
-
case 3:
|
|
287
|
-
response = _context8.sent;
|
|
288
|
-
expect(response).toStrictEqual(responseDetails);
|
|
289
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
|
|
290
|
-
statusCode: 400
|
|
291
|
-
}, {
|
|
292
|
-
file: 'UcmBackendConnector',
|
|
293
|
-
method: 'getVoicemailList'
|
|
294
|
-
});
|
|
295
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
296
|
-
headers: {
|
|
297
|
-
orgId: _voicemailFixture.orgId
|
|
298
|
-
},
|
|
299
|
-
method: _types2.HTTP_METHODS.GET,
|
|
300
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl + _voicemailFixture.voicemailContent)
|
|
301
|
-
});
|
|
302
|
-
case 7:
|
|
303
|
-
case "end":
|
|
304
|
-
return _context8.stop();
|
|
305
|
-
}
|
|
306
|
-
}, _callee8);
|
|
307
|
-
})));
|
|
308
|
-
it('verify failure voicemailContent when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
|
|
309
|
-
var vmContentSpy, failurePayload422, response;
|
|
310
|
-
return _regenerator.default.wrap(function _callee9$(_context9) {
|
|
311
|
-
while (1) switch (_context9.prev = _context9.next) {
|
|
312
|
-
case 0:
|
|
313
|
-
vmContentSpy = jest.spyOn(ucmBackendConnector, 'getVoicemailContent');
|
|
314
|
-
failurePayload422 = {
|
|
315
|
-
statusCode: _constants.UNPROCESSABLE_CONTENT_CODE
|
|
316
|
-
};
|
|
317
|
-
webex.request.mockRejectedValue(failurePayload422);
|
|
318
|
-
_context9.next = 5;
|
|
319
|
-
return ucmBackendConnector.getVoicemailContent(messageId);
|
|
320
|
-
case 5:
|
|
321
|
-
response = _context9.sent;
|
|
322
|
-
expect(vmContentSpy).toBeCalledTimes(1);
|
|
323
|
-
expect(response).toStrictEqual(_voicemailFixture.responseDetails422);
|
|
324
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
|
|
325
|
-
statusCode: _constants.UNPROCESSABLE_CONTENT_CODE
|
|
326
|
-
}, {
|
|
327
|
-
file: 'UcmBackendConnector',
|
|
328
|
-
method: 'getVoicemailContent'
|
|
329
|
-
});
|
|
330
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
331
|
-
headers: {
|
|
332
|
-
orgId: _voicemailFixture.orgId,
|
|
333
|
-
deviceUrl: webex.internal.device.url,
|
|
334
|
-
mercuryHostname: webex.internal.services._serviceUrls.mercuryApi
|
|
335
|
-
},
|
|
336
|
-
method: _types2.HTTP_METHODS.GET,
|
|
337
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId, "/").concat(_constants.CONTENT)
|
|
338
|
-
});
|
|
339
|
-
case 10:
|
|
340
|
-
case "end":
|
|
341
|
-
return _context9.stop();
|
|
342
|
-
}
|
|
343
|
-
}, _callee9);
|
|
344
|
-
})));
|
|
345
|
-
it('verify failure voicemailContent when failure voicemail api response received', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
|
|
346
|
-
var vmContentSpy, failureVoicemailResponse, response, failureVmResponseDetails;
|
|
347
|
-
return _regenerator.default.wrap(function _callee10$(_context10) {
|
|
348
|
-
while (1) switch (_context10.prev = _context10.next) {
|
|
349
|
-
case 0:
|
|
350
|
-
vmContentSpy = jest.spyOn(ucmBackendConnector, 'getVoicemailContent');
|
|
351
|
-
failureVoicemailResponse = {
|
|
352
|
-
statusCode: 204
|
|
353
|
-
};
|
|
354
|
-
webex.request.mockResolvedValueOnce(failureVoicemailResponse);
|
|
355
|
-
_context10.next = 5;
|
|
356
|
-
return ucmBackendConnector.getVoicemailContent(messageId);
|
|
357
|
-
case 5:
|
|
358
|
-
response = _context10.sent;
|
|
359
|
-
failureVmResponseDetails = _objectSpread({
|
|
360
|
-
data: {
|
|
361
|
-
voicemailContent: {
|
|
362
|
-
type: undefined,
|
|
363
|
-
content: undefined
|
|
364
|
-
}
|
|
365
|
-
},
|
|
366
|
-
message: _constants.FAILURE_MESSAGE
|
|
367
|
-
}, failureVoicemailResponse);
|
|
368
|
-
expect(vmContentSpy).toBeCalledTimes(1);
|
|
369
|
-
expect(response).toStrictEqual(_voicemailFixture.responseDetails204);
|
|
370
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith(failureVmResponseDetails, {
|
|
371
|
-
file: 'UcmBackendConnector',
|
|
372
|
-
method: 'getVoicemailContent'
|
|
373
|
-
});
|
|
374
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
375
|
-
headers: {
|
|
376
|
-
orgId: _voicemailFixture.orgId,
|
|
377
|
-
deviceUrl: webex.internal.device.url,
|
|
378
|
-
mercuryHostname: webex.internal.services._serviceUrls.mercuryApi
|
|
379
|
-
},
|
|
380
|
-
method: _types2.HTTP_METHODS.GET,
|
|
381
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId, "/").concat(_constants.CONTENT)
|
|
382
|
-
});
|
|
383
|
-
case 11:
|
|
384
|
-
case "end":
|
|
385
|
-
return _context10.stop();
|
|
386
|
-
}
|
|
387
|
-
}, _callee10);
|
|
388
|
-
})));
|
|
389
|
-
it('verify failure voicemailMarkAsRead when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
|
|
390
|
-
var response;
|
|
391
|
-
return _regenerator.default.wrap(function _callee11$(_context11) {
|
|
392
|
-
while (1) switch (_context11.prev = _context11.next) {
|
|
393
|
-
case 0:
|
|
394
|
-
webex.request.mockRejectedValue(failurePayload);
|
|
395
|
-
_context11.next = 3;
|
|
396
|
-
return ucmBackendConnector.voicemailMarkAsRead(messageId);
|
|
397
|
-
case 3:
|
|
398
|
-
response = _context11.sent;
|
|
399
|
-
expect(response).toStrictEqual(responseDetails);
|
|
400
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
|
|
401
|
-
statusCode: 400
|
|
402
|
-
}, {
|
|
403
|
-
file: 'UcmBackendConnector',
|
|
404
|
-
method: 'voicemailMarkAsRead'
|
|
405
|
-
});
|
|
406
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
407
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId),
|
|
408
|
-
method: _types2.HTTP_METHODS.PUT,
|
|
409
|
-
headers: {
|
|
410
|
-
orgId: _voicemailFixture.orgId
|
|
411
|
-
},
|
|
412
|
-
body: {
|
|
413
|
-
read: 'true'
|
|
414
|
-
}
|
|
415
|
-
});
|
|
416
|
-
case 7:
|
|
417
|
-
case "end":
|
|
418
|
-
return _context11.stop();
|
|
419
|
-
}
|
|
420
|
-
}, _callee11);
|
|
421
|
-
})));
|
|
422
|
-
it('verify failure voicemailMarkAsUnread when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
|
|
423
|
-
var response;
|
|
424
|
-
return _regenerator.default.wrap(function _callee12$(_context12) {
|
|
425
|
-
while (1) switch (_context12.prev = _context12.next) {
|
|
426
|
-
case 0:
|
|
427
|
-
webex.request.mockRejectedValue(failurePayload);
|
|
428
|
-
_context12.next = 3;
|
|
429
|
-
return ucmBackendConnector.voicemailMarkAsUnread(messageId);
|
|
430
|
-
case 3:
|
|
431
|
-
response = _context12.sent;
|
|
432
|
-
expect(response).toStrictEqual(responseDetails);
|
|
433
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
|
|
434
|
-
statusCode: 400
|
|
435
|
-
}, {
|
|
436
|
-
file: 'UcmBackendConnector',
|
|
437
|
-
method: 'voicemailMarkAsUnread'
|
|
438
|
-
});
|
|
439
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
440
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId),
|
|
441
|
-
method: _types2.HTTP_METHODS.PUT,
|
|
442
|
-
headers: {
|
|
443
|
-
orgId: _voicemailFixture.orgId
|
|
444
|
-
},
|
|
445
|
-
body: {
|
|
446
|
-
read: 'false'
|
|
447
|
-
}
|
|
448
|
-
});
|
|
449
|
-
case 7:
|
|
450
|
-
case "end":
|
|
451
|
-
return _context12.stop();
|
|
452
|
-
}
|
|
453
|
-
}, _callee12);
|
|
454
|
-
})));
|
|
455
|
-
it('verify failure delete voicemail when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
|
|
456
|
-
var response;
|
|
457
|
-
return _regenerator.default.wrap(function _callee13$(_context13) {
|
|
458
|
-
while (1) switch (_context13.prev = _context13.next) {
|
|
459
|
-
case 0:
|
|
460
|
-
webex.request.mockRejectedValue(failurePayload);
|
|
461
|
-
_context13.next = 3;
|
|
462
|
-
return ucmBackendConnector.deleteVoicemail(messageId);
|
|
463
|
-
case 3:
|
|
464
|
-
response = _context13.sent;
|
|
465
|
-
expect(response).toStrictEqual(responseDetails);
|
|
466
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
|
|
467
|
-
statusCode: 400
|
|
468
|
-
}, {
|
|
469
|
-
file: 'UcmBackendConnector',
|
|
470
|
-
method: 'deleteVoicemail'
|
|
471
|
-
});
|
|
472
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
473
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId),
|
|
474
|
-
method: _types2.HTTP_METHODS.DELETE,
|
|
475
|
-
headers: {
|
|
476
|
-
orgId: _voicemailFixture.orgId
|
|
477
|
-
}
|
|
478
|
-
});
|
|
479
|
-
case 7:
|
|
480
|
-
case "end":
|
|
481
|
-
return _context13.stop();
|
|
482
|
-
}
|
|
483
|
-
}, _callee13);
|
|
484
|
-
})));
|
|
485
|
-
it('verify failure voicemail listing when user is unauthorised, possible token expiry', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
|
|
486
|
-
var response;
|
|
487
|
-
return _regenerator.default.wrap(function _callee14$(_context14) {
|
|
488
|
-
while (1) switch (_context14.prev = _context14.next) {
|
|
489
|
-
case 0:
|
|
490
|
-
webex.request.mockRejectedValue(failurePayload401);
|
|
491
|
-
_context14.next = 3;
|
|
492
|
-
return ucmBackendConnector.getVoicemailList(0, 20, _types2.SORT.DESC);
|
|
493
|
-
case 3:
|
|
494
|
-
response = _context14.sent;
|
|
495
|
-
expect(response).toStrictEqual(responseDetails401);
|
|
496
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
|
|
497
|
-
statusCode: 401
|
|
498
|
-
}, {
|
|
499
|
-
file: 'UcmBackendConnector',
|
|
500
|
-
method: 'getVoicemailList'
|
|
501
|
-
});
|
|
502
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
503
|
-
headers: {
|
|
504
|
-
orgId: _voicemailFixture.orgId
|
|
505
|
-
},
|
|
506
|
-
method: _types2.HTTP_METHODS.GET,
|
|
507
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl + _voicemailFixture.voicemailContent)
|
|
508
|
-
});
|
|
509
|
-
case 7:
|
|
510
|
-
case "end":
|
|
511
|
-
return _context14.stop();
|
|
512
|
-
}
|
|
513
|
-
}, _callee14);
|
|
514
|
-
})));
|
|
515
|
-
it('verify failure voicemailMarkAsRead when user is unauthorised, possible token expiry', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
|
|
516
|
-
var response;
|
|
517
|
-
return _regenerator.default.wrap(function _callee15$(_context15) {
|
|
518
|
-
while (1) switch (_context15.prev = _context15.next) {
|
|
519
|
-
case 0:
|
|
520
|
-
webex.request.mockRejectedValue(failurePayload401);
|
|
521
|
-
_context15.next = 3;
|
|
522
|
-
return ucmBackendConnector.voicemailMarkAsRead(messageId);
|
|
523
|
-
case 3:
|
|
524
|
-
response = _context15.sent;
|
|
525
|
-
expect(response).toStrictEqual(responseDetails401);
|
|
526
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
|
|
527
|
-
statusCode: 401
|
|
528
|
-
}, {
|
|
529
|
-
file: 'UcmBackendConnector',
|
|
530
|
-
method: 'voicemailMarkAsRead'
|
|
531
|
-
});
|
|
532
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
533
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId),
|
|
534
|
-
method: _types2.HTTP_METHODS.PUT,
|
|
535
|
-
headers: {
|
|
536
|
-
orgId: _voicemailFixture.orgId
|
|
537
|
-
},
|
|
538
|
-
body: {
|
|
539
|
-
read: 'true'
|
|
540
|
-
}
|
|
541
|
-
});
|
|
542
|
-
case 7:
|
|
543
|
-
case "end":
|
|
544
|
-
return _context15.stop();
|
|
545
|
-
}
|
|
546
|
-
}, _callee15);
|
|
547
|
-
})));
|
|
548
|
-
it('verify failure voicemailMarkAsUnread when user is unauthorised, possible token expiry', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
|
|
549
|
-
var response;
|
|
550
|
-
return _regenerator.default.wrap(function _callee16$(_context16) {
|
|
551
|
-
while (1) switch (_context16.prev = _context16.next) {
|
|
552
|
-
case 0:
|
|
553
|
-
webex.request.mockRejectedValue(failurePayload401);
|
|
554
|
-
_context16.next = 3;
|
|
555
|
-
return ucmBackendConnector.voicemailMarkAsUnread(messageId);
|
|
556
|
-
case 3:
|
|
557
|
-
response = _context16.sent;
|
|
558
|
-
expect(response).toStrictEqual(responseDetails401);
|
|
559
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
|
|
560
|
-
statusCode: 401
|
|
561
|
-
}, {
|
|
562
|
-
file: 'UcmBackendConnector',
|
|
563
|
-
method: 'voicemailMarkAsUnread'
|
|
564
|
-
});
|
|
565
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
566
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId),
|
|
567
|
-
method: _types2.HTTP_METHODS.PUT,
|
|
568
|
-
headers: {
|
|
569
|
-
orgId: _voicemailFixture.orgId
|
|
570
|
-
},
|
|
571
|
-
body: {
|
|
572
|
-
read: 'false'
|
|
573
|
-
}
|
|
574
|
-
});
|
|
575
|
-
case 7:
|
|
576
|
-
case "end":
|
|
577
|
-
return _context16.stop();
|
|
578
|
-
}
|
|
579
|
-
}, _callee16);
|
|
580
|
-
})));
|
|
581
|
-
it('verify failure delete voicemail when user is unauthorised, possible token expiry', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
|
|
582
|
-
var response;
|
|
583
|
-
return _regenerator.default.wrap(function _callee17$(_context17) {
|
|
584
|
-
while (1) switch (_context17.prev = _context17.next) {
|
|
585
|
-
case 0:
|
|
586
|
-
webex.request.mockRejectedValue(failurePayload401);
|
|
587
|
-
_context17.next = 3;
|
|
588
|
-
return ucmBackendConnector.deleteVoicemail(messageId);
|
|
589
|
-
case 3:
|
|
590
|
-
response = _context17.sent;
|
|
591
|
-
expect(response).toStrictEqual(responseDetails401);
|
|
592
|
-
expect(serviceErrorCodeHandlerSpy).toBeCalledOnceWith({
|
|
593
|
-
statusCode: 401
|
|
594
|
-
}, {
|
|
595
|
-
file: 'UcmBackendConnector',
|
|
596
|
-
method: 'deleteVoicemail'
|
|
597
|
-
});
|
|
598
|
-
expect(webex.request).toBeCalledOnceWith({
|
|
599
|
-
uri: "".concat(_voicemailFixture.ucmBackendInfoUrl, "/").concat(messageId),
|
|
600
|
-
method: _types2.HTTP_METHODS.DELETE,
|
|
601
|
-
headers: {
|
|
602
|
-
orgId: _voicemailFixture.orgId
|
|
603
|
-
}
|
|
604
|
-
});
|
|
605
|
-
case 7:
|
|
606
|
-
case "end":
|
|
607
|
-
return _context17.stop();
|
|
608
|
-
}
|
|
609
|
-
}, _callee17);
|
|
610
|
-
})));
|
|
611
|
-
it('verify fetching voicemail summary returned to be null', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
|
|
612
|
-
var response;
|
|
613
|
-
return _regenerator.default.wrap(function _callee18$(_context18) {
|
|
614
|
-
while (1) switch (_context18.prev = _context18.next) {
|
|
615
|
-
case 0:
|
|
616
|
-
_context18.next = 2;
|
|
617
|
-
return ucmBackendConnector.getVoicemailSummary();
|
|
618
|
-
case 2:
|
|
619
|
-
response = _context18.sent;
|
|
620
|
-
expect(response).toBeNull();
|
|
621
|
-
case 4:
|
|
622
|
-
case "end":
|
|
623
|
-
return _context18.stop();
|
|
624
|
-
}
|
|
625
|
-
}, _callee18);
|
|
626
|
-
})));
|
|
627
|
-
});
|
|
628
|
-
//# sourceMappingURL=UcmBackendConnector.test.js.map
|