c60689013ee4a96c125d9646fd882117aa6a3b2f
[motion2.git] / server / config / pm2 / index.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
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.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0xff14=['pm2','bluebird','./config','connect','connected','then','start','stop','disconnect','restart','list','describe','delete','dump'];(function(_0x10670e,_0xd94269){var _0x4e4f40=function(_0x464c72){while(--_0x464c72){_0x10670e['push'](_0x10670e['shift']());}};_0x4e4f40(++_0xd94269);}(_0xff14,0x1a4));var _0x4ff1=function(_0x5f4f17,_0x4a5909){_0x5f4f17=_0x5f4f17-0x0;var _0x1d9fe8=_0xff14[_0x5f4f17];return _0x1d9fe8;};'use strict';var pm2=require(_0x4ff1('0x0'));var BPromise=require(_0x4ff1('0x1'));var config=require(_0x4ff1('0x2'));function connect(){return new BPromise(function(_0x288143,_0x2e35c0){return pm2[_0x4ff1('0x3')](function(_0x1c3f1f){if(_0x1c3f1f){return _0x2e35c0(_0x1c3f1f);}return _0x288143(_0x4ff1('0x4'));});});};exports['start']=function(_0x348ed0){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x184ff1,_0x394c95){return pm2[_0x4ff1('0x6')](_0x348ed0,function(_0x19e3d3,_0xd5a54b){if(_0x19e3d3){return _0x394c95(_0x19e3d3);}pm2['disconnect']();return _0x184ff1(_0xd5a54b);});});});};exports[_0x4ff1('0x7')]=function(_0x29fabe){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x2300d5,_0x30e0d2){return pm2['stop'](_0x29fabe,function(_0x29e28f,_0x172873){if(_0x29e28f){return _0x30e0d2(_0x29e28f);}pm2[_0x4ff1('0x8')]();return _0x2300d5(_0x172873);});});});};exports[_0x4ff1('0x9')]=function(_0x39e985){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x32fa87,_0x3552b6){return pm2[_0x4ff1('0x9')](_0x39e985,function(_0x1bf0be,_0x3297a1){if(_0x1bf0be){return _0x3552b6(_0x1bf0be);}pm2[_0x4ff1('0x8')]();return _0x32fa87(_0x3297a1);});});});};exports[_0x4ff1('0xa')]=function(){return connect()['then'](function(){return new BPromise(function(_0x5ea2a8,_0x514caa){return pm2[_0x4ff1('0xa')](function(_0x17d2ac,_0x1a3c56){if(_0x17d2ac){return _0x514caa(_0x17d2ac);}pm2[_0x4ff1('0x8')]();return _0x5ea2a8(_0x1a3c56);});});});};exports[_0x4ff1('0xb')]=function(_0x313599){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x1cfa8b,_0x12e501){return pm2[_0x4ff1('0xb')](_0x313599,function(_0x367527,_0xe9b5a7){if(_0x367527){return _0x12e501(_0x367527);}pm2[_0x4ff1('0x8')]();return _0x1cfa8b(_0xe9b5a7);});});});};exports[_0x4ff1('0xc')]=function(_0x11168a){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x3f54a9,_0x203715){return pm2['delete'](_0x11168a,function(_0x26f4fc,_0x5ec72d){if(_0x26f4fc){return _0x203715(_0x26f4fc);}pm2[_0x4ff1('0x8')]();return _0x3f54a9(_0x5ec72d);});});});};exports[_0x4ff1('0xd')]=function(){return connect()[_0x4ff1('0x5')](function(){return new BPromise(function(_0x1d3cff,_0x3420e3){return pm2[_0x4ff1('0xd')](function(_0x35f6d8){if(_0x35f6d8){return _0x3420e3(_0x35f6d8);}return _0x1d3cff('saved');});});});};