a0f9be8c9db5c5b6ccc613b6809a47fe8eb77a64
[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 _0x3cb2=['online','name','join','Offline\x20apps:','status','None','seedDB','./config/seedDB','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./config/environment','app','./config/pm2','./config/pm2/config','./config/schedule','./config/schedule/whatsapp','sync','then','listen','info','start','Online\x20apps:','map','filter'];(function(_0x1f47d9,_0x3f26e7){var _0x1f3ccd=function(_0x1bf9fa){while(--_0x1bf9fa){_0x1f47d9['push'](_0x1f47d9['shift']());}};_0x1f3ccd(++_0x3f26e7);}(_0x3cb2,0xf6));var _0x23cb=function(_0x5458a6,_0x1688c5){_0x5458a6=_0x5458a6-0x0;var _0x2669fc=_0x3cb2[_0x5458a6];return _0x2669fc;};'use strict';var _=require(_0x23cb('0x0'));var mysqldb=require('./mysqldb');var rpc=require('./rpc');var config=require(_0x23cb('0x1'));var logger=require('./config/logger')(_0x23cb('0x2'));var pm2=require(_0x23cb('0x3'));var pm2Config=require(_0x23cb('0x4'));var schedule=require(_0x23cb('0x5'));var chat=require('./config/schedule/chat');var whatsapp=require(_0x23cb('0x6'));var transcribe=require('./config/schedule/transcribe');var provider=require('./config/schedule/cloud-provider');function main(){return mysqldb['db']['sequelize'][_0x23cb('0x7')]()[_0x23cb('0x8')](function(){return rpc[_0x23cb('0x9')]();})[_0x23cb('0x8')](function(_0x1fca2a){logger[_0x23cb('0xa')](_0x1fca2a);return chat[_0x23cb('0xb')]();})[_0x23cb('0x8')](function(){return whatsapp[_0x23cb('0xb')]();})[_0x23cb('0x8')](function(){return schedule[_0x23cb('0xb')]();})[_0x23cb('0x8')](function(){return transcribe['start']();})[_0x23cb('0x8')](function(){return provider[_0x23cb('0xb')]();})[_0x23cb('0x8')](function(_0x3af07c){logger[_0x23cb('0xa')](_0x3af07c);return pm2[_0x23cb('0xb')](pm2Config);})[_0x23cb('0x8')](function(_0x1afc71){logger[_0x23cb('0xa')](_0x23cb('0xc'),_[_0x23cb('0xd')](_[_0x23cb('0xe')](_0x1afc71,{'status':_0x23cb('0xf')}),_0x23cb('0x10'))[_0x23cb('0x11')]());logger[_0x23cb('0xa')](_0x23cb('0x12'),_[_0x23cb('0xd')](_[_0x23cb('0xe')](_0x1afc71,function(_0x32bb89){return _0x32bb89[_0x23cb('0x13')]!==_0x23cb('0xf');}),_0x23cb('0x10'))[_0x23cb('0x11')]()||_0x23cb('0x14'));config[_0x23cb('0x15')]&&require(_0x23cb('0x16'))[_0x23cb('0x17')]();require(_0x23cb('0x18'))[_0x23cb('0x17')]();})[_0x23cb('0x19')](function(_0x2bef59){logger[_0x23cb('0x1a')](_0x23cb('0x1b'),_0x2bef59);process[_0x23cb('0x1c')](0x1);});}main();