9fe85b9b8045131a3563fb78a293e33beb63c7d4
[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 _0xc746=['list','describe','delete','dump','saved','pm2','bluebird','./config','connect','start','stop','then','disconnect','restart'];(function(_0x3935c9,_0x2eb374){var _0x4fb080=function(_0x2bb240){while(--_0x2bb240){_0x3935c9['push'](_0x3935c9['shift']());}};_0x4fb080(++_0x2eb374);}(_0xc746,0xc9));var _0x6c74=function(_0x9c7d7b,_0x93006){_0x9c7d7b=_0x9c7d7b-0x0;var _0x2ecfda=_0xc746[_0x9c7d7b];return _0x2ecfda;};'use strict';var pm2=require(_0x6c74('0x0'));var BPromise=require(_0x6c74('0x1'));var config=require(_0x6c74('0x2'));function connect(){return new BPromise(function(_0x369c1c,_0x41186f){return pm2[_0x6c74('0x3')](function(_0x47361d){if(_0x47361d){return _0x41186f(_0x47361d);}return _0x369c1c('connected');});});};exports['start']=function(_0x26329b){return connect()['then'](function(){return new BPromise(function(_0x47b982,_0x2fb882){return pm2[_0x6c74('0x4')](_0x26329b,function(_0x5a72d3,_0x4dd4f1){if(_0x5a72d3){return _0x2fb882(_0x5a72d3);}pm2['disconnect']();return _0x47b982(_0x4dd4f1);});});});};exports[_0x6c74('0x5')]=function(_0x4f53a4){return connect()[_0x6c74('0x6')](function(){return new BPromise(function(_0x21f4b5,_0x3bfd28){return pm2[_0x6c74('0x5')](_0x4f53a4,function(_0x8546b9,_0x4a9415){if(_0x8546b9){return _0x3bfd28(_0x8546b9);}pm2[_0x6c74('0x7')]();return _0x21f4b5(_0x4a9415);});});});};exports[_0x6c74('0x8')]=function(_0x379bb8){return connect()['then'](function(){return new BPromise(function(_0xec700c,_0x554bc1){return pm2['restart'](_0x379bb8,function(_0x5c0956,_0x2ac823){if(_0x5c0956){return _0x554bc1(_0x5c0956);}pm2['disconnect']();return _0xec700c(_0x2ac823);});});});};exports['list']=function(){return connect()[_0x6c74('0x6')](function(){return new BPromise(function(_0x34adfb,_0x23bd7e){return pm2[_0x6c74('0x9')](function(_0x504061,_0xb7ce50){if(_0x504061){return _0x23bd7e(_0x504061);}pm2[_0x6c74('0x7')]();return _0x34adfb(_0xb7ce50);});});});};exports[_0x6c74('0xa')]=function(_0x3f7b2a){return connect()[_0x6c74('0x6')](function(){return new BPromise(function(_0x1d2ae1,_0x55ec61){return pm2[_0x6c74('0xa')](_0x3f7b2a,function(_0x5b91c8,_0x403bd3){if(_0x5b91c8){return _0x55ec61(_0x5b91c8);}pm2['disconnect']();return _0x1d2ae1(_0x403bd3);});});});};exports[_0x6c74('0xb')]=function(_0x30735b){return connect()[_0x6c74('0x6')](function(){return new BPromise(function(_0x2a6d7e,_0x352d25){return pm2['delete'](_0x30735b,function(_0x1e1979,_0x1f1626){if(_0x1e1979){return _0x352d25(_0x1e1979);}pm2['disconnect']();return _0x2a6d7e(_0x1f1626);});});});};exports[_0x6c74('0xc')]=function(){return connect()[_0x6c74('0x6')](function(){return new BPromise(function(_0x340f22,_0x579e35){return pm2[_0x6c74('0xc')](function(_0xf82837){if(_0xf82837){return _0x579e35(_0xf82837);}return _0x340f22(_0x6c74('0xd'));});});});};