Built motion from commit (unavailable).|2.5.31
[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 _0x702b=['randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','register','request','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','util','moment','bluebird'];(function(_0x67754c,_0x4ee2c1){var _0x1f09ec=function(_0x255080){while(--_0x255080){_0x67754c['push'](_0x67754c['shift']());}};_0x1f09ec(++_0x4ee2c1);}(_0x702b,0x1d1));var _0xb702=function(_0x5dda55,_0x3c9da0){_0x5dda55=_0x5dda55-0x0;var _0x5709e9=_0x702b[_0x5dda55];return _0x5709e9;};'use strict';var _=require('lodash');var util=require(_0xb702('0x0'));var moment=require(_0xb702('0x1'));var BPromise=require(_0xb702('0x2'));var rs=require(_0xb702('0x3'));var fs=require('fs');var Redis=require(_0xb702('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb702('0x5'));var logger=require('../../config/logger')(_0xb702('0x6'));var config=require(_0xb702('0x7'));var jayson=require(_0xb702('0x8'));var client=jayson['client'][_0xb702('0x9')]({'port':0x232a});config['redis']=_['defaults'](config[_0xb702('0xa')],{'host':_0xb702('0xb'),'port':0x18eb});var socket=require(_0xb702('0xc'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xb702('0xd')](socket);function respondWithRpcPromise(_0x5b299b,_0x3e2994,_0x209365){return new BPromise(function(_0x13735b,_0x55e8ff){return client[_0xb702('0xe')](_0x5b299b,_0x209365)[_0xb702('0xf')](function(_0xb2d2d0){logger[_0xb702('0x10')](_0xb702('0x11'),_0x3e2994,_0xb702('0x12'));logger[_0xb702('0x13')](_0xb702('0x14'),_0x3e2994,_0xb702('0x12'),JSON[_0xb702('0x15')](_0xb2d2d0));if(_0xb2d2d0[_0xb702('0x16')]){if(_0xb2d2d0['error'][_0xb702('0x17')]===0x1f4){logger[_0xb702('0x16')](_0xb702('0x11'),_0x3e2994,_0xb2d2d0['error']['message']);return _0x55e8ff(_0xb2d2d0[_0xb702('0x16')][_0xb702('0x18')]);}logger[_0xb702('0x16')]('DashboardItem,\x20%s,\x20%s',_0x3e2994,_0xb2d2d0[_0xb702('0x16')][_0xb702('0x18')]);return _0x13735b(_0xb2d2d0[_0xb702('0x16')][_0xb702('0x18')]);}else{logger[_0xb702('0x10')](_0xb702('0x11'),_0x3e2994,_0xb702('0x12'));_0x13735b(_0xb2d2d0['result'][_0xb702('0x18')]);}})[_0xb702('0x19')](function(_0x4a641d){logger[_0xb702('0x16')](_0xb702('0x11'),_0x3e2994,_0x4a641d);_0x55e8ff(_0x4a641d);});});}