Built motion from commit (unavailable).|2.5.8
[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 _0xae6e=['online','None','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./mysqldb','./rpc','./config/environment','./config/logger','./config/pm2','./config/schedule','sequelize','sync','listen','then','start','info','map','name','join','Offline\x20apps:','filter','status'];(function(_0x29a29f,_0x155ce7){var _0x443ea3=function(_0xe0dd24){while(--_0xe0dd24){_0x29a29f['push'](_0x29a29f['shift']());}};_0x443ea3(++_0x155ce7);}(_0xae6e,0x1e5));var _0xeae6=function(_0x9d2316,_0xdc2963){_0x9d2316=_0x9d2316-0x0;var _0x2edf4f=_0xae6e[_0x9d2316];return _0x2edf4f;};'use strict';var _=require(_0xeae6('0x0'));var mysqldb=require(_0xeae6('0x1'));var rpc=require(_0xeae6('0x2'));var config=require(_0xeae6('0x3'));var logger=require(_0xeae6('0x4'))('app');var pm2=require(_0xeae6('0x5'));var pm2Config=require('./config/pm2/config');var schedule=require(_0xeae6('0x6'));var chat=require('./config/schedule/chat');var whatsapp=require('./config/schedule/whatsapp');var transcribe=require('./config/schedule/transcribe');function main(){return mysqldb['db'][_0xeae6('0x7')][_0xeae6('0x8')]()['then'](function(){return rpc[_0xeae6('0x9')]();})[_0xeae6('0xa')](function(_0x59ec94){logger['info'](_0x59ec94);return chat[_0xeae6('0xb')]();})[_0xeae6('0xa')](function(){return whatsapp[_0xeae6('0xb')]();})[_0xeae6('0xa')](function(){return schedule[_0xeae6('0xb')]();})['then'](function(){return transcribe[_0xeae6('0xb')]();})[_0xeae6('0xa')](function(_0x592ad2){logger[_0xeae6('0xc')](_0x592ad2);return pm2[_0xeae6('0xb')](pm2Config);})[_0xeae6('0xa')](function(_0x38ab36){logger[_0xeae6('0xc')]('Online\x20apps:',_[_0xeae6('0xd')](_['filter'](_0x38ab36,{'status':'online'}),_0xeae6('0xe'))[_0xeae6('0xf')]());logger[_0xeae6('0xc')](_0xeae6('0x10'),_[_0xeae6('0xd')](_[_0xeae6('0x11')](_0x38ab36,function(_0x209fe2){return _0x209fe2[_0xeae6('0x12')]!==_0xeae6('0x13');}),'name')['join']()||_0xeae6('0x14'));config[_0xeae6('0x15')]&&require(_0xeae6('0x16'))[_0xeae6('0x17')]();require('./config/license')[_0xeae6('0x17')]();})[_0xeae6('0x18')](function(_0x29682c){logger[_0xeae6('0x19')](_0xeae6('0x1a'),_0x29682c);process[_0xeae6('0x1b')](0x1);});}main();