076e52df95934c9e02824555207fc756b20af051
[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 _0xfeb7=['start','then','disconnect','restart','list','delete','saved','pm2','bluebird','connect'];(function(_0x3e883d,_0x50b9b7){var _0xf5bfa4=function(_0x329e){while(--_0x329e){_0x3e883d['push'](_0x3e883d['shift']());}};_0xf5bfa4(++_0x50b9b7);}(_0xfeb7,0x9d));var _0x7feb=function(_0x41dcad,_0x559923){_0x41dcad=_0x41dcad-0x0;var _0x588bcc=_0xfeb7[_0x41dcad];return _0x588bcc;};'use strict';var pm2=require(_0x7feb('0x0'));var BPromise=require(_0x7feb('0x1'));var config=require('./config');function connect(){return new BPromise(function(_0x2e5e69,_0x33730c){return pm2[_0x7feb('0x2')](function(_0x520d0d){if(_0x520d0d){return _0x33730c(_0x520d0d);}return _0x2e5e69('connected');});});};exports[_0x7feb('0x3')]=function(_0x25ebb3){return connect()[_0x7feb('0x4')](function(){return new BPromise(function(_0xdc12da,_0x527c51){return pm2['start'](_0x25ebb3,function(_0x4f6167,_0x30d0e3){if(_0x4f6167){return _0x527c51(_0x4f6167);}pm2[_0x7feb('0x5')]();return _0xdc12da(_0x30d0e3);});});});};exports['stop']=function(_0xe376dc){return connect()[_0x7feb('0x4')](function(){return new BPromise(function(_0x55fdda,_0x1dd781){return pm2['stop'](_0xe376dc,function(_0x528e41,_0x1a0adb){if(_0x528e41){return _0x1dd781(_0x528e41);}pm2['disconnect']();return _0x55fdda(_0x1a0adb);});});});};exports[_0x7feb('0x6')]=function(_0x31cca8){return connect()[_0x7feb('0x4')](function(){return new BPromise(function(_0x9e7d51,_0x3293d5){return pm2[_0x7feb('0x6')](_0x31cca8,function(_0x21211b,_0x179c58){if(_0x21211b){return _0x3293d5(_0x21211b);}pm2['disconnect']();return _0x9e7d51(_0x179c58);});});});};exports[_0x7feb('0x7')]=function(){return connect()['then'](function(){return new BPromise(function(_0x59ef7d,_0x2544bb){return pm2[_0x7feb('0x7')](function(_0x112828,_0x4f065a){if(_0x112828){return _0x2544bb(_0x112828);}pm2[_0x7feb('0x5')]();return _0x59ef7d(_0x4f065a);});});});};exports['describe']=function(_0xf226d4){return connect()[_0x7feb('0x4')](function(){return new BPromise(function(_0x13e62a,_0x1b6efe){return pm2['describe'](_0xf226d4,function(_0xb0d6e7,_0x45d254){if(_0xb0d6e7){return _0x1b6efe(_0xb0d6e7);}pm2[_0x7feb('0x5')]();return _0x13e62a(_0x45d254);});});});};exports[_0x7feb('0x8')]=function(_0x23c20d){return connect()[_0x7feb('0x4')](function(){return new BPromise(function(_0x7e6ced,_0x20e82c){return pm2[_0x7feb('0x8')](_0x23c20d,function(_0x1e1bf3,_0x4e5364){if(_0x1e1bf3){return _0x20e82c(_0x1e1bf3);}pm2[_0x7feb('0x5')]();return _0x7e6ced(_0x4e5364);});});});};exports['dump']=function(){return connect()[_0x7feb('0x4')](function(){return new BPromise(function(_0x540e79,_0x4a2664){return pm2['dump'](function(_0x5cdaf3){if(_0x5cdaf3){return _0x4a2664(_0x5cdaf3);}return _0x540e79(_0x7feb('0x9'));});});});};