c70938be3ebfc9e36026a2122121775e21dc215d
[motion2.git] / server / api / dashboardItem / dashboardItem.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 _0x66ae=['lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','request\x20sent','debug','stringify','error','code','DashboardItem,\x20%s,\x20%s','message','info','result','catch'];(function(_0x32f7d7,_0x54231b){var _0x133d09=function(_0x41a7ab){while(--_0x41a7ab){_0x32f7d7['push'](_0x32f7d7['shift']());}};_0x133d09(++_0x54231b);}(_0x66ae,0x91));var _0xe66a=function(_0x1fea66,_0x621fdb){_0x1fea66=_0x1fea66-0x0;var _0x112af3=_0x66ae[_0x1fea66];return _0x112af3;};'use strict';var _=require(_0xe66a('0x0'));var util=require('util');var moment=require(_0xe66a('0x1'));var BPromise=require(_0xe66a('0x2'));var rs=require(_0xe66a('0x3'));var fs=require('fs');var Redis=require(_0xe66a('0x4'));var db=require(_0xe66a('0x5'))['db'];var utils=require(_0xe66a('0x6'));var logger=require(_0xe66a('0x7'))(_0xe66a('0x8'));var config=require(_0xe66a('0x9'));var jayson=require(_0xe66a('0xa'));var client=jayson[_0xe66a('0xb')][_0xe66a('0xc')]({'port':0x232a});config['redis']=_[_0xe66a('0xd')](config['redis'],{'host':_0xe66a('0xe'),'port':0x18eb});var socket=require(_0xe66a('0xf'))(new Redis(config['redis']));require(_0xe66a('0x10'))[_0xe66a('0x11')](socket);function respondWithRpcPromise(_0x3383b3,_0x1a373b,_0x3dbca7){return new BPromise(function(_0x38d33d,_0x459e95){return client[_0xe66a('0x12')](_0x3383b3,_0x3dbca7)['then'](function(_0x2bee53){logger['info']('DashboardItem,\x20%s,\x20%s',_0x1a373b,_0xe66a('0x13'));logger[_0xe66a('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x1a373b,_0xe66a('0x13'),JSON[_0xe66a('0x15')](_0x2bee53));if(_0x2bee53[_0xe66a('0x16')]){if(_0x2bee53[_0xe66a('0x16')][_0xe66a('0x17')]===0x1f4){logger[_0xe66a('0x16')](_0xe66a('0x18'),_0x1a373b,_0x2bee53['error'][_0xe66a('0x19')]);return _0x459e95(_0x2bee53['error'][_0xe66a('0x19')]);}logger[_0xe66a('0x16')]('DashboardItem,\x20%s,\x20%s',_0x1a373b,_0x2bee53['error'][_0xe66a('0x19')]);return _0x38d33d(_0x2bee53[_0xe66a('0x16')][_0xe66a('0x19')]);}else{logger[_0xe66a('0x1a')]('DashboardItem,\x20%s,\x20%s',_0x1a373b,_0xe66a('0x13'));_0x38d33d(_0x2bee53[_0xe66a('0x1b')][_0xe66a('0x19')]);}})[_0xe66a('0x1c')](function(_0x183fd8){logger['error'](_0xe66a('0x18'),_0x1a373b,_0x183fd8);_0x459e95(_0x183fd8);});});}