Built motion from commit 87cd5f02.|2.5.48
[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 _0x9986=['lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','request','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch'];(function(_0x1b8f38,_0x91ac9){var _0x3eed01=function(_0x1e7a8a){while(--_0x1e7a8a){_0x1b8f38['push'](_0x1b8f38['shift']());}};_0x3eed01(++_0x91ac9);}(_0x9986,0x10e));var _0x6998=function(_0x418ca0,_0x2a51cf){_0x418ca0=_0x418ca0-0x0;var _0x366e80=_0x9986[_0x418ca0];return _0x366e80;};'use strict';var _=require(_0x6998('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x6998('0x1'));var rs=require(_0x6998('0x2'));var fs=require('fs');var Redis=require(_0x6998('0x3'));var db=require(_0x6998('0x4'))['db'];var utils=require(_0x6998('0x5'));var logger=require(_0x6998('0x6'))(_0x6998('0x7'));var config=require(_0x6998('0x8'));var jayson=require(_0x6998('0x9'));var client=jayson[_0x6998('0xa')][_0x6998('0xb')]({'port':0x232a});config[_0x6998('0xc')]=_[_0x6998('0xd')](config[_0x6998('0xc')],{'host':_0x6998('0xe'),'port':0x18eb});var socket=require(_0x6998('0xf'))(new Redis(config[_0x6998('0xc')]));require(_0x6998('0x10'))[_0x6998('0x11')](socket);function respondWithRpcPromise(_0x4241f1,_0x1edf90,_0x3cb23a){return new BPromise(function(_0x43f613,_0x18f821){return client[_0x6998('0x12')](_0x4241f1,_0x3cb23a)[_0x6998('0x13')](function(_0x4d15c1){logger['info'](_0x6998('0x14'),_0x1edf90,_0x6998('0x15'));logger[_0x6998('0x16')](_0x6998('0x17'),_0x1edf90,_0x6998('0x15'),JSON['stringify'](_0x4d15c1));if(_0x4d15c1[_0x6998('0x18')]){if(_0x4d15c1[_0x6998('0x18')][_0x6998('0x19')]===0x1f4){logger[_0x6998('0x18')]('DashboardItem,\x20%s,\x20%s',_0x1edf90,_0x4d15c1[_0x6998('0x18')][_0x6998('0x1a')]);return _0x18f821(_0x4d15c1[_0x6998('0x18')]['message']);}logger['error'](_0x6998('0x14'),_0x1edf90,_0x4d15c1[_0x6998('0x18')][_0x6998('0x1a')]);return _0x43f613(_0x4d15c1[_0x6998('0x18')]['message']);}else{logger[_0x6998('0x1b')](_0x6998('0x14'),_0x1edf90,_0x6998('0x15'));_0x43f613(_0x4d15c1[_0x6998('0x1c')][_0x6998('0x1a')]);}})[_0x6998('0x1d')](function(_0x12c17d){logger[_0x6998('0x18')]('DashboardItem,\x20%s,\x20%s',_0x1edf90,_0x12c17d);_0x18f821(_0x12c17d);});});}