Built motion from commit 37e1ed56.|2.6.29
[motion2.git] / server / app.js
index 39b9d7b..6c09c9f 100644 (file)
@@ -15,4 +15,4 @@
 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                        *
 // *                                                                       *
 // *************************************************************************
-var _0xf842=['seedDB','default','listen','info','start','filter','exitCode','length','map','pm2_env','name','Online\x20apps:','join','Offline\x20apps:','None','log','App\x20Ready!','catch','error','exit','lodash','./mysqldb','./config/seedDB','./config/license','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then'];(function(_0x35d4e9,_0x298c61){var _0x5c2770=function(_0x2f326a){while(--_0x2f326a){_0x35d4e9['push'](_0x35d4e9['shift']());}};_0x5c2770(++_0x298c61);}(_0xf842,0x172));var _0x2f84=function(_0x2d34d6,_0x397ff9){_0x2d34d6=_0x2d34d6-0x0;var _0x1d3d12=_0xf842[_0x2d34d6];return _0x1d3d12;};'use strict';var _=require(_0x2f84('0x0'));var db=require(_0x2f84('0x1'))['db'];var seedDb=require(_0x2f84('0x2'));var checkLicense=require(_0x2f84('0x3'));var rpc=require('./rpc');var config=require(_0x2f84('0x4'));var logger=require(_0x2f84('0x5'))(_0x2f84('0x6'));var pm2=require(_0x2f84('0x7'));var pm2Config=require(_0x2f84('0x8'));var schedule=require('./config/schedule');var chat=require(_0x2f84('0x9'));var whatsapp=require(_0x2f84('0xa'));var transcribe=require(_0x2f84('0xb'));var provider=require('./config/schedule/cloud-provider');function main(){return db[_0x2f84('0xc')][_0x2f84('0xd')]()[_0x2f84('0xe')](function(){if(config[_0x2f84('0xf')]){return seedDb[_0x2f84('0x10')]();}})[_0x2f84('0xe')](function(){return checkLicense[_0x2f84('0x10')]();})[_0x2f84('0xe')](function(){return rpc[_0x2f84('0x11')]();})[_0x2f84('0xe')](function(_0x4edf3b){logger[_0x2f84('0x12')](_0x4edf3b);return chat['start']();})[_0x2f84('0xe')](function(){return whatsapp[_0x2f84('0x13')]();})[_0x2f84('0xe')](function(){return schedule[_0x2f84('0x13')]();})[_0x2f84('0xe')](function(){return transcribe[_0x2f84('0x13')]();})[_0x2f84('0xe')](function(){return provider[_0x2f84('0x13')]();})[_0x2f84('0xe')](function(_0x20e0d0){logger[_0x2f84('0x12')](_0x20e0d0);return pm2[_0x2f84('0x13')](pm2Config);})['then'](function(_0x489f51){var _0x50d906=_0x489f51[_0x2f84('0x14')](function(_0x4073d6){return typeof _0x4073d6[_0x2f84('0x15')]==='number'&&_0x4073d6[_0x2f84('0x15')]>=0x0;});if(_0x50d906[_0x2f84('0x16')]>0x0){throw new Error(_0x50d906[_0x2f84('0x16')]+'\x20processes\x20failed\x20at\x20startup:\x20'+_[_0x2f84('0x17')](_0x50d906,function(_0xbe3e4f){return'\x22'+_0xbe3e4f[_0x2f84('0x18')][_0x2f84('0x19')]+'\x22';}));}logger['info'](_0x2f84('0x1a'),_['map'](_[_0x2f84('0x14')](_0x489f51,{'status':'online'}),'name')[_0x2f84('0x1b')]());logger[_0x2f84('0x12')](_0x2f84('0x1c'),_[_0x2f84('0x17')](_[_0x2f84('0x14')](_0x489f51,function(_0x4600af){return _0x4600af['status']!=='online';}),_0x2f84('0x19'))[_0x2f84('0x1b')]()||_0x2f84('0x1d'));console[_0x2f84('0x1e')](_0x2f84('0x1f'));})[_0x2f84('0x20')](function(_0x546447){console[_0x2f84('0x1e')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error!',_0x546447);logger[_0x2f84('0x21')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x546447);process[_0x2f84('0x22')](0x1);});}main();
\ No newline at end of file
+var _0x9b69=['join','Offline\x20apps:','filter','None','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/environment','app','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','./config/schedule/cloud-provider','sequelize','sync','then','seedDB','default','listen','info','start','exitCode','number','length','\x20processes\x20failed\x20at\x20startup:\x20','map','pm2_env','name','Online\x20apps:','online'];(function(_0x275621,_0x524302){var _0x2ad056=function(_0x1e962f){while(--_0x1e962f){_0x275621['push'](_0x275621['shift']());}};_0x2ad056(++_0x524302);}(_0x9b69,0xa3));var _0x99b6=function(_0x10c29c,_0xb0de02){_0x10c29c=_0x10c29c-0x0;var _0x326619=_0x9b69[_0x10c29c];return _0x326619;};'use strict';var _=require(_0x99b6('0x0'));var db=require(_0x99b6('0x1'))['db'];var seedDb=require(_0x99b6('0x2'));var checkLicense=require('./config/license');var rpc=require('./rpc');var config=require(_0x99b6('0x3'));var logger=require('./config/logger')(_0x99b6('0x4'));var pm2=require(_0x99b6('0x5'));var pm2Config=require(_0x99b6('0x6'));var schedule=require('./config/schedule');var chat=require(_0x99b6('0x7'));var whatsapp=require('./config/schedule/whatsapp');var transcribe=require(_0x99b6('0x8'));var provider=require(_0x99b6('0x9'));function main(){return db[_0x99b6('0xa')][_0x99b6('0xb')]()[_0x99b6('0xc')](function(){if(config[_0x99b6('0xd')]){return seedDb[_0x99b6('0xe')]();}})[_0x99b6('0xc')](function(){return checkLicense[_0x99b6('0xe')]();})[_0x99b6('0xc')](function(){return rpc[_0x99b6('0xf')]();})[_0x99b6('0xc')](function(_0x3af521){logger[_0x99b6('0x10')](_0x3af521);return chat[_0x99b6('0x11')]();})[_0x99b6('0xc')](function(){return whatsapp[_0x99b6('0x11')]();})[_0x99b6('0xc')](function(){return schedule[_0x99b6('0x11')]();})[_0x99b6('0xc')](function(){return transcribe['start']();})['then'](function(){return provider['start']();})['then'](function(_0x57033e){logger['info'](_0x57033e);return pm2['start'](pm2Config);})[_0x99b6('0xc')](function(_0x184e90){var _0x2cda40=_0x184e90['filter'](function(_0xb63749){return typeof _0xb63749[_0x99b6('0x12')]===_0x99b6('0x13')&&_0xb63749[_0x99b6('0x12')]>=0x0;});if(_0x2cda40['length']>0x0){throw new Error(_0x2cda40[_0x99b6('0x14')]+_0x99b6('0x15')+_[_0x99b6('0x16')](_0x2cda40,function(_0x2a2bf2){return'\x22'+_0x2a2bf2[_0x99b6('0x17')][_0x99b6('0x18')]+'\x22';}));}logger[_0x99b6('0x10')](_0x99b6('0x19'),_[_0x99b6('0x16')](_['filter'](_0x184e90,{'status':_0x99b6('0x1a')}),_0x99b6('0x18'))[_0x99b6('0x1b')]());logger[_0x99b6('0x10')](_0x99b6('0x1c'),_[_0x99b6('0x16')](_[_0x99b6('0x1d')](_0x184e90,function(_0x59045f){return _0x59045f['status']!==_0x99b6('0x1a');}),_0x99b6('0x18'))[_0x99b6('0x1b')]()||_0x99b6('0x1e'));console['log'](_0x99b6('0x1f'));})[_0x99b6('0x20')](function(_0x440752){console[_0x99b6('0x21')](_0x99b6('0x22'),_0x440752);logger[_0x99b6('0x23')](_0x99b6('0x24'),_0x440752);process[_0x99b6('0x25')](0x1);});}main();
\ No newline at end of file