Built motion from commit (unavailable).|2.3.2
[motion2.git] / server / app.js
1 // *************************************************************************
2 // *                                                                       *
3 // * xCALLY Motion -  The Omnichannel Contact Center                       *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved                     *
5 // *                                                                       *
6 // *************************************************************************
7 // *                                                                       *
8 // * Email: info@xcally.com                                                *
9 // * Website: https://www.xcally.com                                       *
10 // *                                                                       *
11 // *************************************************************************
12 // *                                                                       *
13 // * The SOFTWARE PRODUCT is protected by copyright laws and international *
14 // * copyright treaties, as well as other intellectual property laws and   *
15 // * treaties. The SOFTWARE PRODUCT is licensed, not sold.                         *
16 // *                                                                       *
17 // *************************************************************************
18 var _0x7b78=['filter','online','join','Offline\x20apps:','name','None','./config/seedDB','default','catch','error','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','sequelize','then','listen','info','start','map'];(function(_0xe1d149,_0x30e778){var _0x220e56=function(_0x12ac80){while(--_0x12ac80){_0xe1d149['push'](_0xe1d149['shift']());}};_0x220e56(++_0x30e778);}(_0x7b78,0xad));var _0x87b7=function(_0x33b4bd,_0x1e618e){_0x33b4bd=_0x33b4bd-0x0;var _0x20020f=_0x7b78[_0x33b4bd];return _0x20020f;};'use strict';var _=require(_0x87b7('0x0'));var mysqldb=require(_0x87b7('0x1'));var rpc=require(_0x87b7('0x2'));var config=require(_0x87b7('0x3'));var logger=require(_0x87b7('0x4'))(_0x87b7('0x5'));var pm2=require(_0x87b7('0x6'));var pm2Config=require(_0x87b7('0x7'));var schedule=require(_0x87b7('0x8'));var chat=require(_0x87b7('0x9'));function main(){return mysqldb['db'][_0x87b7('0xa')]['sync']()[_0x87b7('0xb')](function(){return rpc[_0x87b7('0xc')]();})[_0x87b7('0xb')](function(_0xae70b5){logger[_0x87b7('0xd')](_0xae70b5);return chat['start']();})['then'](function(){return schedule[_0x87b7('0xe')]();})[_0x87b7('0xb')](function(_0x574804){logger['info'](_0x574804);return pm2[_0x87b7('0xe')](pm2Config);})[_0x87b7('0xb')](function(_0x928d6){logger[_0x87b7('0xd')]('Online\x20apps:',_[_0x87b7('0xf')](_[_0x87b7('0x10')](_0x928d6,{'status':_0x87b7('0x11')}),'name')[_0x87b7('0x12')]());logger[_0x87b7('0xd')](_0x87b7('0x13'),_['map'](_[_0x87b7('0x10')](_0x928d6,function(_0x577bbc){return _0x577bbc['status']!==_0x87b7('0x11');}),_0x87b7('0x14'))[_0x87b7('0x12')]()||_0x87b7('0x15'));config['seedDB']&&require(_0x87b7('0x16'))['default']();require('./config/license')[_0x87b7('0x17')]();})[_0x87b7('0x18')](function(_0x2ca329){logger[_0x87b7('0x19')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x2ca329);process[_0x87b7('0x1a')](0x1);});}main();