Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / app.js
index 9b5eb39..045dcbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xc987=['then','listen','start','info','Online\x20apps:','map','filter','name','join','Offline\x20apps:','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','sequelize'];(function(_0xdd8280,_0x5696b9){var _0x1f2b3b=function(_0x12d568){while(--_0x12d568){_0xdd8280['push'](_0xdd8280['shift']());}};_0x1f2b3b(++_0x5696b9);}(_0xc987,0x104));var _0x7c98=function(_0x452968,_0x31e391){_0x452968=_0x452968-0x0;var _0xb6f9ae=_0xc987[_0x452968];return _0xb6f9ae;};'use strict';var _=require(_0x7c98('0x0'));var mysqldb=require(_0x7c98('0x1'));var rpc=require(_0x7c98('0x2'));var config=require(_0x7c98('0x3'));var logger=require(_0x7c98('0x4'))(_0x7c98('0x5'));var pm2=require(_0x7c98('0x6'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x7c98('0x7'));var chat=require(_0x7c98('0x8'));function main(){return mysqldb['db'][_0x7c98('0x9')]['sync']()[_0x7c98('0xa')](function(){return rpc[_0x7c98('0xb')]();})[_0x7c98('0xa')](function(_0x2c6550){logger['info'](_0x2c6550);return chat[_0x7c98('0xc')]();})[_0x7c98('0xa')](function(){return schedule[_0x7c98('0xc')]();})[_0x7c98('0xa')](function(_0x786cf4){logger[_0x7c98('0xd')](_0x786cf4);return pm2[_0x7c98('0xc')](pm2Config);})[_0x7c98('0xa')](function(_0x4dca5d){logger[_0x7c98('0xd')](_0x7c98('0xe'),_[_0x7c98('0xf')](_[_0x7c98('0x10')](_0x4dca5d,{'status':'online'}),_0x7c98('0x11'))[_0x7c98('0x12')]());logger[_0x7c98('0xd')](_0x7c98('0x13'),_[_0x7c98('0xf')](_['filter'](_0x4dca5d,function(_0xb55826){return _0xb55826['status']!=='online';}),'name')[_0x7c98('0x12')]()||'None');config[_0x7c98('0x14')]&&require(_0x7c98('0x15'))['default']();require('./config/license')[_0x7c98('0x16')]();})[_0x7c98('0x17')](function(_0x27c378){logger[_0x7c98('0x18')](_0x7c98('0x19'),_0x27c378);process[_0x7c98('0x1a')](0x1);});}main();
\ No newline at end of file
+var _0x7a2d=['start','filter','exitCode','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','online','Offline\x20apps:','App\x20Ready!','catch','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./config/license','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','info'];(function(_0x4703b9,_0x546f25){var _0x207040=function(_0x2676e7){while(--_0x2676e7){_0x4703b9['push'](_0x4703b9['shift']());}};_0x207040(++_0x546f25);}(_0x7a2d,0x142));var _0xd7a2=function(_0x482df4,_0x4afe04){_0x482df4=_0x482df4-0x0;var _0x45ef02=_0x7a2d[_0x482df4];return _0x45ef02;};'use strict';var _=require(_0xd7a2('0x0'));var db=require(_0xd7a2('0x1'))['db'];var seedDb=require(_0xd7a2('0x2'));var checkLicense=require(_0xd7a2('0x3'));var rpc=require(_0xd7a2('0x4'));var config=require(_0xd7a2('0x5'));var logger=require(_0xd7a2('0x6'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xd7a2('0x7'));var schedule=require(_0xd7a2('0x8'));var chat=require(_0xd7a2('0x9'));var whatsapp=require(_0xd7a2('0xa'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0xd7a2('0xb'));function main(){return db[_0xd7a2('0xc')][_0xd7a2('0xd')]()[_0xd7a2('0xe')](function(){if(config[_0xd7a2('0xf')]){return seedDb[_0xd7a2('0x10')]();}})[_0xd7a2('0xe')](function(){return checkLicense[_0xd7a2('0x10')]();})[_0xd7a2('0xe')](function(){return rpc['listen']();})[_0xd7a2('0xe')](function(_0x319795){logger[_0xd7a2('0x11')](_0x319795);return chat[_0xd7a2('0x12')]();})[_0xd7a2('0xe')](function(){return whatsapp[_0xd7a2('0x12')]();})[_0xd7a2('0xe')](function(){return schedule['start']();})['then'](function(){return transcribe[_0xd7a2('0x12')]();})['then'](function(){return provider[_0xd7a2('0x12')]();})[_0xd7a2('0xe')](function(_0xfac7c9){logger[_0xd7a2('0x11')](_0xfac7c9);return pm2[_0xd7a2('0x12')](pm2Config);})[_0xd7a2('0xe')](function(_0x42a6c5){var _0x1e0ab5=_0x42a6c5[_0xd7a2('0x13')](function(_0x16e2d6){return typeof _0x16e2d6[_0xd7a2('0x14')]==='number'&&_0x16e2d6[_0xd7a2('0x14')]>=0x0;});if(_0x1e0ab5['length']>0x0){throw new Error(_0x1e0ab5['length']+_0xd7a2('0x15')+_[_0xd7a2('0x16')](_0x1e0ab5,function(_0x2e8c80){return'\x22'+_0x2e8c80[_0xd7a2('0x17')][_0xd7a2('0x18')]+'\x22';}));}logger[_0xd7a2('0x11')]('Online\x20apps:',_['map'](_[_0xd7a2('0x13')](_0x42a6c5,{'status':_0xd7a2('0x19')}),_0xd7a2('0x18'))['join']());logger['info'](_0xd7a2('0x1a'),_['map'](_['filter'](_0x42a6c5,function(_0x217c19){return _0x217c19['status']!=='online';}),_0xd7a2('0x18'))['join']()||'None');console['log'](_0xd7a2('0x1b'));})[_0xd7a2('0x1c')](function(_0x4458d5){console[_0xd7a2('0x1d')](_0xd7a2('0x1e'),_0x4458d5);logger[_0xd7a2('0x1f')](_0xd7a2('0x20'),_0x4458d5);process[_0xd7a2('0x21')](0x1);});}main();
\ No newline at end of file