@webex/internal-plugin-mercury 2.60.1-next.9 → 2.60.2

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/config.js CHANGED
@@ -8,7 +8,7 @@ exports.default = void 0;
8
8
  /*!
9
9
  * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
10
10
  */
11
- var _default = exports.default = {
11
+ var _default = {
12
12
  mercury: {
13
13
  /**
14
14
  * Milliseconds between pings sent up the socket
@@ -38,4 +38,5 @@ var _default = exports.default = {
38
38
  forceCloseDelay: process.env.MERCURY_FORCE_CLOSE_DELAY || 2000
39
39
  }
40
40
  };
41
+ exports.default = _default;
41
42
  //# sourceMappingURL=config.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_default","exports","default","mercury","pingInterval","process","env","MERCURY_PING_INTERVAL","pongTimeout","MERCURY_PONG_TIMEOUT","backoffTimeMax","MERCURY_BACKOFF_TIME_MAX","backoffTimeReset","MERCURY_BACKOFF_TIME_RESET","forceCloseDelay","MERCURY_FORCE_CLOSE_DELAY"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n mercury: {\n /**\n * Milliseconds between pings sent up the socket\n * @type {number}\n */\n pingInterval: process.env.MERCURY_PING_INTERVAL || 15000,\n /**\n * Milliseconds to wait for a pong before declaring the connection dead\n * @type {number}\n */\n pongTimeout: process.env.MERCURY_PONG_TIMEOUT || 14000,\n /**\n * Maximum milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeMax: process.env.MERCURY_BACKOFF_TIME_MAX || 32000,\n /**\n * Initial milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeReset: process.env.MERCURY_BACKOFF_TIME_RESET || 1000,\n /**\n * Milliseconds to wait for a close frame before declaring the socket dead and\n * discarding it\n * @type {[type]}\n */\n forceCloseDelay: process.env.MERCURY_FORCE_CLOSE_DELAY || 2000,\n },\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAAAA,QAAA,GAAAC,OAAA,CAAAC,OAAA,GAIe;EACbC,OAAO,EAAE;IACP;AACJ;AACA;AACA;IACIC,YAAY,EAAEC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAI,KAAK;IACxD;AACJ;AACA;AACA;IACIC,WAAW,EAAEH,OAAO,CAACC,GAAG,CAACG,oBAAoB,IAAI,KAAK;IACtD;AACJ;AACA;AACA;IACIC,cAAc,EAAEL,OAAO,CAACC,GAAG,CAACK,wBAAwB,IAAI,KAAK;IAC7D;AACJ;AACA;AACA;IACIC,gBAAgB,EAAEP,OAAO,CAACC,GAAG,CAACO,0BAA0B,IAAI,IAAI;IAChE;AACJ;AACA;AACA;AACA;IACIC,eAAe,EAAET,OAAO,CAACC,GAAG,CAACS,yBAAyB,IAAI;EAC5D;AACF,CAAC"}
1
+ {"version":3,"names":["_default","mercury","pingInterval","process","env","MERCURY_PING_INTERVAL","pongTimeout","MERCURY_PONG_TIMEOUT","backoffTimeMax","MERCURY_BACKOFF_TIME_MAX","backoffTimeReset","MERCURY_BACKOFF_TIME_RESET","forceCloseDelay","MERCURY_FORCE_CLOSE_DELAY","exports","default"],"sources":["config.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nexport default {\n mercury: {\n /**\n * Milliseconds between pings sent up the socket\n * @type {number}\n */\n pingInterval: process.env.MERCURY_PING_INTERVAL || 15000,\n /**\n * Milliseconds to wait for a pong before declaring the connection dead\n * @type {number}\n */\n pongTimeout: process.env.MERCURY_PONG_TIMEOUT || 14000,\n /**\n * Maximum milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeMax: process.env.MERCURY_BACKOFF_TIME_MAX || 32000,\n /**\n * Initial milliseconds between connection attempts\n * @type {Number}\n */\n backoffTimeReset: process.env.MERCURY_BACKOFF_TIME_RESET || 1000,\n /**\n * Milliseconds to wait for a close frame before declaring the socket dead and\n * discarding it\n * @type {[type]}\n */\n forceCloseDelay: process.env.MERCURY_FORCE_CLOSE_DELAY || 2000,\n },\n};\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AAFA,IAAAA,QAAA,GAIe;EACbC,OAAO,EAAE;IACP;AACJ;AACA;AACA;IACIC,YAAY,EAAEC,OAAO,CAACC,GAAG,CAACC,qBAAqB,IAAI,KAAK;IACxD;AACJ;AACA;AACA;IACIC,WAAW,EAAEH,OAAO,CAACC,GAAG,CAACG,oBAAoB,IAAI,KAAK;IACtD;AACJ;AACA;AACA;IACIC,cAAc,EAAEL,OAAO,CAACC,GAAG,CAACK,wBAAwB,IAAI,KAAK;IAC7D;AACJ;AACA;AACA;IACIC,gBAAgB,EAAEP,OAAO,CAACC,GAAG,CAACO,0BAA0B,IAAI,IAAI;IAChE;AACJ;AACA;AACA;AACA;IACIC,eAAe,EAAET,OAAO,CAACC,GAAG,CAACS,yBAAyB,IAAI;EAC5D;AACF,CAAC;AAAAC,OAAA,CAAAC,OAAA,GAAAf,QAAA"}
package/dist/errors.js CHANGED
@@ -16,13 +16,11 @@ var _getPrototypeOf2 = _interopRequireDefault(require("@babel/runtime-corejs2/he
16
16
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
17
17
  var _common = require("@webex/common");
18
18
  function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2.default)(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2.default)(this).constructor; result = _Reflect$construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2.default)(this, result); }; }
19
- function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } /*!
20
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
21
- */
19
+ function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !_Reflect$construct) return false; if (_Reflect$construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(_Reflect$construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
22
20
  /**
23
21
  * Exception thrown when a websocket gets closed
24
22
  */
25
- var ConnectionError = exports.ConnectionError = /*#__PURE__*/function (_Exception) {
23
+ var ConnectionError = /*#__PURE__*/function (_Exception) {
26
24
  (0, _inherits2.default)(ConnectionError, _Exception);
27
25
  var _super = _createSuper(ConnectionError);
28
26
  function ConnectionError() {
@@ -54,8 +52,9 @@ var ConnectionError = exports.ConnectionError = /*#__PURE__*/function (_Exceptio
54
52
  /**
55
53
  * thrown for CloseCode 4400
56
54
  */
55
+ exports.ConnectionError = ConnectionError;
57
56
  (0, _defineProperty2.default)(ConnectionError, "defaultMessage", 'Failed to connect to socket');
58
- var UnknownResponse = exports.UnknownResponse = /*#__PURE__*/function (_ConnectionError) {
57
+ var UnknownResponse = /*#__PURE__*/function (_ConnectionError) {
59
58
  (0, _inherits2.default)(UnknownResponse, _ConnectionError);
60
59
  var _super2 = _createSuper(UnknownResponse);
61
60
  function UnknownResponse() {
@@ -67,8 +66,9 @@ var UnknownResponse = exports.UnknownResponse = /*#__PURE__*/function (_Connecti
67
66
  /**
68
67
  * thrown for CloseCode 4400
69
68
  */
69
+ exports.UnknownResponse = UnknownResponse;
70
70
  (0, _defineProperty2.default)(UnknownResponse, "defaultMessage", 'UnknownResponse is produced by IE when we receive a 4XXX. You probably want to treat this like a NotFound');
71
- var BadRequest = exports.BadRequest = /*#__PURE__*/function (_ConnectionError2) {
71
+ var BadRequest = /*#__PURE__*/function (_ConnectionError2) {
72
72
  (0, _inherits2.default)(BadRequest, _ConnectionError2);
73
73
  var _super3 = _createSuper(BadRequest);
74
74
  function BadRequest() {
@@ -80,8 +80,9 @@ var BadRequest = exports.BadRequest = /*#__PURE__*/function (_ConnectionError2)
80
80
  /**
81
81
  * thrown for CloseCode 4401
82
82
  */
83
+ exports.BadRequest = BadRequest;
83
84
  (0, _defineProperty2.default)(BadRequest, "defaultMessage", 'BadRequest usually implies an attempt to use service account credentials');
84
- var NotAuthorized = exports.NotAuthorized = /*#__PURE__*/function (_ConnectionError3) {
85
+ var NotAuthorized = /*#__PURE__*/function (_ConnectionError3) {
85
86
  (0, _inherits2.default)(NotAuthorized, _ConnectionError3);
86
87
  var _super4 = _createSuper(NotAuthorized);
87
88
  function NotAuthorized() {
@@ -93,8 +94,9 @@ var NotAuthorized = exports.NotAuthorized = /*#__PURE__*/function (_ConnectionEr
93
94
  /**
94
95
  * thrown for CloseCode 4403
95
96
  */
97
+ exports.NotAuthorized = NotAuthorized;
96
98
  (0, _defineProperty2.default)(NotAuthorized, "defaultMessage", 'Please refresh your access token');
97
- var Forbidden = exports.Forbidden = /*#__PURE__*/function (_ConnectionError4) {
99
+ var Forbidden = /*#__PURE__*/function (_ConnectionError4) {
98
100
  (0, _inherits2.default)(Forbidden, _ConnectionError4);
99
101
  var _super5 = _createSuper(Forbidden);
100
102
  function Forbidden() {
@@ -108,5 +110,6 @@ var Forbidden = exports.Forbidden = /*#__PURE__*/function (_ConnectionError4) {
108
110
  // export class NotFound extends ConnectionError {
109
111
  // static defaultMessage = `Please refresh your Mercury registration (typically via a WDM refresh)`;
110
112
  // }
113
+ exports.Forbidden = Forbidden;
111
114
  (0, _defineProperty2.default)(Forbidden, "defaultMessage", 'Forbidden usually implies these credentials are not entitled for Webex');
112
115
  //# sourceMappingURL=errors.js.map
@@ -1 +1 @@
1
- {"version":3,"names":["_common","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","ConnectionError","exports","_Exception","_inherits2","_super","_classCallCheck2","_createClass2","key","value","parse","event","length","undefined","_defineProperties","code","reason","Exception","_defineProperty2","UnknownResponse","_ConnectionError","_super2","BadRequest","_ConnectionError2","_super3","NotAuthorized","_ConnectionError3","_super4","Forbidden","_ConnectionError4","_super5"],"sources":["errors.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Exception} from '@webex/common';\n\n/**\n * Exception thrown when a websocket gets closed\n */\nexport class ConnectionError extends Exception {\n static defaultMessage = 'Failed to connect to socket';\n\n /**\n * @param {CloseEvent} event\n * @returns {string}\n */\n parse(event = {}) {\n Object.defineProperties(this, {\n code: {\n value: event.code,\n },\n reason: {\n value: event.reason,\n },\n });\n\n return event.reason;\n }\n}\n\n/**\n * thrown for CloseCode 4400\n */\nexport class UnknownResponse extends ConnectionError {\n static defaultMessage =\n 'UnknownResponse is produced by IE when we receive a 4XXX. You probably want to treat this like a NotFound';\n}\n\n/**\n * thrown for CloseCode 4400\n */\nexport class BadRequest extends ConnectionError {\n static defaultMessage =\n 'BadRequest usually implies an attempt to use service account credentials';\n}\n\n/**\n * thrown for CloseCode 4401\n */\nexport class NotAuthorized extends ConnectionError {\n static defaultMessage = 'Please refresh your access token';\n}\n\n/**\n * thrown for CloseCode 4403\n */\nexport class Forbidden extends ConnectionError {\n static defaultMessage = 'Forbidden usually implies these credentials are not entitled for Webex';\n}\n\n// /**\n// * thrown for CloseCode 4404\n// */\n// export class NotFound extends ConnectionError {\n// static defaultMessage = `Please refresh your Mercury registration (typically via a WDM refresh)`;\n// }\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAAA,OAAA,GAAAC,OAAA;AAAwC,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,Q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A;EAAA;EAAA,WAAAiB,aAAA,CAAAtB,OAAA,EAAAwC,aAAA;AAAA,EAASxB,eAAe;AAIlD;AACA;AACA;AAFA,IAAAiB,gBAAA,CAAAjC,OAAA,EAJawC,aAAa,oBACA,kCAAkC;AAAA,IAM/CG,SAAS,GAAA1B,OAAA,CAAA0B,SAAA,0BAAAC,iBAAA;EAAA,IAAAzB,UAAA,CAAAnB,OAAA,EAAA2C,SAAA,EAAAC,iBAAA;EAAA,IAAAC,OAAA,GAAApD,YAAA,CAAAkD,SAAA;EAAA,SAAAA,UAAA;IAAA,IAAAtB,gBAAA,CAAArB,OAAA,QAAA2C,SAAA;IAAA,OAAAE,OAAA,CAAAvC,KAAA,OAAAD,SAAA;EAAA;EAAA,WAAAiB,aAAA,CAAAtB,OAAA,EAAA2C,SAAA;AAAA,EAAS3B,eAAe,GAI9C;AACA;AACA;AACA;AACA;AACA;AAAA,IAAAiB,gBAAA,CAAAjC,OAAA,EATa2C,SAAS,oBACI,wEAAwE"}
1
+ {"version":3,"names":["_common","require","_createSuper","Derived","hasNativeReflectConstruct","_isNativeReflectConstruct","_createSuperInternal","Super","_getPrototypeOf2","default","result","NewTarget","constructor","_Reflect$construct","arguments","apply","_possibleConstructorReturn2","Reflect","sham","Proxy","Boolean","prototype","valueOf","call","e","ConnectionError","_Exception","_inherits2","_super","_classCallCheck2","_createClass2","key","value","parse","event","length","undefined","_defineProperties","code","reason","Exception","exports","_defineProperty2","UnknownResponse","_ConnectionError","_super2","BadRequest","_ConnectionError2","_super3","NotAuthorized","_ConnectionError3","_super4","Forbidden","_ConnectionError4","_super5"],"sources":["errors.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport {Exception} from '@webex/common';\n\n/**\n * Exception thrown when a websocket gets closed\n */\nexport class ConnectionError extends Exception {\n static defaultMessage = 'Failed to connect to socket';\n\n /**\n * @param {CloseEvent} event\n * @returns {string}\n */\n parse(event = {}) {\n Object.defineProperties(this, {\n code: {\n value: event.code,\n },\n reason: {\n value: event.reason,\n },\n });\n\n return event.reason;\n }\n}\n\n/**\n * thrown for CloseCode 4400\n */\nexport class UnknownResponse extends ConnectionError {\n static defaultMessage =\n 'UnknownResponse is produced by IE when we receive a 4XXX. You probably want to treat this like a NotFound';\n}\n\n/**\n * thrown for CloseCode 4400\n */\nexport class BadRequest extends ConnectionError {\n static defaultMessage =\n 'BadRequest usually implies an attempt to use service account credentials';\n}\n\n/**\n * thrown for CloseCode 4401\n */\nexport class NotAuthorized extends ConnectionError {\n static defaultMessage = 'Please refresh your access token';\n}\n\n/**\n * thrown for CloseCode 4403\n */\nexport class Forbidden extends ConnectionError {\n static defaultMessage = 'Forbidden usually implies these credentials are not entitled for Webex';\n}\n\n// /**\n// * thrown for CloseCode 4404\n// */\n// export class NotFound extends ConnectionError {\n// static defaultMessage = `Please refresh your Mercury registration (typically via a WDM refresh)`;\n// }\n"],"mappings":";;;;;;;;;;;;;;;;AAIA,IAAAA,OAAA,GAAAC,OAAA;AAAwC,SAAAC,aAAAC,OAAA,QAAAC,yBAAA,GAAAC,yBAAA,oBAAAC,qBAAA,QAAAC,KAAA,OAAAC,gBAAA,CAAAC,OAAA,EAAAN,OAAA,GAAAO,MAAA,MAAAN,yBAAA,QAAAO,SAAA,OAAAH,gBAAA,CAAAC,OAAA,QAAAG,WAAA,EAAAF,MAAA,GAAAG,kBAAA,CAAAN,KAAA,EAAAO,SAAA,EAAAH,SAAA,YAAAD,MAAA,GAAAH,KAAA,CAAAQ,KAAA,OAAAD,SAAA,gBAAAE,2BAAA,CAAAP,OAAA,QAAAC,MAAA;AAAA,SAAAL,0BAAA,eAAAY,OAAA,qBAAAJ,kBAAA,oBAAAA,kBAAA,CAAAK,IAAA,2BAAAC,KAAA,oCAAAC,OAAA,CAAAC,SAAA,CAAAC,OAAA,CAAAC,IAAA,CAAAV,kBAAA,CAAAO,OAAA,8CAAAI,CAAA;AAExC;AACA;AACA;AAFA,IAGaC,e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;IAAA,OAAAE,OAAA,CAAAvC,KAAA,OAAAD,SAAA;EAAA;EAAA,WAAAgB,aAAA,CAAArB,OAAA,EAAA2C,SAAA;AAAA,EAAS3B,eAAe,GAI9C;AACA;AACA;AACA;AACA;AACA;AAAAgB,OAAA,CAAAW,SAAA,GAAAA,SAAA;AAAA,IAAAV,gBAAA,CAAAjC,OAAA,EATa2C,SAAS,oBACI,wEAAwE"}
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"names":["require","_webexCore","_mercury","_interopRequireDefault","_config","_socket","_errors","registerInternalPlugin","Mercury","config","onBeforeLogout","disconnect"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-device';\nimport '@webex/internal-plugin-feature';\nimport '@webex/internal-plugin-metrics';\n\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Mercury from './mercury';\nimport config from './config';\n\nregisterInternalPlugin('mercury', Mercury, {\n config,\n onBeforeLogout() {\n return this.disconnect();\n },\n});\n\nexport {default} from './mercury';\nexport {default as Mercury} from './mercury';\nexport {default as Socket} from './socket';\nexport {default as config} from './config';\nexport {\n BadRequest,\n ConnectionError,\n Forbidden,\n NotAuthorized,\n UnknownResponse,\n // NotFound\n} from './errors';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIAA,OAAA;AACAA,OAAA;AACAA,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AAWA,IAAAK,OAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,OAAA,GAAAN,OAAA;AAxBA;AACA;AACA;;AAWA,IAAAO,iCAAsB,EAAC,SAAS,EAAEC,gBAAO,EAAE;EACzCC,MAAM,EAANA,eAAM;EACNC,cAAc,WAAAA,eAAA,EAAG;IACf,OAAO,IAAI,CAACC,UAAU,CAAC,CAAC;EAC1B;AACF,CAAC,CAAC"}
1
+ {"version":3,"names":["require","_webexCore","_mercury","_interopRequireDefault","_config","_socket","_errors","registerInternalPlugin","Mercury","config","onBeforeLogout","disconnect"],"sources":["index.js"],"sourcesContent":["/*!\n * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.\n */\n\nimport '@webex/internal-plugin-device';\nimport '@webex/internal-plugin-feature';\nimport '@webex/internal-plugin-metrics';\n\nimport {registerInternalPlugin} from '@webex/webex-core';\n\nimport Mercury from './mercury';\nimport config from './config';\n\nregisterInternalPlugin('mercury', Mercury, {\n config,\n onBeforeLogout() {\n return this.disconnect();\n },\n});\n\nexport {default} from './mercury';\nexport {default as Mercury} from './mercury';\nexport {default as Socket} from './socket';\nexport {default as config} from './config';\nexport {\n BadRequest,\n ConnectionError,\n Forbidden,\n NotAuthorized,\n UnknownResponse,\n // NotFound\n} from './errors';\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAIAA,OAAA;AACAA,OAAA;AACAA,OAAA;AAEA,IAAAC,UAAA,GAAAD,OAAA;AAEA,IAAAE,QAAA,GAAAC,sBAAA,CAAAH,OAAA;AACA,IAAAI,OAAA,GAAAD,sBAAA,CAAAH,OAAA;AAWA,IAAAK,OAAA,GAAAF,sBAAA,CAAAH,OAAA;AAEA,IAAAM,OAAA,GAAAN,OAAA;AAxBA;AACA;AACA;;AAWA,IAAAO,iCAAsB,EAAC,SAAS,EAAEC,gBAAO,EAAE;EACzCC,MAAM,EAANA,eAAM;EACNC,cAAc,WAAAA,eAAA,EAAG;IACf,OAAO,IAAI,CAACC,UAAU,EAAE;EAC1B;AACF,CAAC,CAAC"}
package/dist/mercury.js CHANGED
@@ -20,19 +20,18 @@ var _getOwnPropertyDescriptor = _interopRequireDefault(require("@babel/runtime-c
20
20
  var _defineProperty2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/defineProperty"));
21
21
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/slicedToArray"));
22
22
  var _applyDecoratedDescriptor2 = _interopRequireDefault(require("@babel/runtime-corejs2/helpers/applyDecoratedDescriptor"));
23
+ var _set2 = _interopRequireDefault(require("lodash/set"));
24
+ var _get2 = _interopRequireDefault(require("lodash/get"));
25
+ var _camelCase2 = _interopRequireDefault(require("lodash/camelCase"));
23
26
  var _url = _interopRequireDefault(require("url"));
24
27
  var _webexCore = require("@webex/webex-core");
25
28
  var _common = require("@webex/common");
26
- var _lodash = require("lodash");
27
29
  var _backoff = _interopRequireDefault(require("backoff"));
28
30
  var _socket = _interopRequireDefault(require("./socket"));
29
31
  var _errors = require("./errors");
30
32
  var _dec, _dec2, _obj;
31
- /*!
32
- * Copyright (c) 2015-2020 Cisco Systems, Inc. See LICENSE file.
33
- */
34
- 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$getOwnPropertyDescriptor2(e, r).enumerable; })), t.push.apply(t, o); } return t; }
35
- 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$getOwnPropertyDescriptor2(t, r)); }); } return e; }
33
+ function ownKeys(object, enumerableOnly) { var keys = _Object$keys2(object); if (_Object$getOwnPropertySymbols) { var symbols = _Object$getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return _Object$getOwnPropertyDescriptor2(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
34
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : _Object$getOwnPropertyDescriptors ? _Object$defineProperties(target, _Object$getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { _Object$defineProperty(target, key, _Object$getOwnPropertyDescriptor2(source, key)); }); } return target; }
36
35
  var normalReconnectReasons = ['idle', 'done (forced)', 'pong not received', 'pong mismatch'];
37
36
  var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mercury#listen(): Use Mercury#connect() instead'), _dec2 = (0, _common.deprecated)('Mercury#stopListening(): Use Mercury#disconnect() instead'), (_obj = {
38
37
  namespace: 'Mercury',
@@ -59,12 +58,12 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
59
58
  connect: function connect(webSocketUrl) {
60
59
  var _this = this;
61
60
  if (this.connected) {
62
- this.logger.info("".concat(this.namespace, ": already connected, will not connect again"));
61
+ this.logger.info('mercury: already connected, will not connect again');
63
62
  return _promise.default.resolve();
64
63
  }
65
64
  this.connecting = true;
66
65
  return _promise.default.resolve(this.webex.internal.device.registered || this.webex.internal.device.register()).then(function () {
67
- _this.logger.info("".concat(_this.namespace, ": connecting"));
66
+ _this.logger.info('mercury: connecting');
68
67
  return _this._connectWithBackoff(webSocketUrl);
69
68
  });
70
69
  },
@@ -72,13 +71,14 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
72
71
  var _this2 = this;
73
72
  return new _promise.default(function (resolve) {
74
73
  if (_this2.backoffCall) {
75
- _this2.logger.info("".concat(_this2.namespace, ": aborting connection"));
74
+ _this2.logger.info('mercury: aborting connection');
76
75
  _this2.backoffCall.abort();
77
76
  }
78
77
  if (_this2.socket) {
79
78
  _this2.socket.removeAllListeners('message');
80
79
  _this2.once('offline', resolve);
81
- resolve(_this2.socket.close());
80
+ _this2.socket.close();
81
+ return;
82
82
  }
83
83
  resolve();
84
84
  });
@@ -100,7 +100,7 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
100
100
  }
101
101
  var headerKeys = (0, _keys.default)(event.headers);
102
102
  headerKeys.forEach(function (keyPath) {
103
- (0, _lodash.set)(event, keyPath, event.headers[keyPath]);
103
+ (0, _set2.default)(event, keyPath, event.headers[keyPath]);
104
104
  });
105
105
  },
106
106
  _prepareUrl: function _prepareUrl(webSocketUrl) {
@@ -131,7 +131,7 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
131
131
  });
132
132
  (0, _deleteProperty.default)(webSocketUrl.query, 'bufferStates');
133
133
  }
134
- if ((0, _lodash.get)(_this3, 'webex.config.device.ephemeral', false)) {
134
+ if ((0, _get2.default)(_this3, 'webex.config.device.ephemeral', false)) {
135
135
  webSocketUrl.query.multipleConnections = true;
136
136
  }
137
137
  return _url.default.format(webSocketUrl);
@@ -153,18 +153,12 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
153
153
  }
154
154
  return _this4._emit.apply(_this4, ['sequence-mismatch'].concat(args));
155
155
  });
156
- socket.on('ping-pong-latency', function () {
157
- for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
158
- args[_key2] = arguments[_key2];
159
- }
160
- return _this4._emit.apply(_this4, ['ping-pong-latency'].concat(args));
161
- });
162
156
  _promise.default.all([this._prepareUrl(socketUrl), this.webex.credentials.getUserToken()]).then(function (_ref) {
163
157
  var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
164
158
  webSocketUrl = _ref2[0],
165
159
  token = _ref2[1];
166
160
  if (!_this4.backoffCall) {
167
- var msg = "".concat(_this4.namespace, ": prevent socket open when backoffCall no longer defined");
161
+ var msg = 'mercury: prevent socket open when backoffCall no longer defined';
168
162
  _this4.logger.info(msg);
169
163
  return _promise.default.reject(new Error(msg));
170
164
  }
@@ -180,17 +174,24 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
180
174
 
181
175
  // if the consumer has supplied request options use them
182
176
  if (_this4.webex.config.defaultMercuryOptions) {
183
- _this4.logger.info("".concat(_this4.namespace, ": setting custom options"));
177
+ _this4.logger.info('mercury: setting custom options');
184
178
  options = _objectSpread(_objectSpread({}, options), _this4.webex.config.defaultMercuryOptions);
185
179
  }
186
180
 
187
181
  // Set the socket before opening it. This allows a disconnect() to close
188
182
  // the socket if it is in the process of being opened.
189
183
  _this4.socket = socket;
190
- _this4.logger.info("".concat(_this4.namespace, " connection url: ").concat(webSocketUrl));
191
184
  return socket.open(webSocketUrl, options);
192
185
  }).then(function () {
193
- _this4.logger.info("".concat(_this4.namespace, ": connected to mercury, success, action: connected, url: ").concat(attemptWSUrl));
186
+ _this4.webex.internal.metrics.submitClientMetrics('web-ha-mercury', {
187
+ fields: {
188
+ success: true
189
+ },
190
+ tags: {
191
+ action: 'connected',
192
+ url: attemptWSUrl
193
+ }
194
+ });
194
195
  callback();
195
196
  return _this4.webex.internal.feature.getFeature('developer', 'web-high-availability').then(function (haMessagingEnabled) {
196
197
  if (haMessagingEnabled) {
@@ -208,18 +209,18 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
208
209
  retries: _this4.backoffCall.getNumRetries()
209
210
  });
210
211
  }
211
- _this4.logger.info("".concat(_this4.namespace, ": connection attempt failed"), reason);
212
+ _this4.logger.info('mercury: connection attempt failed', reason);
212
213
  // UnknownResponse is produced by IE for any 4XXX; treated it like a bad
213
214
  // web socket url and let WDM handle the token checking
214
215
  if (reason instanceof _errors.UnknownResponse) {
215
- _this4.logger.info("".concat(_this4.namespace, ": received unknown response code, refreshing device registration"));
216
+ _this4.logger.info('mercury: received unknown response code, refreshing device registration');
216
217
  return _this4.webex.internal.device.refresh().then(function () {
217
218
  return callback(reason);
218
219
  });
219
220
  }
220
221
  // NotAuthorized implies expired token
221
222
  if (reason instanceof _errors.NotAuthorized) {
222
- _this4.logger.info("".concat(_this4.namespace, ": received authorization error, reauthorizing"));
223
+ _this4.logger.info('mercury: received authorization error, reauthorizing');
223
224
  return _this4.webex.credentials.refresh({
224
225
  force: true
225
226
  }).then(function () {
@@ -235,14 +236,24 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
235
236
  // BadRequest implies current credentials are for a Service Account
236
237
  // Forbidden implies current user is not entitle for Webex
237
238
  if (reason instanceof _errors.BadRequest || reason instanceof _errors.Forbidden) {
238
- _this4.logger.warn("".concat(_this4.namespace, ": received unrecoverable response from mercury"));
239
+ _this4.logger.warn('mercury: received unrecoverable response from mercury');
239
240
  _this4.backoffCall.abort();
240
241
  return callback(reason);
241
242
  }
242
243
  if (reason instanceof _errors.ConnectionError) {
243
244
  return _this4.webex.internal.feature.getFeature('developer', 'web-high-availability').then(function (haMessagingEnabled) {
244
245
  if (haMessagingEnabled) {
245
- _this4.logger.info("".concat(_this4.namespace, ": received a generic connection error, will try to connect to another datacenter. failed, action: 'failed', url: ").concat(attemptWSUrl, " error: ").concat(reason.message));
246
+ _this4.logger.info('mercury: received a generic connection error, will try to connect to another datacenter');
247
+ _this4.webex.internal.metrics.submitClientMetrics('web-ha-mercury', {
248
+ fields: {
249
+ success: false
250
+ },
251
+ tags: {
252
+ action: 'failed',
253
+ error: reason.message,
254
+ url: attemptWSUrl
255
+ }
256
+ });
246
257
  return _this4.webex.internal.services.markFailedUrl(attemptWSUrl);
247
258
  }
248
259
  return null;
@@ -252,7 +263,7 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
252
263
  }
253
264
  return callback(reason);
254
265
  }).catch(function (reason) {
255
- _this4.logger.error("".concat(_this4.namespace, ": failed to handle connection failure"), reason);
266
+ _this4.logger.error('mercury: failed to handle connection failure', reason);
256
267
  callback(reason);
257
268
  });
258
269
  },
@@ -266,7 +277,7 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
266
277
  _this5.connecting = false;
267
278
  _this5.backoffCall = undefined;
268
279
  if (err) {
269
- _this5.logger.info("".concat(_this5.namespace, ": failed to connect after ").concat(call.getNumRetries(), " retries; log statement about next retry was inaccurate; ").concat(err));
280
+ _this5.logger.info("mercury: failed to connect after ".concat(call.getNumRetries(), " retries; log statement about next retry was inaccurate; ").concat(err));
270
281
  return reject(err);
271
282
  }
272
283
  _this5.connected = true;
@@ -276,7 +287,7 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
276
287
 
277
288
  // eslint-disable-next-line prefer-reflect
278
289
  call = _backoff.default.call(function (callback) {
279
- _this5.logger.info("".concat(_this5.namespace, ": executing connection attempt ").concat(call.getNumRetries()));
290
+ _this5.logger.info("mercury: executing connection attempt ".concat(call.getNumRetries()));
280
291
  _this5._attemptConnection(webSocketUrl, callback);
281
292
  }, onComplete);
282
293
  call.setStrategy(new _backoff.default.ExponentialStrategy({
@@ -287,37 +298,31 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
287
298
  call.failAfter(_this5.config.maxRetries);
288
299
  }
289
300
  call.on('abort', function () {
290
- _this5.logger.info("".concat(_this5.namespace, ": connection aborted"));
301
+ _this5.logger.info('mercury: connection aborted');
291
302
  reject(new Error('Mercury Connection Aborted'));
292
303
  });
293
304
  call.on('callback', function (err) {
294
305
  if (err) {
295
306
  var number = call.getNumRetries();
296
307
  var delay = Math.min(call.strategy_.nextBackoffDelay_, _this5.config.backoffTimeMax);
297
- _this5.logger.info("".concat(_this5.namespace, ": failed to connect; attempting retry ").concat(number + 1, " in ").concat(delay, " ms"));
308
+ _this5.logger.info("mercury: failed to connect; attempting retry ".concat(number + 1, " in ").concat(delay, " ms"));
298
309
  /* istanbul ignore if */
299
310
  if (process.env.NODE_ENV === 'development') {
300
- _this5.logger.debug("".concat(_this5.namespace, ": "), err, err.stack);
311
+ _this5.logger.debug('mercury: ', err, err.stack);
301
312
  }
302
313
  return;
303
314
  }
304
- _this5.logger.info("".concat(_this5.namespace, ": connected"));
315
+ _this5.logger.info('mercury: connected');
305
316
  });
306
317
  call.start();
307
318
  _this5.backoffCall = call;
308
319
  });
309
320
  },
310
321
  _emit: function _emit() {
311
- for (var _len3 = arguments.length, args = new Array(_len3), _key3 = 0; _key3 < _len3; _key3++) {
312
- args[_key3] = arguments[_key3];
313
- }
314
322
  try {
315
- this.trigger.apply(this, args);
323
+ this.trigger.apply(this, arguments);
316
324
  } catch (error) {
317
- this.logger.error("".concat(this.namespace, ": error occurred in event handler"), {
318
- error: error,
319
- arguments: args
320
- });
325
+ this.logger.error('mercury: error occurred in event handler', error);
321
326
  }
322
327
  },
323
328
  _getEventHandlers: function _getEventHandlers(eventType) {
@@ -329,7 +334,7 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
329
334
  if (!this.webex[namespace] && !this.webex.internal[namespace]) {
330
335
  return handlers;
331
336
  }
332
- var handlerName = (0, _lodash.camelCase)("process_".concat(name, "_event"));
337
+ var handlerName = (0, _camelCase2.default)("process_".concat(name, "_event"));
333
338
  if ((this.webex[namespace] || this.webex.internal[namespace])[handlerName]) {
334
339
  handlers.push({
335
340
  name: handlerName,
@@ -352,19 +357,19 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
352
357
  switch (event.code) {
353
358
  case 1003:
354
359
  // metric: disconnect
355
- this.logger.info("".concat(this.namespace, ": Mercury service rejected last message; will not reconnect: ").concat(event.reason));
360
+ this.logger.info("mercury: Mercury service rejected last message; will not reconnect: ".concat(event.reason));
356
361
  this._emit('offline.permanent', event);
357
362
  break;
358
363
  case 4000:
359
364
  // metric: disconnect
360
- this.logger.info("".concat(this.namespace, ": socket replaced; will not reconnect"));
365
+ this.logger.info('mercury: socket replaced; will not reconnect');
361
366
  this._emit('offline.replaced', event);
362
367
  break;
363
368
  case 1001:
364
369
  case 1005:
365
370
  case 1006:
366
371
  case 1011:
367
- this.logger.info("".concat(this.namespace, ": socket disconnected; reconnecting"));
372
+ this.logger.info('mercury: socket disconnected; reconnecting');
368
373
  this._emit('offline.transient', event);
369
374
  this._reconnect(socketUrl);
370
375
  // metric: disconnect
@@ -372,30 +377,30 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
372
377
  break;
373
378
  case 1000:
374
379
  if (normalReconnectReasons.includes(reason)) {
375
- this.logger.info("".concat(this.namespace, ": socket disconnected; reconnecting"));
380
+ this.logger.info('mercury: socket disconnected; reconnecting');
376
381
  this._emit('offline.transient', event);
377
382
  this._reconnect(socketUrl);
378
383
  // metric: disconnect
379
384
  // if (reason === done forced) metric: force closure
380
385
  } else {
381
- this.logger.info("".concat(this.namespace, ": socket disconnected; will not reconnect"));
386
+ this.logger.info('mercury: socket disconnected; will not reconnect');
382
387
  this._emit('offline.permanent', event);
383
388
  }
384
389
  break;
385
390
  default:
386
- this.logger.info("".concat(this.namespace, ": socket disconnected unexpectedly; will not reconnect"));
391
+ this.logger.info('mercury: socket disconnected unexpectedly; will not reconnect');
387
392
  // unexpected disconnect
388
393
  this._emit('offline.permanent', event);
389
394
  }
390
395
  } catch (error) {
391
- this.logger.error("".concat(this.namespace, ": error occurred in close handler"), error);
396
+ this.logger.error('mercury: error occurred in close handler', error);
392
397
  }
393
398
  },
394
399
  _onmessage: function _onmessage(event) {
395
400
  var _this6 = this;
396
401
  var envelope = event.data;
397
402
  if (process.env.ENABLE_MERCURY_LOGGING) {
398
- this.logger.debug("".concat(this.namespace, ": message envelope: "), envelope);
403
+ this.logger.debug('mercury: message envelope: ', envelope);
399
404
  }
400
405
  var data = envelope.data;
401
406
  this._applyOverrides(data);
@@ -406,7 +411,7 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
406
411
  return new _promise.default(function (resolve) {
407
412
  return resolve((_this6.webex[namespace] || _this6.webex.internal[namespace])[name](data));
408
413
  }).catch(function (reason) {
409
- return _this6.logger.error("".concat(_this6.namespace, ": error occurred in autowired event handler for ").concat(data.eventType), reason);
414
+ return _this6.logger.error("mercury: error occurred in autowired event handler for ".concat(data.eventType), reason);
410
415
  });
411
416
  });
412
417
  }, _promise.default.resolve()).then(function () {
@@ -421,14 +426,15 @@ var Mercury = _webexCore.WebexPlugin.extend((_dec = (0, _common.deprecated)('Mer
421
426
  _this6._emit("event:".concat(data.eventType), envelope);
422
427
  }
423
428
  }).catch(function (reason) {
424
- _this6.logger.error("".concat(_this6.namespace, ": error occurred processing socket message"), reason);
429
+ _this6.logger.error('mercury: error occurred processing socket message', reason);
425
430
  });
426
431
  },
427
432
  _reconnect: function _reconnect(webSocketUrl) {
428
- this.logger.info("".concat(this.namespace, ": reconnecting"));
433
+ this.logger.info('mercury: reconnecting');
429
434
  return this.connect(webSocketUrl);
430
435
  },
431
- version: "2.60.1-next.9"
436
+ version: "2.60.2"
432
437
  }, ((0, _applyDecoratedDescriptor2.default)(_obj, "connect", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "connect"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "disconnect", [_common.oneFlight], (0, _getOwnPropertyDescriptor.default)(_obj, "disconnect"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "listen", [_dec], (0, _getOwnPropertyDescriptor.default)(_obj, "listen"), _obj), (0, _applyDecoratedDescriptor2.default)(_obj, "stopListening", [_dec2], (0, _getOwnPropertyDescriptor.default)(_obj, "stopListening"), _obj)), _obj)));
433
- var _default = exports.default = Mercury;
438
+ var _default = Mercury;
439
+ exports.default = _default;
434
440
  //# sourceMappingURL=mercury.js.map