Built motion from commit da617fac.|2.6.6
[motion2.git] / server / app.js
index ea3eac2..fe10af0 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x5294=['map','pm2_env','name','Online\x20apps:','filter','join','Offline\x20apps:','status','online','None','log','catch','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sync','then','seedDB','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20'];(function(_0x2e11ab,_0x4e146e){var _0x1dd724=function(_0x4c6abb){while(--_0x4c6abb){_0x2e11ab['push'](_0x2e11ab['shift']());}};_0x1dd724(++_0x4e146e);}(_0x5294,0x111));var _0x4529=function(_0x2b5eae,_0x55010d){_0x2b5eae=_0x2b5eae-0x0;var _0x5f3ac9=_0x5294[_0x2b5eae];return _0x5f3ac9;};'use strict';var _=require(_0x4529('0x0'));var db=require(_0x4529('0x1'))['db'];var seedDb=require(_0x4529('0x2'));var checkLicense=require(_0x4529('0x3'));var rpc=require(_0x4529('0x4'));var config=require(_0x4529('0x5'));var logger=require('./config/logger')(_0x4529('0x6'));var pm2=require(_0x4529('0x7'));var pm2Config=require(_0x4529('0x8'));var schedule=require('./config/schedule');var chat=require(_0x4529('0x9'));var whatsapp=require(_0x4529('0xa'));var transcribe=require(_0x4529('0xb'));var provider=require(_0x4529('0xc'));function main(){return db['sequelize'][_0x4529('0xd')]()[_0x4529('0xe')](function(){if(config[_0x4529('0xf')]){return seedDb['default']();}})['then'](function(){return checkLicense['default']();})[_0x4529('0xe')](function(){return rpc[_0x4529('0x10')]();})[_0x4529('0xe')](function(_0x579574){logger[_0x4529('0x11')](_0x579574);return chat[_0x4529('0x12')]();})[_0x4529('0xe')](function(){return whatsapp[_0x4529('0x12')]();})[_0x4529('0xe')](function(){return schedule[_0x4529('0x12')]();})['then'](function(){return transcribe['start']();})[_0x4529('0xe')](function(){return provider[_0x4529('0x12')]();})['then'](function(_0x2539ea){logger['info'](_0x2539ea);return pm2[_0x4529('0x12')](pm2Config);})[_0x4529('0xe')](function(_0x19dff1){var _0x3313e0=_0x19dff1['filter'](function(_0x3fa1a0){return typeof _0x3fa1a0[_0x4529('0x13')]===_0x4529('0x14')&&_0x3fa1a0['exitCode']>=0x0;});if(_0x3313e0[_0x4529('0x15')]>0x0){throw new Error(_0x3313e0[_0x4529('0x15')]+_0x4529('0x16')+_[_0x4529('0x17')](_0x3313e0,function(_0x4e17dd){return'\x22'+_0x4e17dd[_0x4529('0x18')][_0x4529('0x19')]+'\x22';}));}logger['info'](_0x4529('0x1a'),_[_0x4529('0x17')](_[_0x4529('0x1b')](_0x19dff1,{'status':'online'}),'name')[_0x4529('0x1c')]());logger[_0x4529('0x11')](_0x4529('0x1d'),_[_0x4529('0x17')](_[_0x4529('0x1b')](_0x19dff1,function(_0x5c7e39){return _0x5c7e39[_0x4529('0x1e')]!==_0x4529('0x1f');}),_0x4529('0x19'))[_0x4529('0x1c')]()||_0x4529('0x20'));console[_0x4529('0x21')]('App\x20Ready!');})[_0x4529('0x22')](function(_0xee9870){console[_0x4529('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0xee9870);logger[_0x4529('0x23')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0xee9870);process[_0x4529('0x24')](0x1);});}main();
\ No newline at end of file
+var _0x818f=['App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','then','seedDB','default','listen','info','start','filter','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','pm2_env','name','Online\x20apps:','map','join','status','online','None'];(function(_0x578718,_0x2ee959){var _0x972321=function(_0x3eba64){while(--_0x3eba64){_0x578718['push'](_0x578718['shift']());}};_0x972321(++_0x2ee959);}(_0x818f,0x1da));var _0xf818=function(_0x250347,_0x1c1403){_0x250347=_0x250347-0x0;var _0x5e5d40=_0x818f[_0x250347];return _0x5e5d40;};'use strict';var _=require(_0xf818('0x0'));var db=require(_0xf818('0x1'))['db'];var seedDb=require(_0xf818('0x2'));var checkLicense=require(_0xf818('0x3'));var rpc=require(_0xf818('0x4'));var config=require(_0xf818('0x5'));var logger=require('./config/logger')(_0xf818('0x6'));var pm2=require(_0xf818('0x7'));var pm2Config=require(_0xf818('0x8'));var schedule=require(_0xf818('0x9'));var chat=require(_0xf818('0xa'));var whatsapp=require(_0xf818('0xb'));var transcribe=require(_0xf818('0xc'));var provider=require(_0xf818('0xd'));function main(){return db[_0xf818('0xe')]['sync']()[_0xf818('0xf')](function(){if(config[_0xf818('0x10')]){return seedDb[_0xf818('0x11')]();}})['then'](function(){return checkLicense['default']();})[_0xf818('0xf')](function(){return rpc[_0xf818('0x12')]();})[_0xf818('0xf')](function(_0x3386f9){logger[_0xf818('0x13')](_0x3386f9);return chat['start']();})[_0xf818('0xf')](function(){return whatsapp[_0xf818('0x14')]();})[_0xf818('0xf')](function(){return schedule[_0xf818('0x14')]();})[_0xf818('0xf')](function(){return transcribe['start']();})['then'](function(){return provider[_0xf818('0x14')]();})[_0xf818('0xf')](function(_0x950109){logger[_0xf818('0x13')](_0x950109);return pm2['start'](pm2Config);})[_0xf818('0xf')](function(_0x3234c5){var _0xbc3568=_0x3234c5[_0xf818('0x15')](function(_0xbfdd71){return typeof _0xbfdd71['exitCode']==='number'&&_0xbfdd71[_0xf818('0x16')]>=0x0;});if(_0xbc3568['length']>0x0){throw new Error(_0xbc3568[_0xf818('0x17')]+_0xf818('0x18')+_['map'](_0xbc3568,function(_0x2bf9f3){return'\x22'+_0x2bf9f3[_0xf818('0x19')][_0xf818('0x1a')]+'\x22';}));}logger['info'](_0xf818('0x1b'),_[_0xf818('0x1c')](_[_0xf818('0x15')](_0x3234c5,{'status':'online'}),'name')[_0xf818('0x1d')]());logger[_0xf818('0x13')]('Offline\x20apps:',_[_0xf818('0x1c')](_['filter'](_0x3234c5,function(_0x1849bf){return _0x1849bf[_0xf818('0x1e')]!==_0xf818('0x1f');}),'name')[_0xf818('0x1d')]()||_0xf818('0x20'));console['log'](_0xf818('0x21'));})[_0xf818('0x22')](function(_0x1160f4){console[_0xf818('0x23')](_0xf818('0x24'),_0x1160f4);logger[_0xf818('0x25')](_0xf818('0x26'),_0x1160f4);process['exit'](0x1);});}main();
\ No newline at end of file