Built motion from commit (unavailable).|2.5.5
[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 _0x5745=['register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','http','redis','localhost','./dashboard.socket'];(function(_0x301d71,_0x3f86b9){var _0x4c1f61=function(_0x13574e){while(--_0x13574e){_0x301d71['push'](_0x301d71['shift']());}};_0x4c1f61(++_0x3f86b9);}(_0x5745,0xf7));var _0x5574=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5745[_0x2b4411];return _0x8e41ef;};'use strict';var _=require(_0x5574('0x0'));var util=require(_0x5574('0x1'));var moment=require(_0x5574('0x2'));var BPromise=require(_0x5574('0x3'));var rs=require(_0x5574('0x4'));var fs=require('fs');var Redis=require(_0x5574('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5574('0x6'));var logger=require('../../config/logger')(_0x5574('0x7'));var config=require(_0x5574('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x5574('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0x5574('0xa')],{'host':_0x5574('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5574('0xa')]));require(_0x5574('0xc'))[_0x5574('0xd')](socket);function respondWithRpcPromise(_0x3c0aeb,_0x115ec7,_0x27f3ef){return new BPromise(function(_0x598cd0,_0xeef142){return client[_0x5574('0xe')](_0x3c0aeb,_0x27f3ef)[_0x5574('0xf')](function(_0x41b3ab){logger[_0x5574('0x10')](_0x5574('0x11'),_0x115ec7,_0x5574('0x12'));logger[_0x5574('0x13')](_0x5574('0x14'),_0x115ec7,_0x5574('0x12'),JSON[_0x5574('0x15')](_0x41b3ab));if(_0x41b3ab[_0x5574('0x16')]){if(_0x41b3ab[_0x5574('0x16')][_0x5574('0x17')]===0x1f4){logger[_0x5574('0x16')]('Dashboard,\x20%s,\x20%s',_0x115ec7,_0x41b3ab[_0x5574('0x16')][_0x5574('0x18')]);return _0xeef142(_0x41b3ab[_0x5574('0x16')][_0x5574('0x18')]);}logger[_0x5574('0x16')](_0x5574('0x11'),_0x115ec7,_0x41b3ab[_0x5574('0x16')]['message']);return _0x598cd0(_0x41b3ab[_0x5574('0x16')][_0x5574('0x18')]);}else{logger[_0x5574('0x10')](_0x5574('0x11'),_0x115ec7,_0x5574('0x12'));_0x598cd0(_0x41b3ab['result']['message']);}})[_0x5574('0x19')](function(_0x529a5d){logger[_0x5574('0x16')](_0x5574('0x11'),_0x115ec7,_0x529a5d);_0xeef142(_0x529a5d);});});}