@webex/calling 3.0.0-next.9 → 3.0.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 (204) hide show
  1. package/dist/CallHistory/CallHistory.js +48 -48
  2. package/dist/CallHistory/CallHistory.js.map +1 -1
  3. package/dist/CallHistory/CallHistory.test.js +9 -0
  4. package/dist/CallHistory/CallHistory.test.js.map +1 -1
  5. package/dist/CallHistory/callHistoryFixtures.js +63 -7
  6. package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
  7. package/dist/CallHistory/constants.js +9 -18
  8. package/dist/CallHistory/constants.js.map +1 -1
  9. package/dist/CallSettings/CallSettings.js +18 -13
  10. package/dist/CallSettings/CallSettings.js.map +1 -1
  11. package/dist/CallSettings/CallSettings.test.js.map +1 -1
  12. package/dist/CallSettings/UcmBackendConnector.js +7 -8
  13. package/dist/CallSettings/UcmBackendConnector.js.map +1 -1
  14. package/dist/CallSettings/UcmBackendConnector.test.js +69 -37
  15. package/dist/CallSettings/UcmBackendConnector.test.js.map +1 -1
  16. package/dist/CallSettings/WxCallBackendConnector.js +19 -13
  17. package/dist/CallSettings/WxCallBackendConnector.js.map +1 -1
  18. package/dist/CallSettings/WxCallBackendConnector.test.js +2 -2
  19. package/dist/CallSettings/WxCallBackendConnector.test.js.map +1 -1
  20. package/dist/CallSettings/constants.js +11 -22
  21. package/dist/CallSettings/constants.js.map +1 -1
  22. package/dist/CallSettings/testFixtures.js +4 -8
  23. package/dist/CallSettings/testFixtures.js.map +1 -1
  24. package/dist/CallSettings/types.js.map +1 -1
  25. package/dist/CallingClient/CallingClient.js +108 -64
  26. package/dist/CallingClient/CallingClient.js.map +1 -1
  27. package/dist/CallingClient/CallingClient.test.js +170 -109
  28. package/dist/CallingClient/CallingClient.test.js.map +1 -1
  29. package/dist/CallingClient/callRecordFixtures.js +2 -4
  30. package/dist/CallingClient/callRecordFixtures.js.map +1 -1
  31. package/dist/CallingClient/calling/CallerId/index.js +9 -29
  32. package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
  33. package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
  34. package/dist/CallingClient/calling/call.js +136 -70
  35. package/dist/CallingClient/calling/call.js.map +1 -1
  36. package/dist/CallingClient/calling/call.test.js +651 -409
  37. package/dist/CallingClient/calling/call.test.js.map +1 -1
  38. package/dist/CallingClient/calling/callManager.js +3 -5
  39. package/dist/CallingClient/calling/callManager.js.map +1 -1
  40. package/dist/CallingClient/calling/callManager.test.js +1 -1
  41. package/dist/CallingClient/calling/callManager.test.js.map +1 -1
  42. package/dist/CallingClient/calling/types.js +31 -33
  43. package/dist/CallingClient/calling/types.js.map +1 -1
  44. package/dist/CallingClient/callingClientFixtures.js +107 -17
  45. package/dist/CallingClient/callingClientFixtures.js.map +1 -1
  46. package/dist/CallingClient/constants.js +101 -193
  47. package/dist/CallingClient/constants.js.map +1 -1
  48. package/dist/CallingClient/line/index.js +18 -17
  49. package/dist/CallingClient/line/index.js.map +1 -1
  50. package/dist/CallingClient/line/line.test.js +13 -13
  51. package/dist/CallingClient/line/line.test.js.map +1 -1
  52. package/dist/CallingClient/line/types.js +7 -14
  53. package/dist/CallingClient/line/types.js.map +1 -1
  54. package/dist/CallingClient/registration/register.js +90 -71
  55. package/dist/CallingClient/registration/register.js.map +1 -1
  56. package/dist/CallingClient/registration/register.test.js +33 -32
  57. package/dist/CallingClient/registration/register.test.js.map +1 -1
  58. package/dist/CallingClient/registration/registerFixtures.js +5 -10
  59. package/dist/CallingClient/registration/registerFixtures.js.map +1 -1
  60. package/dist/CallingClient/registration/types.js.map +1 -1
  61. package/dist/Contacts/ContactsClient.js +30 -19
  62. package/dist/Contacts/ContactsClient.js.map +1 -1
  63. package/dist/Contacts/ContactsClient.test.js +4 -4
  64. package/dist/Contacts/ContactsClient.test.js.map +1 -1
  65. package/dist/Contacts/constants.js +10 -18
  66. package/dist/Contacts/constants.js.map +1 -1
  67. package/dist/Contacts/contactFixtures.js +26 -52
  68. package/dist/Contacts/contactFixtures.js.map +1 -1
  69. package/dist/Contacts/types.js +29 -9
  70. package/dist/Contacts/types.js.map +1 -1
  71. package/dist/Errors/catalog/CallError.js +3 -5
  72. package/dist/Errors/catalog/CallError.js.map +1 -1
  73. package/dist/Errors/catalog/CallingDeviceError.js +4 -6
  74. package/dist/Errors/catalog/CallingDeviceError.js.map +1 -1
  75. package/dist/Errors/catalog/ExtendedError.js +2 -3
  76. package/dist/Errors/catalog/ExtendedError.js.map +1 -1
  77. package/dist/Errors/catalog/LineError.js +5 -7
  78. package/dist/Errors/catalog/LineError.js.map +1 -1
  79. package/dist/Errors/index.js +7 -0
  80. package/dist/Errors/index.js.map +1 -1
  81. package/dist/Errors/types.js +15 -20
  82. package/dist/Errors/types.js.map +1 -1
  83. package/dist/Events/impl/index.js +2 -3
  84. package/dist/Events/impl/index.js.map +1 -1
  85. package/dist/Events/types.js +44 -52
  86. package/dist/Events/types.js.map +1 -1
  87. package/dist/Logger/index.js +1 -2
  88. package/dist/Logger/index.js.map +1 -1
  89. package/dist/Logger/index.test.js.map +1 -1
  90. package/dist/Logger/types.js +9 -12
  91. package/dist/Logger/types.js.map +1 -1
  92. package/dist/Metrics/index.js +2 -4
  93. package/dist/Metrics/index.js.map +1 -1
  94. package/dist/Metrics/index.test.js +3 -3
  95. package/dist/Metrics/index.test.js.map +1 -1
  96. package/dist/Metrics/types.js +15 -20
  97. package/dist/Metrics/types.js.map +1 -1
  98. package/dist/SDKConnector/index.js +1 -2
  99. package/dist/SDKConnector/index.js.map +1 -1
  100. package/dist/SDKConnector/types.js.map +1 -1
  101. package/dist/SDKConnector/utils.js +1 -2
  102. package/dist/SDKConnector/utils.js.map +1 -1
  103. package/dist/Voicemail/BroadworksBackendConnector.js +21 -12
  104. package/dist/Voicemail/BroadworksBackendConnector.js.map +1 -1
  105. package/dist/Voicemail/BroadworksBackendConnector.test.js +2 -2
  106. package/dist/Voicemail/BroadworksBackendConnector.test.js.map +1 -1
  107. package/dist/Voicemail/UcmBackendConnector.js +19 -11
  108. package/dist/Voicemail/UcmBackendConnector.js.map +1 -1
  109. package/dist/Voicemail/UcmBackendConnector.test.js +5 -4
  110. package/dist/Voicemail/UcmBackendConnector.test.js.map +1 -1
  111. package/dist/Voicemail/Voicemail.js +17 -12
  112. package/dist/Voicemail/Voicemail.js.map +1 -1
  113. package/dist/Voicemail/Voicemail.test.js.map +1 -1
  114. package/dist/Voicemail/WxCallBackendConnector.js +17 -10
  115. package/dist/Voicemail/WxCallBackendConnector.js.map +1 -1
  116. package/dist/Voicemail/WxCallBackendConnector.test.js +4 -4
  117. package/dist/Voicemail/WxCallBackendConnector.test.js.map +1 -1
  118. package/dist/Voicemail/constants.js +29 -58
  119. package/dist/Voicemail/constants.js.map +1 -1
  120. package/dist/Voicemail/voicemailFixture.js +35 -70
  121. package/dist/Voicemail/voicemailFixture.js.map +1 -1
  122. package/dist/api.js.map +1 -1
  123. package/dist/common/Utils.js +18 -25
  124. package/dist/common/Utils.js.map +1 -1
  125. package/dist/common/Utils.test.js +3 -3
  126. package/dist/common/Utils.test.js.map +1 -1
  127. package/dist/common/constants.js +41 -82
  128. package/dist/common/constants.js.map +1 -1
  129. package/dist/common/testUtil.js +12 -21
  130. package/dist/common/testUtil.js.map +1 -1
  131. package/dist/common/types.js +34 -43
  132. package/dist/common/types.js.map +1 -1
  133. package/dist/index.js +246 -0
  134. package/dist/index.js.map +1 -1
  135. package/dist/module/CallHistory/CallHistory.js +7 -5
  136. package/dist/module/CallHistory/callHistoryFixtures.js +59 -0
  137. package/dist/module/CallSettings/UcmBackendConnector.js +4 -4
  138. package/dist/module/CallingClient/CallingClient.js +59 -42
  139. package/dist/module/CallingClient/calling/CallerId/index.js +3 -23
  140. package/dist/module/CallingClient/calling/call.js +69 -26
  141. package/dist/module/CallingClient/callingClientFixtures.js +119 -1
  142. package/dist/module/CallingClient/constants.js +8 -4
  143. package/dist/module/CallingClient/line/index.js +9 -12
  144. package/dist/module/CallingClient/line/types.js +0 -5
  145. package/dist/module/CallingClient/registration/register.js +28 -20
  146. package/dist/module/Errors/catalog/CallingDeviceError.js +2 -2
  147. package/dist/module/Errors/catalog/LineError.js +2 -2
  148. package/dist/module/Errors/index.js +1 -0
  149. package/dist/module/Events/types.js +2 -0
  150. package/dist/module/common/Utils.js +14 -19
  151. package/dist/module/common/testUtil.js +2 -1
  152. package/dist/module/common/types.js +6 -5
  153. package/dist/module/index.js +9 -0
  154. package/dist/types/CallHistory/CallHistory.d.ts +2 -1
  155. package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
  156. package/dist/types/CallHistory/callHistoryFixtures.d.ts +1 -0
  157. package/dist/types/CallHistory/callHistoryFixtures.d.ts.map +1 -1
  158. package/dist/types/CallSettings/UcmBackendConnector.d.ts +1 -1
  159. package/dist/types/CallSettings/UcmBackendConnector.d.ts.map +1 -1
  160. package/dist/types/CallSettings/types.d.ts +1 -0
  161. package/dist/types/CallSettings/types.d.ts.map +1 -1
  162. package/dist/types/CallingClient/CallingClient.d.ts +2 -0
  163. package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
  164. package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
  165. package/dist/types/CallingClient/calling/call.d.ts +2 -0
  166. package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
  167. package/dist/types/CallingClient/calling/types.d.ts +1 -0
  168. package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
  169. package/dist/types/CallingClient/callingClientFixtures.d.ts +69 -1
  170. package/dist/types/CallingClient/callingClientFixtures.d.ts.map +1 -1
  171. package/dist/types/CallingClient/constants.d.ts +7 -3
  172. package/dist/types/CallingClient/constants.d.ts.map +1 -1
  173. package/dist/types/CallingClient/line/index.d.ts +6 -6
  174. package/dist/types/CallingClient/line/index.d.ts.map +1 -1
  175. package/dist/types/CallingClient/line/types.d.ts +5 -17
  176. package/dist/types/CallingClient/line/types.d.ts.map +1 -1
  177. package/dist/types/CallingClient/registration/register.d.ts +3 -3
  178. package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
  179. package/dist/types/CallingClient/registration/types.d.ts +3 -3
  180. package/dist/types/CallingClient/registration/types.d.ts.map +1 -1
  181. package/dist/types/Contacts/ContactsClient.d.ts +1 -1
  182. package/dist/types/Errors/catalog/CallingDeviceError.d.ts +4 -4
  183. package/dist/types/Errors/catalog/CallingDeviceError.d.ts.map +1 -1
  184. package/dist/types/Errors/catalog/LineError.d.ts +4 -4
  185. package/dist/types/Errors/catalog/LineError.d.ts.map +1 -1
  186. package/dist/types/Errors/index.d.ts +1 -0
  187. package/dist/types/Errors/index.d.ts.map +1 -1
  188. package/dist/types/Errors/types.d.ts +2 -3
  189. package/dist/types/Errors/types.d.ts.map +1 -1
  190. package/dist/types/Events/types.d.ts +28 -5
  191. package/dist/types/Events/types.d.ts.map +1 -1
  192. package/dist/types/SDKConnector/types.d.ts +2 -1
  193. package/dist/types/SDKConnector/types.d.ts.map +1 -1
  194. package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
  195. package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
  196. package/dist/types/api.d.ts.map +1 -1
  197. package/dist/types/common/Utils.d.ts.map +1 -1
  198. package/dist/types/common/testUtil.d.ts +1 -0
  199. package/dist/types/common/testUtil.d.ts.map +1 -1
  200. package/dist/types/common/types.d.ts +3 -2
  201. package/dist/types/common/types.d.ts.map +1 -1
  202. package/dist/types/index.d.ts +13 -0
  203. package/dist/types/index.d.ts.map +1 -1
  204. package/package.json +3 -3
