1 // *************************************************************************
3 // * xCALLY Motion - The Omnichannel Contact Center *
4 // * Copyright (c) Xenialab s.r.l. All Rights Reserved *
6 // *************************************************************************
8 // * Email: info@xcally.com *
9 // * Website: https://www.xcally.com *
11 // *************************************************************************
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. *
17 // *************************************************************************
18 var _0x2638=['DashboardItem,\x20%s,\x20%s','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','then','info'];(function(_0x2731f0,_0x126b1b){var _0x36a180=function(_0x44d1a9){while(--_0x44d1a9){_0x2731f0['push'](_0x2731f0['shift']());}};_0x36a180(++_0x126b1b);}(_0x2638,0x1c8));var _0x8263=function(_0x378068,_0x49640b){_0x378068=_0x378068-0x0;var _0x373cf0=_0x2638[_0x378068];return _0x373cf0;};'use strict';var _=require(_0x8263('0x0'));var util=require('util');var moment=require(_0x8263('0x1'));var BPromise=require(_0x8263('0x2'));var rs=require(_0x8263('0x3'));var fs=require('fs');var Redis=require(_0x8263('0x4'));var db=require(_0x8263('0x5'))['db'];var utils=require(_0x8263('0x6'));var logger=require(_0x8263('0x7'))(_0x8263('0x8'));var config=require(_0x8263('0x9'));var jayson=require(_0x8263('0xa'));var client=jayson[_0x8263('0xb')][_0x8263('0xc')]({'port':0x232a});config[_0x8263('0xd')]=_[_0x8263('0xe')](config[_0x8263('0xd')],{'host':_0x8263('0xf'),'port':0x18eb});var socket=require(_0x8263('0x10'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x8263('0x11')](socket);function respondWithRpcPromise(_0x2fc2da,_0x88423d,_0x79149a){return new BPromise(function(_0x380d8d,_0x480e9c){return client['request'](_0x2fc2da,_0x79149a)[_0x8263('0x12')](function(_0x24a01c){logger[_0x8263('0x13')](_0x8263('0x14'),_0x88423d,'request\x20sent');logger['debug'](_0x8263('0x15'),_0x88423d,_0x8263('0x16'),JSON[_0x8263('0x17')](_0x24a01c));if(_0x24a01c[_0x8263('0x18')]){if(_0x24a01c[_0x8263('0x18')]['code']===0x1f4){logger[_0x8263('0x18')](_0x8263('0x14'),_0x88423d,_0x24a01c[_0x8263('0x18')][_0x8263('0x19')]);return _0x480e9c(_0x24a01c['error'][_0x8263('0x19')]);}logger[_0x8263('0x18')](_0x8263('0x14'),_0x88423d,_0x24a01c[_0x8263('0x18')][_0x8263('0x19')]);return _0x380d8d(_0x24a01c[_0x8263('0x18')][_0x8263('0x19')]);}else{logger['info'](_0x8263('0x14'),_0x88423d,_0x8263('0x16'));_0x380d8d(_0x24a01c[_0x8263('0x1a')]['message']);}})[_0x8263('0x1b')](function(_0x44362f){logger['error']('DashboardItem,\x20%s,\x20%s',_0x88423d,_0x44362f);_0x480e9c(_0x44362f);});});}