95ea5b853812cd9756d9eecd42d339e39db71845
[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 _0x585e=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize','sync','then','listen','info','start','map','filter','online','join','Offline\x20apps:','status','None','./config/seedDB','default','catch','error'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x585e,0x1c2));var _0xe585=function(_0x4341a5,_0x1c7f06){_0x4341a5=_0x4341a5-0x0;var _0x2af155=_0x585e[_0x4341a5];return _0x2af155;};'use strict';var _=require(_0xe585('0x0'));var mysqldb=require(_0xe585('0x1'));var rpc=require(_0xe585('0x2'));var config=require(_0xe585('0x3'));var logger=require(_0xe585('0x4'))('app');var pm2=require('./config/pm2');var pm2Config=require(_0xe585('0x5'));var schedule=require(_0xe585('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xe585('0x7'));var transcribe=require(_0xe585('0x8'));function main(){return mysqldb['db'][_0xe585('0x9')][_0xe585('0xa')]()[_0xe585('0xb')](function(){return rpc[_0xe585('0xc')]();})[_0xe585('0xb')](function(_0x19d1ec){logger[_0xe585('0xd')](_0x19d1ec);return chat[_0xe585('0xe')]();})[_0xe585('0xb')](function(){return whatsapp[_0xe585('0xe')]();})[_0xe585('0xb')](function(){return schedule['start']();})[_0xe585('0xb')](function(){return transcribe[_0xe585('0xe')]();})['then'](function(_0x2002af){logger['info'](_0x2002af);return pm2[_0xe585('0xe')](pm2Config);})[_0xe585('0xb')](function(_0x3946d2){logger[_0xe585('0xd')]('Online\x20apps:',_[_0xe585('0xf')](_[_0xe585('0x10')](_0x3946d2,{'status':_0xe585('0x11')}),'name')[_0xe585('0x12')]());logger[_0xe585('0xd')](_0xe585('0x13'),_[_0xe585('0xf')](_[_0xe585('0x10')](_0x3946d2,function(_0x491820){return _0x491820[_0xe585('0x14')]!=='online';}),'name')[_0xe585('0x12')]()||_0xe585('0x15'));config['seedDB']&&require(_0xe585('0x16'))[_0xe585('0x17')]();require('./config/license')[_0xe585('0x17')]();})[_0xe585('0x18')](function(_0x1bc3df){logger[_0xe585('0x19')](_0xe585('0x1a'),_0x1bc3df);process[_0xe585('0x1b')](0x1);});}main();