8e2d42d5acb0f454dbbc5c9f974c6bbb66f361ef
[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 _0x0324=['sync','listen','then','start','info','Online\x20apps:','map','filter','online','name','join','Offline\x20apps:','status','None','seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','./mysqldb','./rpc','./config/environment','./config/logger','app','./config/pm2','./config/schedule','./config/schedule/chat','./config/schedule/whatsapp','./config/schedule/transcribe','sequelize'];(function(_0x20f29e,_0xff93c3){var _0x39ba87=function(_0x2bda39){while(--_0x2bda39){_0x20f29e['push'](_0x20f29e['shift']());}};_0x39ba87(++_0xff93c3);}(_0x0324,0x90));var _0x4032=function(_0x16de2b,_0x5443f2){_0x16de2b=_0x16de2b-0x0;var _0x585abc=_0x0324[_0x16de2b];return _0x585abc;};'use strict';var _=require('lodash');var mysqldb=require(_0x4032('0x0'));var rpc=require(_0x4032('0x1'));var config=require(_0x4032('0x2'));var logger=require(_0x4032('0x3'))(_0x4032('0x4'));var pm2=require(_0x4032('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0x4032('0x6'));var chat=require(_0x4032('0x7'));var whatsapp=require(_0x4032('0x8'));var transcribe=require(_0x4032('0x9'));function main(){return mysqldb['db'][_0x4032('0xa')][_0x4032('0xb')]()['then'](function(){return rpc[_0x4032('0xc')]();})[_0x4032('0xd')](function(_0x523421){logger['info'](_0x523421);return chat[_0x4032('0xe')]();})[_0x4032('0xd')](function(){return whatsapp['start']();})[_0x4032('0xd')](function(){return schedule[_0x4032('0xe')]();})[_0x4032('0xd')](function(){return transcribe[_0x4032('0xe')]();})['then'](function(_0x923f5d){logger[_0x4032('0xf')](_0x923f5d);return pm2['start'](pm2Config);})['then'](function(_0x4bdb60){logger[_0x4032('0xf')](_0x4032('0x10'),_[_0x4032('0x11')](_[_0x4032('0x12')](_0x4bdb60,{'status':_0x4032('0x13')}),_0x4032('0x14'))[_0x4032('0x15')]());logger[_0x4032('0xf')](_0x4032('0x16'),_[_0x4032('0x11')](_['filter'](_0x4bdb60,function(_0x53daf2){return _0x53daf2[_0x4032('0x17')]!==_0x4032('0x13');}),_0x4032('0x14'))[_0x4032('0x15')]()||_0x4032('0x18'));config[_0x4032('0x19')]&&require('./config/seedDB')[_0x4032('0x1a')]();require('./config/license')['default']();})[_0x4032('0x1b')](function(_0x2f5c4d){logger[_0x4032('0x1c')](_0x4032('0x1d'),_0x2f5c4d);process[_0x4032('0x1e')](0x1);});}main();