ddde82cf87c08bcb02945e1056a928b96d9f34a8
[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 _0x450c=['sync','then','listen','start','info','Online\x20apps:','map','filter','online','join','Offline\x20apps:','status','name','None','./config/seedDB','default','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/transcribe'];(function(_0x345676,_0x554d0a){var _0x20a1da=function(_0x2b9b8d){while(--_0x2b9b8d){_0x345676['push'](_0x345676['shift']());}};_0x20a1da(++_0x554d0a);}(_0x450c,0x6b));var _0xc450=function(_0x1f244c,_0x499893){_0x1f244c=_0x1f244c-0x0;var _0xd65b6=_0x450c[_0x1f244c];return _0xd65b6;};'use strict';var _=require(_0xc450('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0xc450('0x1'));var config=require(_0xc450('0x2'));var logger=require(_0xc450('0x3'))(_0xc450('0x4'));var pm2=require(_0xc450('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xc450('0x6'));var chat=require(_0xc450('0x7'));var transcribe=require(_0xc450('0x8'));function main(){return mysqldb['db']['sequelize'][_0xc450('0x9')]()[_0xc450('0xa')](function(){return rpc[_0xc450('0xb')]();})[_0xc450('0xa')](function(_0x2e77e3){logger['info'](_0x2e77e3);return chat[_0xc450('0xc')]();})[_0xc450('0xa')](function(){return schedule[_0xc450('0xc')]();})[_0xc450('0xa')](function(){return transcribe['start']();})['then'](function(_0x2d555a){logger[_0xc450('0xd')](_0x2d555a);return pm2[_0xc450('0xc')](pm2Config);})['then'](function(_0x387012){logger[_0xc450('0xd')](_0xc450('0xe'),_[_0xc450('0xf')](_[_0xc450('0x10')](_0x387012,{'status':_0xc450('0x11')}),'name')[_0xc450('0x12')]());logger[_0xc450('0xd')](_0xc450('0x13'),_['map'](_[_0xc450('0x10')](_0x387012,function(_0x1afd3b){return _0x1afd3b[_0xc450('0x14')]!==_0xc450('0x11');}),_0xc450('0x15'))['join']()||_0xc450('0x16'));config['seedDB']&&require(_0xc450('0x17'))[_0xc450('0x18')]();require(_0xc450('0x19'))['default']();})[_0xc450('0x1a')](function(_0x1d28de){logger['error'](_0xc450('0x1b'),_0x1d28de);process[_0xc450('0x1c')](0x1);});}main();