Built motion from commit (unavailable).|2.5.22
[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 _0x27fb=['Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/logger','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','sequelize','sync','then','listen','info','start','Online\x20apps:','map','filter','online','name','status','join','seedDB','./config/seedDB','default','./config/license','catch'];(function(_0x2e4c3f,_0x5a8619){var _0x23f310=function(_0x21583b){while(--_0x21583b){_0x2e4c3f['push'](_0x2e4c3f['shift']());}};_0x23f310(++_0x5a8619);}(_0x27fb,0x1de));var _0xb27f=function(_0xaa344e,_0x1928a1){_0xaa344e=_0xaa344e-0x0;var _0x5dfd27=_0x27fb[_0xaa344e];return _0x5dfd27;};'use strict';var _=require(_0xb27f('0x0'));var mysqldb=require(_0xb27f('0x1'));var rpc=require(_0xb27f('0x2'));var config=require('./config/environment');var logger=require(_0xb27f('0x3'))('app');var pm2=require(_0xb27f('0x4'));var pm2Config=require(_0xb27f('0x5'));var schedule=require(_0xb27f('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require(_0xb27f('0x7'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xb27f('0x8')][_0xb27f('0x9')]()[_0xb27f('0xa')](function(){return rpc[_0xb27f('0xb')]();})[_0xb27f('0xa')](function(_0x4da129){logger[_0xb27f('0xc')](_0x4da129);return chat[_0xb27f('0xd')]();})['then'](function(){return whatsapp[_0xb27f('0xd')]();})[_0xb27f('0xa')](function(){return schedule[_0xb27f('0xd')]();})[_0xb27f('0xa')](function(){return transcribe['start']();})[_0xb27f('0xa')](function(_0x300422){logger['info'](_0x300422);return pm2[_0xb27f('0xd')](pm2Config);})[_0xb27f('0xa')](function(_0x5e5453){logger[_0xb27f('0xc')](_0xb27f('0xe'),_[_0xb27f('0xf')](_[_0xb27f('0x10')](_0x5e5453,{'status':_0xb27f('0x11')}),_0xb27f('0x12'))['join']());logger[_0xb27f('0xc')]('Offline\x20apps:',_[_0xb27f('0xf')](_['filter'](_0x5e5453,function(_0x35cb70){return _0x35cb70[_0xb27f('0x13')]!==_0xb27f('0x11');}),_0xb27f('0x12'))[_0xb27f('0x14')]()||'None');config[_0xb27f('0x15')]&&require(_0xb27f('0x16'))[_0xb27f('0x17')]();require(_0xb27f('0x18'))[_0xb27f('0x17')]();})[_0xb27f('0x19')](function(_0x428a86){logger['error'](_0xb27f('0x1a'),_0x428a86);process[_0xb27f('0x1b')](0x1);});}main();