Built motion from commit (unavailable).|2.4.2
[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 _0xb773=['./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter'];(function(_0x41d02a,_0x355e19){var _0x4c3983=function(_0x4802a7){while(--_0x4802a7){_0x41d02a['push'](_0x41d02a['shift']());}};_0x4c3983(++_0x355e19);}(_0xb773,0x14e));var _0x3b77=function(_0x5a77fb,_0x2d2d59){_0x5a77fb=_0x5a77fb-0x0;var _0x6ca4fb=_0xb773[_0x5a77fb];return _0x6ca4fb;};'use strict';var _=require(_0x3b77('0x0'));var util=require(_0x3b77('0x1'));var moment=require(_0x3b77('0x2'));var BPromise=require(_0x3b77('0x3'));var rs=require(_0x3b77('0x4'));var fs=require('fs');var Redis=require(_0x3b77('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3b77('0x6'));var config=require(_0x3b77('0x7'));var jayson=require(_0x3b77('0x8'));var client=jayson[_0x3b77('0x9')]['http']({'port':0x232a});config[_0x3b77('0xa')]=_[_0x3b77('0xb')](config[_0x3b77('0xa')],{'host':_0x3b77('0xc'),'port':0x18eb});var socket=require(_0x3b77('0xd'))(new Redis(config[_0x3b77('0xa')]));require(_0x3b77('0xe'))[_0x3b77('0xf')](socket);function respondWithRpcPromise(_0x1ad43e,_0x11fade,_0x1261c8){return new BPromise(function(_0x1b309a,_0x28bb78){return client[_0x3b77('0x10')](_0x1ad43e,_0x1261c8)[_0x3b77('0x11')](function(_0xe4748c){logger['info'](_0x3b77('0x12'),_0x11fade,_0x3b77('0x13'));logger[_0x3b77('0x14')](_0x3b77('0x15'),_0x11fade,_0x3b77('0x13'),JSON[_0x3b77('0x16')](_0xe4748c));if(_0xe4748c['error']){if(_0xe4748c[_0x3b77('0x17')][_0x3b77('0x18')]===0x1f4){logger[_0x3b77('0x17')](_0x3b77('0x12'),_0x11fade,_0xe4748c['error'][_0x3b77('0x19')]);return _0x28bb78(_0xe4748c[_0x3b77('0x17')]['message']);}logger[_0x3b77('0x17')](_0x3b77('0x12'),_0x11fade,_0xe4748c['error'][_0x3b77('0x19')]);return _0x1b309a(_0xe4748c[_0x3b77('0x17')][_0x3b77('0x19')]);}else{logger[_0x3b77('0x1a')](_0x3b77('0x12'),_0x11fade,_0x3b77('0x13'));_0x1b309a(_0xe4748c[_0x3b77('0x1b')][_0x3b77('0x19')]);}})[_0x3b77('0x1c')](function(_0x4b5f64){logger[_0x3b77('0x17')](_0x3b77('0x12'),_0x11fade,_0x4b5f64);_0x28bb78(_0x4b5f64);});});}