@webex/calling 3.9.0 → 3.10.0-next.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 (193) hide show
  1. package/dist/CallHistory/CallHistory.js +43 -43
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +157 -152
  4. package/dist/CallHistory/CallHistory.test.js.map +1 -1
  5. package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
  6. package/dist/CallHistory/constants.js.map +1 -1
  7. package/dist/CallHistory/types.js.map +1 -1
  8. package/dist/CallSettings/CallSettings.js +8 -8
  9. package/dist/CallSettings/CallSettings.js.map +1 -1
  10. package/dist/CallSettings/CallSettings.test.js +1 -1
  11. package/dist/CallSettings/CallSettings.test.js.map +1 -1
  12. package/dist/CallSettings/UcmBackendConnector.js +12 -11
  13. package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
  14. package/dist/CallSettings/UcmBackendConnector.test.js +11 -11
  15. package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
  16. package/dist/CallSettings/WxCallBackendConnector.js +53 -52
  17. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  18. package/dist/CallSettings/WxCallBackendConnector.test.js +112 -110
  19. package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
  20. package/dist/CallSettings/constants.js.map +1 -1
  21. package/dist/CallSettings/testFixtures.js.map +1 -1
  22. package/dist/CallSettings/types.js.map +1 -1
  23. package/dist/CallingClient/CallingClient.js +458 -203
  24. package/dist/CallingClient/CallingClient.js.map +1 -1
  25. package/dist/CallingClient/CallingClient.test.js +458 -315
  26. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  27. package/dist/CallingClient/callRecordFixtures.js.map +1 -1
  28. package/dist/CallingClient/calling/CallerId/index.js +2 -2
  29. package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
  30. package/dist/CallingClient/calling/CallerId/index.test.js +8 -7
  31. package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
  32. package/dist/CallingClient/calling/CallerId/types.js.map +1 -1
  33. package/dist/CallingClient/calling/call.js +405 -372
  34. package/dist/CallingClient/calling/call.js.map +1 -1
  35. package/dist/CallingClient/calling/call.test.js +411 -410
  36. package/dist/CallingClient/calling/call.test.js.map +1 -1
  37. package/dist/CallingClient/calling/callManager.js +3 -4
  38. package/dist/CallingClient/calling/callManager.js.map +1 -1
  39. package/dist/CallingClient/calling/callManager.test.js +68 -69
  40. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  41. package/dist/CallingClient/calling/index.js.map +1 -1
  42. package/dist/CallingClient/calling/types.js.map +1 -1
  43. package/dist/CallingClient/callingClientFixtures.js.map +1 -1
  44. package/dist/CallingClient/constants.js +9 -6
  45. package/dist/CallingClient/constants.js.map +1 -1
  46. package/dist/CallingClient/line/index.js +10 -11
  47. package/dist/CallingClient/line/index.js.map +1 -1
  48. package/dist/CallingClient/line/line.test.js +10 -9
  49. package/dist/CallingClient/line/line.test.js.map +1 -1
  50. package/dist/CallingClient/line/types.js.map +1 -1
  51. package/dist/CallingClient/registration/index.js.map +1 -1
  52. package/dist/CallingClient/registration/register.js +285 -205
  53. package/dist/CallingClient/registration/register.js.map +1 -1
  54. package/dist/CallingClient/registration/register.test.js +251 -180
  55. package/dist/CallingClient/registration/register.test.js.map +1 -1
  56. package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
  57. package/dist/CallingClient/registration/types.js.map +1 -1
  58. package/dist/CallingClient/registration/webWorker.js +25 -10
  59. package/dist/CallingClient/registration/webWorker.js.map +1 -1
  60. package/dist/CallingClient/registration/webWorker.test.js +85 -38
  61. package/dist/CallingClient/registration/webWorker.test.js.map +1 -1
  62. package/dist/CallingClient/registration/webWorkerStr.js +1 -1
  63. package/dist/CallingClient/registration/webWorkerStr.js.map +1 -1
  64. package/dist/CallingClient/types.js.map +1 -1
  65. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js +142 -0
  66. package/dist/CallingClient/windowsChromiumIceWarmupUtils.js.map +1 -0
  67. package/dist/Contacts/ContactsClient.js +244 -247
  68. package/dist/Contacts/ContactsClient.js.map +1 -1
  69. package/dist/Contacts/ContactsClient.test.js +93 -93
  70. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  71. package/dist/Contacts/constants.js +2 -2
  72. package/dist/Contacts/constants.js.map +1 -1
  73. package/dist/Contacts/contactFixtures.js.map +1 -1
  74. package/dist/Contacts/types.js.map +1 -1
  75. package/dist/Errors/catalog/CallError.js +2 -2
  76. package/dist/Errors/catalog/CallError.js.map +1 -1
  77. package/dist/Errors/catalog/CallingDeviceError.js +2 -2
  78. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  79. package/dist/Errors/catalog/ExtendedError.js +3 -3
  80. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  81. package/dist/Errors/catalog/LineError.js +2 -2
  82. package/dist/Errors/catalog/LineError.js.map +1 -1
  83. package/dist/Errors/index.js.map +1 -1
  84. package/dist/Errors/types.js.map +1 -1
  85. package/dist/Events/impl/index.js +4 -3
  86. package/dist/Events/impl/index.js.map +1 -1
  87. package/dist/Events/types.js.map +1 -1
  88. package/dist/Logger/index.js +3 -3
  89. package/dist/Logger/index.js.map +1 -1
  90. package/dist/Logger/index.test.js +1 -1
  91. package/dist/Logger/index.test.js.map +1 -1
  92. package/dist/Logger/types.js.map +1 -1
  93. package/dist/Metrics/index.js +221 -104
  94. package/dist/Metrics/index.js.map +1 -1
  95. package/dist/Metrics/index.test.js +112 -23
  96. package/dist/Metrics/index.test.js.map +1 -1
  97. package/dist/Metrics/types.js +15 -1
  98. package/dist/Metrics/types.js.map +1 -1
  99. package/dist/SDKConnector/index.js +0 -1
  100. package/dist/SDKConnector/index.js.map +1 -1
  101. package/dist/SDKConnector/index.test.js.map +1 -1
  102. package/dist/SDKConnector/types.js.map +1 -1
  103. package/dist/SDKConnector/utils.js.map +1 -1
  104. package/dist/SDKConnector/utils.test.js.map +1 -1
  105. package/dist/Voicemail/BroadworksBackendConnector.js +55 -61
  106. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  107. package/dist/Voicemail/BroadworksBackendConnector.test.js +129 -122
  108. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  109. package/dist/Voicemail/UcmBackendConnector.js +53 -50
  110. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  111. package/dist/Voicemail/UcmBackendConnector.test.js +73 -74
  112. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  113. package/dist/Voicemail/Voicemail.js +89 -113
  114. package/dist/Voicemail/Voicemail.js.map +1 -1
  115. package/dist/Voicemail/Voicemail.test.js +2 -2
  116. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  117. package/dist/Voicemail/WxCallBackendConnector.js +87 -92
  118. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  119. package/dist/Voicemail/WxCallBackendConnector.test.js +228 -203
  120. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  121. package/dist/Voicemail/constants.js.map +1 -1
  122. package/dist/Voicemail/types.js.map +1 -1
  123. package/dist/Voicemail/voicemailFixture.js.map +1 -1
  124. package/dist/api.js.map +1 -1
  125. package/dist/common/Utils.js +85 -66
  126. package/dist/common/Utils.js.map +1 -1
  127. package/dist/common/Utils.test.js +113 -123
  128. package/dist/common/Utils.test.js.map +1 -1
  129. package/dist/common/constants.js.map +1 -1
  130. package/dist/common/index.js.map +1 -1
  131. package/dist/common/testUtil.js +1 -1
  132. package/dist/common/testUtil.js.map +1 -1
  133. package/dist/common/types.js.map +1 -1
  134. package/dist/index.js +5 -5
  135. package/dist/index.js.map +1 -1
  136. package/dist/module/CallHistory/CallHistory.js +17 -8
  137. package/dist/module/CallSettings/UcmBackendConnector.js +2 -2
  138. package/dist/module/CallSettings/WxCallBackendConnector.js +14 -14
  139. package/dist/module/CallingClient/CallingClient.js +176 -36
  140. package/dist/module/CallingClient/calling/call.js +91 -61
  141. package/dist/module/CallingClient/constants.js +8 -4
  142. package/dist/module/CallingClient/line/index.js +3 -3
  143. package/dist/module/CallingClient/registration/register.js +37 -13
  144. package/dist/module/CallingClient/registration/webWorker.js +17 -3
  145. package/dist/module/CallingClient/registration/webWorkerStr.js +19 -3
  146. package/dist/module/CallingClient/windowsChromiumIceWarmupUtils.js +59 -0
  147. package/dist/module/Contacts/ContactsClient.js +33 -37
  148. package/dist/module/Contacts/constants.js +1 -1
  149. package/dist/module/Events/impl/index.js +2 -1
  150. package/dist/module/Logger/index.js +2 -2
  151. package/dist/module/Metrics/index.js +142 -55
  152. package/dist/module/Metrics/types.js +14 -0
  153. package/dist/module/Voicemail/BroadworksBackendConnector.js +10 -17
  154. package/dist/module/Voicemail/UcmBackendConnector.js +11 -10
  155. package/dist/module/Voicemail/Voicemail.js +42 -68
  156. package/dist/module/Voicemail/WxCallBackendConnector.js +22 -28
  157. package/dist/module/common/Utils.js +29 -12
  158. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  159. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  160. package/dist/types/CallSettings/WxCallBackendConnector.d.ts.map +1 -1
  161. package/dist/types/CallingClient/CallingClient.d.ts +12 -1
  162. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  163. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  164. package/dist/types/CallingClient/calling/types.d.ts +2 -1
  165. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  166. package/dist/types/CallingClient/constants.d.ts +8 -4
  167. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  168. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  169. package/dist/types/CallingClient/registration/register.d.ts +1 -0
  170. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  171. package/dist/types/CallingClient/registration/webWorker.d.ts +2 -1
  172. package/dist/types/CallingClient/registration/webWorker.d.ts.map +1 -1
  173. package/dist/types/CallingClient/registration/webWorkerStr.d.ts +1 -1
  174. package/dist/types/CallingClient/registration/webWorkerStr.d.ts.map +1 -1
  175. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts +5 -0
  176. package/dist/types/CallingClient/windowsChromiumIceWarmupUtils.d.ts.map +1 -0
  177. package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
  178. package/dist/types/Contacts/constants.d.ts +1 -1
  179. package/dist/types/Contacts/constants.d.ts.map +1 -1
  180. package/dist/types/Events/impl/index.d.ts.map +1 -1
  181. package/dist/types/Logger/index.d.ts +1 -2
  182. package/dist/types/Logger/index.d.ts.map +1 -1
  183. package/dist/types/Metrics/index.d.ts.map +1 -1
  184. package/dist/types/Metrics/types.d.ts +18 -3
  185. package/dist/types/Metrics/types.d.ts.map +1 -1
  186. package/dist/types/Voicemail/BroadworksBackendConnector.d.ts.map +1 -1
  187. package/dist/types/Voicemail/UcmBackendConnector.d.ts.map +1 -1
  188. package/dist/types/Voicemail/Voicemail.d.ts.map +1 -1
  189. package/dist/types/Voicemail/WxCallBackendConnector.d.ts.map +1 -1
  190. package/dist/types/common/Utils.d.ts.map +1 -1
  191. package/dist/types/common/types.d.ts +1 -0
  192. package/dist/types/common/types.d.ts.map +1 -1
  193. package/package.json +10 -8
