Built motion from commit 97153652.|2.6.26
[motion2.git] / server / api / dashboard / dashboard.rpc.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 _0x521a=['request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','request','then','info'];(function(_0x4d68ed,_0x211450){var _0x3a8ff4=function(_0x4ca658){while(--_0x4ca658){_0x4d68ed['push'](_0x4d68ed['shift']());}};_0x3a8ff4(++_0x211450);}(_0x521a,0x95));var _0xa521=function(_0x4d35c7,_0xb930e0){_0x4d35c7=_0x4d35c7-0x0;var _0x595121=_0x521a[_0x4d35c7];return _0x595121;};'use strict';var _=require(_0xa521('0x0'));var util=require(_0xa521('0x1'));var moment=require(_0xa521('0x2'));var BPromise=require(_0xa521('0x3'));var rs=require(_0xa521('0x4'));var fs=require('fs');var Redis=require(_0xa521('0x5'));var db=require(_0xa521('0x6'))['db'];var utils=require(_0xa521('0x7'));var logger=require(_0xa521('0x8'))(_0xa521('0x9'));var config=require(_0xa521('0xa'));var jayson=require(_0xa521('0xb'));var client=jayson[_0xa521('0xc')][_0xa521('0xd')]({'port':0x232a});config[_0xa521('0xe')]=_['defaults'](config[_0xa521('0xe')],{'host':_0xa521('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa521('0xe')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x2cd9c3,_0x362ce7,_0x528810){return new BPromise(function(_0x23b2c3,_0x48b883){return client[_0xa521('0x10')](_0x2cd9c3,_0x528810)[_0xa521('0x11')](function(_0x3b7b46){logger[_0xa521('0x12')]('Dashboard,\x20%s,\x20%s',_0x362ce7,_0xa521('0x13'));logger[_0xa521('0x14')](_0xa521('0x15'),_0x362ce7,_0xa521('0x13'),JSON[_0xa521('0x16')](_0x3b7b46));if(_0x3b7b46[_0xa521('0x17')]){if(_0x3b7b46[_0xa521('0x17')][_0xa521('0x18')]===0x1f4){logger[_0xa521('0x17')](_0xa521('0x19'),_0x362ce7,_0x3b7b46['error'][_0xa521('0x1a')]);return _0x48b883(_0x3b7b46['error'][_0xa521('0x1a')]);}logger[_0xa521('0x17')]('Dashboard,\x20%s,\x20%s',_0x362ce7,_0x3b7b46[_0xa521('0x17')][_0xa521('0x1a')]);return _0x23b2c3(_0x3b7b46[_0xa521('0x17')][_0xa521('0x1a')]);}else{logger['info'](_0xa521('0x19'),_0x362ce7,'request\x20sent');_0x23b2c3(_0x3b7b46[_0xa521('0x1b')]['message']);}})['catch'](function(_0x445a76){logger[_0xa521('0x17')](_0xa521('0x19'),_0x362ce7,_0x445a76);_0x48b883(_0x445a76);});});}