Built motion from commit (unavailable).|2.5.6
[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 _0x5408=['info','result','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./dashboardItem.socket','register','request','then','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','code','error','DashboardItem,\x20%s,\x20%s','message'];(function(_0x12ee62,_0x1700b8){var _0x296d13=function(_0x58791d){while(--_0x58791d){_0x12ee62['push'](_0x12ee62['shift']());}};_0x296d13(++_0x1700b8);}(_0x5408,0xb1));var _0x8540=function(_0x1af1e1,_0x37bc24){_0x1af1e1=_0x1af1e1-0x0;var _0x5f3450=_0x5408[_0x1af1e1];return _0x5f3450;};'use strict';var _=require(_0x8540('0x0'));var util=require(_0x8540('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8540('0x2'));var fs=require('fs');var Redis=require(_0x8540('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8540('0x4'));var logger=require(_0x8540('0x5'))(_0x8540('0x6'));var config=require(_0x8540('0x7'));var jayson=require(_0x8540('0x8'));var client=jayson[_0x8540('0x9')][_0x8540('0xa')]({'port':0x232a});config['redis']=_[_0x8540('0xb')](config['redis'],{'host':_0x8540('0xc'),'port':0x18eb});var socket=require(_0x8540('0xd'))(new Redis(config[_0x8540('0xe')]));require(_0x8540('0xf'))[_0x8540('0x10')](socket);function respondWithRpcPromise(_0x2aab04,_0x136e6a,_0x1da459){return new BPromise(function(_0xa913a2,_0x4ba3a4){return client[_0x8540('0x11')](_0x2aab04,_0x1da459)[_0x8540('0x12')](function(_0x82b6ca){logger['info']('DashboardItem,\x20%s,\x20%s',_0x136e6a,_0x8540('0x13'));logger[_0x8540('0x14')](_0x8540('0x15'),_0x136e6a,_0x8540('0x13'),JSON['stringify'](_0x82b6ca));if(_0x82b6ca['error']){if(_0x82b6ca['error'][_0x8540('0x16')]===0x1f4){logger[_0x8540('0x17')](_0x8540('0x18'),_0x136e6a,_0x82b6ca['error'][_0x8540('0x19')]);return _0x4ba3a4(_0x82b6ca[_0x8540('0x17')][_0x8540('0x19')]);}logger[_0x8540('0x17')](_0x8540('0x18'),_0x136e6a,_0x82b6ca[_0x8540('0x17')][_0x8540('0x19')]);return _0xa913a2(_0x82b6ca['error'][_0x8540('0x19')]);}else{logger[_0x8540('0x1a')](_0x8540('0x18'),_0x136e6a,_0x8540('0x13'));_0xa913a2(_0x82b6ca[_0x8540('0x1b')][_0x8540('0x19')]);}})[_0x8540('0x1c')](function(_0x4c85dd){logger[_0x8540('0x17')]('DashboardItem,\x20%s,\x20%s',_0x136e6a,_0x4c85dd);_0x4ba3a4(_0x4c85dd);});});}