Built motion from commit caf7d5f0.|2.5.39
[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 _0x21e8=['sync','then','info','start','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','error','exit','lodash','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe'];(function(_0x213958,_0x385e38){var _0x5b2a2d=function(_0x56326c){while(--_0x56326c){_0x213958['push'](_0x213958['shift']());}};_0x5b2a2d(++_0x385e38);}(_0x21e8,0x152));var _0x821e=function(_0x3c1051,_0x105071){_0x3c1051=_0x3c1051-0x0;var _0x189aa7=_0x21e8[_0x3c1051];return _0x189aa7;};'use strict';var _=require(_0x821e('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require(_0x821e('0x1'));var logger=require(_0x821e('0x2'))(_0x821e('0x3'));var pm2=require(_0x821e('0x4'));var pm2Config=require(_0x821e('0x5'));var schedule=require(_0x821e('0x6'));var chat=require(_0x821e('0x7'));var whatsapp=require(_0x821e('0x8'));var transcribe=require(_0x821e('0x9'));function main(){return mysqldb['db']['sequelize'][_0x821e('0xa')]()[_0x821e('0xb')](function(){return rpc['listen']();})[_0x821e('0xb')](function(_0x1020ee){logger[_0x821e('0xc')](_0x1020ee);return chat[_0x821e('0xd')]();})['then'](function(){return whatsapp[_0x821e('0xd')]();})[_0x821e('0xb')](function(){return schedule[_0x821e('0xd')]();})['then'](function(){return transcribe[_0x821e('0xd')]();})[_0x821e('0xb')](function(_0x3be145){logger[_0x821e('0xc')](_0x3be145);return pm2[_0x821e('0xd')](pm2Config);})[_0x821e('0xb')](function(_0x2e5b98){logger[_0x821e('0xc')](_0x821e('0xe'),_[_0x821e('0xf')](_[_0x821e('0x10')](_0x2e5b98,{'status':_0x821e('0x11')}),_0x821e('0x12'))[_0x821e('0x13')]());logger[_0x821e('0xc')](_0x821e('0x14'),_[_0x821e('0xf')](_[_0x821e('0x10')](_0x2e5b98,function(_0x87a732){return _0x87a732[_0x821e('0x15')]!==_0x821e('0x11');}),_0x821e('0x12'))[_0x821e('0x13')]()||_0x821e('0x16'));config[_0x821e('0x17')]&&require(_0x821e('0x18'))[_0x821e('0x19')]();require(_0x821e('0x1a'))['default']();})['catch'](function(_0x1b7bc8){logger[_0x821e('0x1b')]('Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s',_0x1b7bc8);process[_0x821e('0x1c')](0x1);});}main();