Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

opossum

Package Overview
Dependencies
Maintainers
5
Versions
67
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

opossum - npm Package Compare versions

Comparing version 5.0.2 to 5.1.0

25

CHANGELOG.md

@@ -5,2 +5,27 @@ # Changelog

## [5.1.0](https://www.github.com/nodeshift/opossum/compare/v5.0.2...v5.1.0) (2020-12-02)
### Features
* pass circuit params to error filter ([#492](https://www.github.com/nodeshift/opossum/issues/492)) ([29175d7](https://www.github.com/nodeshift/opossum/commit/29175d75d03adf4ebfd4d7603dc454349b056b94))
### Bug Fixes
* lint issues in test ([#499](https://www.github.com/nodeshift/opossum/issues/499)) ([35ddd8c](https://www.github.com/nodeshift/opossum/commit/35ddd8c9326d0d882d0ab3a089ac87a3279ffa6c))
* package.json & package-lock.json to reduce vulnerabilities ([#493](https://www.github.com/nodeshift/opossum/issues/493)) ([03fed29](https://www.github.com/nodeshift/opossum/commit/03fed29b3ac5c75662868800feda86b787ed7d9b))
* upgrade @babel/core from 7.12.1 to 7.12.3 ([#490](https://www.github.com/nodeshift/opossum/issues/490)) ([6a73957](https://www.github.com/nodeshift/opossum/commit/6a73957a52a290a30039b846bb5785f8503b15cd))
* upgrade babel-loader from 8.1.0 to 8.2.1 ([#505](https://www.github.com/nodeshift/opossum/issues/505)) ([885403b](https://www.github.com/nodeshift/opossum/commit/885403b58e4084d2abe71f1a65e666413abd4f32))
* upgrade documentation from 13.0.2 to 13.1.0 ([#491](https://www.github.com/nodeshift/opossum/issues/491)) ([cc94100](https://www.github.com/nodeshift/opossum/commit/cc94100c665096c830e04653016662c8c19dc5ce))
* upgrade multiple dependencies with Snyk ([#485](https://www.github.com/nodeshift/opossum/issues/485)) ([efe299e](https://www.github.com/nodeshift/opossum/commit/efe299e1d1cc0311a5ea406dad659ccd5d105754))
* upgrade multiple dependencies with Snyk ([#487](https://www.github.com/nodeshift/opossum/issues/487)) ([3afaa17](https://www.github.com/nodeshift/opossum/commit/3afaa1757a1defc7d1b6050aedb301e188fe35c6))
* upgrade webpack from 5.1.1 to 5.3.2 ([#500](https://www.github.com/nodeshift/opossum/issues/500)) ([1562a41](https://www.github.com/nodeshift/opossum/commit/1562a4148bbfbc8cc9d98e6b2241bbf942941c4e))
* upgrade webpack-cli from 4.0.0 to 4.1.0 ([#501](https://www.github.com/nodeshift/opossum/issues/501)) ([63d20c2](https://www.github.com/nodeshift/opossum/commit/63d20c27475319a5c8de434b6eb66b5e866376b7))
### Reverts
* Revert "build: use pull_request_target in actions workflow (#476)" ([3fa32b9](https://www.github.com/nodeshift/opossum/commit/3fa32b9d20c97a7f4e02cf602b8d4831f1ed1c83)), closes [#476](https://www.github.com/nodeshift/opossum/issues/476)
### [5.0.2](https://www.github.com/nodeshift/opossum/compare/v5.0.1...v5.0.2) (2020-10-14)

@@ -7,0 +32,0 @@

4

dist/opossum.min.js

@@ -1,2 +0,2 @@

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.circuitBreaker=t():e.circuitBreaker=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){(function(t){var r=n(2),o=n(9);function i(){return(new Date).getTime()}var u,c=Array.prototype.slice,s={};u=void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};for(var a=[[function(){},"log"],[function(){u.log.apply(u,arguments)},"info"],[function(){u.log.apply(u,arguments)},"warn"],[function(){u.warn.apply(u,arguments)},"error"],[function(e){s[e]=i()},"time"],[function(e){var t=s[e];if(!t)throw new Error("No such label: "+e);delete s[e];var n=i()-t;u.log(e+": "+n+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=r.format.apply(null,arguments),u.error(e.stack)},"trace"],[function(e){u.log(r.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=c.call(arguments,1);o.ok(!1,r.format.apply(null,t))}},"assert"]],f=0;f<a.length;f++){var l=a[f],p=l[0],h=l[1];u[h]||(u[h]=p)}e.exports=u}).call(this,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(e,r){var o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},i=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(s(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,u=String(e).replace(i,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),c=r[n];n<o;c=r[++n])v(c)||!O(c)?u+=" "+c:u+=" "+s(c);return u},t.deprecate=function(n,o){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,o).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(o);e.traceDeprecation?r.trace(o):r.error(o),i=!0}return n.apply(this,arguments)}};var u,c={};function s(e,n){var r={seen:[],stylize:f};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),l(r,e,r.depth)}function a(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function f(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&x(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return g(o)||(o=l(e,o,r)),o}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(g(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(d(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(v(t))return e.stylize("null","null")}(e,n);if(i)return i;var u=Object.keys(n),c=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(n)),j(n)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return p(n);if(0===u.length){if(x(n)){var s=n.name?": "+n.name:"";return e.stylize("[Function"+s+"]","special")}if(w(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(j(n))return p(n)}var a,f="",O=!1,S=["{","}"];(y(n)&&(O=!0,S=["[","]"]),x(n))&&(f=" [Function"+(n.name?": "+n.name:"")+"]");return w(n)&&(f=" "+RegExp.prototype.toString.call(n)),E(n)&&(f=" "+Date.prototype.toUTCString.call(n)),j(n)&&(f=" "+p(n)),0!==u.length||O&&0!=n.length?r<0?w(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),a=O?function(e,t,n,r,o){for(var i=[],u=0,c=t.length;u<c;++u)_(t,String(u))?i.push(h(e,t,n,r,String(u),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(h(e,t,n,r,o,!0))})),i}(e,n,r,c,u):u.map((function(t){return h(e,n,r,c,t,O)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(a,f,S)):S[0]+f+S[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,i){var u,c,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?c=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(c=e.stylize("[Setter]","special")),_(r,o)||(u="["+o+"]"),c||(e.seen.indexOf(s.value)<0?(c=v(n)?l(e,s.value,null):l(e,s.value,n-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+c.split("\n").map((function(e){return" "+e})).join("\n")):c=e.stylize("[Circular]","special")),b(u)){if(i&&o.match(/^\d+$/))return c;(u=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+c}function y(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function d(e){return"number"==typeof e}function g(e){return"string"==typeof e}function b(e){return void 0===e}function w(e){return O(e)&&"[object RegExp]"===S(e)}function O(e){return"object"==typeof e&&null!==e}function E(e){return O(e)&&"[object Date]"===S(e)}function j(e){return O(e)&&("[object Error]"===S(e)||e instanceof Error)}function x(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(b(u)&&(u=Object({WEB:"web"}).NODE_DEBUG||""),n=n.toUpperCase(),!c[n])if(new RegExp("\\b"+n+"\\b","i").test(u)){var o=e.pid;c[n]=function(){var e=t.format.apply(t,arguments);r.error("%s %d: %s",n,o,e)}}else c[n]=function(){};return c[n]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=y,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=d,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=w,t.isObject=O,t.isDate=E,t.isError=j,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(7);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){r.log("%s - %s",P(),t.format.apply(t,arguments))},t.inherits=n(8),t._extend=function(e,t){if(!t||!O(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function A(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(L&&e[L]){var t;if("function"!=typeof(t=e[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),L&&Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=L,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,u=function(){return o.apply(i,arguments)};t.apply(this,n).then((function(t){e.nextTick(u,null,t)}),(function(t){e.nextTick(A,t,u)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,o(t)),n}}).call(this,n(6),n(0))},function(e,t,n){"use strict";(function(t){var n,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function f(e,n,r,o){var i,u,c,f;if(s(r),void 0===(u=e._events)?(u=e._events=Object.create(null),e._eventsCount=0):(void 0!==u.newListener&&(e.emit("newListener",n,r.listener?r.listener:r),u=e._events),c=u[n]),void 0===c)c=u[n]=r,++e._eventsCount;else if("function"==typeof c?c=u[n]=o?[r,c]:[c,r]:o?c.unshift(r):c.push(r),(i=a(e))>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=n,l.count=c.length,f=l,t&&t.warn&&t.warn(f)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):m(o,o.length)}function y(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return a(this)},u.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var u;if(t.length>0&&(u=t[0]),u instanceof Error)throw u;var c=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw c.context=u,c}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)o(s,this,t);else{var a=s.length,f=m(s,a);for(n=0;n<a;++n)o(f[n],this,t)}return!0},u.prototype.addListener=function(e,t){return f(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return f(this,e,t,!0)},u.prototype.once=function(e,t){return s(t),this.on(e,p(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,p(this,e,t)),this},u.prototype.removeListener=function(e,t){var n,r,o,i,u;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){u=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,u||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return h(this,e,!0)},u.prototype.rawListeners=function(e){return h(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},u.prototype.listenerCount=y,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=n(5)},function(e,t,n){"use strict";(function(t){function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?f(e):t}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=n(3),m=n(11),v=n(12),d=Symbol("state"),g=Symbol("open"),b=Symbol("closed"),w=Symbol("half-open"),O=Symbol("pending-close"),E=Symbol("shutdown"),j=Symbol("fallback"),x=Symbol("status"),S=Symbol("name"),T=Symbol("group"),k=new WeakMap,P=Symbol("Enabled"),_=Symbol("warming-up"),L=Symbol("volume-threshold"),A=Symbol("our-error"),D=Symbol("reset-timeout"),C=Symbol("warmup-timeout"),M="options.maxFailures is deprecated. Please use options.errorThresholdPercentage",R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(o,e);var n,r=(n=o,function(){var e,t=p(n);if(l()){var r=p(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function o(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(u(this,o),(n=r.call(this)).options=i,n.options.timeout=!1!==i.timeout&&(i.timeout||1e4),n.options.resetTimeout=i.resetTimeout||3e4,n.options.errorThresholdPercentage=i.errorThresholdPercentage||50,n.options.rollingCountTimeout=i.rollingCountTimeout||1e4,n.options.rollingCountBuckets=i.rollingCountBuckets||10,n.options.rollingPercentilesEnabled=!1!==i.rollingPercentilesEnabled,n.options.capacity=Number.isInteger(i.capacity)?i.capacity:Number.MAX_SAFE_INTEGER,n.options.errorFilter=i.errorFilter||function(e){return!1},n.semaphore=new v(n.options.capacity),n[L]=Number.isInteger(i.volumeThreshold)?i.volumeThreshold:0,n[_]=!0===i.allowWarmUp,n[x]=new m(n.options),n[d]=b,n[j]=null,n[O]=!1,n[S]=i.name||e.name||B(),n[T]=i.group||n[S],n[P]=!1!==i.enabled,n[_]){var c=n[C]=setTimeout((function(e){return n[_]=!1}),n.options.rollingCountTimeout);"function"==typeof c.unref&&c.unref()}n.action="function"!=typeof e?function(t){return Promise.resolve(e)}:e,i.maxFailures&&t.error(M);var s=function(e){return function(t,r){return n[x].increment(e,r)}};function a(e){return function(t){var n=e[D]=setTimeout((function(){e[d]=w,e[O]=!0,e.emit("halfOpen",e.options.resetTimeout)}),e.options.resetTimeout);"function"==typeof n.unref&&n.unref()}}return n.on("success",s("successes")),n.on("failure",s("failures")),n.on("fallback",s("fallbacks")),n.on("timeout",s("timeouts")),n.on("fire",s("fires")),n.on("reject",s("rejects")),n.on("cacheHit",s("cacheHits")),n.on("cacheMiss",s("cacheMisses")),n.on("open",(function(e){return n[x].open()})),n.on("close",(function(e){return n[x].close()})),n.on("semaphoreLocked",s("semaphoreRejections")),n.on("open",a(f(n))),n.on("success",(function(e){n.halfOpen&&n.close()})),n.options.cache&&k.set(f(n),void 0),n}return s(o,null,[{key:"isOurError",value:function(e){return!!e[A]}}]),s(o,[{key:"close",value:function(){this[d]!==b&&(this[D]&&clearTimeout(this[D]),this[d]=b,this[O]=!1,this.emit("close"))}},{key:"open",value:function(){this[d]!==g&&(this[d]=g,this[O]=!1,this.emit("open"))}},{key:"shutdown",value:function(){this.disable(),this.removeAllListeners(),this[D]&&clearTimeout(this[D]),this[C]&&clearTimeout(this[C]),this.status.shutdown(),this[d]=E,this.emit("shutdown")}},{key:"fallback",value:function(e){var t=e;return e instanceof o&&(t=function(){return e.fire.apply(e,arguments)}),this[j]=t,this}},{key:"fire",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.call.apply(this,[this.action].concat(t))}},{key:"call",value:function(e){var t=this;if(this.isShutdown){var n=N("The circuit has been shutdown.","ESHUTDOWN");return Promise.reject(n)}for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];var u,c=Array.prototype.slice.call(o);if(this.emit("fire",c),void 0!==k.get(this))return this.emit("cacheHit"),k.get(this);if(this.options.cache&&this.emit("cacheMiss"),!this[P]){var s=this.action.apply(e,c);return"function"==typeof s.then?s:Promise.resolve(s)}if(!this.closed&&!this.pendingClose){var a=N("Breaker is open","EOPENBREAKER");return this.emit("reject",a),F(this,a,c)||Promise.reject(a)}this[O]=!1;var f=!1;return new Promise((function(n,r){var o=Date.now();if(t.semaphore.test()){t.options.timeout&&(u=setTimeout((function(){f=!0;var e=N("Timed out after ".concat(t.options.timeout,"ms"),"ETIMEDOUT"),i=Date.now()-o;t.semaphore.release(),t.emit("timeout",e,i,c),q(e,t,u,c,i,n,r)}),t.options.timeout));try{var i=t.action.apply(e,c),s="function"==typeof i.then?i:Promise.resolve(i);s.then((function(e){f||(clearTimeout(u),t.emit("success",e,Date.now()-o),t.semaphore.release(),n(e),t.options.cache&&k.set(t,s))})).catch((function(e){if(!f){t.semaphore.release();var i=Date.now()-o;q(e,t,u,c,i,n,r)}}))}catch(e){t.semaphore.release();var a=Date.now()-o;q(e,t,u,c,a,n,r)}}else{var l=Date.now()-o,p=N("Semaphore locked","ESEMLOCKED");t.emit("semaphoreLocked",p,l),q(p,t,u,c,l,n,r)}}))}},{key:"clearCache",value:function(){k.set(this,void 0)}},{key:"healthCheck",value:function(e,t){var n=this;if(t=t||5e3,"function"!=typeof e)throw new TypeError("Health check function must be a function");if(isNaN(t))throw new TypeError("Health check interval must be a number");var r=function(t){e.apply(n).catch((function(e){n.emit("healthCheckFailed",e),n.open()}))},o=setInterval(r,t);"function"==typeof o.unref&&o.unref(),r()}},{key:"enable",value:function(){this[P]=!0}},{key:"disable",value:function(){this[P]=!1}},{key:"isShutdown",get:function(){return this[d]===E}},{key:"name",get:function(){return this[S]}},{key:"group",get:function(){return this[T]}},{key:"pendingClose",get:function(){return this[O]}},{key:"closed",get:function(){return this[d]===b}},{key:"opened",get:function(){return this[d]===g}},{key:"halfOpen",get:function(){return this[d]===w}},{key:"status",get:function(){return this[x]}},{key:"stats",get:function(){return this[x].stats}},{key:"enabled",get:function(){return this[P]}},{key:"warmUp",get:function(){return this[_]}},{key:"volumeThreshold",get:function(){return this[L]}}]),o}(y);function q(e,t,n,r,o,i,u){clearTimeout(n),t.options.errorFilter(e)?t.emit("success",e,o):function(e,t,n,r){if(e.emit("failure",t,r,n),e.warmUp)return;var o=e.stats;if(o.fires<e.volumeThreshold&&!e.halfOpen)return;(o.failures/o.fires*100>e.options.errorThresholdPercentage||o.failures>=e.options.maxFailures||e.halfOpen)&&e.open()}(t,e,r,o);var c=F(t,e,r);c?i(c):u(e)}function F(e,t,n){if(e[j]){var o=e[j].apply(e[j],[].concat(r(n),[t]));return e.emit("fallback",o,t),o instanceof Promise?o:Promise.resolve(o)}}function N(e,t){var n=new Error(e);return n.code=t,n[A]=!0,n}var B=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))};e.exports=R}).call(this,n(0))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var s,a=[],f=!1,l=-1;function p(){f&&s&&(f=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!f){var e=c(p);f=!0;for(var t=a.length;t;){for(s=a,a=[];++l<t;)s&&s[l].run();l=-1,t=a.length}s=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new y(e,t)),1!==a.length||f||c(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";(function(t){var r=n(10);
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.circuitBreaker=t():e.circuitBreaker=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){(function(t){var r=n(2),o=n(9);function i(){return(new Date).getTime()}var u,c=Array.prototype.slice,s={};u=void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};for(var a=[[function(){},"log"],[function(){u.log.apply(u,arguments)},"info"],[function(){u.log.apply(u,arguments)},"warn"],[function(){u.warn.apply(u,arguments)},"error"],[function(e){s[e]=i()},"time"],[function(e){var t=s[e];if(!t)throw new Error("No such label: "+e);delete s[e];var n=i()-t;u.log(e+": "+n+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=r.format.apply(null,arguments),u.error(e.stack)},"trace"],[function(e){u.log(r.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=c.call(arguments,1);o.ok(!1,r.format.apply(null,t))}},"assert"]],f=0;f<a.length;f++){var l=a[f],p=l[0],h=l[1];u[h]||(u[h]=p)}e.exports=u}).call(this,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(e,r){var o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},i=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(s(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,u=String(e).replace(i,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),c=r[n];n<o;c=r[++n])v(c)||!O(c)?u+=" "+c:u+=" "+s(c);return u},t.deprecate=function(n,o){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,o).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(o);e.traceDeprecation?r.trace(o):r.error(o),i=!0}return n.apply(this,arguments)}};var u,c={};function s(e,n){var r={seen:[],stylize:f};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),l(r,e,r.depth)}function a(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function f(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&x(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return g(o)||(o=l(e,o,r)),o}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(g(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(d(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(v(t))return e.stylize("null","null")}(e,n);if(i)return i;var u=Object.keys(n),c=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(n)),j(n)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return p(n);if(0===u.length){if(x(n)){var s=n.name?": "+n.name:"";return e.stylize("[Function"+s+"]","special")}if(w(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(j(n))return p(n)}var a,f="",O=!1,S=["{","}"];(y(n)&&(O=!0,S=["[","]"]),x(n))&&(f=" [Function"+(n.name?": "+n.name:"")+"]");return w(n)&&(f=" "+RegExp.prototype.toString.call(n)),E(n)&&(f=" "+Date.prototype.toUTCString.call(n)),j(n)&&(f=" "+p(n)),0!==u.length||O&&0!=n.length?r<0?w(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),a=O?function(e,t,n,r,o){for(var i=[],u=0,c=t.length;u<c;++u)_(t,String(u))?i.push(h(e,t,n,r,String(u),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(h(e,t,n,r,o,!0))})),i}(e,n,r,c,u):u.map((function(t){return h(e,n,r,c,t,O)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(a,f,S)):S[0]+f+S[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,i){var u,c,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?c=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(c=e.stylize("[Setter]","special")),_(r,o)||(u="["+o+"]"),c||(e.seen.indexOf(s.value)<0?(c=v(n)?l(e,s.value,null):l(e,s.value,n-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+c.split("\n").map((function(e){return" "+e})).join("\n")):c=e.stylize("[Circular]","special")),b(u)){if(i&&o.match(/^\d+$/))return c;(u=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+c}function y(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function d(e){return"number"==typeof e}function g(e){return"string"==typeof e}function b(e){return void 0===e}function w(e){return O(e)&&"[object RegExp]"===S(e)}function O(e){return"object"==typeof e&&null!==e}function E(e){return O(e)&&"[object Date]"===S(e)}function j(e){return O(e)&&("[object Error]"===S(e)||e instanceof Error)}function x(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(b(u)&&(u=Object({WEB:"web"}).NODE_DEBUG||""),n=n.toUpperCase(),!c[n])if(new RegExp("\\b"+n+"\\b","i").test(u)){var o=e.pid;c[n]=function(){var e=t.format.apply(t,arguments);r.error("%s %d: %s",n,o,e)}}else c[n]=function(){};return c[n]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=y,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=d,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=w,t.isObject=O,t.isDate=E,t.isError=j,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(7);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){r.log("%s - %s",P(),t.format.apply(t,arguments))},t.inherits=n(8),t._extend=function(e,t){if(!t||!O(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function A(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(L&&e[L]){var t;if("function"!=typeof(t=e[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),L&&Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=L,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,u=function(){return o.apply(i,arguments)};t.apply(this,n).then((function(t){e.nextTick(u,null,t)}),(function(t){e.nextTick(A,t,u)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,o(t)),n}}).call(this,n(6),n(0))},function(e,t,n){"use strict";(function(t){var n,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,e.exports.once=function(e,t){return new Promise((function(n,r){function o(){void 0!==i&&e.removeListener("error",i),n([].slice.call(arguments))}var i;"error"!==t&&(i=function(n){e.removeListener(t,o),r(n)},e.once("error",i)),e.once(t,o)}))},u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function f(e,n,r,o){var i,u,c,f;if(s(r),void 0===(u=e._events)?(u=e._events=Object.create(null),e._eventsCount=0):(void 0!==u.newListener&&(e.emit("newListener",n,r.listener?r.listener:r),u=e._events),c=u[n]),void 0===c)c=u[n]=r,++e._eventsCount;else if("function"==typeof c?c=u[n]=o?[r,c]:[c,r]:o?c.unshift(r):c.push(r),(i=a(e))>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=n,l.count=c.length,f=l,t&&t.warn&&t.warn(f)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):m(o,o.length)}function y(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return a(this)},u.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var u;if(t.length>0&&(u=t[0]),u instanceof Error)throw u;var c=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw c.context=u,c}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)o(s,this,t);else{var a=s.length,f=m(s,a);for(n=0;n<a;++n)o(f[n],this,t)}return!0},u.prototype.addListener=function(e,t){return f(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return f(this,e,t,!0)},u.prototype.once=function(e,t){return s(t),this.on(e,p(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,p(this,e,t)),this},u.prototype.removeListener=function(e,t){var n,r,o,i,u;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){u=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,u||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return h(this,e,!0)},u.prototype.rawListeners=function(e){return h(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},u.prototype.listenerCount=y,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=n(5)},function(e,t,n){"use strict";(function(t){function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(e);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function f(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=h(e);if(t){var o=h(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return l(this,n)}}function l(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?p(e):t}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function h(e){return(h=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var y=n(3),m=n(11),v=n(12),d=Symbol("state"),g=Symbol("open"),b=Symbol("closed"),w=Symbol("half-open"),O=Symbol("pending-close"),E=Symbol("shutdown"),j=Symbol("fallback"),x=Symbol("status"),S=Symbol("name"),T=Symbol("group"),k=new WeakMap,P=Symbol("Enabled"),_=Symbol("warming-up"),L=Symbol("volume-threshold"),A=Symbol("our-error"),D=Symbol("reset-timeout"),C=Symbol("warmup-timeout"),M="options.maxFailures is deprecated. Please use options.errorThresholdPercentage",R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(r,e);var n=f(r);function r(e){var o,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(u(this,r),(o=n.call(this)).options=i,o.options.timeout=!1!==i.timeout&&(i.timeout||1e4),o.options.resetTimeout=i.resetTimeout||3e4,o.options.errorThresholdPercentage=i.errorThresholdPercentage||50,o.options.rollingCountTimeout=i.rollingCountTimeout||1e4,o.options.rollingCountBuckets=i.rollingCountBuckets||10,o.options.rollingPercentilesEnabled=!1!==i.rollingPercentilesEnabled,o.options.capacity=Number.isInteger(i.capacity)?i.capacity:Number.MAX_SAFE_INTEGER,o.options.errorFilter=i.errorFilter||function(e){return!1},o.semaphore=new v(o.options.capacity),o[L]=Number.isInteger(i.volumeThreshold)?i.volumeThreshold:0,o[_]=!0===i.allowWarmUp,o[x]=new m(o.options),o[d]=b,o[j]=null,o[O]=!1,o[S]=i.name||e.name||B(),o[T]=i.group||o[S],o[P]=!1!==i.enabled,o[_]){var c=o[C]=setTimeout((function(e){return o[_]=!1}),o.options.rollingCountTimeout);"function"==typeof c.unref&&c.unref()}o.action="function"!=typeof e?function(t){return Promise.resolve(e)}:e,i.maxFailures&&t.error(M);var s=function(e){return function(t,n){return o[x].increment(e,n)}};function a(e){return function(t){var n=e[D]=setTimeout((function(){e[d]=w,e[O]=!0,e.emit("halfOpen",e.options.resetTimeout)}),e.options.resetTimeout);"function"==typeof n.unref&&n.unref()}}return o.on("success",s("successes")),o.on("failure",s("failures")),o.on("fallback",s("fallbacks")),o.on("timeout",s("timeouts")),o.on("fire",s("fires")),o.on("reject",s("rejects")),o.on("cacheHit",s("cacheHits")),o.on("cacheMiss",s("cacheMisses")),o.on("open",(function(e){return o[x].open()})),o.on("close",(function(e){return o[x].close()})),o.on("semaphoreLocked",s("semaphoreRejections")),o.on("open",a(p(o))),o.on("success",(function(e){o.halfOpen&&o.close()})),o.options.cache&&k.set(p(o),void 0),o}return s(r,null,[{key:"isOurError",value:function(e){return!!e[A]}}]),s(r,[{key:"close",value:function(){this[d]!==b&&(this[D]&&clearTimeout(this[D]),this[d]=b,this[O]=!1,this.emit("close"))}},{key:"open",value:function(){this[d]!==g&&(this[d]=g,this[O]=!1,this.emit("open"))}},{key:"shutdown",value:function(){this.disable(),this.removeAllListeners(),this[D]&&clearTimeout(this[D]),this[C]&&clearTimeout(this[C]),this.status.shutdown(),this[d]=E,this.emit("shutdown")}},{key:"fallback",value:function(e){var t=e;return e instanceof r&&(t=function(){return e.fire.apply(e,arguments)}),this[j]=t,this}},{key:"fire",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.call.apply(this,[this.action].concat(t))}},{key:"call",value:function(e){var t=this;if(this.isShutdown){var n=N("The circuit has been shutdown.","ESHUTDOWN");return Promise.reject(n)}for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];var u,c=Array.prototype.slice.call(o);if(this.emit("fire",c),void 0!==k.get(this))return this.emit("cacheHit"),k.get(this);if(this.options.cache&&this.emit("cacheMiss"),!this[P]){var s=this.action.apply(e,c);return"function"==typeof s.then?s:Promise.resolve(s)}if(!this.closed&&!this.pendingClose){var a=N("Breaker is open","EOPENBREAKER");return this.emit("reject",a),F(this,a,c)||Promise.reject(a)}this[O]=!1;var f=!1;return new Promise((function(n,r){var o=Date.now();if(t.semaphore.test()){t.options.timeout&&(u=setTimeout((function(){f=!0;var e=N("Timed out after ".concat(t.options.timeout,"ms"),"ETIMEDOUT"),i=Date.now()-o;t.semaphore.release(),t.emit("timeout",e,i,c),q(e,t,u,c,i,n,r)}),t.options.timeout));try{var i=t.action.apply(e,c),s="function"==typeof i.then?i:Promise.resolve(i);s.then((function(e){f||(clearTimeout(u),t.emit("success",e,Date.now()-o),t.semaphore.release(),n(e),t.options.cache&&k.set(t,s))})).catch((function(e){if(!f){t.semaphore.release();var i=Date.now()-o;q(e,t,u,c,i,n,r)}}))}catch(e){t.semaphore.release();var a=Date.now()-o;q(e,t,u,c,a,n,r)}}else{var l=Date.now()-o,p=N("Semaphore locked","ESEMLOCKED");t.emit("semaphoreLocked",p,l),q(p,t,u,c,l,n,r)}}))}},{key:"clearCache",value:function(){k.set(this,void 0)}},{key:"healthCheck",value:function(e,t){var n=this;if(t=t||5e3,"function"!=typeof e)throw new TypeError("Health check function must be a function");if(isNaN(t))throw new TypeError("Health check interval must be a number");var r=function(t){e.apply(n).catch((function(e){n.emit("healthCheckFailed",e),n.open()}))},o=setInterval(r,t);"function"==typeof o.unref&&o.unref(),r()}},{key:"enable",value:function(){this[P]=!0}},{key:"disable",value:function(){this[P]=!1}},{key:"isShutdown",get:function(){return this[d]===E}},{key:"name",get:function(){return this[S]}},{key:"group",get:function(){return this[T]}},{key:"pendingClose",get:function(){return this[O]}},{key:"closed",get:function(){return this[d]===b}},{key:"opened",get:function(){return this[d]===g}},{key:"halfOpen",get:function(){return this[d]===w}},{key:"status",get:function(){return this[x]}},{key:"stats",get:function(){return this[x].stats}},{key:"enabled",get:function(){return this[P]}},{key:"warmUp",get:function(){return this[_]}},{key:"volumeThreshold",get:function(){return this[L]}}]),r}(y);function q(e,t,n,r,o,i,u){clearTimeout(n),t.options.errorFilter(e)?t.emit("success",e,o):function(e,t,n,r){if(e.emit("failure",t,r,n),e.warmUp)return;var o=e.stats;if(o.fires<e.volumeThreshold&&!e.halfOpen)return;(o.failures/o.fires*100>e.options.errorThresholdPercentage||o.failures>=e.options.maxFailures||e.halfOpen)&&e.open()}(t,e,r,o);var c=F(t,e,r);c?i(c):u(e)}function F(e,t,n){if(e[j]){var o=e[j].apply(e[j],[].concat(r(n),[t]));return e.emit("fallback",o,t),o instanceof Promise?o:Promise.resolve(o)}}function N(e,t){var n=new Error(e);return n.code=t,n[A]=!0,n}var B=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))};e.exports=R}).call(this,n(0))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var s,a=[],f=!1,l=-1;function p(){f&&s&&(f=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!f){var e=c(p);f=!0;for(var t=a.length;t;){for(s=a,a=[];++l<t;)s&&s[l].run();l=-1,t=a.length}s=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new y(e,t)),1!==a.length||f||c(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";(function(t){var r=n(10);
/*!

@@ -12,3 +12,3 @@ * The buffer module from node.js, for the browser.

@license MIT
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function u(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,c,s=u(e),a=1;a<arguments.length;a++){for(var f in n=Object(arguments[a]))o.call(n,f)&&(s[f]=n[f]);if(r){c=r(n);for(var l=0;l<c.length;l++)i.call(n,c[l])&&(s[c[l]]=n[c[l]])}}return s}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var a=Symbol("window"),f=Symbol("buckets"),l=Symbol("timeout"),p=Symbol("percentiles"),h=Symbol("bucket-interval"),y=Symbol("snapshot-interval"),m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(b,e);var t,n,r,m,g=(t=b,function(){var e,n=c(t);if(u()){var r=c(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return i(this,e)});function b(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b),(t=g.call(this))[f]=e.rollingCountBuckets,t[l]=e.rollingCountTimeout,t[a]=new Array(t[f]),t[p]=[0,.25,.5,.75,.9,.95,.99,.995,1],t.rollingPercentilesEnabled=e.rollingPercentilesEnabled;for(var n=0;n<t[f];n++)t[a][n]=d();var r=Math.floor(t[l]/t[f]);return t[h]=setInterval(v(t[a]),r),"function"==typeof t[h].unref&&t[h].unref(),t[y]=setInterval((function(e){return t.emit("snapshot",t.stats)}),r),"function"==typeof t[y].unref&&t[y].unref(),t}return n=b,(r=[{key:"increment",value:function(e,t){this[a][0][e]++,"successes"!==e&&"failures"!==e&&"timeouts"!==e||this[a][0].latencyTimes.push(t||0)}},{key:"open",value:function(){this[a][0].isCircuitBreakerOpen=!0}},{key:"close",value:function(){this[a][0].isCircuitBreakerOpen=!1}},{key:"shutdown",value:function(){this.removeAllListeners(),clearInterval(this[h]),clearInterval(this[y])}},{key:"stats",get:function(){var e=this,t=this[a].reduce((function(t,n){return n?(Object.keys(t).forEach((function(e){"latencyTimes"!==e&&"percentiles"!==e&&(t[e]+=n[e]||0)})),e.rollingPercentilesEnabled&&t.latencyTimes.push.apply(t.latencyTimes,n.latencyTimes||[]),t):t}),d());return this.rollingPercentilesEnabled?(t.latencyTimes.sort((function(e,t){return e-t})),t.latencyTimes.length?t.latencyMean=t.latencyTimes.reduce((function(e,t){return e+t}),0)/t.latencyTimes.length:t.latencyMean=0,this[p].forEach((function(e){t.percentiles[e]=function(e,t){if(0===e)return t[0]||0;var n=Math.ceil(e*t.length);return t[n-1]||0}(e,t.latencyTimes)}))):(t.latencyMean=-1,this[p].forEach((function(e){t.percentiles[e]=-1}))),t}},{key:"window",get:function(){return this[a].slice()}}])&&o(n.prototype,r),m&&o(n,m),b}(n(3).EventEmitter),v=function(e){return function(t){e.pop(),e.unshift(d())}},d=function(e){return{failures:0,fallbacks:0,successes:0,rejects:0,fires:0,timeouts:0,cacheHits:0,cacheMisses:0,semaphoreRejections:0,percentiles:{},latencyTimes:[]}};e.exports=m},function(e,t,n){"use strict";e.exports=function(e){var t=[],n=e,r={take:o,release:i,test:function(){return!(n<1)&&(o()&&!0)}};return Object.defineProperty(r,"count",{get:function(e){return n},enumerable:!0}),r;function o(e){return n>0?(--n,Promise.resolve(i)):new Promise((function(r,o){t.push((function(e){--n,r(i)})),e&&setTimeout((function(n){t.shift();var r=new Error("Timed out after ".concat(e,"ms"));r.code="ETIMEDOUT",o(r)}),e)}))}function i(){n++,t.length>0&&t.shift()()}}}])}));
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function u(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,c,s=u(e),a=1;a<arguments.length;a++){for(var f in n=Object(arguments[a]))o.call(n,f)&&(s[f]=n[f]);if(r){c=r(n);for(var l=0;l<c.length;l++)i.call(n,c[l])&&(s[c[l]]=n[c[l]])}}return s}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){return(i=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function u(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=s(e);if(t){var o=s(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return c(this,n)}}function c(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function s(e){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}var a=Symbol("window"),f=Symbol("buckets"),l=Symbol("timeout"),p=Symbol("percentiles"),h=Symbol("bucket-interval"),y=Symbol("snapshot-interval"),m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&i(e,t)}(s,e);var t,n,r,c=u(s);function s(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,s),(t=c.call(this))[f]=e.rollingCountBuckets,t[l]=e.rollingCountTimeout,t[a]=new Array(t[f]),t[p]=[0,.25,.5,.75,.9,.95,.99,.995,1],t.rollingPercentilesEnabled=e.rollingPercentilesEnabled;for(var n=0;n<t[f];n++)t[a][n]=d();var r=Math.floor(t[l]/t[f]);return t[h]=setInterval(v(t[a]),r),"function"==typeof t[h].unref&&t[h].unref(),t[y]=setInterval((function(e){return t.emit("snapshot",t.stats)}),r),"function"==typeof t[y].unref&&t[y].unref(),t}return t=s,(n=[{key:"increment",value:function(e,t){this[a][0][e]++,"successes"!==e&&"failures"!==e&&"timeouts"!==e||this[a][0].latencyTimes.push(t||0)}},{key:"open",value:function(){this[a][0].isCircuitBreakerOpen=!0}},{key:"close",value:function(){this[a][0].isCircuitBreakerOpen=!1}},{key:"shutdown",value:function(){this.removeAllListeners(),clearInterval(this[h]),clearInterval(this[y])}},{key:"stats",get:function(){var e=this,t=this[a].reduce((function(t,n){return n?(Object.keys(t).forEach((function(e){"latencyTimes"!==e&&"percentiles"!==e&&(t[e]+=n[e]||0)})),e.rollingPercentilesEnabled&&t.latencyTimes.push.apply(t.latencyTimes,n.latencyTimes||[]),t):t}),d());return this.rollingPercentilesEnabled?(t.latencyTimes.sort((function(e,t){return e-t})),t.latencyTimes.length?t.latencyMean=t.latencyTimes.reduce((function(e,t){return e+t}),0)/t.latencyTimes.length:t.latencyMean=0,this[p].forEach((function(e){t.percentiles[e]=function(e,t){if(0===e)return t[0]||0;var n=Math.ceil(e*t.length);return t[n-1]||0}(e,t.latencyTimes)}))):(t.latencyMean=-1,this[p].forEach((function(e){t.percentiles[e]=-1}))),t}},{key:"window",get:function(){return this[a].slice()}}])&&o(t.prototype,n),r&&o(t,r),s}(n(3).EventEmitter),v=function(e){return function(t){e.pop(),e.unshift(d())}},d=function(e){return{failures:0,fallbacks:0,successes:0,rejects:0,fires:0,timeouts:0,cacheHits:0,cacheMisses:0,semaphoreRejections:0,percentiles:{},latencyTimes:[]}};e.exports=m},function(e,t,n){"use strict";e.exports=function(e){var t=[],n=e,r={take:o,release:i,test:function(){return!(n<1)&&(o()&&!0)}};return Object.defineProperty(r,"count",{get:function(e){return n},enumerable:!0}),r;function o(e){return n>0?(--n,Promise.resolve(i)):new Promise((function(r,o){t.push((function(e){--n,r(i)})),e&&setTimeout((function(n){t.shift();var r=new Error("Timed out after ".concat(e,"ms"));r.code="ETIMEDOUT",o(r)}),e)}))}function i(){n++,t.length>0&&t.shift()()}}}])}));
//# sourceMappingURL=opossum.min.map

@@ -48,3 +48,3 @@ 'use strict';

* options.rollingCountTimeout is 10000, and options.rollingCountBuckets is 10,
* then the statistical window will be 1000 1 second snapshots in the
* then the statistical window will be 1000/1 second snapshots in the
* statistical window. Default: 10

@@ -69,5 +69,5 @@ * @param {String} options.name the circuit name to use when reporting stats.

* `rollingCountTimeout` property). Default: false
* allow before enabling the circuit. This can help in situations where no
* matter what your `errorThresholdPercentage` is, if the first execution
* times out or fails, the circuit immediately opens.
* This can help in situations where no matter what your
* `errorThresholdPercentage` is, if the first execution times out or fails,
* the circuit immediately opens.
* @param {Number} options.volumeThreshold the minimum number of requests within

@@ -653,3 +653,3 @@ * the rolling statistical window that must exist before the circuit breaker

if (circuit.options.errorFilter(error)) {
if (circuit.options.errorFilter(error, ...args)) {
circuit.emit('success', error, latency);

@@ -656,0 +656,0 @@ } else {

{
"name": "opossum",
"version": "5.0.2",
"version": "5.1.0",
"author": "Red Hat, Inc.",
"license": "Apache-2.0",
"support": {
"target": "LTS",
"response": "REGULAR-7",
"backing": "COMPANY"
},
"scripts": {

@@ -49,8 +44,8 @@ "prebuild": "npm run lint",

"devDependencies": {
"@babel/core": "^7.11.6",
"@babel/preset-env": "^7.11.5",
"babel-loader": "^8.0.6",
"@babel/core": "^7.12.3",
"@babel/preset-env": "^7.12.1",
"babel-loader": "^8.2.1",
"codacy-coverage": "^3.4.0",
"coveralls": "^3.1.0",
"documentation": "^13.0.2",
"documentation": "^13.1.0",
"nyc": "~15.1.0",

@@ -63,4 +58,4 @@ "opener": "1.5.2",

"tape": "~5.0.1",
"webpack": "~4.44.2",
"webpack-cli": "~3.3.12"
"webpack": "~5.3.2",
"webpack-cli": "~4.1.0"
},

@@ -78,5 +73,6 @@ "description": "A fail-fast circuit breaker for promises and callbacks",

"engines": {
"node": "^14 || ^12 || ^10"
"node": "^15 || ^14 || ^12 || ^10"
},
"dependencies": {}
"dependencies": {},
"support": true
}

@@ -1,6 +0,5 @@

# opossum
# opossum
![Node.js CI](https://github.com/nodeshift/opossum/workflows/Node.js%20CI/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/nodeshift/opossum/badge.svg?branch=master)](https://coveralls.io/github/nodeshift/opossum?branch=master)
[![Greenkeeper badge](https://badges.greenkeeper.io/nodeshift/opossum.svg)](https://greenkeeper.io/)
[![Known Vulnerabilities](https://snyk.io/test/npm/opossum/badge.svg)](https://snyk.io/test/npm/opossum)

@@ -35,3 +34,3 @@ [![dependencies Status](https://david-dm.org/nodeshift/opossum/status.svg)](https://david-dm.org/nodeshift/opossum)

function asyncFunctionThatCouldFail (x, y) {
function asyncFunctionThatCouldFail(x, y) {
return new Promise((resolve, reject) => {

@@ -49,3 +48,3 @@ // Do something, maybe on the network or a disk

breaker.fire(params)
breaker.fire(x, y)
.then(console.log)

@@ -150,12 +149,12 @@ .catch(console.error);

timeout: 500,
maxFailures: 3,
errorThresholdPercentage: 50,
resetTimeout: 5000
};
const circuit = new CircuitBreaker(() => $.get(route), circuitBreakerOptions);
circuit.fallback(() => `${route} unavailable right now. Try later.`));
circuit.on('success', (result) => $(element).append(JSON.stringify(result)}));
const breaker = new CircuitBreaker(() => $.get(route), circuitBreakerOptions);
breaker.fallback(() => `${route} unavailable right now. Try later.`));
breaker.on('success', (result) => $(element).append(JSON.stringify(result)}));
$(() => {
$('#serviceButton').click(() => circuit.fire().catch((e) => console.error(e)));
$('#serviceButton').click(() => breaker.fire().catch((e) => console.error(e)));
});

@@ -185,31 +184,31 @@

```js
const circuit = new CircuitBreaker(() => $.get(route), circuitBreakerOptions);
const breaker = new CircuitBreaker(() => $.get(route), circuitBreakerOptions);
circuit.fallback(() => ({ body: `${route} unavailable right now. Try later.` }));
breaker.fallback(() => ({ body: `${route} unavailable right now. Try later.` }));
circuit.on('success',
breaker.on('success',
(result) => $(element).append(
makeNode(`SUCCESS: ${JSON.stringify(result)}`)));
circuit.on('timeout',
breaker.on('timeout',
() => $(element).append(
makeNode(`TIMEOUT: ${route} is taking too long to respond.`)));
circuit.on('reject',
breaker.on('reject',
() => $(element).append(
makeNode(`REJECTED: The breaker for ${route} is open. Failing fast.`)));
circuit.on('open',
breaker.on('open',
() => $(element).append(
makeNode(`OPEN: The breaker for ${route} just opened.`)));
circuit.on('halfOpen',
breaker.on('halfOpen',
() => $(element).append(
makeNode(`HALF_OPEN: The breaker for ${route} is half open.`)));
circuit.on('close',
breaker.on('close',
() => $(element).append(
makeNode(`CLOSE: The breaker for ${route} has closed. Service OK.`)));
circuit.on('fallback',
breaker.on('fallback',
(data) => $(element).append(

@@ -287,5 +286,5 @@ makeNode(`FALLBACK: ${JSON.stringify(data)}`)));

```js
circuit.stats.getHystrixStream().setMaxListeners(100);
breaker.stats.getHystrixStream().setMaxListeners(100);
```
Or it could be that you have a large test suite which exercises some code that creates `CircuitBreaker`s and does so repeatedly. If the `CircuitBreaker` being created is only needed for the duration of the test, use `circuit.shutdown()` when the circuit is no longer in use to clean up all listeners.
Or it could be that you have a large test suite which exercises some code that creates `CircuitBreaker`s and does so repeatedly. If the `CircuitBreaker` being created is only needed for the duration of the test, use `breaker.shutdown()` when the circuit is no longer in use to clean up all listeners.

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc