Built motion from commit (unavailable).|2.5.6
[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 _0x793e=['None','./config/seedDB','default','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2/config','./config/schedule/chat','sequelize','listen','info','start','then','Online\x20apps:','filter','name','map','status','online','join'];(function(_0x59af3b,_0x116878){var _0x59b03f=function(_0x350f14){while(--_0x350f14){_0x59af3b['push'](_0x59af3b['shift']());}};_0x59b03f(++_0x116878);}(_0x793e,0x83));var _0xe793=function(_0x1605b7,_0x13302a){_0x1605b7=_0x1605b7-0x0;var _0x3c6527=_0x793e[_0x1605b7];return _0x3c6527;};'use strict';var _=require('lodash');var mysqldb=require(_0xe793('0x0'));var rpc=require(_0xe793('0x1'));var config=require(_0xe793('0x2'));var logger=require(_0xe793('0x3'))(_0xe793('0x4'));var pm2=require('./config/pm2');var pm2Config=require(_0xe793('0x5'));var schedule=require('./config/schedule');var chat=require(_0xe793('0x6'));var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xe793('0x7')]['sync']()['then'](function(){return rpc[_0xe793('0x8')]();})['then'](function(_0x4f05e1){logger[_0xe793('0x9')](_0x4f05e1);return chat[_0xe793('0xa')]();})['then'](function(){return schedule[_0xe793('0xa')]();})[_0xe793('0xb')](function(){return transcribe[_0xe793('0xa')]();})[_0xe793('0xb')](function(_0x3db4ef){logger[_0xe793('0x9')](_0x3db4ef);return pm2[_0xe793('0xa')](pm2Config);})['then'](function(_0x51a7e1){logger[_0xe793('0x9')](_0xe793('0xc'),_['map'](_[_0xe793('0xd')](_0x51a7e1,{'status':'online'}),_0xe793('0xe'))['join']());logger[_0xe793('0x9')]('Offline\x20apps:',_[_0xe793('0xf')](_[_0xe793('0xd')](_0x51a7e1,function(_0x2a2fba){return _0x2a2fba[_0xe793('0x10')]!==_0xe793('0x11');}),_0xe793('0xe'))[_0xe793('0x12')]()||_0xe793('0x13'));config['seedDB']&&require(_0xe793('0x14'))[_0xe793('0x15')]();require('./config/license')[_0xe793('0x15')]();})[_0xe793('0x16')](function(_0x3d7aff){logger['error'](_0xe793('0x17'),_0x3d7aff);process[_0xe793('0x18')](0x1);});}main();