@@ -5,14 +5,14 @@ var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/obje
5
5
  var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
6
6
  var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
7
7
  var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
8
- var _Object$defineProperty2 = require("@babel/runtime-corejs2/core-js/object/define-property");
8
+ var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
9
9
  var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
10
10
  var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs2/regenerator"));
11
11
  var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/asyncToGenerator"));
12
12
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
13
- var _defineProperty3 = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/define-property"));
14
13
  var _assign = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/object/assign"));
15
14
  var _stringify = _interopRequireDefault(require("@babel/runtime-corejs2/core-js/json/stringify"));
15
+ var _uuid = require("uuid");
16
16
  var _calling = require("../CallingClient/calling");
17
17
  var _Errors = require("../Errors");
18
18
  var _testUtil = require("./testUtil");
@@ -26,16 +26,14 @@ var _constants2 = require("./constants");
26
26
  var _types3 = require("../Events/types");
27
27
  var _SDKConnector = _interopRequireDefault(require("../SDKConnector"));
28
28
  function ownKeys(e, r) { var t = _Object$keys(e); if (_Object$getOwnPropertySymbols) { var o = _Object$getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return _Object$getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
29
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty2(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable no-underscore-dangle */
30
- // Mock crypto for Node.js test environment
31
- (0, _defineProperty3.default)(global, 'crypto', {
32
- value: {
33
- randomUUID: jest.fn(function () {
34
- return 'mocked-uuid-12345';
35
- })
36
- },
37
- writable: true
29
+ function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(e, _Object$getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { _Object$defineProperty(e, r, _Object$getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable no-underscore-dangle */
30
+ // Mock uuid
31
+ jest.mock('uuid', function () {
32
+ return {
33
+ v4: jest.fn()
34
+ };
38
35
  });
36
+ var mockUuid = _uuid.v4;
39
37
  var mockSubmitRegistrationMetric = jest.fn();
40
38
  var mockEmitterCb = jest.fn();
41
39
  var mockRestoreCb = jest.fn();
@@ -289,7 +287,7 @@ describe('CallingClient Error Tests', function () {
289
287
  beforeEach(function () {
290
288
  jest.clearAllMocks();
291
289
  });
292
- it('verify 401 error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
290
+ it('verify 401 error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
293
291
  var statusCode, message, errorType, finalError, webexPayload, mockErrorEvent, callClientError, result;
294
292
  return _regenerator.default.wrap(function _callee$(_context) {
295
293
  while (1) switch (_context.prev = _context.next) {
@@ -331,7 +329,7 @@ describe('CallingClient Error Tests', function () {
331
329
  }
332
330
  }, _callee);
333
331
  })));
334
- it('verify 500 error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
332
+ it('verify 500 error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee2() {
335
333
  var statusCode, message, errorType, finalError, webexPayload, mockErrorEvent, callClientError, result;
336
334
  return _regenerator.default.wrap(function _callee2$(_context2) {
337
335
  while (1) switch (_context2.prev = _context2.next) {
@@ -373,7 +371,7 @@ describe('CallingClient Error Tests', function () {
373
371
  }
374
372
  }, _callee2);
375
373
  })));
376
- it('verify unknown error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3() {
374
+ it('verify unknown error response for calling client', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee3() {
377
375
  var statusCode, message, errorType, finalError, webexPayload, mockErrorEvent, callClientError, result;
378
376
  return _regenerator.default.wrap(function _callee3$(_context3) {
379
377
  while (1) switch (_context3.prev = _context3.next) {
@@ -961,7 +959,7 @@ describe('resolveContact tests', function () {
961
959
  }));
962
960
  });
963
961
  });
964
- it('Resolve by userExternalId - SCIM exception', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4() {
962
+ it('Resolve by userExternalId - SCIM exception', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee4() {
965
963
  var _callingPartyInfo$use2;
966
964
  var callingPartyInfo, warnSpy, webexSpy, displayInfo, query;
967
965
  return _regenerator.default.wrap(function _callee4$(_context4) {
@@ -981,7 +979,7 @@ describe('resolveContact tests', function () {
981
979
  displayInfo = _context4.sent;
982
980
  expect(displayInfo === null || displayInfo === void 0 ? void 0 : displayInfo.name).toBeUndefined();
983
981
  expect(warnSpy).toHaveBeenCalledWith('Error response: - 500', {
984
- file: 'utils',
982
+ file: _constants.UTILS_FILE,
985
983
  method: 'resolveCallerIdDisplay'
986
984
  });
987
985
  query = scimUrl + encodeURIComponent("id eq \"".concat((_callingPartyInfo$use2 = callingPartyInfo.userExternalId) === null || _callingPartyInfo$use2 === void 0 ? void 0 : _callingPartyInfo$use2.$, "\""));
@@ -994,7 +992,7 @@ describe('resolveContact tests', function () {
994
992
  }
995
993
  }, _callee4);
996
994
  })));
997
- it('Resolve by userExternalId - totalResults zero', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
995
+ it('Resolve by userExternalId - totalResults zero', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee5() {
998
996
  var _callingPartyInfo$use3;
999
997
  var callingPartyInfo, scimResponse, webexSpy, displayInfo, query;
1000
998
  return _regenerator.default.wrap(function _callee5$(_context5) {
@@ -1026,7 +1024,7 @@ describe('resolveContact tests', function () {
1026
1024
  }
1027
1025
  }, _callee5);
1028
1026
  })));
1029
- it('Resolve by userExternalId - no primary number and no phone numbers', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6() {
1027
+ it('Resolve by userExternalId - no primary number and no phone numbers', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee6() {
1030
1028
  var _callingPartyInfo$use4, _displayInfo, _displayInfo2;
1031
1029
  var callingPartyInfo, scimResponse, webexSpy, displayInfo, query, phoneNumbers;
1032
1030
  return _regenerator.default.wrap(function _callee6$(_context6) {
@@ -1139,7 +1137,7 @@ describe('resolveContact tests', function () {
1139
1137
  }));
1140
1138
  });
1141
1139
  });
1142
- it('Resolve by name - Empty Info', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
1140
+ it('Resolve by name - Empty Info', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
1143
1141
  var callingPartyInfo, peopleListResponse, items, webexSpy, displayInfo;
1144
1142
  return _regenerator.default.wrap(function _callee7$(_context7) {
1145
1143
  while (1) switch (_context7.prev = _context7.next) {
@@ -1167,7 +1165,7 @@ describe('resolveContact tests', function () {
1167
1165
  }
1168
1166
  }, _callee7);
1169
1167
  })));
1170
- it('Resolve by name - ID as plain UUID instead of part of URI', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee8() {
1168
+ it('Resolve by name - ID as plain UUID instead of part of URI', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee8() {
1171
1169
  var _displayInfo3, _displayInfo4, _displayInfo5, _displayInfo6, _displayInfo7, _displayInfo8;
1172
1170
  var callingPartyInfo, peopleListResponse, id, webexSpy, displayInfo;
1173
1171
  return _regenerator.default.wrap(function _callee8$(_context8) {
@@ -1214,7 +1212,7 @@ describe('resolveContact tests', function () {
1214
1212
  }
1215
1213
  }, _callee8);
1216
1214
  })));
1217
- it('Resolve by name - Phone numbers no match for type - work', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee9() {
1215
+ it('Resolve by name - Phone numbers no match for type - work', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee9() {
1218
1216
  var callingPartyInfo, peopleListResponse, phoneNumbers, webexSpy, displayInfo;
1219
1217
  return _regenerator.default.wrap(function _callee9$(_context9) {
1220
1218
  while (1) switch (_context9.prev = _context9.next) {
@@ -1245,10 +1243,10 @@ describe('resolveContact tests', function () {
1245
1243
  }
1246
1244
  }, _callee9);
1247
1245
  })));
1248
- it('Resolve by name - Phone numbers empty', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
1246
+ it('Resolve by name - Phone numbers empty', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee0() {
1249
1247
  var callingPartyInfo, peopleListResponse, phoneNumbers, webexSpy, displayInfo;
1250
- return _regenerator.default.wrap(function _callee10$(_context10) {
1251
- while (1) switch (_context10.prev = _context10.next) {
1248
+ return _regenerator.default.wrap(function _callee0$(_context0) {
1249
+ while (1) switch (_context0.prev = _context0.next) {
1252
1250
  case 0:
1253
1251
  callingPartyInfo = {};
1254
1252
  peopleListResponse = (0, _testUtil.getSamplePeopleListResponse)();
@@ -1258,10 +1256,10 @@ describe('resolveContact tests', function () {
1258
1256
  callingPartyInfo.name = {
1259
1257
  $: 'Name'
1260
1258
  };
1261
- _context10.next = 8;
1259
+ _context0.next = 8;
1262
1260
  return (0, _Utils.resolveContact)(callingPartyInfo);
1263
1261
  case 8:
1264
- displayInfo = _context10.sent;
1262
+ displayInfo = _context0.sent;
1265
1263
  expect(webexSpy).toBeCalledOnceWith(expect.objectContaining({
1266
1264
  displayName: 'Name'
1267
1265
  }));
@@ -1271,9 +1269,9 @@ describe('resolveContact tests', function () {
1271
1269
  peopleListResponse.items[0].phoneNumbers = phoneNumbers;
1272
1270
  case 14:
1273
1271
  case "end":
1274
- return _context10.stop();
1272
+ return _context0.stop();
1275
1273
  }
1276
- }, _callee10);
1274
+ }, _callee0);
1277
1275
  })));
1278
1276
  });
1279
1277
  describe('Store and Fetch voicemail tests', function () {
@@ -1378,10 +1376,10 @@ describe('Infer id from UUID Tests', function () {
1378
1376
  /* Tests conversion of UUID to hydra Id */
1379
1377
 
1380
1378
  it('verify encoding of userId to personId', function () {
1381
- var uuid = '14533573-f6aa-429d-b4fe-58aa04a2b631';
1382
- var hydraId = (0, _Utils.inferIdFromUuid)(uuid, _types.DecodeType.PEOPLE);
1379
+ var uuidVal = '14533573-f6aa-429d-b4fe-58aa04a2b631';
1380
+ var hydraId = (0, _Utils.inferIdFromUuid)(uuidVal, _types.DecodeType.PEOPLE);
1383
1381
  var uuidAgain = Buffer.from(hydraId, 'base64').toString('binary');
1384
- expect("".concat(_constants2.INFER_ID_CONSTANT, "/").concat(_types.DecodeType.PEOPLE, "/").concat(uuid)).toStrictEqual(uuidAgain);
1382
+ expect("".concat(_constants2.INFER_ID_CONSTANT, "/").concat(_types.DecodeType.PEOPLE, "/").concat(uuidVal)).toStrictEqual(uuidAgain);
1385
1383
  });
1386
1384
  it('verify encoding of orgId', function () {
1387
1385
  var orgId = '24533573-f6aa-429d-b4fe-58aa04a2b630';
@@ -1391,40 +1389,40 @@ describe('Infer id from UUID Tests', function () {
1391
1389
  });
1392
1390
  });
1393
1391
  describe('Get endpoint by CALLING_BACKEND tests', function () {
1394
- it('verify invalid calling backend ucm for xsi endpoint', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee11() {
1395
- return _regenerator.default.wrap(function _callee11$(_context11) {
1396
- while (1) switch (_context11.prev = _context11.next) {
1392
+ it('verify invalid calling backend ucm for xsi endpoint', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee1() {
1393
+ return _regenerator.default.wrap(function _callee1$(_context1) {
1394
+ while (1) switch (_context1.prev = _context1.next) {
1397
1395
  case 0:
1398
- _context11.t0 = expect;
1399
- _context11.next = 3;
1396
+ _context1.t0 = expect;
1397
+ _context1.next = 3;
1400
1398
  return (0, _Utils.getXsiActionEndpoint)(webex, {
1401
1399
  file: 'testFile',
1402
1400
  method: 'testMethod'
1403
1401
  }, _types.CALLING_BACKEND.UCM);
1404
1402
  case 3:
1405
- _context11.t1 = _context11.sent;
1406
- (0, _context11.t0)(_context11.t1).toBeInstanceOf(Error);
1403
+ _context1.t1 = _context1.sent;
1404
+ (0, _context1.t0)(_context1.t1).toBeInstanceOf(Error);
1407
1405
  case 5:
1408
1406
  case "end":
1409
- return _context11.stop();
1407
+ return _context1.stop();
1410
1408
  }
1411
- }, _callee11);
1409
+ }, _callee1);
1412
1410
  })));
1413
- it('verify invalid calling backend wxc for vg endpoint', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee12() {
1414
- return _regenerator.default.wrap(function _callee12$(_context12) {
1415
- while (1) switch (_context12.prev = _context12.next) {
1411
+ it('verify invalid calling backend wxc for vg endpoint', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee10() {
1412
+ return _regenerator.default.wrap(function _callee10$(_context10) {
1413
+ while (1) switch (_context10.prev = _context10.next) {
1416
1414
  case 0:
1417
- _context12.t0 = expect;
1418
- _context12.next = 3;
1415
+ _context10.t0 = expect;
1416
+ _context10.next = 3;
1419
1417
  return (0, _Utils.getVgActionEndpoint)(webex, _types.CALLING_BACKEND.WXC);
1420
1418
  case 3:
1421
- _context12.t1 = _context12.sent;
1422
- (0, _context12.t0)(_context12.t1).toBeInstanceOf(Error);
1419
+ _context10.t1 = _context10.sent;
1420
+ (0, _context10.t0)(_context10.t1).toBeInstanceOf(Error);
1423
1421
  case 5:
1424
1422
  case "end":
1425
- return _context12.stop();
1423
+ return _context10.stop();
1426
1424
  }
1427
- }, _callee12);
1425
+ }, _callee10);
1428
1426
  })));
1429
1427
  });
1430
1428
  describe('Get XSI Action Endpoint tests', function () {
@@ -1442,10 +1440,10 @@ describe('Get XSI Action Endpoint tests', function () {
1442
1440
  file: 'testFile',
1443
1441
  method: 'testMethod'
1444
1442
  };
1445
- it('should return xsiEndpoint for BWRKS backend when URL ends with /v2.0', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
1443
+ it('should return xsiEndpoint for BWRKS backend when URL ends with /v2.0', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee11() {
1446
1444
  var mockResponse, xsiEndpoint;
1447
- return _regenerator.default.wrap(function _callee13$(_context13) {
1448
- while (1) switch (_context13.prev = _context13.next) {
1445
+ return _regenerator.default.wrap(function _callee11$(_context11) {
1446
+ while (1) switch (_context11.prev = _context11.next) {
1449
1447
  case 0:
1450
1448
  mockResponse = {
1451
1449
  body: {
@@ -1457,22 +1455,22 @@ describe('Get XSI Action Endpoint tests', function () {
1457
1455
  }
1458
1456
  };
1459
1457
  mockWebex.request.mockResolvedValue(mockResponse);
1460
- _context13.next = 4;
1458
+ _context11.next = 4;
1461
1459
  return (0, _Utils.getXsiActionEndpoint)(mockWebex, loggerContext, _types.CALLING_BACKEND.BWRKS);
1462
1460
  case 4:
1463
- xsiEndpoint = _context13.sent;
1461
+ xsiEndpoint = _context11.sent;
1464
1462
  expect(mockWebex.request).toHaveBeenCalledTimes(1);
1465
1463
  expect(xsiEndpoint).toBe('https://fake-broadworks-url.com');
1466
1464
  case 7:
1467
1465
  case "end":
1468
- return _context13.stop();
1466
+ return _context11.stop();
1469
1467
  }
1470
- }, _callee13);
1468
+ }, _callee11);
1471
1469
  })));
1472
- it('should return xsiEndpoint for BWRKS backend when URL ends with /v2.0/', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14() {
1470
+ it('should return xsiEndpoint for BWRKS backend when URL ends with /v2.0/', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee12() {
1473
1471
  var mockResponse, xsiEndpoint;
1474
- return _regenerator.default.wrap(function _callee14$(_context14) {
1475
- while (1) switch (_context14.prev = _context14.next) {
1472
+ return _regenerator.default.wrap(function _callee12$(_context12) {
1473
+ while (1) switch (_context12.prev = _context12.next) {
1476
1474
  case 0:
1477
1475
  mockResponse = {
1478
1476
  body: {
@@ -1484,22 +1482,22 @@ describe('Get XSI Action Endpoint tests', function () {
1484
1482
  }
1485
1483
  };
1486
1484
  mockWebex.request.mockResolvedValue(mockResponse);
1487
- _context14.next = 4;
1485
+ _context12.next = 4;
1488
1486
  return (0, _Utils.getXsiActionEndpoint)(mockWebex, loggerContext, _types.CALLING_BACKEND.BWRKS);
1489
1487
  case 4:
1490
- xsiEndpoint = _context14.sent;
1488
+ xsiEndpoint = _context12.sent;
1491
1489
  expect(mockWebex.request).toHaveBeenCalledTimes(1);
1492
1490
  expect(xsiEndpoint).toBe('https://fake-broadworks-url.com');
1493
1491
  case 7:
1494
1492
  case "end":
1495
- return _context14.stop();
1493
+ return _context12.stop();
1496
1494
  }
1497
- }, _callee14);
1495
+ }, _callee12);
1498
1496
  })));
1499
- it('should return xsiEndpoint for BWRKS backend when URL does not end with any version', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee15() {
1497
+ it('should return xsiEndpoint for BWRKS backend when URL does not end with any version', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee13() {
1500
1498
  var mockResponse, xsiEndpoint;
1501
- return _regenerator.default.wrap(function _callee15$(_context15) {
1502
- while (1) switch (_context15.prev = _context15.next) {
1499
+ return _regenerator.default.wrap(function _callee13$(_context13) {
1500
+ while (1) switch (_context13.prev = _context13.next) {
1503
1501
  case 0:
1504
1502
  mockResponse = {
1505
1503
  body: {
@@ -1511,17 +1509,17 @@ describe('Get XSI Action Endpoint tests', function () {
1511
1509
  }
1512
1510
  };
1513
1511
  mockWebex.request.mockResolvedValue(mockResponse);
1514
- _context15.next = 4;
1512
+ _context13.next = 4;
1515
1513
  return (0, _Utils.getXsiActionEndpoint)(mockWebex, loggerContext, _types.CALLING_BACKEND.BWRKS);
1516
1514
  case 4:
1517
- xsiEndpoint = _context15.sent;
1515
+ xsiEndpoint = _context13.sent;
1518
1516
  expect(mockWebex.request).toHaveBeenCalledTimes(1);
1519
1517
  expect(xsiEndpoint).toBe('https://fake-broadworks-url.com');
1520
1518
  case 7:
1521
1519
  case "end":
1522
- return _context15.stop();
1520
+ return _context13.stop();
1523
1521
  }
1524
- }, _callee15);
1522
+ }, _callee13);
1525
1523
  })));
1526
1524
  });
1527
1525
  describe('modifySdpForIPv4', function () {
@@ -1573,15 +1571,10 @@ describe('modifySdpForIPv4', function () {
1573
1571
  });
1574
1572
  });
1575
1573
  describe('uploadLogs', function () {
1576
- var originalCrypto;
1577
1574
  var submitLogsMock;
1578
1575
  beforeEach(function () {
1579
- // Save original crypto and mock it
1580
- originalCrypto = global.crypto;
1581
- global.crypto = {
1582
- randomUUID: jest.fn().mockReturnValue('mocked-uuid-12345')
1583
- };
1584
-
1576
+ // Mock uuid to return a consistent value
1577
+ mockUuid.mockReturnValue('mocked-uuid-12345');
1585
1578
  // Mock the metrics manager submit function directly
1586
1579
  mockSubmitRegistrationMetric.mockClear();
1587
1580
 
@@ -1594,23 +1587,21 @@ describe('uploadLogs', function () {
1594
1587
  };
1595
1588
  });
1596
1589
  afterEach(function () {
1597
- // Restore original crypto
1598
- global.crypto = originalCrypto;
1599
1590
  jest.clearAllMocks();
1600
1591
  });
1601
- it('should upload logs and return the response', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16() {
1592
+ it('should upload logs and return the response', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee14() {
1602
1593
  var mockMetaData, logSpy, result;
1603
- return _regenerator.default.wrap(function _callee16$(_context16) {
1604
- while (1) switch (_context16.prev = _context16.next) {
1594
+ return _regenerator.default.wrap(function _callee14$(_context14) {
1595
+ while (1) switch (_context14.prev = _context14.next) {
1605
1596
  case 0:
1606
1597
  mockMetaData = {
1607
1598
  correlationId: 'test-correlation'
1608
1599
  };
1609
1600
  logSpy = jest.spyOn(_Logger.default, 'info');
1610
- _context16.next = 4;
1601
+ _context14.next = 4;
1611
1602
  return (0, _Utils.uploadLogs)(mockMetaData, true);
1612
1603
  case 4:
1613
- result = _context16.sent;
1604
+ result = _context14.sent;
1614
1605
  expect(result).toEqual({
1615
1606
  trackingid: '1234',
1616
1607
  feedbackId: 'mocked-uuid-12345'
@@ -1643,14 +1634,14 @@ describe('uploadLogs', function () {
1643
1634
  });
1644
1635
  case 9:
1645
1636
  case "end":
1646
- return _context16.stop();
1637
+ return _context14.stop();
1647
1638
  }
1648
- }, _callee16);
1639
+ }, _callee14);
1649
1640
  })));
1650
- it('should log and throw an error if the upload fails', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee17() {
1641
+ it('should log and throw an error if the upload fails', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee15() {
1651
1642
  var mockMetaData, mockError, logSpy;
1652
- return _regenerator.default.wrap(function _callee17$(_context17) {
1653
- while (1) switch (_context17.prev = _context17.next) {
1643
+ return _regenerator.default.wrap(function _callee15$(_context15) {
1644
+ while (1) switch (_context15.prev = _context15.next) {
1654
1645
  case 0:
1655
1646
  mockMetaData = {
1656
1647
  correlationId: 'test-correlation'
@@ -1658,34 +1649,33 @@ describe('uploadLogs', function () {
1658
1649
  mockError = new Error('Upload failed'); // Mock the submitLogs to fail
1659
1650
  submitLogsMock.mockRejectedValueOnce(mockError);
1660
1651
  logSpy = jest.spyOn(_Logger.default, 'error');
1661
- _context17.prev = 4;
1662
- _context17.next = 7;
1652
+ _context15.prev = 4;
1653
+ _context15.next = 7;
1663
1654
  return (0, _Utils.uploadLogs)(mockMetaData, true);
1664
1655
  case 7:
1665
1656
  // If we get here, the test should fail since we expected an exception
1666
1657
  expect(true).toBe(false); // This will fail the test if no exception is thrown
1667
- _context17.next = 15;
1658
+ _context15.next = 15;
1668
1659
  break;
1669
1660
  case 10:
1670
- _context17.prev = 10;
1671
- _context17.t0 = _context17["catch"](4);
1672
- expect(_context17.t0).toBe(mockError);
1673
- expect(logSpy).toHaveBeenCalledWith(expect.objectContaining({
1674
- message: expect.stringContaining('Failed to upload Logs')
1675
- }), {
1661
+ _context15.prev = 10;
1662
+ _context15.t0 = _context15["catch"](4);
1663
+ expect(_context15.t0).toBe(mockError);
1664
+ expect(logSpy).toHaveBeenCalledWith("Failed to upload Logs ".concat((0, _stringify.default)(_context15.t0)), {
1676
1665
  file: _constants.UTILS_FILE,
1677
1666
  method: 'uploadLogs'
1678
1667
  });
1679
1668
  expect(mockSubmitRegistrationMetric).toHaveBeenCalledWith('web-calling-sdk-upload-logs-failed', {
1680
1669
  fields: {
1681
- call_id: undefined,
1682
- calling_sdk_version: 'unknown',
1683
- correlation_id: 'Failed to upload Logs Error: Upload failed',
1684
1670
  device_url: undefined,
1685
- error: undefined,
1686
- feedback_id: 'test-correlation',
1687
1671
  mobius_url: undefined,
1688
- tracking_id: 'mocked-uuid-12345'
1672
+ calling_sdk_version: 'unknown',
1673
+ correlation_id: 'test-correlation',
1674
+ broadworksCorrelationInfo: undefined,
1675
+ tracking_id: undefined,
1676
+ feedback_id: 'mocked-uuid-12345',
1677
+ call_id: undefined,
1678
+ error: "Failed to upload Logs ".concat((0, _stringify.default)(_context15.t0))
1689
1679
  },
1690
1680
  tags: {
1691
1681
  action: 'upload_logs',
@@ -1696,42 +1686,42 @@ describe('uploadLogs', function () {
1696
1686
  });
1697
1687
  case 15:
1698
1688
  case "end":
1699
- return _context17.stop();
1689
+ return _context15.stop();
1700
1690
  }
1701
- }, _callee17, null, [[4, 10]]);
1691
+ }, _callee15, null, [[4, 10]]);
1702
1692
  })));
1703
- it('should log error and not throw an error if the upload fails with throw exception false', /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
1693
+ it('should log error and not throw an error if the upload fails with throw exception false', /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee16() {
1704
1694
  var mockMetaData, mockError, logSpy, result;
1705
- return _regenerator.default.wrap(function _callee18$(_context18) {
1706
- while (1) switch (_context18.prev = _context18.next) {
1695
+ return _regenerator.default.wrap(function _callee16$(_context16) {
1696
+ while (1) switch (_context16.prev = _context16.next) {
1707
1697
  case 0:
1708
1698
  mockMetaData = {
1709
- correlationId: 'test-correlation'
1699
+ correlationId: 'test-correlation',
1700
+ broadworksCorrelationInfo: 'test-broadworks-correlation'
1710
1701
  };
1711
1702
  mockError = new Error('Upload failed'); // Mock the submitLogs to fail
1712
1703
  submitLogsMock.mockRejectedValueOnce(mockError);
1713
1704
  logSpy = jest.spyOn(_Logger.default, 'error');
1714
- _context18.next = 6;
1705
+ _context16.next = 6;
1715
1706
  return (0, _Utils.uploadLogs)(mockMetaData, false);
1716
1707
  case 6:
1717
- result = _context18.sent;
1708
+ result = _context16.sent;
1718
1709
  expect(result).toBeUndefined();
1719
- expect(logSpy).toHaveBeenCalledWith(expect.objectContaining({
1720
- message: expect.stringContaining('Failed to upload Logs')
1721
- }), {
1710
+ expect(logSpy).toHaveBeenCalledWith("Failed to upload Logs ".concat((0, _stringify.default)(mockError)), {
1722
1711
  file: _constants.UTILS_FILE,
1723
1712
  method: 'uploadLogs'
1724
1713
  });
1725
1714
  expect(mockSubmitRegistrationMetric).toHaveBeenCalledWith('web-calling-sdk-upload-logs-failed', {
1726
1715
  fields: {
1727
- call_id: undefined,
1728
- calling_sdk_version: 'unknown',
1729
- correlation_id: 'Failed to upload Logs Error: Upload failed',
1730
1716
  device_url: undefined,
1731
- error: undefined,
1732
- feedback_id: 'test-correlation',
1733
1717
  mobius_url: undefined,
1734
- tracking_id: 'mocked-uuid-12345'
1718
+ calling_sdk_version: 'unknown',
1719
+ correlation_id: 'test-correlation',
1720
+ broadworksCorrelationInfo: 'test-broadworks-correlation',
1721
+ tracking_id: undefined,
1722
+ feedback_id: 'mocked-uuid-12345',
1723
+ call_id: undefined,
1724
+ error: "Failed to upload Logs ".concat((0, _stringify.default)(mockError))
1735
1725
  },
1736
1726
  tags: {
1737
1727
  action: 'upload_logs',
@@ -1742,9 +1732,9 @@ describe('uploadLogs', function () {
1742
1732
  });
1743
1733
  case 10:
1744
1734
  case "end":
1745
- return _context18.stop();
1735
+ return _context16.stop();
1746
1736
  }
1747
- }, _callee18);
1737
+ }, _callee16);
1748
1738
  })));
1749
1739
  });
1750
1740
  //# sourceMappingURL=Utils.test.js.map