Built motion from commit 9e1ec266.|2.6.28
[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 _0x995c=['bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./dashboardItem.socket','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util'];(function(_0x3297b8,_0x17ce35){var _0x2066de=function(_0x4750c3){while(--_0x4750c3){_0x3297b8['push'](_0x3297b8['shift']());}};_0x2066de(++_0x17ce35);}(_0x995c,0x142));var _0xc995=function(_0x5d0980,_0x26474b){_0x5d0980=_0x5d0980-0x0;var _0x3d6318=_0x995c[_0x5d0980];return _0x3d6318;};'use strict';var _=require(_0xc995('0x0'));var util=require(_0xc995('0x1'));var moment=require('moment');var BPromise=require(_0xc995('0x2'));var rs=require(_0xc995('0x3'));var fs=require('fs');var Redis=require(_0xc995('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xc995('0x5'))(_0xc995('0x6'));var config=require(_0xc995('0x7'));var jayson=require(_0xc995('0x8'));var client=jayson[_0xc995('0x9')][_0xc995('0xa')]({'port':0x232a});config[_0xc995('0xb')]=_[_0xc995('0xc')](config[_0xc995('0xb')],{'host':_0xc995('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc995('0xb')]));require(_0xc995('0xe'))['register'](socket);function respondWithRpcPromise(_0x4ce1d5,_0x247f63,_0x3a901a){return new BPromise(function(_0xc8b03a,_0x4567f7){return client[_0xc995('0xf')](_0x4ce1d5,_0x3a901a)[_0xc995('0x10')](function(_0x50ed4d){logger['info'](_0xc995('0x11'),_0x247f63,_0xc995('0x12'));logger[_0xc995('0x13')](_0xc995('0x14'),_0x247f63,_0xc995('0x12'),JSON[_0xc995('0x15')](_0x50ed4d));if(_0x50ed4d[_0xc995('0x16')]){if(_0x50ed4d[_0xc995('0x16')][_0xc995('0x17')]===0x1f4){logger[_0xc995('0x16')](_0xc995('0x11'),_0x247f63,_0x50ed4d[_0xc995('0x16')][_0xc995('0x18')]);return _0x4567f7(_0x50ed4d[_0xc995('0x16')][_0xc995('0x18')]);}logger[_0xc995('0x16')](_0xc995('0x11'),_0x247f63,_0x50ed4d[_0xc995('0x16')][_0xc995('0x18')]);return _0xc8b03a(_0x50ed4d[_0xc995('0x16')]['message']);}else{logger['info'](_0xc995('0x11'),_0x247f63,_0xc995('0x12'));_0xc8b03a(_0x50ed4d[_0xc995('0x19')][_0xc995('0x18')]);}})[_0xc995('0x1a')](function(_0x2ca40b){logger[_0xc995('0x16')](_0xc995('0x11'),_0x247f63,_0x2ca40b);_0x4567f7(_0x2ca40b);});});}