68a1f0d2adbc4f1f5f0ea57d6f5b311fc3e450f2
[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 _0xfcbd=['list','describe','delete','dump','pm2','connect','connected','start','then','disconnect','stop','restart'];(function(_0x16dbea,_0xdb7d2a){var _0x126bd5=function(_0x49b061){while(--_0x49b061){_0x16dbea['push'](_0x16dbea['shift']());}};_0x126bd5(++_0xdb7d2a);}(_0xfcbd,0x160));var _0xdfcb=function(_0x28e178,_0x2f91a3){_0x28e178=_0x28e178-0x0;var _0x1abf49=_0xfcbd[_0x28e178];return _0x1abf49;};'use strict';var pm2=require(_0xdfcb('0x0'));var BPromise=require('bluebird');var config=require('./config');function connect(){return new BPromise(function(_0x3d9fc3,_0x3df05b){return pm2[_0xdfcb('0x1')](function(_0x3ec4cc){if(_0x3ec4cc){return _0x3df05b(_0x3ec4cc);}return _0x3d9fc3(_0xdfcb('0x2'));});});};exports[_0xdfcb('0x3')]=function(_0x545391){return connect()[_0xdfcb('0x4')](function(){return new BPromise(function(_0x3b97ed,_0x4bdf76){return pm2['start'](_0x545391,function(_0x46956c,_0x183ea8){if(_0x46956c){return _0x4bdf76(_0x46956c);}pm2[_0xdfcb('0x5')]();return _0x3b97ed(_0x183ea8);});});});};exports[_0xdfcb('0x6')]=function(_0xbe50d6){return connect()[_0xdfcb('0x4')](function(){return new BPromise(function(_0x2c5d00,_0x5e650d){return pm2[_0xdfcb('0x6')](_0xbe50d6,function(_0x3b9c91,_0x1a739d){if(_0x3b9c91){return _0x5e650d(_0x3b9c91);}pm2[_0xdfcb('0x5')]();return _0x2c5d00(_0x1a739d);});});});};exports[_0xdfcb('0x7')]=function(_0x1fc1e4){return connect()[_0xdfcb('0x4')](function(){return new BPromise(function(_0x29a244,_0x1fe2c7){return pm2[_0xdfcb('0x7')](_0x1fc1e4,function(_0x2996e3,_0x4efab3){if(_0x2996e3){return _0x1fe2c7(_0x2996e3);}pm2[_0xdfcb('0x5')]();return _0x29a244(_0x4efab3);});});});};exports[_0xdfcb('0x8')]=function(){return connect()[_0xdfcb('0x4')](function(){return new BPromise(function(_0x41275a,_0x4164b4){return pm2['list'](function(_0xd8c73d,_0x391bf4){if(_0xd8c73d){return _0x4164b4(_0xd8c73d);}pm2[_0xdfcb('0x5')]();return _0x41275a(_0x391bf4);});});});};exports[_0xdfcb('0x9')]=function(_0x336866){return connect()['then'](function(){return new BPromise(function(_0x3afbd2,_0x421054){return pm2[_0xdfcb('0x9')](_0x336866,function(_0x65ec83,_0x11437d){if(_0x65ec83){return _0x421054(_0x65ec83);}pm2[_0xdfcb('0x5')]();return _0x3afbd2(_0x11437d);});});});};exports[_0xdfcb('0xa')]=function(_0x33e541){return connect()[_0xdfcb('0x4')](function(){return new BPromise(function(_0x210931,_0x4a5a6e){return pm2['delete'](_0x33e541,function(_0x3eb32f,_0x19051f){if(_0x3eb32f){return _0x4a5a6e(_0x3eb32f);}pm2['disconnect']();return _0x210931(_0x19051f);});});});};exports[_0xdfcb('0xb')]=function(){return connect()[_0xdfcb('0x4')](function(){return new BPromise(function(_0x56bcc0,_0x57abe3){return pm2[_0xdfcb('0xb')](function(_0x497db4){if(_0x497db4){return _0x57abe3(_0x497db4);}return _0x56bcc0('saved');});});});};