Built motion from commit (unavailable).|2.3.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 _0xd97e=['then','listen','info','start','map','filter','online','name','Offline\x20apps:','status','join','seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/pm2','./config/pm2/config','./config/schedule/chat','sequelize','sync'];(function(_0x39bc4a,_0x595147){var _0x436b0d=function(_0x44e6eb){while(--_0x44e6eb){_0x39bc4a['push'](_0x39bc4a['shift']());}};_0x436b0d(++_0x595147);}(_0xd97e,0x7a));var _0xed97=function(_0x54d40d,_0x220dfe){_0x54d40d=_0x54d40d-0x0;var _0x191ec5=_0xd97e[_0x54d40d];return _0x191ec5;};'use strict';var _=require('lodash');var mysqldb=require(_0xed97('0x0'));var rpc=require(_0xed97('0x1'));var config=require(_0xed97('0x2'));var logger=require('./config/logger')('app');var pm2=require(_0xed97('0x3'));var pm2Config=require(_0xed97('0x4'));var schedule=require('./config/schedule');var chat=require(_0xed97('0x5'));function main(){return mysqldb['db'][_0xed97('0x6')][_0xed97('0x7')]()[_0xed97('0x8')](function(){return rpc[_0xed97('0x9')]();})[_0xed97('0x8')](function(_0x410c69){logger[_0xed97('0xa')](_0x410c69);return chat[_0xed97('0xb')]();})[_0xed97('0x8')](function(){return schedule[_0xed97('0xb')]();})['then'](function(_0xee35ed){logger[_0xed97('0xa')](_0xee35ed);return pm2[_0xed97('0xb')](pm2Config);})[_0xed97('0x8')](function(_0x4c3023){logger[_0xed97('0xa')]('Online\x20apps:',_[_0xed97('0xc')](_[_0xed97('0xd')](_0x4c3023,{'status':_0xed97('0xe')}),_0xed97('0xf'))['join']());logger['info'](_0xed97('0x10'),_[_0xed97('0xc')](_[_0xed97('0xd')](_0x4c3023,function(_0x54ee0c){return _0x54ee0c[_0xed97('0x11')]!=='online';}),_0xed97('0xf'))[_0xed97('0x12')]()||'None');config[_0xed97('0x13')]&&require('./config/seedDB')[_0xed97('0x14')]();require(_0xed97('0x15'))[_0xed97('0x14')]();})[_0xed97('0x16')](function(_0x34f86f){logger[_0xed97('0x17')](_0xed97('0x18'),_0x34f86f);process[_0xed97('0x19')](0x1);});}main();