Built motion from commit (unavailable).|2.5.0
[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 _0x8b4d=['socket.io-emitter','register','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','redis','localhost'];(function(_0x485f62,_0xd898d8){var _0x520f12=function(_0x7079ea){while(--_0x7079ea){_0x485f62['push'](_0x485f62['shift']());}};_0x520f12(++_0xd898d8);}(_0x8b4d,0x11d));var _0xd8b4=function(_0x3b3cc6,_0x1a6e24){_0x3b3cc6=_0x3b3cc6-0x0;var _0x1161e4=_0x8b4d[_0x3b3cc6];return _0x1161e4;};'use strict';var _=require(_0xd8b4('0x0'));var util=require(_0xd8b4('0x1'));var moment=require(_0xd8b4('0x2'));var BPromise=require(_0xd8b4('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd8b4('0x4'));var db=require(_0xd8b4('0x5'))['db'];var utils=require(_0xd8b4('0x6'));var logger=require(_0xd8b4('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xd8b4('0x8'));var client=jayson[_0xd8b4('0x9')]['http']({'port':0x232a});config[_0xd8b4('0xa')]=_['defaults'](config['redis'],{'host':_0xd8b4('0xb'),'port':0x18eb});var socket=require(_0xd8b4('0xc'))(new Redis(config[_0xd8b4('0xa')]));require('./dashboard.socket')[_0xd8b4('0xd')](socket);function respondWithRpcPromise(_0x4d03e3,_0x818fbe,_0x413a75){return new BPromise(function(_0x53dc8a,_0x589296){return client[_0xd8b4('0xe')](_0x4d03e3,_0x413a75)[_0xd8b4('0xf')](function(_0x1da18f){logger[_0xd8b4('0x10')](_0xd8b4('0x11'),_0x818fbe,_0xd8b4('0x12'));logger[_0xd8b4('0x13')](_0xd8b4('0x14'),_0x818fbe,_0xd8b4('0x12'),JSON[_0xd8b4('0x15')](_0x1da18f));if(_0x1da18f['error']){if(_0x1da18f['error'][_0xd8b4('0x16')]===0x1f4){logger[_0xd8b4('0x17')](_0xd8b4('0x11'),_0x818fbe,_0x1da18f[_0xd8b4('0x17')][_0xd8b4('0x18')]);return _0x589296(_0x1da18f['error'][_0xd8b4('0x18')]);}logger['error'](_0xd8b4('0x11'),_0x818fbe,_0x1da18f[_0xd8b4('0x17')][_0xd8b4('0x18')]);return _0x53dc8a(_0x1da18f[_0xd8b4('0x17')][_0xd8b4('0x18')]);}else{logger[_0xd8b4('0x10')]('Dashboard,\x20%s,\x20%s',_0x818fbe,'request\x20sent');_0x53dc8a(_0x1da18f[_0xd8b4('0x19')][_0xd8b4('0x18')]);}})[_0xd8b4('0x1a')](function(_0x5b0033){logger[_0xd8b4('0x17')](_0xd8b4('0x11'),_0x818fbe,_0x5b0033);_0x589296(_0x5b0033);});});}