Built motion from commit (unavailable).|2.4.17
[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 _0x1096=['DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','http','defaults','redis','localhost','request','then','info'];(function(_0x4c46d6,_0x3d6ae6){var _0x50189b=function(_0x357c34){while(--_0x357c34){_0x4c46d6['push'](_0x4c46d6['shift']());}};_0x50189b(++_0x3d6ae6);}(_0x1096,0xb9));var _0x6109=function(_0x492df6,_0x1b87e3){_0x492df6=_0x492df6-0x0;var _0x173489=_0x1096[_0x492df6];return _0x173489;};'use strict';var _=require(_0x6109('0x0'));var util=require('util');var moment=require(_0x6109('0x1'));var BPromise=require('bluebird');var rs=require(_0x6109('0x2'));var fs=require('fs');var Redis=require(_0x6109('0x3'));var db=require(_0x6109('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6109('0x5'))(_0x6109('0x6'));var config=require('../../config/environment');var jayson=require(_0x6109('0x7'));var client=jayson['client'][_0x6109('0x8')]({'port':0x232a});config['redis']=_[_0x6109('0x9')](config[_0x6109('0xa')],{'host':_0x6109('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x6109('0xa')]));require('./dashboardItem.socket')['register'](socket);function respondWithRpcPromise(_0x28b3e7,_0x1bbd77,_0x359549){return new BPromise(function(_0x2e17b6,_0x339da6){return client[_0x6109('0xc')](_0x28b3e7,_0x359549)[_0x6109('0xd')](function(_0x2fe665){logger[_0x6109('0xe')](_0x6109('0xf'),_0x1bbd77,'request\x20sent');logger[_0x6109('0x10')](_0x6109('0x11'),_0x1bbd77,_0x6109('0x12'),JSON[_0x6109('0x13')](_0x2fe665));if(_0x2fe665[_0x6109('0x14')]){if(_0x2fe665[_0x6109('0x14')][_0x6109('0x15')]===0x1f4){logger[_0x6109('0x14')](_0x6109('0xf'),_0x1bbd77,_0x2fe665['error'][_0x6109('0x16')]);return _0x339da6(_0x2fe665['error'][_0x6109('0x16')]);}logger[_0x6109('0x14')](_0x6109('0xf'),_0x1bbd77,_0x2fe665[_0x6109('0x14')][_0x6109('0x16')]);return _0x2e17b6(_0x2fe665['error'][_0x6109('0x16')]);}else{logger[_0x6109('0xe')](_0x6109('0xf'),_0x1bbd77,_0x6109('0x12'));_0x2e17b6(_0x2fe665[_0x6109('0x17')][_0x6109('0x16')]);}})[_0x6109('0x18')](function(_0x548b6b){logger[_0x6109('0x14')]('DashboardItem,\x20%s,\x20%s',_0x1bbd77,_0x548b6b);_0x339da6(_0x548b6b);});});}