Built motion from commit 911eb874.|2.6.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 _0xcd6a=['register','then','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','redis','localhost'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0xcd6a,0xcc));var _0xacd6=function(_0x53f6dc,_0x23354e){_0x53f6dc=_0x53f6dc-0x0;var _0x3f4df1=_0xcd6a[_0x53f6dc];return _0x3f4df1;};'use strict';var _=require(_0xacd6('0x0'));var util=require('util');var moment=require(_0xacd6('0x1'));var BPromise=require('bluebird');var rs=require(_0xacd6('0x2'));var fs=require('fs');var Redis=require(_0xacd6('0x3'));var db=require(_0xacd6('0x4'))['db'];var utils=require(_0xacd6('0x5'));var logger=require(_0xacd6('0x6'))('rpc');var config=require(_0xacd6('0x7'));var jayson=require(_0xacd6('0x8'));var client=jayson[_0xacd6('0x9')]['http']({'port':0x232a});config[_0xacd6('0xa')]=_['defaults'](config[_0xacd6('0xa')],{'host':_0xacd6('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xacd6('0xa')]));require('./dashboardItem.socket')[_0xacd6('0xc')](socket);function respondWithRpcPromise(_0x18175a,_0x329328,_0x207886){return new BPromise(function(_0x3de701,_0x542460){return client['request'](_0x18175a,_0x207886)[_0xacd6('0xd')](function(_0x55b72a){logger['info'](_0xacd6('0xe'),_0x329328,_0xacd6('0xf'));logger[_0xacd6('0x10')](_0xacd6('0x11'),_0x329328,_0xacd6('0xf'),JSON['stringify'](_0x55b72a));if(_0x55b72a[_0xacd6('0x12')]){if(_0x55b72a['error'][_0xacd6('0x13')]===0x1f4){logger[_0xacd6('0x12')](_0xacd6('0xe'),_0x329328,_0x55b72a[_0xacd6('0x12')]['message']);return _0x542460(_0x55b72a[_0xacd6('0x12')][_0xacd6('0x14')]);}logger[_0xacd6('0x12')]('DashboardItem,\x20%s,\x20%s',_0x329328,_0x55b72a[_0xacd6('0x12')][_0xacd6('0x14')]);return _0x3de701(_0x55b72a[_0xacd6('0x12')][_0xacd6('0x14')]);}else{logger[_0xacd6('0x15')]('DashboardItem,\x20%s,\x20%s',_0x329328,_0xacd6('0xf'));_0x3de701(_0x55b72a[_0xacd6('0x16')][_0xacd6('0x14')]);}})[_0xacd6('0x17')](function(_0x27e9b6){logger[_0xacd6('0x12')](_0xacd6('0xe'),_0x329328,_0x27e9b6);_0x542460(_0x27e9b6);});});}