Built motion from commit 15aa0e42.|2.6.19
[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 _0x3141=['stop','disconnect','restart','list','describe','delete','dump','pm2','./config','connected','start','then'];(function(_0x5df843,_0x35331a){var _0x160f4f=function(_0x48a47d){while(--_0x48a47d){_0x5df843['push'](_0x5df843['shift']());}};_0x160f4f(++_0x35331a);}(_0x3141,0xdf));var _0x1314=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x3141[_0x122ef9];return _0x42fba0;};'use strict';var pm2=require(_0x1314('0x0'));var BPromise=require('bluebird');var config=require(_0x1314('0x1'));function connect(){return new BPromise(function(_0x3df58b,_0x5c4278){return pm2['connect'](function(_0x127661){if(_0x127661){return _0x5c4278(_0x127661);}return _0x3df58b(_0x1314('0x2'));});});};exports[_0x1314('0x3')]=function(_0x5630ce){return connect()[_0x1314('0x4')](function(){return new BPromise(function(_0x544522,_0x1587bf){return pm2['start'](_0x5630ce,function(_0x14714a,_0x5722c9){if(_0x14714a){return _0x1587bf(_0x14714a);}pm2['disconnect']();return _0x544522(_0x5722c9);});});});};exports['stop']=function(_0x4757ee){return connect()[_0x1314('0x4')](function(){return new BPromise(function(_0x353770,_0xbf2b4a){return pm2[_0x1314('0x5')](_0x4757ee,function(_0x295873,_0x38a2bb){if(_0x295873){return _0xbf2b4a(_0x295873);}pm2[_0x1314('0x6')]();return _0x353770(_0x38a2bb);});});});};exports['restart']=function(_0x4a18ca){return connect()[_0x1314('0x4')](function(){return new BPromise(function(_0x24e8b2,_0x43d016){return pm2[_0x1314('0x7')](_0x4a18ca,function(_0x496d6f,_0x3f1466){if(_0x496d6f){return _0x43d016(_0x496d6f);}pm2[_0x1314('0x6')]();return _0x24e8b2(_0x3f1466);});});});};exports[_0x1314('0x8')]=function(){return connect()['then'](function(){return new BPromise(function(_0x24d083,_0x2c1f42){return pm2[_0x1314('0x8')](function(_0xc3493f,_0x1c6fec){if(_0xc3493f){return _0x2c1f42(_0xc3493f);}pm2[_0x1314('0x6')]();return _0x24d083(_0x1c6fec);});});});};exports[_0x1314('0x9')]=function(_0x2862bb){return connect()['then'](function(){return new BPromise(function(_0x178923,_0x29ae15){return pm2[_0x1314('0x9')](_0x2862bb,function(_0x42a037,_0x82c3b0){if(_0x42a037){return _0x29ae15(_0x42a037);}pm2['disconnect']();return _0x178923(_0x82c3b0);});});});};exports[_0x1314('0xa')]=function(_0x41f3b1){return connect()[_0x1314('0x4')](function(){return new BPromise(function(_0x3d19e5,_0x2db71f){return pm2['delete'](_0x41f3b1,function(_0x301ff0,_0x14825f){if(_0x301ff0){return _0x2db71f(_0x301ff0);}pm2['disconnect']();return _0x3d19e5(_0x14825f);});});});};exports['dump']=function(){return connect()[_0x1314('0x4')](function(){return new BPromise(function(_0x1d9d57,_0x4e94a1){return pm2[_0x1314('0xb')](function(_0x2468c3){if(_0x2468c3){return _0x4e94a1(_0x2468c3);}return _0x1d9d57('saved');});});});};