Built motion from commit 20b39a97.|2.6.29
[motion2.git] / server / app.js
index b83fa71..bd23f46 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x0f9f=['default','listen','info','start','number','exitCode','length','\x20processes\x20failed\x20at\x20startup:\x20','map','name','Online\x20apps:','filter','online','join','Offline\x20apps:','status','None','log','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then'];(function(_0x3b8320,_0x4f2177){var _0x278859=function(_0x58a817){while(--_0x58a817){_0x3b8320['push'](_0x3b8320['shift']());}};_0x278859(++_0x4f2177);}(_0x0f9f,0xae));var _0xf0f9=function(_0x24fa8f,_0x56b265){_0x24fa8f=_0x24fa8f-0x0;var _0x380153=_0x0f9f[_0x24fa8f];return _0x380153;};'use strict';var _=require(_0xf0f9('0x0'));var db=require(_0xf0f9('0x1'))['db'];var seedDb=require(_0xf0f9('0x2'));var checkLicense=require(_0xf0f9('0x3'));var rpc=require(_0xf0f9('0x4'));var config=require(_0xf0f9('0x5'));var logger=require(_0xf0f9('0x6'))(_0xf0f9('0x7'));var pm2=require(_0xf0f9('0x8'));var pm2Config=require(_0xf0f9('0x9'));var schedule=require(_0xf0f9('0xa'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xf0f9('0xb'));var transcribe=require(_0xf0f9('0xc'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0xf0f9('0xd')][_0xf0f9('0xe')]()[_0xf0f9('0xf')](function(){if(config['seedDB']){return seedDb[_0xf0f9('0x10')]();}})[_0xf0f9('0xf')](function(){return checkLicense['default']();})[_0xf0f9('0xf')](function(){return rpc[_0xf0f9('0x11')]();})[_0xf0f9('0xf')](function(_0x3be7af){logger[_0xf0f9('0x12')](_0x3be7af);return chat[_0xf0f9('0x13')]();})[_0xf0f9('0xf')](function(){return whatsapp[_0xf0f9('0x13')]();})['then'](function(){return schedule[_0xf0f9('0x13')]();})[_0xf0f9('0xf')](function(){return transcribe[_0xf0f9('0x13')]();})[_0xf0f9('0xf')](function(){return provider['start']();})[_0xf0f9('0xf')](function(_0xd4e645){logger['info'](_0xd4e645);return pm2[_0xf0f9('0x13')](pm2Config);})['then'](function(_0x538864){var _0x2c832a=_0x538864['filter'](function(_0x3e1587){return typeof _0x3e1587['exitCode']===_0xf0f9('0x14')&&_0x3e1587[_0xf0f9('0x15')]>=0x0;});if(_0x2c832a[_0xf0f9('0x16')]>0x0){throw new Error(_0x2c832a[_0xf0f9('0x16')]+_0xf0f9('0x17')+_[_0xf0f9('0x18')](_0x2c832a,function(_0x10dae6){return'\x22'+_0x10dae6['pm2_env'][_0xf0f9('0x19')]+'\x22';}));}logger[_0xf0f9('0x12')](_0xf0f9('0x1a'),_[_0xf0f9('0x18')](_[_0xf0f9('0x1b')](_0x538864,{'status':_0xf0f9('0x1c')}),_0xf0f9('0x19'))[_0xf0f9('0x1d')]());logger['info'](_0xf0f9('0x1e'),_['map'](_[_0xf0f9('0x1b')](_0x538864,function(_0x510119){return _0x510119[_0xf0f9('0x1f')]!==_0xf0f9('0x1c');}),_0xf0f9('0x19'))[_0xf0f9('0x1d')]()||_0xf0f9('0x20'));console[_0xf0f9('0x21')]('App\x20Ready!');})[_0xf0f9('0x22')](function(_0x535c2c){console[_0xf0f9('0x21')](_0xf0f9('0x23'),_0x535c2c);logger['error'](_0xf0f9('0x24'),_0x535c2c);process[_0xf0f9('0x25')](0x1);});}main();
\ No newline at end of file
+var _0xc1fa=['map','pm2_env','name','Online\x20apps:','online','join','Offline\x20apps:','status','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','sync','then','seedDB','default','listen','start','info','filter','exitCode','length'];(function(_0x3400ca,_0x27c04d){var _0x26e8d1=function(_0x2284e9){while(--_0x2284e9){_0x3400ca['push'](_0x3400ca['shift']());}};_0x26e8d1(++_0x27c04d);}(_0xc1fa,0x83));var _0xac1f=function(_0x2d61ac,_0x18ff36){_0x2d61ac=_0x2d61ac-0x0;var _0x3f7d3c=_0xc1fa[_0x2d61ac];return _0x3f7d3c;};'use strict';var _=require(_0xac1f('0x0'));var db=require(_0xac1f('0x1'))['db'];var seedDb=require(_0xac1f('0x2'));var checkLicense=require(_0xac1f('0x3'));var rpc=require(_0xac1f('0x4'));var config=require(_0xac1f('0x5'));var logger=require('./config/logger')(_0xac1f('0x6'));var pm2=require(_0xac1f('0x7'));var pm2Config=require(_0xac1f('0x8'));var schedule=require(_0xac1f('0x9'));var chat=require(_0xac1f('0xa'));var whatsapp=require(_0xac1f('0xb'));var transcribe=require(_0xac1f('0xc'));var provider=require(_0xac1f('0xd'));function main(){return db[_0xac1f('0xe')][_0xac1f('0xf')]()[_0xac1f('0x10')](function(){if(config[_0xac1f('0x11')]){return seedDb['default']();}})[_0xac1f('0x10')](function(){return checkLicense[_0xac1f('0x12')]();})[_0xac1f('0x10')](function(){return rpc[_0xac1f('0x13')]();})[_0xac1f('0x10')](function(_0x50fbcb){logger['info'](_0x50fbcb);return chat[_0xac1f('0x14')]();})['then'](function(){return whatsapp['start']();})[_0xac1f('0x10')](function(){return schedule[_0xac1f('0x14')]();})['then'](function(){return transcribe[_0xac1f('0x14')]();})[_0xac1f('0x10')](function(){return provider[_0xac1f('0x14')]();})[_0xac1f('0x10')](function(_0xb5005b){logger[_0xac1f('0x15')](_0xb5005b);return pm2[_0xac1f('0x14')](pm2Config);})[_0xac1f('0x10')](function(_0x2c7411){var _0x1ab6dc=_0x2c7411[_0xac1f('0x16')](function(_0x2671ec){return typeof _0x2671ec[_0xac1f('0x17')]==='number'&&_0x2671ec[_0xac1f('0x17')]>=0x0;});if(_0x1ab6dc[_0xac1f('0x18')]>0x0){throw new Error(_0x1ab6dc[_0xac1f('0x18')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0xac1f('0x19')](_0x1ab6dc,function(_0x5c7847){return'\x22'+_0x5c7847[_0xac1f('0x1a')][_0xac1f('0x1b')]+'\x22';}));}logger[_0xac1f('0x15')](_0xac1f('0x1c'),_['map'](_[_0xac1f('0x16')](_0x2c7411,{'status':_0xac1f('0x1d')}),'name')[_0xac1f('0x1e')]());logger['info'](_0xac1f('0x1f'),_[_0xac1f('0x19')](_[_0xac1f('0x16')](_0x2c7411,function(_0x44a8c7){return _0x44a8c7[_0xac1f('0x20')]!==_0xac1f('0x1d');}),_0xac1f('0x1b'))[_0xac1f('0x1e')]()||'None');console['log'](_0xac1f('0x21'));})[_0xac1f('0x22')](function(_0x1c6281){console[_0xac1f('0x23')](_0xac1f('0x24'),_0x1c6281);logger[_0xac1f('0x25')](_0xac1f('0x26'),_0x1c6281);process['exit'](0x1);});}main();
\ No newline at end of file