5c549b8127f5a98665127eef7560c1c660ada7e5
[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 _0xccc1=['./mysqldb','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','then','listen','info','start','Online\x20apps:','filter','online','join','Offline\x20apps:','map','status','name','seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash'];(function(_0xd75f0e,_0x2f98db){var _0x34a003=function(_0x1e13c7){while(--_0x1e13c7){_0xd75f0e['push'](_0xd75f0e['shift']());}};_0x34a003(++_0x2f98db);}(_0xccc1,0x9b));var _0x1ccc=function(_0x35ead7,_0x453d3a){_0x35ead7=_0x35ead7-0x0;var _0x33b761=_0xccc1[_0x35ead7];return _0x33b761;};'use strict';var _=require(_0x1ccc('0x0'));var mysqldb=require(_0x1ccc('0x1'));var rpc=require('./rpc');var config=require(_0x1ccc('0x2'));var logger=require(_0x1ccc('0x3'))(_0x1ccc('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0x1ccc('0x5'));var schedule=require('./config/schedule');var chat=require(_0x1ccc('0x6'));var transcribe=require(_0x1ccc('0x7'));function main(){return mysqldb['db']['sequelize']['sync']()[_0x1ccc('0x8')](function(){return rpc[_0x1ccc('0x9')]();})[_0x1ccc('0x8')](function(_0x5d13d3){logger[_0x1ccc('0xa')](_0x5d13d3);return chat[_0x1ccc('0xb')]();})[_0x1ccc('0x8')](function(){return schedule[_0x1ccc('0xb')]();})['then'](function(){return transcribe[_0x1ccc('0xb')]();})[_0x1ccc('0x8')](function(_0x5223d0){logger[_0x1ccc('0xa')](_0x5223d0);return pm2[_0x1ccc('0xb')](pm2Config);})['then'](function(_0x1837cc){logger[_0x1ccc('0xa')](_0x1ccc('0xc'),_['map'](_[_0x1ccc('0xd')](_0x1837cc,{'status':_0x1ccc('0xe')}),'name')[_0x1ccc('0xf')]());logger[_0x1ccc('0xa')](_0x1ccc('0x10'),_[_0x1ccc('0x11')](_[_0x1ccc('0xd')](_0x1837cc,function(_0x37b0ea){return _0x37b0ea[_0x1ccc('0x12')]!=='online';}),_0x1ccc('0x13'))[_0x1ccc('0xf')]()||'None');config[_0x1ccc('0x14')]&&require('./config/seedDB')[_0x1ccc('0x15')]();require('./config/license')[_0x1ccc('0x15')]();})[_0x1ccc('0x16')](function(_0x1d3a69){logger[_0x1ccc('0x17')](_0x1ccc('0x18'),_0x1d3a69);process[_0x1ccc('0x19')](0x1);});}main();