Built motion from commit 14588770.|2.5.38
[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 _0xafd3=['pm2','./config','start','then','stop','disconnect','restart','list','describe','delete','saved'];(function(_0x465893,_0x282856){var _0xde14bc=function(_0x539be7){while(--_0x539be7){_0x465893['push'](_0x465893['shift']());}};_0xde14bc(++_0x282856);}(_0xafd3,0xb0));var _0x3afd=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0xafd3[_0x2142c8];return _0x4286e9;};'use strict';var pm2=require(_0x3afd('0x0'));var BPromise=require('bluebird');var config=require(_0x3afd('0x1'));function connect(){return new BPromise(function(_0x113182,_0x320a74){return pm2['connect'](function(_0xefc9b2){if(_0xefc9b2){return _0x320a74(_0xefc9b2);}return _0x113182('connected');});});};exports[_0x3afd('0x2')]=function(_0x42f97f){return connect()[_0x3afd('0x3')](function(){return new BPromise(function(_0x943d1d,_0x16ce76){return pm2['start'](_0x42f97f,function(_0x165182,_0x3211ed){if(_0x165182){return _0x16ce76(_0x165182);}pm2['disconnect']();return _0x943d1d(_0x3211ed);});});});};exports[_0x3afd('0x4')]=function(_0x3f5dbe){return connect()['then'](function(){return new BPromise(function(_0xa0935c,_0xbcfa31){return pm2['stop'](_0x3f5dbe,function(_0x3dd1e0,_0x4ccc9b){if(_0x3dd1e0){return _0xbcfa31(_0x3dd1e0);}pm2[_0x3afd('0x5')]();return _0xa0935c(_0x4ccc9b);});});});};exports[_0x3afd('0x6')]=function(_0x1fa6a9){return connect()[_0x3afd('0x3')](function(){return new BPromise(function(_0x1b2892,_0x5a2095){return pm2[_0x3afd('0x6')](_0x1fa6a9,function(_0x15c7ee,_0x5ac767){if(_0x15c7ee){return _0x5a2095(_0x15c7ee);}pm2['disconnect']();return _0x1b2892(_0x5ac767);});});});};exports[_0x3afd('0x7')]=function(){return connect()[_0x3afd('0x3')](function(){return new BPromise(function(_0x43a122,_0x5b8616){return pm2['list'](function(_0x1deed9,_0x468931){if(_0x1deed9){return _0x5b8616(_0x1deed9);}pm2[_0x3afd('0x5')]();return _0x43a122(_0x468931);});});});};exports[_0x3afd('0x8')]=function(_0x3899ca){return connect()[_0x3afd('0x3')](function(){return new BPromise(function(_0x3c1b52,_0x4b7f39){return pm2['describe'](_0x3899ca,function(_0x454394,_0x128eb6){if(_0x454394){return _0x4b7f39(_0x454394);}pm2[_0x3afd('0x5')]();return _0x3c1b52(_0x128eb6);});});});};exports[_0x3afd('0x9')]=function(_0x15d048){return connect()[_0x3afd('0x3')](function(){return new BPromise(function(_0x1ae362,_0x4f03cb){return pm2[_0x3afd('0x9')](_0x15d048,function(_0x17cdc1,_0x4f885a){if(_0x17cdc1){return _0x4f03cb(_0x17cdc1);}pm2[_0x3afd('0x5')]();return _0x1ae362(_0x4f885a);});});});};exports['dump']=function(){return connect()['then'](function(){return new BPromise(function(_0x44ee02,_0x3d4047){return pm2['dump'](function(_0xde975c){if(_0xde975c){return _0x3d4047(_0xde975c);}return _0x44ee02(_0x3afd('0xa'));});});});};