Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / app.js
index 985e731..045dcbc 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x2ff5=['./config/seedDB','default','catch','error','exit','./mysqldb','./rpc','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','listen','then','info','start','map','online','name','Offline\x20apps:','filter','status','join','None','seedDB'];(function(_0x15cd66,_0x15eae4){var _0x3cf022=function(_0x3bb95a){while(--_0x3bb95a){_0x15cd66['push'](_0x15cd66['shift']());}};_0x3cf022(++_0x15eae4);}(_0x2ff5,0x1d5));var _0x52ff=function(_0x2c79e0,_0x4bb088){_0x2c79e0=_0x2c79e0-0x0;var _0x505015=_0x2ff5[_0x2c79e0];return _0x505015;};'use strict';var _=require('lodash');var mysqldb=require(_0x52ff('0x0'));var rpc=require(_0x52ff('0x1'));var config=require('./config/environment');var logger=require(_0x52ff('0x2'))(_0x52ff('0x3'));var pm2=require(_0x52ff('0x4'));var pm2Config=require(_0x52ff('0x5'));var schedule=require(_0x52ff('0x6'));var chat=require(_0x52ff('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x52ff('0x8'));function main(){return mysqldb['db'][_0x52ff('0x9')][_0x52ff('0xa')]()['then'](function(){return rpc[_0x52ff('0xb')]();})[_0x52ff('0xc')](function(_0x3cfd13){logger[_0x52ff('0xd')](_0x3cfd13);return chat[_0x52ff('0xe')]();})[_0x52ff('0xc')](function(){return whatsapp[_0x52ff('0xe')]();})[_0x52ff('0xc')](function(){return schedule[_0x52ff('0xe')]();})[_0x52ff('0xc')](function(){return transcribe[_0x52ff('0xe')]();})[_0x52ff('0xc')](function(_0xe66d8f){logger[_0x52ff('0xd')](_0xe66d8f);return pm2[_0x52ff('0xe')](pm2Config);})['then'](function(_0x59afbe){logger['info']('Online\x20apps:',_[_0x52ff('0xf')](_['filter'](_0x59afbe,{'status':_0x52ff('0x10')}),_0x52ff('0x11'))['join']());logger[_0x52ff('0xd')](_0x52ff('0x12'),_[_0x52ff('0xf')](_[_0x52ff('0x13')](_0x59afbe,function(_0x418202){return _0x418202[_0x52ff('0x14')]!=='online';}),_0x52ff('0x11'))[_0x52ff('0x15')]()||_0x52ff('0x16'));config[_0x52ff('0x17')]&&require(_0x52ff('0x18'))[_0x52ff('0x19')]();require('./config/license')[_0x52ff('0x19')]();})[_0x52ff('0x1a')](function(_0x3cbe60){logger[_0x52ff('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x3cbe60);process[_0x52ff('0x1c')](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