Built motion from commit (unavailable).|2.5.31
[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 _0x5b47=['start','then','Online\x20apps:','map','filter','online','Offline\x20apps:','status','join','None','seedDB','./config/seedDB','./config/license','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./config/pm2/config','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','listen','info'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x5b47,0x120));var _0x75b4=function(_0x21ad5e,_0x49e9c6){_0x21ad5e=_0x21ad5e-0x0;var _0x5035f4=_0x5b47[_0x21ad5e];return _0x5035f4;};'use strict';var _=require(_0x75b4('0x0'));var mysqldb=require(_0x75b4('0x1'));var rpc=require('./rpc');var config=require('./config/environment');var logger=require('./config/logger')('app');var pm2=require('./config/pm2');var pm2Config=require(_0x75b4('0x2'));var schedule=require(_0x75b4('0x3'));var chat=require(_0x75b4('0x4'));var whatsapp=require(_0x75b4('0x5'));var transcribe=require(_0x75b4('0x6'));function main(){return mysqldb['db']['sequelize']['sync']()['then'](function(){return rpc[_0x75b4('0x7')]();})['then'](function(_0x16138d){logger[_0x75b4('0x8')](_0x16138d);return chat[_0x75b4('0x9')]();})[_0x75b4('0xa')](function(){return whatsapp[_0x75b4('0x9')]();})[_0x75b4('0xa')](function(){return schedule[_0x75b4('0x9')]();})[_0x75b4('0xa')](function(){return transcribe[_0x75b4('0x9')]();})['then'](function(_0x3d9f18){logger['info'](_0x3d9f18);return pm2[_0x75b4('0x9')](pm2Config);})[_0x75b4('0xa')](function(_0x468bb5){logger[_0x75b4('0x8')](_0x75b4('0xb'),_[_0x75b4('0xc')](_[_0x75b4('0xd')](_0x468bb5,{'status':_0x75b4('0xe')}),'name')['join']());logger['info'](_0x75b4('0xf'),_[_0x75b4('0xc')](_['filter'](_0x468bb5,function(_0x2782ea){return _0x2782ea[_0x75b4('0x10')]!==_0x75b4('0xe');}),'name')[_0x75b4('0x11')]()||_0x75b4('0x12'));config[_0x75b4('0x13')]&&require(_0x75b4('0x14'))['default']();require(_0x75b4('0x15'))[_0x75b4('0x16')]();})[_0x75b4('0x17')](function(_0x7e396d){logger[_0x75b4('0x18')](_0x75b4('0x19'),_0x7e396d);process[_0x75b4('0x1a')](0x1);});}main();