1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold. *
17 // *************************************************************************
18 var _0x2ac4=['disconnect','stop','restart','list','describe','delete','dump','saved','bluebird','connect','connected','then'];(function(_0x46b0ed,_0x18118c){var _0xbe4c89=function(_0x1d3934){while(--_0x1d3934){_0x46b0ed['push'](_0x46b0ed['shift']());}};_0xbe4c89(++_0x18118c);}(_0x2ac4,0x68));var _0x42ac=function(_0x28c4db,_0x2ccd05){_0x28c4db=_0x28c4db-0x0;var _0x5907ed=_0x2ac4[_0x28c4db];return _0x5907ed;};'use strict';var pm2=require('pm2');var BPromise=require(_0x42ac('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x23058f,_0x39e3a3){return pm2[_0x42ac('0x1')](function(_0x3877b4){if(_0x3877b4){return _0x39e3a3(_0x3877b4);}return _0x23058f(_0x42ac('0x2'));});});};exports['start']=function(_0x13431f){return connect()[_0x42ac('0x3')](function(){return new BPromise(function(_0x4d0f9a,_0x101e11){return pm2['start'](_0x13431f,function(_0x24d253,_0x501938){if(_0x24d253){return _0x101e11(_0x24d253);}pm2[_0x42ac('0x4')]();return _0x4d0f9a(_0x501938);});});});};exports[_0x42ac('0x5')]=function(_0x2634e4){return connect()[_0x42ac('0x3')](function(){return new BPromise(function(_0xf31869,_0x578d01){return pm2[_0x42ac('0x5')](_0x2634e4,function(_0xf2ff24,_0x52134d){if(_0xf2ff24){return _0x578d01(_0xf2ff24);}pm2[_0x42ac('0x4')]();return _0xf31869(_0x52134d);});});});};exports[_0x42ac('0x6')]=function(_0x43085b){return connect()['then'](function(){return new BPromise(function(_0x955de7,_0x46b649){return pm2['restart'](_0x43085b,function(_0x56c040,_0x2e7cc6){if(_0x56c040){return _0x46b649(_0x56c040);}pm2[_0x42ac('0x4')]();return _0x955de7(_0x2e7cc6);});});});};exports[_0x42ac('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x2df301,_0x3db1d0){return pm2[_0x42ac('0x7')](function(_0x391481,_0x1a2f9d){if(_0x391481){return _0x3db1d0(_0x391481);}pm2[_0x42ac('0x4')]();return _0x2df301(_0x1a2f9d);});});});};exports[_0x42ac('0x8')]=function(_0x4c4d6c){return connect()['then'](function(){return new BPromise(function(_0xcdddc,_0x59b8b5){return pm2[_0x42ac('0x8')](_0x4c4d6c,function(_0x2ba163,_0x1c9981){if(_0x2ba163){return _0x59b8b5(_0x2ba163);}pm2[_0x42ac('0x4')]();return _0xcdddc(_0x1c9981);});});});};exports[_0x42ac('0x9')]=function(_0x28a280){return connect()['then'](function(){return new BPromise(function(_0x3ef474,_0x4764c2){return pm2[_0x42ac('0x9')](_0x28a280,function(_0x42f384,_0x3a8317){if(_0x42f384){return _0x4764c2(_0x42f384);}pm2['disconnect']();return _0x3ef474(_0x3a8317);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x5a91bf,_0x97a24f){return pm2[_0x42ac('0xa')](function(_0x331ee5){if(_0x331ee5){return _0x97a24f(_0x331ee5);}return _0x5a91bf(_0x42ac('0xb'));});});});};