@webex/calling 3.10.0 → 3.11.0-webex-services-ready.1

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 (151) 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 +298 -347
  18. package/dist/CallingClient/CallingClient.js.map +1 -1
  19. package/dist/CallingClient/CallingClient.test.js +267 -405
  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 +657 -616
  26. package/dist/CallingClient/calling/call.js.map +1 -1
  27. package/dist/CallingClient/calling/call.test.js +864 -551
  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 +5 -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 +659 -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/windowsChromiumIceWarmupUtils.js +28 -28
  51. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -1
  52. package/dist/Contacts/ContactsClient.js +259 -268
  53. package/dist/Contacts/ContactsClient.js.map +1 -1
  54. package/dist/Contacts/ContactsClient.test.js +64 -63
  55. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  56. package/dist/Errors/catalog/CallError.js +7 -10
  57. package/dist/Errors/catalog/CallError.js.map +1 -1
  58. package/dist/Errors/catalog/CallingDeviceError.js +6 -9
  59. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  60. package/dist/Errors/catalog/ExtendedError.js +6 -8
  61. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  62. package/dist/Errors/catalog/LineError.js +6 -9
  63. package/dist/Errors/catalog/LineError.js.map +1 -1
  64. package/dist/Events/impl/index.js +12 -14
  65. package/dist/Events/impl/index.js.map +1 -1
  66. package/dist/Logger/index.js +3 -3
  67. package/dist/Logger/index.js.map +1 -1
  68. package/dist/Logger/index.test.js +1 -1
  69. package/dist/Logger/index.test.js.map +1 -1
  70. package/dist/Metrics/index.js +1 -2
  71. package/dist/Metrics/index.js.map +1 -1
  72. package/dist/SDKConnector/index.js +1 -2
  73. package/dist/SDKConnector/index.js.map +1 -1
  74. package/dist/SDKConnector/types.js.map +1 -1
  75. package/dist/Voicemail/BroadworksBackendConnector.js +131 -139
  76. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  77. package/dist/Voicemail/BroadworksBackendConnector.test.js +106 -98
  78. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  79. package/dist/Voicemail/UcmBackendConnector.js +88 -92
  80. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  81. package/dist/Voicemail/UcmBackendConnector.test.js +72 -72
  82. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  83. package/dist/Voicemail/Voicemail.js +103 -131
  84. package/dist/Voicemail/Voicemail.js.map +1 -1
  85. package/dist/Voicemail/Voicemail.test.js +20 -20
  86. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  87. package/dist/Voicemail/WxCallBackendConnector.js +117 -131
  88. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  89. package/dist/Voicemail/WxCallBackendConnector.test.js +180 -154
  90. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  91. package/dist/common/Utils.js +198 -166
  92. package/dist/common/Utils.js.map +1 -1
  93. package/dist/common/Utils.test.js +436 -191
  94. package/dist/common/Utils.test.js.map +1 -1
  95. package/dist/common/constants.js +3 -1
  96. package/dist/common/constants.js.map +1 -1
  97. package/dist/common/testUtil.js +5 -4
  98. package/dist/common/testUtil.js.map +1 -1
  99. package/dist/module/CallHistory/CallHistory.js +20 -11
  100. package/dist/module/CallSettings/UcmBackendConnector.js +21 -8
  101. package/dist/module/CallSettings/WxCallBackendConnector.js +10 -15
  102. package/dist/module/CallingClient/CallingClient.js +83 -123
  103. package/dist/module/CallingClient/calling/call.js +73 -58
  104. package/dist/module/CallingClient/calling/callManager.js +7 -0
  105. package/dist/module/CallingClient/constants.js +3 -0
  106. package/dist/module/CallingClient/registration/register.js +85 -5
  107. package/dist/module/CallingClient/registration/webWorker.js +2 -2
  108. package/dist/module/CallingClient/registration/webWorkerStr.js +2 -2
  109. package/dist/module/Contacts/ContactsClient.js +19 -25
  110. package/dist/module/Events/impl/index.js +1 -1
  111. package/dist/module/Logger/index.js +2 -2
  112. package/dist/module/Voicemail/BroadworksBackendConnector.js +10 -18
  113. package/dist/module/Voicemail/UcmBackendConnector.js +7 -11
  114. package/dist/module/Voicemail/Voicemail.js +42 -68
  115. package/dist/module/Voicemail/WxCallBackendConnector.js +14 -28
  116. package/dist/module/common/Utils.js +31 -5
  117. package/dist/module/common/constants.js +2 -0
  118. package/dist/module/common/testUtil.js +1 -0
  119. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  120. package/dist/types/CallSettings/UcmBackendConnector.d.ts +1 -0
  121. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  122. package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
  123. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  124. package/dist/types/CallingClient/calling/call.d.ts +4 -0
  125. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  126. package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
  127. package/dist/types/CallingClient/constants.d.ts +3 -0
  128. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  129. package/dist/types/CallingClient/registration/register.d.ts +4 -0
  130. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  131. package/dist/types/CallingClient/registration/types.d.ts +6 -0
  132. package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
  133. package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
  134. package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
  135. package/dist/types/Contacts/ContactsClient.d.ts +1 -0
  136. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  137. package/dist/types/Logger/index.d.ts +1 -2
  138. package/dist/types/Logger/index.d.ts.map +1 -1
  139. package/dist/types/SDKConnector/types.d.ts +16 -0
  140. package/dist/types/SDKConnector/types.d.ts.map +1 -1
  141. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
  142. package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
  143. package/dist/types/Voicemail/Voicemail.d.ts.map +1 -1
  144. package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
  145. package/dist/types/common/Utils.d.ts +1 -1
  146. package/dist/types/common/Utils.d.ts.map +1 -1
  147. package/dist/types/common/constants.d.ts +2 -0
  148. package/dist/types/common/constants.d.ts.map +1 -1
  149. package/dist/types/common/testUtil.d.ts +1 -0
  150. package/dist/types/common/testUtil.d.ts.map +1 -1
  151. package/package.json +4 -4
@@ -9,8 +9,8 @@ var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/de
9
9
  var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
10
10
  var _WeakMap = require("@babel/runtime-corejs2/core-js/weak-map");
11
11
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
12
- var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
13
12
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
13
+ var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
14
14
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
15
15
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
16
16
  var _types = require("../Logger/types");
@@ -71,16 +71,16 @@ describe('Voicemail webex call Backend Connector Test case', function () {
71
71
  });
72
72
  it('verify failure voicemail listing when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
73
73
  var failurePayload, response, responseDetails;
74
- return _regenerator.default.wrap(function _callee$(_context) {
74
+ return _regenerator.default.wrap(function (_context) {
75
75
  while (1) switch (_context.prev = _context.next) {
76
76
  case 0:
77
77
  failurePayload = {
78
78
  statusCode: 400
79
79
  };
80
80
  webex.request.mockRejectedValueOnce(failurePayload);
81
- _context.next = 4;
81
+ _context.next = 1;
82
82
  return wxCallBackendConnector.getVoicemailList(0, 20, _types2.SORT.DESC, true);
83
- case 4:
83
+ case 1:
84
84
  response = _context.sent;
85
85
  responseDetails = {
86
86
  statusCode: 400,
@@ -101,11 +101,11 @@ describe('Voicemail webex call Backend Connector Test case', function () {
101
101
  file: 'WxCallBackendConnector',
102
102
  method: 'getVoicemailList'
103
103
  }));
104
- expect(errorSpy).toHaveBeenCalledWith(expect.any(Error), expect.objectContaining({
104
+ expect(errorSpy).toHaveBeenCalledWith("Failed to get voicemail list: ".concat((0, _stringify.default)(failurePayload)), {
105
105
  file: 'WxCallBackendConnector',
106
106
  method: 'getVoicemailList'
107
- }));
108
- case 11:
107
+ });
108
+ case 2:
109
109
  case "end":
110
110
  return _context.stop();
111
111
  }
@@ -113,7 +113,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
113
113
  })));
114
114
  it('verify failure voicemailMarkAsRead when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
115
115
  var failurePayload, responseDetails, response;
116
- return _regenerator.default.wrap(function _callee2$(_context2) {
116
+ return _regenerator.default.wrap(function (_context2) {
117
117
  while (1) switch (_context2.prev = _context2.next) {
118
118
  case 0:
119
119
  failurePayload = {
@@ -127,9 +127,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
127
127
  },
128
128
  message: FAILURE
129
129
  };
130
- _context2.next = 5;
130
+ _context2.next = 1;
131
131
  return wxCallBackendConnector.voicemailMarkAsRead(messageId.$);
132
- case 5:
132
+ case 1:
133
133
  response = _context2.sent;
134
134
  expect(response).toStrictEqual(responseDetails);
135
135
  expect(response.message).toBe(FAILURE);
@@ -143,13 +143,11 @@ describe('Voicemail webex call Backend Connector Test case', function () {
143
143
  file: 'WxCallBackendConnector',
144
144
  method: 'voicemailMarkAsRead'
145
145
  });
146
- expect(errorSpy).toHaveBeenNthCalledWith(1, expect.objectContaining({
147
- message: expect.stringContaining('Failed to mark voicemail as read')
148
- }), {
146
+ expect(errorSpy).toHaveBeenNthCalledWith(1, "Failed to mark voicemail as read: ".concat((0, _stringify.default)(failurePayload)), {
149
147
  file: 'WxCallBackendConnector',
150
148
  method: 'voicemailMarkAsRead'
151
149
  });
152
- case 11:
150
+ case 2:
153
151
  case "end":
154
152
  return _context2.stop();
155
153
  }
@@ -157,7 +155,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
157
155
  })));
158
156
  it('verify failure voicemailMarkAsUnread when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
159
157
  var failurePayload, responseDetails, response;
160
- return _regenerator.default.wrap(function _callee3$(_context3) {
158
+ return _regenerator.default.wrap(function (_context3) {
161
159
  while (1) switch (_context3.prev = _context3.next) {
162
160
  case 0:
163
161
  failurePayload = {
@@ -171,9 +169,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
171
169
  },
172
170
  message: FAILURE
173
171
  };
174
- _context3.next = 5;
172
+ _context3.next = 1;
175
173
  return wxCallBackendConnector.voicemailMarkAsUnread(messageId.$);
176
- case 5:
174
+ case 1:
177
175
  response = _context3.sent;
178
176
  expect(response).toStrictEqual(responseDetails);
179
177
  expect(response.message).toBe(FAILURE);
@@ -187,13 +185,11 @@ describe('Voicemail webex call Backend Connector Test case', function () {
187
185
  file: 'WxCallBackendConnector',
188
186
  method: 'voicemailMarkAsUnread'
189
187
  });
190
- expect(errorSpy).toHaveBeenNthCalledWith(1, expect.objectContaining({
191
- message: expect.stringContaining('Failed to mark voicemail as unread')
192
- }), {
188
+ expect(errorSpy).toHaveBeenNthCalledWith(1, "Failed to mark voicemail as unread: ".concat((0, _stringify.default)(failurePayload)), {
193
189
  file: 'WxCallBackendConnector',
194
190
  method: 'voicemailMarkAsUnread'
195
191
  });
196
- case 11:
192
+ case 2:
197
193
  case "end":
198
194
  return _context3.stop();
199
195
  }
@@ -201,7 +197,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
201
197
  })));
202
198
  it('verify failure delete Voicemail when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
203
199
  var failurePayload, responseDetails, response;
204
- return _regenerator.default.wrap(function _callee4$(_context4) {
200
+ return _regenerator.default.wrap(function (_context4) {
205
201
  while (1) switch (_context4.prev = _context4.next) {
206
202
  case 0:
207
203
  failurePayload = {
@@ -215,9 +211,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
215
211
  },
216
212
  message: FAILURE
217
213
  };
218
- _context4.next = 5;
214
+ _context4.next = 1;
219
215
  return wxCallBackendConnector.deleteVoicemail(messageId.$);
220
- case 5:
216
+ case 1:
221
217
  response = _context4.sent;
222
218
  expect(response).toStrictEqual(responseDetails);
223
219
  expect(response.message).toBe(FAILURE);
@@ -231,13 +227,11 @@ describe('Voicemail webex call Backend Connector Test case', function () {
231
227
  file: 'WxCallBackendConnector',
232
228
  method: 'deleteVoicemail'
233
229
  });
234
- expect(errorSpy).toHaveBeenCalledWith(expect.objectContaining({
235
- message: expect.stringContaining('Failed to delete voicemail')
236
- }), {
230
+ expect(errorSpy).toHaveBeenCalledWith("Failed to delete voicemail: ".concat((0, _stringify.default)(failurePayload)), {
237
231
  file: 'WxCallBackendConnector',
238
232
  method: 'deleteVoicemail'
239
233
  });
240
- case 11:
234
+ case 2:
241
235
  case "end":
242
236
  return _context4.stop();
243
237
  }
@@ -245,7 +239,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
245
239
  })));
246
240
  it('verify failure for get transcript when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
247
241
  var failurePayload, responseDetails, response;
248
- return _regenerator.default.wrap(function _callee5$(_context5) {
242
+ return _regenerator.default.wrap(function (_context5) {
249
243
  while (1) switch (_context5.prev = _context5.next) {
250
244
  case 0:
251
245
  failurePayload = {
@@ -259,9 +253,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
259
253
  },
260
254
  message: FAILURE
261
255
  };
262
- _context5.next = 5;
256
+ _context5.next = 1;
263
257
  return wxCallBackendConnector.getVMTranscript(messageId.$);
264
- case 5:
258
+ case 1:
265
259
  response = _context5.sent;
266
260
  expect(response).toStrictEqual(responseDetails);
267
261
  expect(response === null || response === void 0 ? void 0 : response.message).toBe(FAILURE);
@@ -271,7 +265,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
271
265
  file: 'WxCallBackendConnector',
272
266
  method: 'getVMTranscript'
273
267
  });
274
- case 9:
268
+ case 2:
275
269
  case "end":
276
270
  return _context5.stop();
277
271
  }
@@ -279,16 +273,16 @@ describe('Voicemail webex call Backend Connector Test case', function () {
279
273
  })));
280
274
  it('verify failure voicemail listing when user is unauthorised, possible token expiry', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
281
275
  var failurePayload, response, responseDetails;
282
- return _regenerator.default.wrap(function _callee6$(_context6) {
276
+ return _regenerator.default.wrap(function (_context6) {
283
277
  while (1) switch (_context6.prev = _context6.next) {
284
278
  case 0:
285
279
  failurePayload = {
286
280
  statusCode: 401
287
281
  };
288
282
  webex.request.mockRejectedValue(failurePayload);
289
- _context6.next = 4;
283
+ _context6.next = 1;
290
284
  return wxCallBackendConnector.getVoicemailList(0, 20, _types2.SORT.DESC, true);
291
- case 4:
285
+ case 1:
292
286
  response = _context6.sent;
293
287
  responseDetails = {
294
288
  statusCode: 401,
@@ -305,7 +299,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
305
299
  file: 'WxCallBackendConnector',
306
300
  method: 'getVoicemailList'
307
301
  });
308
- case 9:
302
+ case 2:
309
303
  case "end":
310
304
  return _context6.stop();
311
305
  }
@@ -313,7 +307,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
313
307
  })));
314
308
  it('verify failure voicemailMarkAsRead when user is unauthorised, possible token expiry', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
315
309
  var failurePayload, responseDetails, response;
316
- return _regenerator.default.wrap(function _callee7$(_context7) {
310
+ return _regenerator.default.wrap(function (_context7) {
317
311
  while (1) switch (_context7.prev = _context7.next) {
318
312
  case 0:
319
313
  failurePayload = {
@@ -327,9 +321,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
327
321
  },
328
322
  message: FAILURE
329
323
  };
330
- _context7.next = 5;
324
+ _context7.next = 1;
331
325
  return wxCallBackendConnector.voicemailMarkAsRead(messageId.$);
332
- case 5:
326
+ case 1:
333
327
  response = _context7.sent;
334
328
  expect(response).toStrictEqual(responseDetails);
335
329
  expect(response.message).toBe(FAILURE);
@@ -339,7 +333,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
339
333
  file: 'WxCallBackendConnector',
340
334
  method: 'voicemailMarkAsRead'
341
335
  });
342
- case 9:
336
+ case 2:
343
337
  case "end":
344
338
  return _context7.stop();
345
339
  }
@@ -347,7 +341,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
347
341
  })));
348
342
  it('verify failure voicemailMarkAsUnread when user is unauthorised, possible token expiry', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
349
343
  var failurePayload, responseDetails, response;
350
- return _regenerator.default.wrap(function _callee8$(_context8) {
344
+ return _regenerator.default.wrap(function (_context8) {
351
345
  while (1) switch (_context8.prev = _context8.next) {
352
346
  case 0:
353
347
  failurePayload = {
@@ -361,9 +355,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
361
355
  },
362
356
  message: FAILURE
363
357
  };
364
- _context8.next = 5;
358
+ _context8.next = 1;
365
359
  return wxCallBackendConnector.voicemailMarkAsUnread(messageId.$);
366
- case 5:
360
+ case 1:
367
361
  response = _context8.sent;
368
362
  expect(response).toStrictEqual(responseDetails);
369
363
  expect(response.message).toBe(FAILURE);
@@ -373,7 +367,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
373
367
  file: 'WxCallBackendConnector',
374
368
  method: 'voicemailMarkAsUnread'
375
369
  });
376
- case 9:
370
+ case 2:
377
371
  case "end":
378
372
  return _context8.stop();
379
373
  }
@@ -381,7 +375,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
381
375
  })));
382
376
  it('verify failure delete Voicemail when user is unauthorised, possible token expiry', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
383
377
  var failurePayload, responseDetails, response;
384
- return _regenerator.default.wrap(function _callee9$(_context9) {
378
+ return _regenerator.default.wrap(function (_context9) {
385
379
  while (1) switch (_context9.prev = _context9.next) {
386
380
  case 0:
387
381
  failurePayload = {
@@ -395,9 +389,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
395
389
  },
396
390
  message: FAILURE
397
391
  };
398
- _context9.next = 5;
392
+ _context9.next = 1;
399
393
  return wxCallBackendConnector.deleteVoicemail(messageId.$);
400
- case 5:
394
+ case 1:
401
395
  response = _context9.sent;
402
396
  expect(response).toStrictEqual(responseDetails);
403
397
  expect(response.message).toBe(FAILURE);
@@ -407,7 +401,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
407
401
  file: 'WxCallBackendConnector',
408
402
  method: 'deleteVoicemail'
409
403
  });
410
- case 9:
404
+ case 2:
411
405
  case "end":
412
406
  return _context9.stop();
413
407
  }
@@ -415,7 +409,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
415
409
  })));
416
410
  it('verify failure for get transcript when user is unauthorised, possible token expiry', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
417
411
  var failurePayload, responseDetails, response;
418
- return _regenerator.default.wrap(function _callee0$(_context0) {
412
+ return _regenerator.default.wrap(function (_context0) {
419
413
  while (1) switch (_context0.prev = _context0.next) {
420
414
  case 0:
421
415
  failurePayload = {
@@ -429,9 +423,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
429
423
  },
430
424
  message: FAILURE
431
425
  };
432
- _context0.next = 5;
426
+ _context0.next = 1;
433
427
  return wxCallBackendConnector.getVMTranscript(messageId.$);
434
- case 5:
428
+ case 1:
435
429
  response = _context0.sent;
436
430
  expect(response).toStrictEqual(responseDetails);
437
431
  expect(response === null || response === void 0 ? void 0 : response.message).toBe(FAILURE);
@@ -441,7 +435,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
441
435
  file: 'WxCallBackendConnector',
442
436
  method: 'getVMTranscript'
443
437
  });
444
- case 9:
438
+ case 2:
445
439
  case "end":
446
440
  return _context0.stop();
447
441
  }
@@ -449,16 +443,16 @@ describe('Voicemail webex call Backend Connector Test case', function () {
449
443
  })));
450
444
  it('verify failure voicemail summary when bad request occur', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
451
445
  var failurePayload, response, responseDetails;
452
- return _regenerator.default.wrap(function _callee1$(_context1) {
446
+ return _regenerator.default.wrap(function (_context1) {
453
447
  while (1) switch (_context1.prev = _context1.next) {
454
448
  case 0:
455
449
  failurePayload = {
456
450
  statusCode: 400
457
451
  };
458
452
  webex.request.mockRejectedValueOnce(failurePayload);
459
- _context1.next = 4;
453
+ _context1.next = 1;
460
454
  return wxCallBackendConnector.getVoicemailSummary();
461
- case 4:
455
+ case 1:
462
456
  response = _context1.sent;
463
457
  responseDetails = {
464
458
  statusCode: 400,
@@ -483,11 +477,11 @@ describe('Voicemail webex call Backend Connector Test case', function () {
483
477
  file: 'WxCallBackendConnector',
484
478
  method: 'getVoicemailSummary'
485
479
  });
486
- expect(errorSpy).toHaveBeenCalledWith(expect.any(Error), expect.objectContaining({
480
+ expect(errorSpy).toHaveBeenCalledWith("Failed to get voicemail summary: ".concat((0, _stringify.default)(failurePayload)), {
487
481
  file: 'WxCallBackendConnector',
488
482
  method: 'getVoicemailSummary'
489
- }));
490
- case 11:
483
+ });
484
+ case 2:
491
485
  case "end":
492
486
  return _context1.stop();
493
487
  }
@@ -495,14 +489,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
495
489
  })));
496
490
  it('verify failure case for the voicemail content when api response is invalid', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
497
491
  var xsiActionsEndpointUrl, response;
498
- return _regenerator.default.wrap(function _callee10$(_context10) {
492
+ return _regenerator.default.wrap(function (_context10) {
499
493
  while (1) switch (_context10.prev = _context10.next) {
500
494
  case 0:
501
495
  webex.request.mockResolvedValueOnce({});
502
496
  xsiActionsEndpointUrl = _voicemailFixture.mockWXCData.body.items[0].xsiActionsEndpoint;
503
- _context10.next = 4;
497
+ _context10.next = 1;
504
498
  return wxCallBackendConnector.getVoicemailContent(messageId);
505
- case 4:
499
+ case 1:
506
500
  response = _context10.sent;
507
501
  expect(response).toStrictEqual(_voicemailFixture.responseDetails422);
508
502
  expect(webex.request).toBeCalledOnceWith({
@@ -514,7 +508,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
514
508
  file: 'WxCallBackendConnector',
515
509
  method: 'getVoicemailContent'
516
510
  });
517
- case 8:
511
+ case 2:
518
512
  case "end":
519
513
  return _context10.stop();
520
514
  }
@@ -533,7 +527,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
533
527
  });
534
528
  it('verify successfully fetching voicemail summary with newMessages and newUrgentMessage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
535
529
  var mockRawRequest, mockVoicemailSummary, voicemailSummary, response, voicemailSummaryResponseInfo, responseDetails;
536
- return _regenerator.default.wrap(function _callee11$(_context11) {
530
+ return _regenerator.default.wrap(function (_context11) {
537
531
  while (1) switch (_context11.prev = _context11.next) {
538
532
  case 0:
539
533
  mockRawRequest = {
@@ -545,9 +539,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
545
539
  };
546
540
  voicemailSummary = mockVoicemailSummary;
547
541
  webex.request.mockResolvedValueOnce(voicemailSummary);
548
- _context11.next = 6;
542
+ _context11.next = 1;
549
543
  return wxCallBackendConnector.getVoicemailSummary();
550
- case 6:
544
+ case 1:
551
545
  response = _context11.sent;
552
546
  voicemailSummaryResponseInfo = {
553
547
  voicemailSummary: {
@@ -576,7 +570,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
576
570
  file: 'WxCallBackendConnector',
577
571
  method: 'getVoicemailSummary'
578
572
  });
579
- case 13:
573
+ case 2:
580
574
  case "end":
581
575
  return _context11.stop();
582
576
  }
@@ -584,7 +578,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
584
578
  })));
585
579
  it('verify successfully fetching voicemail summary with oldMessages and oldUrgentMessage', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
586
580
  var mockRawRequest, mockVoicemailSummary, voicemailSummary, response, voicemailSummaryResponseInfo, responseDetails;
587
- return _regenerator.default.wrap(function _callee12$(_context12) {
581
+ return _regenerator.default.wrap(function (_context12) {
588
582
  while (1) switch (_context12.prev = _context12.next) {
589
583
  case 0:
590
584
  mockRawRequest = {
@@ -596,9 +590,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
596
590
  };
597
591
  voicemailSummary = mockVoicemailSummary;
598
592
  webex.request.mockResolvedValueOnce(voicemailSummary);
599
- _context12.next = 6;
593
+ _context12.next = 1;
600
594
  return wxCallBackendConnector.getVoicemailSummary();
601
- case 6:
595
+ case 1:
602
596
  response = _context12.sent;
603
597
  voicemailSummaryResponseInfo = {
604
598
  voicemailSummary: {
@@ -619,7 +613,15 @@ describe('Voicemail webex call Backend Connector Test case', function () {
619
613
  headers: {}
620
614
  });
621
615
  expect(response).toStrictEqual(responseDetails);
622
- case 11:
616
+ expect(infoSpy).toHaveBeenCalledWith(_constants2.METHOD_START_MESSAGE, {
617
+ file: 'WxCallBackendConnector',
618
+ method: 'getVoicemailSummary'
619
+ });
620
+ expect(logSpy).toHaveBeenCalledWith('Successfully fetched voicemail summary', {
621
+ file: 'WxCallBackendConnector',
622
+ method: 'getVoicemailSummary'
623
+ });
624
+ case 2:
623
625
  case "end":
624
626
  return _context12.stop();
625
627
  }
@@ -627,7 +629,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
627
629
  })));
628
630
  it('verify that PENDING transcription status is passed while transcribing is in progress in the backend', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
629
631
  var pending, mockPendingResponse, mockVoicemailTranscript, voicemailTranscript, response, responseDetails;
630
- return _regenerator.default.wrap(function _callee13$(_context13) {
632
+ return _regenerator.default.wrap(function (_context13) {
631
633
  while (1) switch (_context13.prev = _context13.next) {
632
634
  case 0:
633
635
  pending = 'PENDING';
@@ -639,9 +641,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
639
641
  });
640
642
  voicemailTranscript = mockVoicemailTranscript;
641
643
  webex.request.mockResolvedValueOnce(voicemailTranscript);
642
- _context13.next = 7;
644
+ _context13.next = 1;
643
645
  return wxCallBackendConnector.getVMTranscript('98099432-9d81-4224-bd04-00def73cd262');
644
- case 7:
646
+ case 1:
645
647
  response = _context13.sent;
646
648
  responseDetails = {
647
649
  data: {
@@ -652,7 +654,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
652
654
  };
653
655
  expect(response === null || response === void 0 ? void 0 : response.message).toBe(pending);
654
656
  expect(response).toStrictEqual(responseDetails);
655
- case 11:
657
+ case 2:
656
658
  case "end":
657
659
  return _context13.stop();
658
660
  }
@@ -660,7 +662,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
660
662
  })));
661
663
  it('verify successfully fetching voicemail transcript', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
662
664
  var ready, mockRawRequest, mockVoicemailTranscript, voicemailTranscript, response, voicemailResponseInfo, responseDetails;
663
- return _regenerator.default.wrap(function _callee14$(_context14) {
665
+ return _regenerator.default.wrap(function (_context14) {
664
666
  while (1) switch (_context14.prev = _context14.next) {
665
667
  case 0:
666
668
  ready = 'READY';
@@ -672,9 +674,9 @@ describe('Voicemail webex call Backend Connector Test case', function () {
672
674
  });
673
675
  voicemailTranscript = mockVoicemailTranscript;
674
676
  webex.request.mockResolvedValueOnce(voicemailTranscript);
675
- _context14.next = 7;
677
+ _context14.next = 1;
676
678
  return wxCallBackendConnector.getVMTranscript('98099432-9d81-4224-bd04-00def73cd262');
677
- case 7:
679
+ case 1:
678
680
  response = _context14.sent;
679
681
  voicemailResponseInfo = {
680
682
  voicemailTranscript: 'Hi, uh, testing, voice mail script, so dropping this message to be able to fetch it later.'
@@ -686,7 +688,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
686
688
  };
687
689
  expect(response === null || response === void 0 ? void 0 : response.message).toBe(ready);
688
690
  expect(response).toStrictEqual(responseDetails);
689
- case 12:
691
+ case 2:
690
692
  case "end":
691
693
  return _context14.stop();
692
694
  }
@@ -694,14 +696,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
694
696
  })));
695
697
  it('verify successful voicemail listing in descending order with offset 0 and limit 20', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
696
698
  var voiceMailPayload, response, voicemailResponseInfo, responseDetails;
697
- return _regenerator.default.wrap(function _callee15$(_context15) {
699
+ return _regenerator.default.wrap(function (_context15) {
698
700
  while (1) switch (_context15.prev = _context15.next) {
699
701
  case 0:
700
702
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
701
703
  webex.request.mockResolvedValueOnce(voiceMailPayload);
702
- _context15.next = 4;
704
+ _context15.next = 1;
703
705
  return wxCallBackendConnector.getVoicemailList(0, 20, _types2.SORT.DESC, true);
704
- case 4:
706
+ case 1:
705
707
  response = _context15.sent;
706
708
  voicemailResponseInfo = {
707
709
  voicemailList: _voicemailFixture.getDescVoicemailListJsonWXC.body.VoiceMessagingMessages.messageInfoList.messageInfo
@@ -719,7 +721,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
719
721
  file: 'WxCallBackendConnector',
720
722
  method: 'getVoicemailList'
721
723
  });
722
- case 12:
724
+ case 2:
723
725
  case "end":
724
726
  return _context15.stop();
725
727
  }
@@ -727,14 +729,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
727
729
  })));
728
730
  it('verify successful voicemail listing in ascending order with offset 0 and limit 20', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
729
731
  var voiceMailPayload, response, voicemailResponseInfo, responseDetails;
730
- return _regenerator.default.wrap(function _callee16$(_context16) {
732
+ return _regenerator.default.wrap(function (_context16) {
731
733
  while (1) switch (_context16.prev = _context16.next) {
732
734
  case 0:
733
735
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
734
736
  webex.request.mockResolvedValueOnce(voiceMailPayload);
735
- _context16.next = 4;
737
+ _context16.next = 1;
736
738
  return wxCallBackendConnector.getVoicemailList(0, 20, _types2.SORT.ASC, true);
737
- case 4:
739
+ case 1:
738
740
  response = _context16.sent;
739
741
  voicemailResponseInfo = {
740
742
  voicemailList: _voicemailFixture.getAscVoicemailListJsonWXC.body.VoiceMessagingMessages.messageInfoList.messageInfo
@@ -752,7 +754,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
752
754
  file: 'WxCallBackendConnector',
753
755
  method: 'getVoicemailList'
754
756
  });
755
- case 12:
757
+ case 2:
756
758
  case "end":
757
759
  return _context16.stop();
758
760
  }
@@ -760,14 +762,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
760
762
  })));
761
763
  it('verify successful voicemail listing in descending order with offset 0 and limit 2 with incorrect SORT param', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee17() {
762
764
  var voiceMailPayload, response, voicemailResponseInfo, responseDetails;
763
- return _regenerator.default.wrap(function _callee17$(_context17) {
765
+ return _regenerator.default.wrap(function (_context17) {
764
766
  while (1) switch (_context17.prev = _context17.next) {
765
767
  case 0:
766
768
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
767
769
  webex.request.mockResolvedValueOnce(voiceMailPayload);
768
- _context17.next = 4;
770
+ _context17.next = 1;
769
771
  return wxCallBackendConnector.getVoicemailList(0, 2, 'abcd', true);
770
- case 4:
772
+ case 1:
771
773
  response = _context17.sent;
772
774
  voicemailResponseInfo = {
773
775
  voicemailList: _voicemailFixture.getDescVoicemailListJsonWXC.body.VoiceMessagingMessages.messageInfoList.messageInfo.slice(0, 2)
@@ -785,7 +787,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
785
787
  file: 'WxCallBackendConnector',
786
788
  method: 'getVoicemailList'
787
789
  });
788
- case 12:
790
+ case 2:
789
791
  case "end":
790
792
  return _context17.stop();
791
793
  }
@@ -793,14 +795,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
793
795
  })));
794
796
  it('verify successful voicemail listing in ascending order with offset 0 and limit 4', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee18() {
795
797
  var voiceMailPayload, response, voicemailResponseInfo, responseDetails;
796
- return _regenerator.default.wrap(function _callee18$(_context18) {
798
+ return _regenerator.default.wrap(function (_context18) {
797
799
  while (1) switch (_context18.prev = _context18.next) {
798
800
  case 0:
799
801
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
800
802
  webex.request.mockResolvedValueOnce(voiceMailPayload);
801
- _context18.next = 4;
803
+ _context18.next = 1;
802
804
  return wxCallBackendConnector.getVoicemailList(0, 4, _types2.SORT.ASC, true);
803
- case 4:
805
+ case 1:
804
806
  response = _context18.sent;
805
807
  voicemailResponseInfo = {
806
808
  voicemailList: _voicemailFixture.getAscVoicemailListJsonWXC.body.VoiceMessagingMessages.messageInfoList.messageInfo.slice(0, 4)
@@ -818,7 +820,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
818
820
  file: 'WxCallBackendConnector',
819
821
  method: 'getVoicemailList'
820
822
  });
821
- case 12:
823
+ case 2:
822
824
  case "end":
823
825
  return _context18.stop();
824
826
  }
@@ -826,13 +828,13 @@ describe('Voicemail webex call Backend Connector Test case', function () {
826
828
  })));
827
829
  it('verify empty voicemail list data', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee19() {
828
830
  var response, voicemailResponseInfo, responseDetails;
829
- return _regenerator.default.wrap(function _callee19$(_context19) {
831
+ return _regenerator.default.wrap(function (_context19) {
830
832
  while (1) switch (_context19.prev = _context19.next) {
831
833
  case 0:
832
834
  webex.request.mockResolvedValueOnce(_voicemailFixture.getEmptyVoicemailListJsonWxC);
833
- _context19.next = 3;
835
+ _context19.next = 1;
834
836
  return wxCallBackendConnector.getVoicemailList(0, 20, _types2.SORT.DESC, true);
835
- case 3:
837
+ case 1:
836
838
  response = _context19.sent;
837
839
  voicemailResponseInfo = {
838
840
  voicemailList: []
@@ -849,7 +851,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
849
851
  file: 'WxCallBackendConnector',
850
852
  method: 'getVoicemailList'
851
853
  });
852
- case 10:
854
+ case 2:
853
855
  case "end":
854
856
  return _context19.stop();
855
857
  }
@@ -857,13 +859,13 @@ describe('Voicemail webex call Backend Connector Test case', function () {
857
859
  })));
858
860
  it('verify empty voicemail list data when response data is in invalid format', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee20() {
859
861
  var response, voicemailResponseInfo, responseDetails;
860
- return _regenerator.default.wrap(function _callee20$(_context20) {
862
+ return _regenerator.default.wrap(function (_context20) {
861
863
  while (1) switch (_context20.prev = _context20.next) {
862
864
  case 0:
863
865
  webex.request.mockResolvedValueOnce(_voicemailFixture.getInvalidVoicemailListJsonWxC);
864
- _context20.next = 3;
866
+ _context20.next = 1;
865
867
  return wxCallBackendConnector.getVoicemailList(0, 20, _types2.SORT.DESC, true);
866
- case 3:
868
+ case 1:
867
869
  response = _context20.sent;
868
870
  voicemailResponseInfo = {
869
871
  voicemailList: [{}]
@@ -880,7 +882,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
880
882
  file: 'WxCallBackendConnector',
881
883
  method: 'getVoicemailList'
882
884
  });
883
- case 10:
885
+ case 2:
884
886
  case "end":
885
887
  return _context20.stop();
886
888
  }
@@ -888,16 +890,16 @@ describe('Voicemail webex call Backend Connector Test case', function () {
888
890
  })));
889
891
  it('verify successful fetching of voicemail list without refresh', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee21() {
890
892
  var voiceMailPayload, vmEncodedList, response, voicemailResponseInfo, responseDetails;
891
- return _regenerator.default.wrap(function _callee21$(_context21) {
893
+ return _regenerator.default.wrap(function (_context21) {
892
894
  while (1) switch (_context21.prev = _context21.next) {
893
895
  case 0:
894
896
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
895
897
  webex.request.mockResolvedValueOnce(voiceMailPayload);
896
898
  vmEncodedList = Buffer.from((0, _stringify.default)(_voicemailFixture.getAscVoicemailListJsonWXC.body.VoiceMessagingMessages.messageInfoList.messageInfo), 'utf8').toString('base64');
897
899
  sessionStorage.setItem(CONTEXT, vmEncodedList.toString());
898
- _context21.next = 6;
900
+ _context21.next = 1;
899
901
  return wxCallBackendConnector.getVoicemailList(0, 4, _types2.SORT.ASC, false);
900
- case 6:
902
+ case 1:
901
903
  response = _context21.sent;
902
904
  voicemailResponseInfo = {
903
905
  voicemailList: _voicemailFixture.getAscVoicemailListJsonWXC.body.VoiceMessagingMessages.messageInfoList.messageInfo.slice(0, 4)
@@ -916,7 +918,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
916
918
  method: 'getVoicemailList'
917
919
  });
918
920
  sessionStorage.removeItem(CONTEXT);
919
- case 15:
921
+ case 2:
920
922
  case "end":
921
923
  return _context21.stop();
922
924
  }
@@ -924,17 +926,25 @@ describe('Voicemail webex call Backend Connector Test case', function () {
924
926
  })));
925
927
  it('verify successful voicemailMarkAsRead', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee22() {
926
928
  var voiceMailPayload, response;
927
- return _regenerator.default.wrap(function _callee22$(_context22) {
929
+ return _regenerator.default.wrap(function (_context22) {
928
930
  while (1) switch (_context22.prev = _context22.next) {
929
931
  case 0:
930
932
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
931
933
  webex.request.mockResolvedValueOnce(voiceMailPayload);
932
- _context22.next = 4;
934
+ _context22.next = 1;
933
935
  return wxCallBackendConnector.voicemailMarkAsRead(messageId.$);
934
- case 4:
936
+ case 1:
935
937
  response = _context22.sent;
936
938
  expect(response).toStrictEqual(EMPTY_SUCCESS_RESPONSE);
937
- case 6:
939
+ expect(infoSpy).toHaveBeenCalledWith("".concat(_constants2.METHOD_START_MESSAGE, " with messageId: ").concat(messageId.$), {
940
+ file: 'WxCallBackendConnector',
941
+ method: 'voicemailMarkAsRead'
942
+ });
943
+ expect(logSpy).toHaveBeenCalledWith('Successfully marked voicemail as read', {
944
+ file: 'WxCallBackendConnector',
945
+ method: 'voicemailMarkAsRead'
946
+ });
947
+ case 2:
938
948
  case "end":
939
949
  return _context22.stop();
940
950
  }
@@ -942,17 +952,25 @@ describe('Voicemail webex call Backend Connector Test case', function () {
942
952
  })));
943
953
  it('verify successful voicemailMarkAsUnread', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee23() {
944
954
  var voiceMailPayload, response;
945
- return _regenerator.default.wrap(function _callee23$(_context23) {
955
+ return _regenerator.default.wrap(function (_context23) {
946
956
  while (1) switch (_context23.prev = _context23.next) {
947
957
  case 0:
948
958
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
949
959
  webex.request.mockResolvedValueOnce(voiceMailPayload);
950
- _context23.next = 4;
960
+ _context23.next = 1;
951
961
  return wxCallBackendConnector.voicemailMarkAsUnread(messageId.$);
952
- case 4:
962
+ case 1:
953
963
  response = _context23.sent;
954
964
  expect(response).toStrictEqual(EMPTY_SUCCESS_RESPONSE);
955
- case 6:
965
+ expect(infoSpy).toHaveBeenCalledWith("".concat(_constants2.METHOD_START_MESSAGE, " with messageId: ").concat(messageId.$), {
966
+ file: 'WxCallBackendConnector',
967
+ method: 'voicemailMarkAsUnread'
968
+ });
969
+ expect(logSpy).toHaveBeenCalledWith('Successfully marked voicemail as unread', {
970
+ file: 'WxCallBackendConnector',
971
+ method: 'voicemailMarkAsUnread'
972
+ });
973
+ case 2:
956
974
  case "end":
957
975
  return _context23.stop();
958
976
  }
@@ -960,17 +978,25 @@ describe('Voicemail webex call Backend Connector Test case', function () {
960
978
  })));
961
979
  it('verify successful deleteVoicemail', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee24() {
962
980
  var voiceMailPayload, response;
963
- return _regenerator.default.wrap(function _callee24$(_context24) {
981
+ return _regenerator.default.wrap(function (_context24) {
964
982
  while (1) switch (_context24.prev = _context24.next) {
965
983
  case 0:
966
984
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
967
985
  webex.request.mockResolvedValueOnce(voiceMailPayload);
968
- _context24.next = 4;
986
+ _context24.next = 1;
969
987
  return wxCallBackendConnector.deleteVoicemail(messageId.$);
970
- case 4:
988
+ case 1:
971
989
  response = _context24.sent;
972
990
  expect(response).toStrictEqual(EMPTY_SUCCESS_RESPONSE);
973
- case 6:
991
+ expect(infoSpy).toHaveBeenCalledWith("".concat(_constants2.METHOD_START_MESSAGE, " with messageId: ").concat(messageId.$), {
992
+ file: 'WxCallBackendConnector',
993
+ method: 'deleteVoicemail'
994
+ });
995
+ expect(logSpy).toHaveBeenCalledWith('Successfully deleted voicemail', {
996
+ file: 'WxCallBackendConnector',
997
+ method: 'deleteVoicemail'
998
+ });
999
+ case 2:
974
1000
  case "end":
975
1001
  return _context24.stop();
976
1002
  }
@@ -978,26 +1004,26 @@ describe('Voicemail webex call Backend Connector Test case', function () {
978
1004
  })));
979
1005
  it('verify resolveContact', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee25() {
980
1006
  var voiceMailPayload, samplePeopleListResponse, displayInfo;
981
- return _regenerator.default.wrap(function _callee25$(_context25) {
1007
+ return _regenerator.default.wrap(function (_context25) {
982
1008
  while (1) switch (_context25.prev = _context25.next) {
983
1009
  case 0:
984
1010
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
985
1011
  webex.request.mockResolvedValueOnce(voiceMailPayload);
986
1012
  samplePeopleListResponse = (0, _testUtil.getSamplePeopleListResponse)();
987
1013
  webex.people.list.mockResolvedValue(samplePeopleListResponse);
988
- _context25.next = 6;
1014
+ _context25.next = 1;
989
1015
  return wxCallBackendConnector.resolveContact({
990
1016
  name: {
991
1017
  $: 'Name'
992
1018
  }
993
1019
  });
994
- case 6:
1020
+ case 1:
995
1021
  displayInfo = _context25.sent;
996
1022
  expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.id).toStrictEqual(Buffer.from(samplePeopleListResponse.items[0].id, 'base64').toString('binary').split('/').pop());
997
1023
  expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.name).toStrictEqual(samplePeopleListResponse.items[0].displayName);
998
1024
  expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.num).toStrictEqual(samplePeopleListResponse.items[0].phoneNumbers[0].value);
999
1025
  expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.avatarSrc).toStrictEqual(samplePeopleListResponse.items[0].avatar);
1000
- case 11:
1026
+ case 2:
1001
1027
  case "end":
1002
1028
  return _context25.stop();
1003
1029
  }
@@ -1008,7 +1034,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1008
1034
  webex.config.fedramp = true;
1009
1035
  var MOCK_FEDRAMP_URL = 'https://mock-fedramp-url/com.broadsoft.xsi-actions';
1010
1036
  beforeAll(/*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee26() {
1011
- return _regenerator.default.wrap(function _callee26$(_context26) {
1037
+ return _regenerator.default.wrap(function (_context26) {
1012
1038
  while (1) switch (_context26.prev = _context26.next) {
1013
1039
  case 0:
1014
1040
  webex.credentials.getUserToken.mockResolvedValue('mockAuthToken');
@@ -1017,12 +1043,12 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1017
1043
  level: _types.LOGGER.INFO
1018
1044
  });
1019
1045
  jest.spyOn(webex, 'request');
1020
- _context26.next = 6;
1046
+ _context26.next = 1;
1021
1047
  return wxCallBackendConnector.init();
1022
- case 6:
1048
+ case 1:
1023
1049
  wxCallBackendConnector['context'] = CONTEXT;
1024
1050
  wxCallBackendConnector.getSDKConnector();
1025
- case 8:
1051
+ case 2:
1026
1052
  case "end":
1027
1053
  return _context26.stop();
1028
1054
  }
@@ -1035,14 +1061,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1035
1061
  });
1036
1062
  it('getVoicemailList: adds the authorization header when in fedramp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee27() {
1037
1063
  var voiceMailPayload;
1038
- return _regenerator.default.wrap(function _callee27$(_context27) {
1064
+ return _regenerator.default.wrap(function (_context27) {
1039
1065
  while (1) switch (_context27.prev = _context27.next) {
1040
1066
  case 0:
1041
1067
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
1042
1068
  webex.request.mockResolvedValueOnce(voiceMailPayload);
1043
- _context27.next = 4;
1069
+ _context27.next = 1;
1044
1070
  return wxCallBackendConnector.getVoicemailList(0, 4, _types2.SORT.ASC, true);
1045
- case 4:
1071
+ case 1:
1046
1072
  expect(webex.request).toBeCalledOnceWith({
1047
1073
  method: _types2.HTTP_METHODS.GET,
1048
1074
  uri: "".concat(MOCK_FEDRAMP_URL, "/v2.0/user/").concat(_voicemailFixture.userId, "/VoiceMessagingMessages?format=json"),
@@ -1050,7 +1076,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1050
1076
  Authorization: 'mockAuthToken'
1051
1077
  }
1052
1078
  });
1053
- case 5:
1079
+ case 2:
1054
1080
  case "end":
1055
1081
  return _context27.stop();
1056
1082
  }
@@ -1058,14 +1084,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1058
1084
  })));
1059
1085
  it('getVoicemailContent: adds the authorization header when in fedramp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee28() {
1060
1086
  var voiceMailPayload;
1061
- return _regenerator.default.wrap(function _callee28$(_context28) {
1087
+ return _regenerator.default.wrap(function (_context28) {
1062
1088
  while (1) switch (_context28.prev = _context28.next) {
1063
1089
  case 0:
1064
1090
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
1065
1091
  webex.request.mockResolvedValueOnce(voiceMailPayload);
1066
- _context28.next = 4;
1092
+ _context28.next = 1;
1067
1093
  return wxCallBackendConnector.getVoicemailContent(messageId.$);
1068
- case 4:
1094
+ case 1:
1069
1095
  expect(webex.request).toBeCalledOnceWith({
1070
1096
  method: _types2.HTTP_METHODS.GET,
1071
1097
  uri: "".concat(MOCK_FEDRAMP_URL).concat(_voicemailFixture.braodworksUserMessageInfo, "/").concat(_voicemailFixture.broadworksUserMessageId),
@@ -1073,7 +1099,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1073
1099
  Authorization: 'mockAuthToken'
1074
1100
  }
1075
1101
  });
1076
- case 5:
1102
+ case 2:
1077
1103
  case "end":
1078
1104
  return _context28.stop();
1079
1105
  }
@@ -1081,14 +1107,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1081
1107
  })));
1082
1108
  it('getVoicemailSummary: adds the authorization header when in fedramp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee29() {
1083
1109
  var voiceMailPayload;
1084
- return _regenerator.default.wrap(function _callee29$(_context29) {
1110
+ return _regenerator.default.wrap(function (_context29) {
1085
1111
  while (1) switch (_context29.prev = _context29.next) {
1086
1112
  case 0:
1087
1113
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
1088
1114
  webex.request.mockResolvedValueOnce(voiceMailPayload);
1089
- _context29.next = 4;
1115
+ _context29.next = 1;
1090
1116
  return wxCallBackendConnector.getVoicemailSummary();
1091
- case 4:
1117
+ case 1:
1092
1118
  expect(webex.request).toBeCalledOnceWith({
1093
1119
  method: _types2.HTTP_METHODS.GET,
1094
1120
  uri: "".concat(MOCK_FEDRAMP_URL, "/v2.0/user/").concat(_voicemailFixture.userId, "/calls/MessageSummary"),
@@ -1096,7 +1122,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1096
1122
  Authorization: 'mockAuthToken'
1097
1123
  }
1098
1124
  });
1099
- case 5:
1125
+ case 2:
1100
1126
  case "end":
1101
1127
  return _context29.stop();
1102
1128
  }
@@ -1104,14 +1130,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1104
1130
  })));
1105
1131
  it('voicemailMarkAsRead: adds the authorization header when in fedramp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee30() {
1106
1132
  var voiceMailPayload;
1107
- return _regenerator.default.wrap(function _callee30$(_context30) {
1133
+ return _regenerator.default.wrap(function (_context30) {
1108
1134
  while (1) switch (_context30.prev = _context30.next) {
1109
1135
  case 0:
1110
1136
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
1111
1137
  webex.request.mockResolvedValueOnce(voiceMailPayload);
1112
- _context30.next = 4;
1138
+ _context30.next = 1;
1113
1139
  return wxCallBackendConnector.voicemailMarkAsRead(messageId.$);
1114
- case 4:
1140
+ case 1:
1115
1141
  expect(webex.request).toBeCalledOnceWith({
1116
1142
  method: _types2.HTTP_METHODS.PUT,
1117
1143
  uri: "".concat(MOCK_FEDRAMP_URL).concat(messageId.$, "/MarkAsRead"),
@@ -1119,7 +1145,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1119
1145
  Authorization: 'mockAuthToken'
1120
1146
  }
1121
1147
  });
1122
- case 5:
1148
+ case 2:
1123
1149
  case "end":
1124
1150
  return _context30.stop();
1125
1151
  }
@@ -1127,14 +1153,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1127
1153
  })));
1128
1154
  it('voicemailMarkAsUnread: adds the authorization header when in fedramp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee31() {
1129
1155
  var voiceMailPayload;
1130
- return _regenerator.default.wrap(function _callee31$(_context31) {
1156
+ return _regenerator.default.wrap(function (_context31) {
1131
1157
  while (1) switch (_context31.prev = _context31.next) {
1132
1158
  case 0:
1133
1159
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
1134
1160
  webex.request.mockResolvedValueOnce(voiceMailPayload);
1135
- _context31.next = 4;
1161
+ _context31.next = 1;
1136
1162
  return wxCallBackendConnector.voicemailMarkAsUnread(messageId.$);
1137
- case 4:
1163
+ case 1:
1138
1164
  expect(webex.request).toBeCalledOnceWith({
1139
1165
  method: _types2.HTTP_METHODS.PUT,
1140
1166
  uri: "".concat(MOCK_FEDRAMP_URL).concat(messageId.$, "/MarkAsUnread"),
@@ -1142,7 +1168,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1142
1168
  Authorization: 'mockAuthToken'
1143
1169
  }
1144
1170
  });
1145
- case 5:
1171
+ case 2:
1146
1172
  case "end":
1147
1173
  return _context31.stop();
1148
1174
  }
@@ -1150,14 +1176,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1150
1176
  })));
1151
1177
  it('deleteVoicemail: adds the authorization header when in fedramp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee32() {
1152
1178
  var voiceMailPayload;
1153
- return _regenerator.default.wrap(function _callee32$(_context32) {
1179
+ return _regenerator.default.wrap(function (_context32) {
1154
1180
  while (1) switch (_context32.prev = _context32.next) {
1155
1181
  case 0:
1156
1182
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
1157
1183
  webex.request.mockResolvedValueOnce(voiceMailPayload);
1158
- _context32.next = 4;
1184
+ _context32.next = 1;
1159
1185
  return wxCallBackendConnector.deleteVoicemail(messageId.$);
1160
- case 4:
1186
+ case 1:
1161
1187
  expect(webex.request).toBeCalledOnceWith({
1162
1188
  method: _types2.HTTP_METHODS.DELETE,
1163
1189
  uri: "".concat(MOCK_FEDRAMP_URL).concat(messageId.$),
@@ -1165,7 +1191,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1165
1191
  Authorization: 'mockAuthToken'
1166
1192
  }
1167
1193
  });
1168
- case 5:
1194
+ case 2:
1169
1195
  case "end":
1170
1196
  return _context32.stop();
1171
1197
  }
@@ -1173,14 +1199,14 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1173
1199
  })));
1174
1200
  it('getVMTranscript: adds the authorization header when in fedramp', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee33() {
1175
1201
  var voiceMailPayload;
1176
- return _regenerator.default.wrap(function _callee33$(_context33) {
1202
+ return _regenerator.default.wrap(function (_context33) {
1177
1203
  while (1) switch (_context33.prev = _context33.next) {
1178
1204
  case 0:
1179
1205
  voiceMailPayload = _voicemailFixture.getVoicemailListJsonWXC;
1180
1206
  webex.request.mockResolvedValueOnce(voiceMailPayload);
1181
- _context33.next = 4;
1207
+ _context33.next = 1;
1182
1208
  return wxCallBackendConnector.getVMTranscript(messageId.$);
1183
- case 4:
1209
+ case 1:
1184
1210
  expect(webex.request).toBeCalledOnceWith({
1185
1211
  method: _types2.HTTP_METHODS.GET,
1186
1212
  uri: "".concat(MOCK_FEDRAMP_URL).concat(messageId.$, "/transcript"),
@@ -1188,7 +1214,7 @@ describe('Voicemail webex call Backend Connector Test case', function () {
1188
1214
  Authorization: 'mockAuthToken'
1189
1215
  }
1190
1216
  });
1191
- case 5:
1217
+ case 2:
1192
1218
  case "end":
1193
1219
  return _context33.stop();
1194
1220
  }