Built motion from commit 19a84241.|2.5.34
[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 _0xe29a=['sequelize','sync','then','listen','start','info','Online\x20apps:','map','filter','online','name','Offline\x20apps:','join','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config'];(function(_0x4eb6ec,_0x7f2520){var _0x58881b=function(_0x4f375f){while(--_0x4f375f){_0x4eb6ec['push'](_0x4eb6ec['shift']());}};_0x58881b(++_0x7f2520);}(_0xe29a,0xe8));var _0xae29=function(_0x37db4c,_0x33cfd0){_0x37db4c=_0x37db4c-0x0;var _0x5090dc=_0xe29a[_0x37db4c];return _0x5090dc;};'use strict';var _=require(_0xae29('0x0'));var mysqldb=require(_0xae29('0x1'));var rpc=require(_0xae29('0x2'));var config=require(_0xae29('0x3'));var logger=require(_0xae29('0x4'))(_0xae29('0x5'));var pm2=require(_0xae29('0x6'));var pm2Config=require(_0xae29('0x7'));var schedule=require('./config/schedule');var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xae29('0x8')][_0xae29('0x9')]()[_0xae29('0xa')](function(){return rpc[_0xae29('0xb')]();})[_0xae29('0xa')](function(_0xd2b41){logger['info'](_0xd2b41);return chat[_0xae29('0xc')]();})[_0xae29('0xa')](function(){return whatsapp['start']();})[_0xae29('0xa')](function(){return schedule[_0xae29('0xc')]();})['then'](function(){return transcribe[_0xae29('0xc')]();})[_0xae29('0xa')](function(_0x2f864c){logger[_0xae29('0xd')](_0x2f864c);return pm2['start'](pm2Config);})[_0xae29('0xa')](function(_0x3fe9f4){logger[_0xae29('0xd')](_0xae29('0xe'),_[_0xae29('0xf')](_[_0xae29('0x10')](_0x3fe9f4,{'status':_0xae29('0x11')}),_0xae29('0x12'))['join']());logger[_0xae29('0xd')](_0xae29('0x13'),_[_0xae29('0xf')](_[_0xae29('0x10')](_0x3fe9f4,function(_0x2e43a7){return _0x2e43a7['status']!==_0xae29('0x11');}),'name')[_0xae29('0x14')]()||_0xae29('0x15'));config[_0xae29('0x16')]&&require(_0xae29('0x17'))[_0xae29('0x18')]();require(_0xae29('0x19'))[_0xae29('0x18')]();})[_0xae29('0x1a')](function(_0x27ea80){logger[_0xae29('0x1b')](_0xae29('0x1c'),_0x27ea80);process[_0xae29('0x1d')](0x1);});}main();