Built motion from commit (unavailable).|2.5.4
[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 _0x04a1=['status','name','None','./config/seedDB','./config/license','catch','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/pm2','./config/pm2/config','./config/schedule/chat','./config/schedule/transcribe','sequelize','sync','then','listen','start','info','Online\x20apps:','map','filter','online','join','Offline\x20apps:'];(function(_0x2112d4,_0x3c863c){var _0x434972=function(_0x477020){while(--_0x477020){_0x2112d4['push'](_0x2112d4['shift']());}};_0x434972(++_0x3c863c);}(_0x04a1,0xfb));var _0x104a=function(_0x193319,_0x260d2d){_0x193319=_0x193319-0x0;var _0x45ee2d=_0x04a1[_0x193319];return _0x45ee2d;};'use strict';var _=require(_0x104a('0x0'));var mysqldb=require(_0x104a('0x1'));var rpc=require(_0x104a('0x2'));var config=require('./config/environment');var logger=require('./config/logger')('app');var pm2=require(_0x104a('0x3'));var pm2Config=require(_0x104a('0x4'));var schedule=require('./config/schedule');var chat=require(_0x104a('0x5'));var transcribe=require(_0x104a('0x6'));function main(){return mysqldb['db'][_0x104a('0x7')][_0x104a('0x8')]()[_0x104a('0x9')](function(){return rpc[_0x104a('0xa')]();})['then'](function(_0xf0a8b5){logger['info'](_0xf0a8b5);return chat['start']();})['then'](function(){return schedule[_0x104a('0xb')]();})[_0x104a('0x9')](function(){return transcribe[_0x104a('0xb')]();})['then'](function(_0x1c288d){logger[_0x104a('0xc')](_0x1c288d);return pm2[_0x104a('0xb')](pm2Config);})[_0x104a('0x9')](function(_0x2c768b){logger[_0x104a('0xc')](_0x104a('0xd'),_[_0x104a('0xe')](_[_0x104a('0xf')](_0x2c768b,{'status':_0x104a('0x10')}),'name')[_0x104a('0x11')]());logger[_0x104a('0xc')](_0x104a('0x12'),_[_0x104a('0xe')](_[_0x104a('0xf')](_0x2c768b,function(_0x2258d4){return _0x2258d4[_0x104a('0x13')]!==_0x104a('0x10');}),_0x104a('0x14'))[_0x104a('0x11')]()||_0x104a('0x15'));config['seedDB']&&require(_0x104a('0x16'))['default']();require(_0x104a('0x17'))['default']();})[_0x104a('0x18')](function(_0x436f6f){logger['error'](_0x104a('0x19'),_0x436f6f);process[_0x104a('0x1a')](0x1);});}main();