acbdb73282ece377a711ee8b8d37d91d32e309b6
[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 _0xb24d=['restart','list','describe','delete','dump','saved','bluebird','connect','connected','then','disconnect','stop'];(function(_0x34ddc1,_0x853f0){var _0x913f4e=function(_0x5069c7){while(--_0x5069c7){_0x34ddc1['push'](_0x34ddc1['shift']());}};_0x913f4e(++_0x853f0);}(_0xb24d,0x1f2));var _0xdb24=function(_0x2efb0b,_0x11b3b9){_0x2efb0b=_0x2efb0b-0x0;var _0x4c1d0a=_0xb24d[_0x2efb0b];return _0x4c1d0a;};'use strict';var pm2=require('pm2');var BPromise=require(_0xdb24('0x0'));var config=require('./config');function connect(){return new BPromise(function(_0x5a5c11,_0x2840ce){return pm2[_0xdb24('0x1')](function(_0x19bb9d){if(_0x19bb9d){return _0x2840ce(_0x19bb9d);}return _0x5a5c11(_0xdb24('0x2'));});});};exports['start']=function(_0x50b78c){return connect()[_0xdb24('0x3')](function(){return new BPromise(function(_0x44eeb1,_0x56b960){return pm2['start'](_0x50b78c,function(_0x36959e,_0x2233a7){if(_0x36959e){return _0x56b960(_0x36959e);}pm2[_0xdb24('0x4')]();return _0x44eeb1(_0x2233a7);});});});};exports[_0xdb24('0x5')]=function(_0x1eb6d7){return connect()['then'](function(){return new BPromise(function(_0x586b31,_0x19d90b){return pm2[_0xdb24('0x5')](_0x1eb6d7,function(_0x23c149,_0x10af8c){if(_0x23c149){return _0x19d90b(_0x23c149);}pm2[_0xdb24('0x4')]();return _0x586b31(_0x10af8c);});});});};exports['restart']=function(_0x19b959){return connect()['then'](function(){return new BPromise(function(_0x421190,_0x4f1540){return pm2[_0xdb24('0x6')](_0x19b959,function(_0xe34fa6,_0x4bfd62){if(_0xe34fa6){return _0x4f1540(_0xe34fa6);}pm2['disconnect']();return _0x421190(_0x4bfd62);});});});};exports['list']=function(){return connect()[_0xdb24('0x3')](function(){return new BPromise(function(_0x2b8ffc,_0x552fbc){return pm2[_0xdb24('0x7')](function(_0x2411bc,_0x5d9ce0){if(_0x2411bc){return _0x552fbc(_0x2411bc);}pm2[_0xdb24('0x4')]();return _0x2b8ffc(_0x5d9ce0);});});});};exports[_0xdb24('0x8')]=function(_0x162752){return connect()[_0xdb24('0x3')](function(){return new BPromise(function(_0x9644f4,_0x1bf4b8){return pm2['describe'](_0x162752,function(_0x3cdd9d,_0x5e6e49){if(_0x3cdd9d){return _0x1bf4b8(_0x3cdd9d);}pm2[_0xdb24('0x4')]();return _0x9644f4(_0x5e6e49);});});});};exports[_0xdb24('0x9')]=function(_0x5779ef){return connect()[_0xdb24('0x3')](function(){return new BPromise(function(_0xf838a8,_0x2082a7){return pm2['delete'](_0x5779ef,function(_0x2a1551,_0x10e540){if(_0x2a1551){return _0x2082a7(_0x2a1551);}pm2[_0xdb24('0x4')]();return _0xf838a8(_0x10e540);});});});};exports[_0xdb24('0xa')]=function(){return connect()[_0xdb24('0x3')](function(){return new BPromise(function(_0x505efc,_0x53801f){return pm2[_0xdb24('0xa')](function(_0x20b97a){if(_0x20b97a){return _0x53801f(_0x20b97a);}return _0x505efc(_0xdb24('0xb'));});});});};