@webex/calling 3.7.0-next.8 → 3.7.0-wxcc.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.
- package/dist/CallHistory/CallHistory.js +67 -195
- package/dist/CallHistory/CallHistory.js.map +1 -1
- package/dist/CallHistory/CallHistory.test.js +108 -331
- package/dist/CallHistory/CallHistory.test.js.map +1 -1
- package/dist/CallHistory/callHistoryFixtures.js +1 -25
- package/dist/CallHistory/callHistoryFixtures.js.map +1 -1
- package/dist/CallHistory/constants.js +1 -4
- package/dist/CallHistory/constants.js.map +1 -1
- package/dist/CallHistory/types.js.map +1 -1
- package/dist/CallingClient/CallingClient.js +2 -2
- package/dist/CallingClient/CallingClient.js.map +1 -1
- package/dist/CallingClient/CallingClient.test.js +2 -2
- package/dist/CallingClient/CallingClient.test.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.js +5 -14
- package/dist/CallingClient/calling/CallerId/index.js.map +1 -1
- package/dist/CallingClient/calling/CallerId/index.test.js +6 -6
- package/dist/CallingClient/calling/CallerId/index.test.js.map +1 -1
- package/dist/CallingClient/calling/call.js +348 -434
- package/dist/CallingClient/calling/call.js.map +1 -1
- package/dist/CallingClient/calling/call.test.js +386 -516
- package/dist/CallingClient/calling/call.test.js.map +1 -1
- package/dist/CallingClient/calling/callManager.js +6 -6
- package/dist/CallingClient/calling/callManager.js.map +1 -1
- package/dist/CallingClient/calling/callManager.test.js +3 -3
- package/dist/CallingClient/calling/callManager.test.js.map +1 -1
- package/dist/CallingClient/calling/types.js +1 -6
- package/dist/CallingClient/calling/types.js.map +1 -1
- package/dist/CallingClient/constants.js +3 -2
- package/dist/CallingClient/constants.js.map +1 -1
- package/dist/CallingClient/line/index.js +7 -14
- package/dist/CallingClient/line/index.js.map +1 -1
- package/dist/CallingClient/line/line.test.js +22 -84
- package/dist/CallingClient/line/line.test.js.map +1 -1
- package/dist/CallingClient/line/types.js.map +1 -1
- package/dist/CallingClient/registration/register.js +59 -79
- package/dist/CallingClient/registration/register.js.map +1 -1
- package/dist/CallingClient/registration/register.test.js +1 -1
- package/dist/CallingClient/registration/register.test.js.map +1 -1
- package/dist/CallingClient/types.js.map +1 -1
- package/dist/Contacts/ContactsClient.js +14 -14
- package/dist/Contacts/ContactsClient.js.map +1 -1
- package/dist/Events/types.js +0 -2
- package/dist/Events/types.js.map +1 -1
- package/dist/common/Utils.js +13 -18
- package/dist/common/Utils.js.map +1 -1
- package/dist/common/Utils.test.js +0 -97
- package/dist/common/Utils.test.js.map +1 -1
- package/dist/common/constants.js +3 -4
- package/dist/common/constants.js.map +1 -1
- package/dist/common/types.js +0 -1
- package/dist/common/types.js.map +1 -1
- package/dist/index.js +12 -0
- package/dist/index.js.map +1 -1
- package/dist/module/CallHistory/CallHistory.js +2 -64
- package/dist/module/CallHistory/callHistoryFixtures.js +0 -24
- package/dist/module/CallHistory/constants.js +0 -3
- package/dist/module/CallingClient/CallingClient.js +1 -1
- package/dist/module/CallingClient/calling/CallerId/index.js +6 -6
- package/dist/module/CallingClient/calling/call.js +22 -66
- package/dist/module/CallingClient/calling/callManager.js +5 -5
- package/dist/module/CallingClient/calling/types.js +0 -5
- package/dist/module/CallingClient/constants.js +2 -1
- package/dist/module/CallingClient/line/index.js +8 -14
- package/dist/module/CallingClient/registration/register.js +4 -12
- package/dist/module/Contacts/ContactsClient.js +2 -2
- package/dist/module/Events/types.js +0 -2
- package/dist/module/common/Utils.js +5 -12
- package/dist/module/common/constants.js +2 -3
- package/dist/module/common/types.js +0 -1
- package/dist/module/index.js +1 -0
- package/dist/types/CallHistory/CallHistory.d.ts +2 -4
- package/dist/types/CallHistory/CallHistory.d.ts.map +1 -1
- package/dist/types/CallHistory/callHistoryFixtures.d.ts +2 -6
- package/dist/types/CallHistory/callHistoryFixtures.d.ts.map +1 -1
- package/dist/types/CallHistory/constants.d.ts +0 -3
- package/dist/types/CallHistory/constants.d.ts.map +1 -1
- package/dist/types/CallHistory/types.d.ts +0 -9
- package/dist/types/CallHistory/types.d.ts.map +1 -1
- package/dist/types/CallingClient/CallingClient.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/CallerId/index.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/call.d.ts +5 -7
- package/dist/types/CallingClient/calling/call.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts +1 -1
- package/dist/types/CallingClient/calling/callManager.d.ts.map +1 -1
- package/dist/types/CallingClient/calling/types.d.ts +2 -6
- package/dist/types/CallingClient/calling/types.d.ts.map +1 -1
- package/dist/types/CallingClient/constants.d.ts +2 -1
- package/dist/types/CallingClient/constants.d.ts.map +1 -1
- package/dist/types/CallingClient/line/index.d.ts +2 -3
- package/dist/types/CallingClient/line/index.d.ts.map +1 -1
- package/dist/types/CallingClient/line/types.d.ts +1 -1
- package/dist/types/CallingClient/line/types.d.ts.map +1 -1
- package/dist/types/CallingClient/registration/register.d.ts +2 -4
- package/dist/types/CallingClient/registration/register.d.ts.map +1 -1
- package/dist/types/CallingClient/types.d.ts +0 -1
- package/dist/types/CallingClient/types.d.ts.map +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts +1 -1
- package/dist/types/Contacts/ContactsClient.d.ts.map +1 -1
- package/dist/types/Events/types.d.ts +2 -15
- package/dist/types/Events/types.d.ts.map +1 -1
- package/dist/types/Voicemail/UcmBackendConnector.d.ts +1 -1
- package/dist/types/Voicemail/WxCallBackendConnector.d.ts +1 -1
- package/dist/types/common/Utils.d.ts +2 -2
- package/dist/types/common/Utils.d.ts.map +1 -1
- package/dist/types/common/constants.d.ts +0 -1
- package/dist/types/common/constants.d.ts.map +1 -1
- package/dist/types/common/types.d.ts +1 -2
- package/dist/types/common/types.d.ts.map +1 -1
- package/dist/types/index.d.ts +2 -0
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["LINE_EVENTS","exports"],"sources":["types.ts"],"sourcesContent":["import {LineEventTypes} from '../../Events/types';\nimport {Eventing} from '../../Events/impl';\nimport {IRegistration} from '../registration/types';\nimport {LineError} from '../../Errors/catalog/LineError';\nimport {\n CallDetails,\n CorrelationId,\n IDeviceInfo,\n MobiusDeviceId,\n RegistrationStatus,\n} from '../../common/types';\nimport {ICall} from '../calling/types';\n\nexport enum LINE_EVENTS {\n CONNECTING = 'connecting',\n ERROR = 'error',\n RECONNECTED = 'reconnected',\n RECONNECTING = 'reconnecting',\n REGISTERED = 'registered',\n UNREGISTERED = 'unregistered',\n INCOMING_CALL = 'line:incoming_call',\n}\n\n/**\n * Represents an interface for managing a telephony line.\n */\nexport interface ILine extends Eventing<LineEventTypes> {\n /**\n * The unique identifier of the user associated with the line.\n */\n userId: string;\n\n /**\n * The URI of the client device associated with the line.\n */\n clientDeviceUri: string;\n\n /**\n * The unique identifier of the line.\n */\n lineId: string;\n\n /**\n * The optional Mobius device identifier associated with the line.\n */\n mobiusDeviceId?: string;\n\n /**\n * The phone number associated with the line.\n */\n phoneNumber?: string;\n\n /**\n * The extension number associated with the line.\n */\n extension?: string;\n\n /**\n * An array of SIP addresses associated with the line.\n */\n sipAddresses?: string[];\n\n /**\n * The voicemail number associated with the line.\n */\n voicemail?: string;\n\n /**\n * The timestamp when the line was last seen.\n */\n lastSeen?: string;\n\n /**\n * The interval for sending keep-alive messages for the line.\n */\n keepaliveInterval?: number;\n\n /**\n * The interval for sending call keep-alive messages for the line.\n */\n callKeepaliveInterval?: number;\n\n /**\n * The minimum rehoming interval for the line.\n */\n rehomingIntervalMin?: number;\n\n /**\n * The maximum rehoming interval for the line.\n */\n rehomingIntervalMax?: number;\n\n /**\n * The voice portal number associated with the line.\n */\n voicePortalNumber?: number;\n\n /**\n * The voice portal extension associated with the line.\n */\n voicePortalExtension?: number;\n\n /**\n * The registration information for the line as {@link IRegistration}.\n */\n registration: IRegistration;\n\n /**\n * Registers the line.\n */\n register(): void;\n\n /**\n * Deregisters the line.\n */\n deregister(): void;\n\n /**\n * Retrieves the active Mobius server URL associated with the line.\n *\n */\n getActiveMobiusUrl(): string;\n\n /**\n * Retrieves the registration status of the line as {@link MobiusStatus}.\n *\n */\n getStatus(): RegistrationStatus;\n\n /**\n * Retrieves the device identifier associated with the line as {@link MobiusDeviceId},\n * or `undefined` if no device is associated.\n *\n */\n getDeviceId(): MobiusDeviceId | undefined;\n\n /**\n * Emits line-related events.\n *\n * @param event - The line event to emit.\n * @param deviceInfo - Additional device information (optional).\n * @param lineError - Information about line-related errors (optional).\n *\n * @example\n * ```typescript\n * line.lineEmitter(LINE_EVENTS.UNREGISTERED);\n * ```\n * @ignore\n */\n lineEmitter: (event: LINE_EVENTS, deviceInfo?: IDeviceInfo, lineError?: LineError) => void;\n\n /**\n * Initiates a call to the specified destination.\n *\n * @param dest - The call details including destination information.\n *\n * @example\n * ```typescript\n * const callDetails : CallDetails = {type: 'uri', address: 'example@webex.com'};\n * const callObj: ICall = line.makeCall(callDetails);\n * ```\n */\n makeCall(dest
|
|
1
|
+
{"version":3,"names":["LINE_EVENTS","exports"],"sources":["types.ts"],"sourcesContent":["import {LineEventTypes} from '../../Events/types';\nimport {Eventing} from '../../Events/impl';\nimport {IRegistration} from '../registration/types';\nimport {LineError} from '../../Errors/catalog/LineError';\nimport {\n CallDetails,\n CorrelationId,\n IDeviceInfo,\n MobiusDeviceId,\n RegistrationStatus,\n} from '../../common/types';\nimport {ICall} from '../calling/types';\n\nexport enum LINE_EVENTS {\n CONNECTING = 'connecting',\n ERROR = 'error',\n RECONNECTED = 'reconnected',\n RECONNECTING = 'reconnecting',\n REGISTERED = 'registered',\n UNREGISTERED = 'unregistered',\n INCOMING_CALL = 'line:incoming_call',\n}\n\n/**\n * Represents an interface for managing a telephony line.\n */\nexport interface ILine extends Eventing<LineEventTypes> {\n /**\n * The unique identifier of the user associated with the line.\n */\n userId: string;\n\n /**\n * The URI of the client device associated with the line.\n */\n clientDeviceUri: string;\n\n /**\n * The unique identifier of the line.\n */\n lineId: string;\n\n /**\n * The optional Mobius device identifier associated with the line.\n */\n mobiusDeviceId?: string;\n\n /**\n * The phone number associated with the line.\n */\n phoneNumber?: string;\n\n /**\n * The extension number associated with the line.\n */\n extension?: string;\n\n /**\n * An array of SIP addresses associated with the line.\n */\n sipAddresses?: string[];\n\n /**\n * The voicemail number associated with the line.\n */\n voicemail?: string;\n\n /**\n * The timestamp when the line was last seen.\n */\n lastSeen?: string;\n\n /**\n * The interval for sending keep-alive messages for the line.\n */\n keepaliveInterval?: number;\n\n /**\n * The interval for sending call keep-alive messages for the line.\n */\n callKeepaliveInterval?: number;\n\n /**\n * The minimum rehoming interval for the line.\n */\n rehomingIntervalMin?: number;\n\n /**\n * The maximum rehoming interval for the line.\n */\n rehomingIntervalMax?: number;\n\n /**\n * The voice portal number associated with the line.\n */\n voicePortalNumber?: number;\n\n /**\n * The voice portal extension associated with the line.\n */\n voicePortalExtension?: number;\n\n /**\n * The registration information for the line as {@link IRegistration}.\n */\n registration: IRegistration;\n\n /**\n * Registers the line.\n */\n register(): void;\n\n /**\n * Deregisters the line.\n */\n deregister(): void;\n\n /**\n * Retrieves the active Mobius server URL associated with the line.\n *\n */\n getActiveMobiusUrl(): string;\n\n /**\n * Retrieves the registration status of the line as {@link MobiusStatus}.\n *\n */\n getStatus(): RegistrationStatus;\n\n /**\n * Retrieves the device identifier associated with the line as {@link MobiusDeviceId},\n * or `undefined` if no device is associated.\n *\n */\n getDeviceId(): MobiusDeviceId | undefined;\n\n /**\n * Emits line-related events.\n *\n * @param event - The line event to emit.\n * @param deviceInfo - Additional device information (optional).\n * @param lineError - Information about line-related errors (optional).\n *\n * @example\n * ```typescript\n * line.lineEmitter(LINE_EVENTS.UNREGISTERED);\n * ```\n * @ignore\n */\n lineEmitter: (event: LINE_EVENTS, deviceInfo?: IDeviceInfo, lineError?: LineError) => void;\n\n /**\n * Initiates a call to the specified destination.\n *\n * @param dest - The call details including destination information.\n *\n * @example\n * ```typescript\n * const callDetails : CallDetails = {type: 'uri', address: 'example@webex.com'};\n * const callObj: ICall = line.makeCall(callDetails);\n * ```\n */\n makeCall(dest: CallDetails): ICall | undefined;\n\n /**\n * Retrieves a call object based on the provided correlation identifier.\n *\n * @param correlationId - The correlation identifier of the call.\n * @example\n * ```typescript\n * const callObj: ICall = line.getCall(correlationId);\n * ```\n */\n getCall(correlationId: CorrelationId): ICall;\n}\n\nexport type LineEmitterCallback = (\n event: LINE_EVENTS,\n deviceInfo?: IDeviceInfo,\n clientError?: LineError\n) => void;\n\nexport type LineErrorEmitterCallback = (err: LineError, finalError?: boolean) => void;\n"],"mappings":";;;;;;;IAaYA,WAAW,GAAAC,OAAA,CAAAD,WAAA,0BAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAXA,WAAW;EAAA,OAAXA,WAAW;AAAA;AAUvB;AACA;AACA"}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
var _Object$keys2 = require("@babel/runtime-corejs2/core-js/object/keys");
|
|
4
|
-
var _Object$getOwnPropertySymbols = require("@babel/runtime-corejs2/core-js/object/get-own-property-symbols");
|
|
5
|
-
var _Object$getOwnPropertyDescriptor = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptor");
|
|
6
|
-
var _Object$getOwnPropertyDescriptors = require("@babel/runtime-corejs2/core-js/object/get-own-property-descriptors");
|
|
7
|
-
var _Object$defineProperties = require("@babel/runtime-corejs2/core-js/object/define-properties");
|
|
8
|
-
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
9
3
|
var _Array$from = require("@babel/runtime-corejs2/core-js/array/from");
|
|
10
4
|
var _Symbol = require("@babel/runtime-corejs2/core-js/symbol");
|
|
11
5
|
var _Symbol$iterator = require("@babel/runtime-corejs2/core-js/symbol/iterator");
|
|
12
6
|
var _Array$isArray = require("@babel/runtime-corejs2/core-js/array/is-array");
|
|
7
|
+
var _Object$defineProperty = require("@babel/runtime-corejs2/core-js/object/define-property");
|
|
13
8
|
var _interopRequireDefault = require("@babel/runtime-corejs2/helpers/interopRequireDefault");
|
|
14
9
|
_Object$defineProperty(exports, "__esModule", {
|
|
15
10
|
value: true
|
|
@@ -36,15 +31,13 @@ var _types4 = require("../line/types");
|
|
|
36
31
|
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof _Symbol !== "undefined" && o[_Symbol$iterator] || o["@@iterator"]; if (!it) { if (_Array$isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
|
|
37
32
|
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return _Array$from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
|
|
38
33
|
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
|
|
39
|
-
function ownKeys(e, r) { var t = _Object$keys2(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; }
|
|
40
|
-
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; }
|
|
41
34
|
/**
|
|
42
35
|
*
|
|
43
36
|
*/
|
|
44
37
|
var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
45
38
|
/**
|
|
46
39
|
*/
|
|
47
|
-
function Registration(webex, serviceData, mutex, lineEmitter, logLevel
|
|
40
|
+
function Registration(webex, serviceData, mutex, lineEmitter, logLevel) {
|
|
48
41
|
(0, _classCallCheck2.default)(this, Registration);
|
|
49
42
|
(0, _defineProperty2.default)(this, "sdkConnector", void 0);
|
|
50
43
|
(0, _defineProperty2.default)(this, "webex", void 0);
|
|
@@ -66,10 +59,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
66
59
|
(0, _defineProperty2.default)(this, "backupMobiusUris", void 0);
|
|
67
60
|
(0, _defineProperty2.default)(this, "registerRetry", false);
|
|
68
61
|
(0, _defineProperty2.default)(this, "reconnectPending", false);
|
|
69
|
-
(0, _defineProperty2.default)(this, "jwe", void 0);
|
|
70
62
|
(0, _defineProperty2.default)(this, "isCCFlow", false);
|
|
71
|
-
(0, _defineProperty2.default)(this, "failoverImmediately", false);
|
|
72
|
-
this.jwe = jwe;
|
|
73
63
|
this.sdkConnector = _SDKConnector.default;
|
|
74
64
|
this.serviceData = serviceData;
|
|
75
65
|
this.isCCFlow = serviceData.indicator === _types3.ServiceIndicator.CONTACT_CENTER;
|
|
@@ -217,9 +207,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
217
207
|
deviceInfo = {
|
|
218
208
|
userId: this.userId,
|
|
219
209
|
clientDeviceUri: this.webex.internal.device.url,
|
|
220
|
-
serviceData: this.
|
|
221
|
-
jwe: this.jwe
|
|
222
|
-
}) : this.serviceData
|
|
210
|
+
serviceData: this.serviceData
|
|
223
211
|
};
|
|
224
212
|
return _context3.abrupt("return", this.webex.request({
|
|
225
213
|
uri: "".concat(url, "device"),
|
|
@@ -374,7 +362,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
374
362
|
excessVal = timeElapsed + interval - TIMER_THRESHOLD;
|
|
375
363
|
interval -= excessVal;
|
|
376
364
|
}
|
|
377
|
-
if (!(interval > _constants.BASE_REG_RETRY_TIMER_VAL_IN_SEC
|
|
365
|
+
if (!(interval > _constants.BASE_REG_RETRY_TIMER_VAL_IN_SEC)) {
|
|
378
366
|
_context10.next = 12;
|
|
379
367
|
break;
|
|
380
368
|
}
|
|
@@ -413,18 +401,17 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
413
401
|
}, _callee7);
|
|
414
402
|
})), interval * _constants.SEC_TO_MSEC_MFACTOR);
|
|
415
403
|
_Logger.default.log("Scheduled retry with primary in ".concat(interval, " seconds, number of attempts : ").concat(attempt), loggerContext);
|
|
416
|
-
_context10.next =
|
|
404
|
+
_context10.next = 21;
|
|
417
405
|
break;
|
|
418
406
|
case 12:
|
|
419
407
|
if (!this.backupMobiusUris.length) {
|
|
420
|
-
_context10.next =
|
|
408
|
+
_context10.next = 20;
|
|
421
409
|
break;
|
|
422
410
|
}
|
|
423
411
|
_Logger.default.log('Failing over to backup servers.', loggerContext);
|
|
424
|
-
|
|
425
|
-
_context10.next = 17;
|
|
412
|
+
_context10.next = 16;
|
|
426
413
|
return this.attemptRegistrationWithServers(this.startFailoverTimer.name, this.backupMobiusUris);
|
|
427
|
-
case
|
|
414
|
+
case 16:
|
|
428
415
|
abort = _context10.sent;
|
|
429
416
|
if (!abort && !this.isDeviceRegistered()) {
|
|
430
417
|
interval = this.getRegRetryInterval();
|
|
@@ -460,13 +447,13 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
460
447
|
})), interval * _constants.SEC_TO_MSEC_MFACTOR);
|
|
461
448
|
_Logger.default.log("Scheduled retry with backup servers in ".concat(interval, " seconds."), loggerContext);
|
|
462
449
|
}
|
|
463
|
-
_context10.next =
|
|
450
|
+
_context10.next = 21;
|
|
464
451
|
break;
|
|
465
|
-
case
|
|
452
|
+
case 20:
|
|
466
453
|
(0, _common.emitFinalFailure)(function (clientError) {
|
|
467
454
|
_this.lineEmitter(_types4.LINE_EVENTS.ERROR, undefined, clientError);
|
|
468
455
|
}, loggerContext);
|
|
469
|
-
case
|
|
456
|
+
case 21:
|
|
470
457
|
case "end":
|
|
471
458
|
return _context10.stop();
|
|
472
459
|
}
|
|
@@ -932,14 +919,8 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
932
919
|
case 0:
|
|
933
920
|
servers = _args19.length > 1 && _args19[1] !== undefined ? _args19[1] : this.primaryMobiusUris;
|
|
934
921
|
abort = false;
|
|
935
|
-
if (!this.failoverImmediately) {
|
|
936
|
-
_context19.next = 4;
|
|
937
|
-
break;
|
|
938
|
-
}
|
|
939
|
-
return _context19.abrupt("return", abort);
|
|
940
|
-
case 4:
|
|
941
922
|
if (!this.isDeviceRegistered()) {
|
|
942
|
-
_context19.next =
|
|
923
|
+
_context19.next = 5;
|
|
943
924
|
break;
|
|
944
925
|
}
|
|
945
926
|
_Logger.default.log("[".concat(caller, "] : Device already registered with : ").concat(this.activeMobiusUrl), {
|
|
@@ -947,17 +928,17 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
947
928
|
method: this.attemptRegistrationWithServers.name
|
|
948
929
|
});
|
|
949
930
|
return _context19.abrupt("return", abort);
|
|
950
|
-
case
|
|
931
|
+
case 5:
|
|
951
932
|
_iterator = _createForOfIteratorHelper(servers);
|
|
952
|
-
_context19.prev =
|
|
933
|
+
_context19.prev = 6;
|
|
953
934
|
_iterator.s();
|
|
954
|
-
case
|
|
935
|
+
case 8:
|
|
955
936
|
if ((_step = _iterator.n()).done) {
|
|
956
|
-
_context19.next =
|
|
937
|
+
_context19.next = 53;
|
|
957
938
|
break;
|
|
958
939
|
}
|
|
959
940
|
url = _step.value;
|
|
960
|
-
_context19.prev =
|
|
941
|
+
_context19.prev = 10;
|
|
961
942
|
abort = false;
|
|
962
943
|
this.registrationStatus = _types3.RegistrationStatus.INACTIVE;
|
|
963
944
|
this.lineEmitter(_types4.LINE_EVENTS.CONNECTING);
|
|
@@ -966,9 +947,9 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
966
947
|
method: this.attemptRegistrationWithServers.name
|
|
967
948
|
});
|
|
968
949
|
// eslint-disable-next-line no-await-in-loop
|
|
969
|
-
_context19.next =
|
|
950
|
+
_context19.next = 17;
|
|
970
951
|
return this.postRegistration(url);
|
|
971
|
-
case
|
|
952
|
+
case 17:
|
|
972
953
|
resp = _context19.sent;
|
|
973
954
|
this.deviceInfo = resp.body;
|
|
974
955
|
this.registrationStatus = _types3.RegistrationStatus.ACTIVE;
|
|
@@ -979,12 +960,12 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
979
960
|
this.metricManager.submitRegistrationMetric(_types2.METRIC_EVENT.REGISTRATION, _types2.REG_ACTION.REGISTER, _types2.METRIC_TYPE.BEHAVIORAL, undefined);
|
|
980
961
|
this.startKeepaliveTimer((_this$deviceInfo$devi = this.deviceInfo.device) === null || _this$deviceInfo$devi === void 0 ? void 0 : _this$deviceInfo$devi.uri, this.deviceInfo.keepaliveInterval);
|
|
981
962
|
this.initiateFailback();
|
|
982
|
-
return _context19.abrupt("break",
|
|
983
|
-
case
|
|
984
|
-
_context19.prev =
|
|
985
|
-
_context19.t0 = _context19["catch"](
|
|
963
|
+
return _context19.abrupt("break", 53);
|
|
964
|
+
case 30:
|
|
965
|
+
_context19.prev = 30;
|
|
966
|
+
_context19.t0 = _context19["catch"](10);
|
|
986
967
|
body = _context19.t0; // eslint-disable-next-line no-await-in-loop, @typescript-eslint/no-unused-vars
|
|
987
|
-
_context19.next =
|
|
968
|
+
_context19.next = 35;
|
|
988
969
|
return (0, _common.handleRegistrationErrors)(body, function (clientError, finalError) {
|
|
989
970
|
if (finalError) {
|
|
990
971
|
_this6.lineEmitter(_types4.LINE_EVENTS.ERROR, undefined, clientError);
|
|
@@ -996,60 +977,60 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
996
977
|
method: this.attemptRegistrationWithServers.name,
|
|
997
978
|
file: _constants.REGISTRATION_FILE
|
|
998
979
|
}, this.restoreRegistrationCallBack());
|
|
999
|
-
case
|
|
980
|
+
case 35:
|
|
1000
981
|
abort = _context19.sent;
|
|
1001
982
|
if (!(this.registrationStatus === _types3.RegistrationStatus.ACTIVE)) {
|
|
1002
|
-
_context19.next =
|
|
983
|
+
_context19.next = 39;
|
|
1003
984
|
break;
|
|
1004
985
|
}
|
|
1005
986
|
_Logger.default.info("[".concat(caller, "] : Device is already restored, active mobius url: ").concat(this.activeMobiusUrl), {
|
|
1006
987
|
file: _constants.REGISTRATION_FILE,
|
|
1007
988
|
method: this.attemptRegistrationWithServers.name
|
|
1008
989
|
});
|
|
1009
|
-
return _context19.abrupt("break",
|
|
1010
|
-
case
|
|
990
|
+
return _context19.abrupt("break", 53);
|
|
991
|
+
case 39:
|
|
1011
992
|
if (!abort) {
|
|
1012
|
-
_context19.next =
|
|
993
|
+
_context19.next = 44;
|
|
1013
994
|
break;
|
|
1014
995
|
}
|
|
1015
996
|
this.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
1016
|
-
return _context19.abrupt("break",
|
|
1017
|
-
case
|
|
997
|
+
return _context19.abrupt("break", 53);
|
|
998
|
+
case 44:
|
|
1018
999
|
if (!(caller === this.executeFailback.name)) {
|
|
1019
|
-
_context19.next =
|
|
1000
|
+
_context19.next = 51;
|
|
1020
1001
|
break;
|
|
1021
1002
|
}
|
|
1022
1003
|
error = body.statusCode;
|
|
1023
1004
|
if (!(error === _types.ERROR_CODE.TOO_MANY_REQUESTS)) {
|
|
1024
|
-
_context19.next =
|
|
1005
|
+
_context19.next = 51;
|
|
1025
1006
|
break;
|
|
1026
1007
|
}
|
|
1027
|
-
_context19.next =
|
|
1008
|
+
_context19.next = 49;
|
|
1028
1009
|
return this.scheduleFailback429Retry();
|
|
1029
|
-
case
|
|
1010
|
+
case 49:
|
|
1030
1011
|
abort = true;
|
|
1031
|
-
return _context19.abrupt("break",
|
|
1012
|
+
return _context19.abrupt("break", 53);
|
|
1013
|
+
case 51:
|
|
1014
|
+
_context19.next = 8;
|
|
1015
|
+
break;
|
|
1032
1016
|
case 53:
|
|
1033
|
-
_context19.next =
|
|
1017
|
+
_context19.next = 58;
|
|
1034
1018
|
break;
|
|
1035
1019
|
case 55:
|
|
1036
|
-
_context19.
|
|
1037
|
-
|
|
1038
|
-
case 57:
|
|
1039
|
-
_context19.prev = 57;
|
|
1040
|
-
_context19.t1 = _context19["catch"](8);
|
|
1020
|
+
_context19.prev = 55;
|
|
1021
|
+
_context19.t1 = _context19["catch"](6);
|
|
1041
1022
|
_iterator.e(_context19.t1);
|
|
1042
|
-
case
|
|
1043
|
-
_context19.prev =
|
|
1023
|
+
case 58:
|
|
1024
|
+
_context19.prev = 58;
|
|
1044
1025
|
_iterator.f();
|
|
1045
|
-
return _context19.finish(
|
|
1046
|
-
case
|
|
1026
|
+
return _context19.finish(58);
|
|
1027
|
+
case 61:
|
|
1047
1028
|
return _context19.abrupt("return", abort);
|
|
1048
|
-
case
|
|
1029
|
+
case 62:
|
|
1049
1030
|
case "end":
|
|
1050
1031
|
return _context19.stop();
|
|
1051
1032
|
}
|
|
1052
|
-
}, _callee19, this, [[
|
|
1033
|
+
}, _callee19, this, [[6, 55, 58, 61], [10, 30]]);
|
|
1053
1034
|
}));
|
|
1054
1035
|
function attemptRegistrationWithServers(_x11) {
|
|
1055
1036
|
return _attemptRegistrationWithServers.apply(this, arguments);
|
|
@@ -1084,7 +1065,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1084
1065
|
while (1) switch (_context20.prev = _context20.next) {
|
|
1085
1066
|
case 0:
|
|
1086
1067
|
if (!(_this7.isDeviceRegistered() && keepAliveRetryCount < RETRY_COUNT_THRESHOLD)) {
|
|
1087
|
-
_context20.next =
|
|
1068
|
+
_context20.next = 29;
|
|
1088
1069
|
break;
|
|
1089
1070
|
}
|
|
1090
1071
|
_context20.prev = 1;
|
|
@@ -1097,7 +1078,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1097
1078
|
_this7.lineEmitter(_types4.LINE_EVENTS.RECONNECTED);
|
|
1098
1079
|
}
|
|
1099
1080
|
keepAliveRetryCount = 0;
|
|
1100
|
-
_context20.next =
|
|
1081
|
+
_context20.next = 29;
|
|
1101
1082
|
break;
|
|
1102
1083
|
case 10:
|
|
1103
1084
|
_context20.prev = 10;
|
|
@@ -1118,26 +1099,25 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1118
1099
|
case 17:
|
|
1119
1100
|
abort = _context20.sent;
|
|
1120
1101
|
if (!(abort || keepAliveRetryCount >= RETRY_COUNT_THRESHOLD)) {
|
|
1121
|
-
_context20.next =
|
|
1102
|
+
_context20.next = 28;
|
|
1122
1103
|
break;
|
|
1123
1104
|
}
|
|
1124
|
-
_this7.failoverImmediately = _this7.isCCFlow;
|
|
1125
1105
|
_this7.setStatus(_types3.RegistrationStatus.INACTIVE);
|
|
1126
1106
|
_this7.clearKeepaliveTimer();
|
|
1127
1107
|
_this7.clearFailbackTimer();
|
|
1128
1108
|
_this7.lineEmitter(_types4.LINE_EVENTS.UNREGISTERED);
|
|
1129
1109
|
if (abort) {
|
|
1130
|
-
_context20.next =
|
|
1110
|
+
_context20.next = 26;
|
|
1131
1111
|
break;
|
|
1132
1112
|
}
|
|
1133
|
-
_context20.next =
|
|
1113
|
+
_context20.next = 26;
|
|
1134
1114
|
return _this7.reconnectOnFailure(_this7.startKeepaliveTimer.name);
|
|
1135
|
-
case
|
|
1136
|
-
_context20.next =
|
|
1115
|
+
case 26:
|
|
1116
|
+
_context20.next = 29;
|
|
1137
1117
|
break;
|
|
1138
|
-
case
|
|
1118
|
+
case 28:
|
|
1139
1119
|
_this7.lineEmitter(_types4.LINE_EVENTS.RECONNECTING);
|
|
1140
|
-
case
|
|
1120
|
+
case 29:
|
|
1141
1121
|
case "end":
|
|
1142
1122
|
return _context20.stop();
|
|
1143
1123
|
}
|
|
@@ -1305,7 +1285,7 @@ var Registration = exports.Registration = /*#__PURE__*/function () {
|
|
|
1305
1285
|
}();
|
|
1306
1286
|
/*
|
|
1307
1287
|
*/
|
|
1308
|
-
var createRegistration = exports.createRegistration = function createRegistration(webex, serviceData, mutex, lineEmitter, logLevel
|
|
1309
|
-
return new Registration(webex, serviceData, mutex, lineEmitter, logLevel
|
|
1288
|
+
var createRegistration = exports.createRegistration = function createRegistration(webex, serviceData, mutex, lineEmitter, logLevel) {
|
|
1289
|
+
return new Registration(webex, serviceData, mutex, lineEmitter, logLevel);
|
|
1310
1290
|
};
|
|
1311
1291
|
//# sourceMappingURL=register.js.map
|