Built motion from commit 449495f6.|2.6.27
[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 _0xcd44=['localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0xcd44,0xa0));var _0x4cd4=function(_0x111dc3,_0x2a6fbd){_0x111dc3=_0x111dc3-0x0;var _0x59695c=_0xcd44[_0x111dc3];return _0x59695c;};'use strict';var _=require(_0x4cd4('0x0'));var util=require(_0x4cd4('0x1'));var moment=require(_0x4cd4('0x2'));var BPromise=require(_0x4cd4('0x3'));var rs=require(_0x4cd4('0x4'));var fs=require('fs');var Redis=require(_0x4cd4('0x5'));var db=require(_0x4cd4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4cd4('0x7'))(_0x4cd4('0x8'));var config=require(_0x4cd4('0x9'));var jayson=require(_0x4cd4('0xa'));var client=jayson[_0x4cd4('0xb')][_0x4cd4('0xc')]({'port':0x232a});config[_0x4cd4('0xd')]=_['defaults'](config[_0x4cd4('0xd')],{'host':_0x4cd4('0xe'),'port':0x18eb});var socket=require(_0x4cd4('0xf'))(new Redis(config[_0x4cd4('0xd')]));require(_0x4cd4('0x10'))[_0x4cd4('0x11')](socket);function respondWithRpcPromise(_0x5c5455,_0x53deec,_0x3d3598){return new BPromise(function(_0x2bf113,_0x314812){return client[_0x4cd4('0x12')](_0x5c5455,_0x3d3598)[_0x4cd4('0x13')](function(_0x261638){logger[_0x4cd4('0x14')](_0x4cd4('0x15'),_0x53deec,'request\x20sent');logger[_0x4cd4('0x16')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0x53deec,_0x4cd4('0x17'),JSON[_0x4cd4('0x18')](_0x261638));if(_0x261638[_0x4cd4('0x19')]){if(_0x261638[_0x4cd4('0x19')]['code']===0x1f4){logger[_0x4cd4('0x19')](_0x4cd4('0x15'),_0x53deec,_0x261638[_0x4cd4('0x19')][_0x4cd4('0x1a')]);return _0x314812(_0x261638[_0x4cd4('0x19')][_0x4cd4('0x1a')]);}logger['error'](_0x4cd4('0x15'),_0x53deec,_0x261638[_0x4cd4('0x19')][_0x4cd4('0x1a')]);return _0x2bf113(_0x261638[_0x4cd4('0x19')][_0x4cd4('0x1a')]);}else{logger[_0x4cd4('0x14')](_0x4cd4('0x15'),_0x53deec,_0x4cd4('0x17'));_0x2bf113(_0x261638[_0x4cd4('0x1b')][_0x4cd4('0x1a')]);}})[_0x4cd4('0x1c')](function(_0x573181){logger[_0x4cd4('0x19')](_0x4cd4('0x15'),_0x53deec,_0x573181);_0x314812(_0x573181);});});}