@@ -34,7 +34,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
34
34
  /**
35
35
  *
36
36
  */
37
- var Registration = /*#__PURE__*/function () {
37
+ var Registration = exports.Registration = /*#__PURE__*/function () {
38
38
  /**
39
39
  */
40
40
  function Registration(webex, serviceData, mutex, lineEmitter, logLevel) {
@@ -66,7 +66,7 @@ var Registration = /*#__PURE__*/function () {
66
66
  }
67
67
  this.webex = this.sdkConnector.getWebex();
68
68
  this.userId = this.webex.internal.device.userId;
69
- this.registrationStatus = _types3.MobiusStatus.DEFAULT;
69
+ this.registrationStatus = _types3.RegistrationStatus.IDLE;
70
70
  this.failback429RetryAttempts = 0;
71
71
  _Logger.default.setLogger(logLevel, _constants.REGISTRATION_FILE);
72
72
  this.rehomingIntervalMin = _constants.DEFAULT_REHOMING_INTERVAL_MIN;
@@ -106,16 +106,15 @@ var Registration = /*#__PURE__*/function () {
106
106
  */
107
107
  }, {
108
108
  key: "postKeepAlive",
109
- value: function () {
109
+ value: (function () {
110
110
  var _postKeepAlive = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(url) {
111
- var _headers;
112
111
  return _regenerator.default.wrap(function _callee$(_context) {
113
112
  while (1) switch (_context.prev = _context.next) {
114
113
  case 0:
115
114
  return _context.abrupt("return", this.webex.request({
116
115
  uri: "".concat(url, "/status"),
117
116
  method: _types3.HTTP_METHODS.POST,
118
- headers: (_headers = {}, (0, _defineProperty2.default)(_headers, _constants.CISCO_DEVICE_URL, this.webex.internal.device.url), (0, _defineProperty2.default)(_headers, _constants.SPARK_USER_AGENT, _constants.CALLING_USER_AGENT), _headers),
117
+ headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.CISCO_DEVICE_URL, this.webex.internal.device.url), _constants.SPARK_USER_AGENT, _constants.CALLING_USER_AGENT),
119
118
  service: _types3.ALLOWED_SERVICES.MOBIUS
120
119
  }));
121
120
  case 1:
@@ -133,45 +132,57 @@ var Registration = /*#__PURE__*/function () {
133
132
  * Implementation of delete device.
134
133
  *
135
134
  */
135
+ )
136
136
  }, {
137
137
  key: "deleteRegistration",
138
- value: function () {
138
+ value: (function () {
139
139
  var _deleteRegistration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(url, deviceId, deviceUrl) {
140
- var _headers2;
140
+ var _response;
141
141
  var response;
142
142
  return _regenerator.default.wrap(function _callee2$(_context2) {
143
143
  while (1) switch (_context2.prev = _context2.next) {
144
144
  case 0:
145
+ _context2.prev = 0;
145
146
  _context2.t0 = fetch;
146
147
  _context2.t1 = "".concat(url).concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(deviceId);
147
148
  _context2.t2 = _types3.HTTP_METHODS.DELETE;
148
- _headers2 = {};
149
- (0, _defineProperty2.default)(_headers2, _constants.CISCO_DEVICE_URL, deviceUrl);
150
149
  _context2.t3 = _defineProperty2.default;
151
- _context2.t4 = _headers2;
152
- _context2.next = 9;
150
+ _context2.t4 = _defineProperty2.default;
151
+ _context2.t5 = _defineProperty2.default;
152
+ _context2.t6 = (0, _defineProperty2.default)({}, _constants.CISCO_DEVICE_URL, deviceUrl);
153
+ _context2.next = 10;
153
154
  return this.webex.credentials.getUserToken();
154
- case 9:
155
- _context2.t5 = _context2.sent;
156
- (0, _context2.t3)(_context2.t4, "Authorization", _context2.t5);
157
- (0, _defineProperty2.default)(_headers2, "trackingId", "".concat(_constants.WEBEX_WEB_CLIENT, "_").concat((0, _uuid.v4)()));
158
- (0, _defineProperty2.default)(_headers2, _constants.SPARK_USER_AGENT, _constants.CALLING_USER_AGENT);
159
- _context2.t6 = _headers2;
160
- _context2.t7 = {
155
+ case 10:
156
+ _context2.t7 = _context2.sent;
157
+ _context2.t8 = (0, _context2.t5)(_context2.t6, "Authorization", _context2.t7);
158
+ _context2.t9 = "".concat(_constants.WEBEX_WEB_CLIENT, "_").concat((0, _uuid.v4)());
159
+ _context2.t10 = (0, _context2.t4)(_context2.t8, "trackingId", _context2.t9);
160
+ _context2.t11 = _constants.SPARK_USER_AGENT;
161
+ _context2.t12 = _constants.CALLING_USER_AGENT;
162
+ _context2.t13 = (0, _context2.t3)(_context2.t10, _context2.t11, _context2.t12);
163
+ _context2.t14 = {
161
164
  method: _context2.t2,
162
- headers: _context2.t6
165
+ headers: _context2.t13
163
166
  };
164
- _context2.next = 17;
165
- return (0, _context2.t0)(_context2.t1, _context2.t7);
166
- case 17:
167
+ _context2.next = 20;
168
+ return (0, _context2.t0)(_context2.t1, _context2.t14);
169
+ case 20:
167
170
  response = _context2.sent;
171
+ _context2.next = 26;
172
+ break;
173
+ case 23:
174
+ _context2.prev = 23;
175
+ _context2.t15 = _context2["catch"](0);
176
+ _Logger.default.warn("Delete failed with Mobius", {});
177
+ case 26:
178
+ this.setStatus(_types3.RegistrationStatus.INACTIVE);
168
179
  this.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
169
- return _context2.abrupt("return", response.json());
170
- case 20:
180
+ return _context2.abrupt("return", (_response = response) === null || _response === void 0 ? void 0 : _response.json());
181
+ case 29:
171
182
  case "end":
172
183
  return _context2.stop();
173
184
  }
174
- }, _callee2, this);
185
+ }, _callee2, this, [[0, 23]]);
175
186
  }));
176
187
  function deleteRegistration(_x2, _x3, _x4) {
177
188
  return _deleteRegistration.apply(this, arguments);
@@ -182,11 +193,11 @@ var Registration = /*#__PURE__*/function () {
182
193
  * Implementation of POST request for device registration.
183
194
  *
184
195
  */
196
+ )
185
197
  }, {
186
198
  key: "postRegistration",
187
- value: function () {
199
+ value: (function () {
188
200
  var _postRegistration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(url) {
189
- var _headers3;
190
201
  var deviceInfo;
191
202
  return _regenerator.default.wrap(function _callee3$(_context3) {
192
203
  while (1) switch (_context3.prev = _context3.next) {
@@ -199,7 +210,7 @@ var Registration = /*#__PURE__*/function () {
199
210
  return _context3.abrupt("return", this.webex.request({
200
211
  uri: "".concat(url, "device"),
201
212
  method: _types3.HTTP_METHODS.POST,
202
- headers: (_headers3 = {}, (0, _defineProperty2.default)(_headers3, _constants.CISCO_DEVICE_URL, deviceInfo.clientDeviceUri), (0, _defineProperty2.default)(_headers3, _constants.SPARK_USER_AGENT, _constants.CALLING_USER_AGENT), _headers3),
213
+ headers: (0, _defineProperty2.default)((0, _defineProperty2.default)({}, _constants.CISCO_DEVICE_URL, deviceInfo.clientDeviceUri), _constants.SPARK_USER_AGENT, _constants.CALLING_USER_AGENT),
203
214
  body: deviceInfo,
204
215
  service: _types3.ALLOWED_SERVICES.MOBIUS
205
216
  }));
@@ -218,9 +229,10 @@ var Registration = /*#__PURE__*/function () {
218
229
  * Re-attempts registration with the mobius url it was last registered
219
230
  * to, that mobius url is expected to be updated already in this.activeMobiusUrl.
220
231
  */
232
+ )
221
233
  }, {
222
234
  key: "restorePreviousRegistration",
223
- value: function () {
235
+ value: (function () {
224
236
  var _restorePreviousRegistration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(caller) {
225
237
  var abort;
226
238
  return _regenerator.default.wrap(function _callee4$(_context4) {
@@ -254,9 +266,10 @@ var Registration = /*#__PURE__*/function () {
254
266
  * can handle this device registration now, in such cases this
255
267
  * method is called to retry sooner than the rehoming timer value.
256
268
  */
269
+ )
257
270
  }, {
258
271
  key: "scheduleFailback429Retry",
259
- value: function () {
272
+ value: (function () {
260
273
  var _scheduleFailback429Retry = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5() {
261
274
  var interval, abort;
262
275
  return _regenerator.default.wrap(function _callee5$(_context5) {
@@ -303,6 +316,7 @@ var Registration = /*#__PURE__*/function () {
303
316
  *
304
317
  * attempted already.
305
318
  */
319
+ )
306
320
  }, {
307
321
  key: "getRegRetryInterval",
308
322
  value: function getRegRetryInterval() {
@@ -319,7 +333,7 @@ var Registration = /*#__PURE__*/function () {
319
333
  */
320
334
  }, {
321
335
  key: "startFailoverTimer",
322
- value: function () {
336
+ value: (function () {
323
337
  var _startFailoverTimer = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee10() {
324
338
  var _this = this;
325
339
  var attempt,
@@ -449,6 +463,7 @@ var Registration = /*#__PURE__*/function () {
449
463
  /**
450
464
  * Clears the failback timer if running.
451
465
  */
466
+ )
452
467
  }, {
453
468
  key: "clearFailbackTimer",
454
469
  value: function clearFailbackTimer() {
@@ -527,7 +542,7 @@ var Registration = /*#__PURE__*/function () {
527
542
  */
528
543
  }, {
529
544
  key: "executeFailback",
530
- value: function () {
545
+ value: (function () {
531
546
  var _executeFailback = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee13() {
532
547
  var _this3 = this;
533
548
  return _regenerator.default.wrap(function _callee13$(_context13) {
@@ -618,6 +633,7 @@ var Registration = /*#__PURE__*/function () {
618
633
  * server.
619
634
  *
620
635
  */
636
+ )
621
637
  }, {
622
638
  key: "setIntervalValues",
623
639
  value: function setIntervalValues(deviceInfo) {
@@ -646,7 +662,7 @@ var Registration = /*#__PURE__*/function () {
646
662
  }, {
647
663
  key: "isDeviceRegistered",
648
664
  value: function isDeviceRegistered() {
649
- return this.registrationStatus === _types3.MobiusStatus.ACTIVE;
665
+ return this.registrationStatus === _types3.RegistrationStatus.ACTIVE;
650
666
  }
651
667
  }, {
652
668
  key: "getStatus",
@@ -666,7 +682,7 @@ var Registration = /*#__PURE__*/function () {
666
682
  */
667
683
  }, {
668
684
  key: "restartRegistration",
669
- value: function () {
685
+ value: (function () {
670
686
  var _restartRegistration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee14(caller) {
671
687
  var abort;
672
688
  return _regenerator.default.wrap(function _callee14$(_context14) {
@@ -704,9 +720,10 @@ var Registration = /*#__PURE__*/function () {
704
720
  * Allows retry if not restored in the first attempt.
705
721
  *
706
722
  */
723
+ )
707
724
  }, {
708
725
  key: "handleConnectionRestoration",
709
- value: function () {
726
+ value: (function () {
710
727
  var _handleConnectionRestoration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee16(retry) {
711
728
  var _this4 = this;
712
729
  return _regenerator.default.wrap(function _callee16$(_context16) {
@@ -722,7 +739,7 @@ var Registration = /*#__PURE__*/function () {
722
739
  _context15.next = 14;
723
740
  break;
724
741
  }
725
- _Logger.default.info('Mercury connection is up again, Re-registering with Mobius', {
742
+ _Logger.default.info('Mercury connection is up again, re-registering with Webex Calling if needed', {
726
743
  file: _constants.REGISTRATION_FILE,
727
744
  method: _this4.handleConnectionRestoration.name
728
745
  });
@@ -774,6 +791,7 @@ var Registration = /*#__PURE__*/function () {
774
791
  * due to device registration already exists.
775
792
  *
776
793
  */
794
+ )
777
795
  }, {
778
796
  key: "restoreRegistrationCallBack",
779
797
  value: function restoreRegistrationCallBack() {
@@ -837,7 +855,7 @@ var Registration = /*#__PURE__*/function () {
837
855
  */
838
856
  }, {
839
857
  key: "triggerRegistration",
840
- value: function () {
858
+ value: (function () {
841
859
  var _triggerRegistration = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee18() {
842
860
  var abort;
843
861
  return _regenerator.default.wrap(function _callee18$(_context18) {
@@ -876,9 +894,10 @@ var Registration = /*#__PURE__*/function () {
876
894
  * attempt has hit a final error and a retry should not be scheduled
877
895
  * else false.
878
896
  */
897
+ )
879
898
  }, {
880
899
  key: "attemptRegistrationWithServers",
881
- value: function () {
900
+ value: (function () {
882
901
  var _attemptRegistrationWithServers = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee19(caller) {
883
902
  var _this6 = this;
884
903
  var servers,
@@ -911,13 +930,13 @@ var Registration = /*#__PURE__*/function () {
911
930
  _iterator.s();
912
931
  case 8:
913
932
  if ((_step = _iterator.n()).done) {
914
- _context19.next = 52;
933
+ _context19.next = 53;
915
934
  break;
916
935
  }
917
936
  url = _step.value;
918
937
  _context19.prev = 10;
919
938
  abort = false;
920
- this.registrationStatus = _types3.MobiusStatus.DEFAULT;
939
+ this.registrationStatus = _types3.RegistrationStatus.INACTIVE;
921
940
  this.lineEmitter(_types4.LINE_EVENTS.CONNECTING);
922
941
  _Logger.default.log("[".concat(caller, "] : Mobius url to contact: ").concat(url), {
923
942
  file: _constants.REGISTRATION_FILE,
@@ -929,15 +948,15 @@ var Registration = /*#__PURE__*/function () {
929
948
  case 17:
930
949
  resp = _context19.sent;
931
950
  this.deviceInfo = resp.body;
951
+ this.registrationStatus = _types3.RegistrationStatus.ACTIVE;
932
952
  this.lineEmitter(_types4.LINE_EVENTS.REGISTERED, resp.body);
933
- this.registrationStatus = _types3.MobiusStatus.ACTIVE;
934
953
  this.setActiveMobiusUrl(url);
935
954
  this.setIntervalValues(this.deviceInfo);
936
955
  this.metricManager.setDeviceInfo(this.deviceInfo);
937
956
  this.metricManager.submitRegistrationMetric(_types2.METRIC_EVENT.REGISTRATION, _types2.REG_ACTION.REGISTER, _types2.METRIC_TYPE.BEHAVIORAL, undefined);
938
957
  this.startKeepaliveTimer((_this$deviceInfo$devi = this.deviceInfo.device) === null || _this$deviceInfo$devi === void 0 ? void 0 : _this$deviceInfo$devi.uri, this.deviceInfo.keepaliveInterval);
939
958
  this.initiateFailback();
940
- return _context19.abrupt("break", 52);
959
+ return _context19.abrupt("break", 53);
941
960
  case 30:
942
961
  _context19.prev = 30;
943
962
  _context19.t0 = _context19["catch"](10);
@@ -956,7 +975,7 @@ var Registration = /*#__PURE__*/function () {
956
975
  }, this.restoreRegistrationCallBack());
957
976
  case 35:
958
977
  abort = _context19.sent;
959
- if (!(this.registrationStatus === _types3.MobiusStatus.ACTIVE)) {
978
+ if (!(this.registrationStatus === _types3.RegistrationStatus.ACTIVE)) {
960
979
  _context19.next = 39;
961
980
  break;
962
981
  }
@@ -964,49 +983,50 @@ var Registration = /*#__PURE__*/function () {
964
983
  file: _constants.REGISTRATION_FILE,
965
984
  method: this.attemptRegistrationWithServers.name
966
985
  });
967
- return _context19.abrupt("break", 52);
986
+ return _context19.abrupt("break", 53);
968
987
  case 39:
969
988
  if (!abort) {
970
- _context19.next = 43;
989
+ _context19.next = 44;
971
990
  break;
972
991
  }
973
- return _context19.abrupt("break", 52);
974
- case 43:
992
+ this.setStatus(_types3.RegistrationStatus.INACTIVE);
993
+ return _context19.abrupt("break", 53);
994
+ case 44:
975
995
  if (!(caller === this.executeFailback.name)) {
976
- _context19.next = 50;
996
+ _context19.next = 51;
977
997
  break;
978
998
  }
979
999
  error = body.statusCode;
980
1000
  if (!(error === _types.ERROR_CODE.TOO_MANY_REQUESTS)) {
981
- _context19.next = 50;
1001
+ _context19.next = 51;
982
1002
  break;
983
1003
  }
984
- _context19.next = 48;
1004
+ _context19.next = 49;
985
1005
  return this.scheduleFailback429Retry();
986
- case 48:
1006
+ case 49:
987
1007
  abort = true;
988
- return _context19.abrupt("break", 52);
989
- case 50:
1008
+ return _context19.abrupt("break", 53);
1009
+ case 51:
990
1010
  _context19.next = 8;
991
1011
  break;
992
- case 52:
993
- _context19.next = 57;
1012
+ case 53:
1013
+ _context19.next = 58;
994
1014
  break;
995
- case 54:
996
- _context19.prev = 54;
1015
+ case 55:
1016
+ _context19.prev = 55;
997
1017
  _context19.t1 = _context19["catch"](6);
998
1018
  _iterator.e(_context19.t1);
999
- case 57:
1000
- _context19.prev = 57;
1019
+ case 58:
1020
+ _context19.prev = 58;
1001
1021
  _iterator.f();
1002
- return _context19.finish(57);
1003
- case 60:
1004
- return _context19.abrupt("return", abort);
1022
+ return _context19.finish(58);
1005
1023
  case 61:
1024
+ return _context19.abrupt("return", abort);
1025
+ case 62:
1006
1026
  case "end":
1007
1027
  return _context19.stop();
1008
1028
  }
1009
- }, _callee19, this, [[6, 54, 57, 60], [10, 30]]);
1029
+ }, _callee19, this, [[6, 55, 58, 61], [10, 30]]);
1010
1030
  }));
1011
1031
  function attemptRegistrationWithServers(_x11) {
1012
1032
  return _attemptRegistrationWithServers.apply(this, arguments);
@@ -1017,6 +1037,7 @@ var Registration = /*#__PURE__*/function () {
1017
1037
  * This method sets up a timer to periodically send keep-alive requests to maintain a connection.
1018
1038
  * It handles retries, error handling, and re-registration attempts based on the response, ensuring continuous connectivity with the server.
1019
1039
  */
1040
+ )
1020
1041
  }, {
1021
1042
  key: "startKeepaliveTimer",
1022
1043
  value: function startKeepaliveTimer(url, interval) {
@@ -1076,7 +1097,7 @@ var Registration = /*#__PURE__*/function () {
1076
1097
  _context20.next = 28;
1077
1098
  break;
1078
1099
  }
1079
- _this7.setStatus(_types3.MobiusStatus.DEFAULT);
1100
+ _this7.setStatus(_types3.RegistrationStatus.INACTIVE);
1080
1101
  _this7.clearKeepaliveTimer();
1081
1102
  _this7.clearFailbackTimer();
1082
1103
  _this7.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
@@ -1141,7 +1162,7 @@ var Registration = /*#__PURE__*/function () {
1141
1162
  _Logger.default.warn("Delete failed with Mobius", {});
1142
1163
  case 8:
1143
1164
  this.clearKeepaliveTimer();
1144
- this.setStatus(_types3.MobiusStatus.DEFAULT);
1165
+ this.setStatus(_types3.RegistrationStatus.INACTIVE);
1145
1166
  case 10:
1146
1167
  case "end":
1147
1168
  return _context22.stop();
@@ -1192,7 +1213,7 @@ var Registration = /*#__PURE__*/function () {
1192
1213
  var stringToReplace = "".concat(_constants.DEVICES_ENDPOINT_RESOURCE, "/").concat(restoreData.devices[0].deviceId);
1193
1214
  var uri = restoreData.devices[0].uri.replace(stringToReplace, '');
1194
1215
  this.setActiveMobiusUrl(uri);
1195
- this.registrationStatus = _types3.MobiusStatus.ACTIVE;
1216
+ this.registrationStatus = _types3.RegistrationStatus.ACTIVE;
1196
1217
  return true;
1197
1218
  }
1198
1219
  return false;
@@ -1209,7 +1230,7 @@ var Registration = /*#__PURE__*/function () {
1209
1230
  */
1210
1231
  }, {
1211
1232
  key: "reconnectOnFailure",
1212
- value: function () {
1233
+ value: (function () {
1213
1234
  var _reconnectOnFailure = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee23(caller) {
1214
1235
  var abort;
1215
1236
  return _regenerator.default.wrap(function _callee23$(_context23) {
@@ -1253,15 +1274,13 @@ var Registration = /*#__PURE__*/function () {
1253
1274
  return _reconnectOnFailure.apply(this, arguments);
1254
1275
  }
1255
1276
  return reconnectOnFailure;
1256
- }()
1277
+ }())
1257
1278
  }]);
1258
1279
  return Registration;
1259
1280
  }();
1260
1281
  /*
1261
1282
  */
1262
- exports.Registration = Registration;
1263
- var createRegistration = function createRegistration(webex, serviceData, mutex, lineEmitter, logLevel) {
1283
+ var createRegistration = exports.createRegistration = function createRegistration(webex, serviceData, mutex, lineEmitter, logLevel) {
1264
1284
  return new Registration(webex, serviceData, mutex, lineEmitter, logLevel);
1265
1285
  };
1266
- exports.createRegistration = createRegistration;
1267
1286
  //# sourceMappingURL=register.js.map