Built motion from commit 6db1674d.|2.6.23
[motion2.git] / server / app.js
index ad33a1c..92de7cd 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0x63b6=['join','status','log','Server\x20failed\x20to\x20start\x20due\x20to\x20error!','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/seedDB','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/cloud-provider','sync','then','seedDB','default','listen','info','start','filter','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name'];(function(_0x492e33,_0x111910){var _0x51be0d=function(_0x4a2ac8){while(--_0x4a2ac8){_0x492e33['push'](_0x492e33['shift']());}};_0x51be0d(++_0x111910);}(_0x63b6,0x127));var _0x663b=function(_0x1fd88b,_0x520877){_0x1fd88b=_0x1fd88b-0x0;var _0x1f996d=_0x63b6[_0x1fd88b];return _0x1f996d;};'use strict';var _=require(_0x663b('0x0'));var db=require(_0x663b('0x1'))['db'];var seedDb=require(_0x663b('0x2'));var checkLicense=require('./config/license');var rpc=require(_0x663b('0x3'));var config=require('./config/environment');var logger=require(_0x663b('0x4'))('app');var pm2=require(_0x663b('0x5'));var pm2Config=require(_0x663b('0x6'));var schedule=require(_0x663b('0x7'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x663b('0x8'));var transcribe=require('./config/schedule/transcribe');var provider=require(_0x663b('0x9'));function main(){return db['sequelize'][_0x663b('0xa')]()[_0x663b('0xb')](function(){if(config[_0x663b('0xc')]){return seedDb[_0x663b('0xd')]();}})[_0x663b('0xb')](function(){return checkLicense[_0x663b('0xd')]();})['then'](function(){return rpc[_0x663b('0xe')]();})[_0x663b('0xb')](function(_0x1d0dba){logger[_0x663b('0xf')](_0x1d0dba);return chat[_0x663b('0x10')]();})[_0x663b('0xb')](function(){return whatsapp[_0x663b('0x10')]();})[_0x663b('0xb')](function(){return schedule[_0x663b('0x10')]();})[_0x663b('0xb')](function(){return transcribe['start']();})['then'](function(){return provider[_0x663b('0x10')]();})[_0x663b('0xb')](function(_0x3baf10){logger[_0x663b('0xf')](_0x3baf10);return pm2[_0x663b('0x10')](pm2Config);})[_0x663b('0xb')](function(_0x4e263a){var _0x18a6da=_0x4e263a[_0x663b('0x11')](function(_0x4738e2){return typeof _0x4738e2[_0x663b('0x12')]===_0x663b('0x13')&&_0x4738e2[_0x663b('0x12')]>=0x0;});if(_0x18a6da[_0x663b('0x14')]>0x0){throw new Error(_0x18a6da[_0x663b('0x14')]+_0x663b('0x15')+_[_0x663b('0x16')](_0x18a6da,function(_0x26a596){return'\x22'+_0x26a596[_0x663b('0x17')][_0x663b('0x18')]+'\x22';}));}logger[_0x663b('0xf')]('Online\x20apps:',_[_0x663b('0x16')](_[_0x663b('0x11')](_0x4e263a,{'status':'online'}),_0x663b('0x18'))[_0x663b('0x19')]());logger['info']('Offline\x20apps:',_[_0x663b('0x16')](_[_0x663b('0x11')](_0x4e263a,function(_0x33a6b9){return _0x33a6b9[_0x663b('0x1a')]!=='online';}),_0x663b('0x18'))[_0x663b('0x19')]()||'None');console['log']('App\x20Ready!');})['catch'](function(_0x37d41d){console[_0x663b('0x1b')](_0x663b('0x1c'),_0x37d41d);logger[_0x663b('0x1d')](_0x663b('0x1e'),_0x37d41d);process[_0x663b('0x1f')](0x1);});}main();
\ No newline at end of file
+var _0x9973=['./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','default','then','listen','info','start','filter','exitCode','number','length','pm2_env','Online\x20apps:','map','online','join','Offline\x20apps:','name','App\x20Ready!','catch','log','error','./mysqldb','./config/seedDB','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule'];(function(_0x59452e,_0x4aed7a){var _0x302b1f=function(_0x47a420){while(--_0x47a420){_0x59452e['push'](_0x59452e['shift']());}};_0x302b1f(++_0x4aed7a);}(_0x9973,0x157));var _0x3997=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x9973[_0x40a045];return _0x1a687c;};'use strict';var _=require('lodash');var db=require(_0x3997('0x0'))['db'];var seedDb=require(_0x3997('0x1'));var checkLicense=require('./config/license');var rpc=require(_0x3997('0x2'));var config=require(_0x3997('0x3'));var logger=require(_0x3997('0x4'))(_0x3997('0x5'));var pm2=require(_0x3997('0x6'));var pm2Config=require(_0x3997('0x7'));var schedule=require(_0x3997('0x8'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x3997('0x9'));var provider=require(_0x3997('0xa'));function main(){return db[_0x3997('0xb')]['sync']()['then'](function(){if(config['seedDB']){return seedDb[_0x3997('0xc')]();}})[_0x3997('0xd')](function(){return checkLicense[_0x3997('0xc')]();})[_0x3997('0xd')](function(){return rpc[_0x3997('0xe')]();})[_0x3997('0xd')](function(_0x6ec837){logger[_0x3997('0xf')](_0x6ec837);return chat[_0x3997('0x10')]();})[_0x3997('0xd')](function(){return whatsapp[_0x3997('0x10')]();})[_0x3997('0xd')](function(){return schedule[_0x3997('0x10')]();})[_0x3997('0xd')](function(){return transcribe[_0x3997('0x10')]();})[_0x3997('0xd')](function(){return provider[_0x3997('0x10')]();})[_0x3997('0xd')](function(_0x33fa6b){logger[_0x3997('0xf')](_0x33fa6b);return pm2[_0x3997('0x10')](pm2Config);})[_0x3997('0xd')](function(_0x5fd33b){var _0x58a008=_0x5fd33b[_0x3997('0x11')](function(_0xa39649){return typeof _0xa39649[_0x3997('0x12')]===_0x3997('0x13')&&_0xa39649['exitCode']>=0x0;});if(_0x58a008[_0x3997('0x14')]>0x0){throw new Error(_0x58a008[_0x3997('0x14')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_['map'](_0x58a008,function(_0x29280d){return'\x22'+_0x29280d[_0x3997('0x15')]['name']+'\x22';}));}logger[_0x3997('0xf')](_0x3997('0x16'),_[_0x3997('0x17')](_[_0x3997('0x11')](_0x5fd33b,{'status':_0x3997('0x18')}),'name')[_0x3997('0x19')]());logger[_0x3997('0xf')](_0x3997('0x1a'),_['map'](_[_0x3997('0x11')](_0x5fd33b,function(_0x1ed237){return _0x1ed237['status']!==_0x3997('0x18');}),_0x3997('0x1b'))[_0x3997('0x19')]()||'None');console['log'](_0x3997('0x1c'));})[_0x3997('0x1d')](function(_0x3f94e5){console[_0x3997('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x3f94e5);logger[_0x3997('0x1f')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x3f94e5);process['exit'](0x1);});}main();
\ No newline at end of file