Built motion from commit bbec7235.|2.6.20
[motion2.git] / server / api / dashboard / dashboard.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 _0x903f=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','request','then','info','request\x20sent','debug','stringify','code','error','Dashboard,\x20%s,\x20%s','message','result'];(function(_0x344128,_0x9b9e88){var _0x693fae=function(_0x3e2b2e){while(--_0x3e2b2e){_0x344128['push'](_0x344128['shift']());}};_0x693fae(++_0x9b9e88);}(_0x903f,0x197));var _0xf903=function(_0x3913d5,_0x2f7f8d){_0x3913d5=_0x3913d5-0x0;var _0x3bb52e=_0x903f[_0x3913d5];return _0x3bb52e;};'use strict';var _=require(_0xf903('0x0'));var util=require(_0xf903('0x1'));var moment=require(_0xf903('0x2'));var BPromise=require(_0xf903('0x3'));var rs=require(_0xf903('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf903('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf903('0x6'))(_0xf903('0x7'));var config=require(_0xf903('0x8'));var jayson=require(_0xf903('0x9'));var client=jayson[_0xf903('0xa')][_0xf903('0xb')]({'port':0x232a});config[_0xf903('0xc')]=_[_0xf903('0xd')](config[_0xf903('0xc')],{'host':_0xf903('0xe'),'port':0x18eb});var socket=require(_0xf903('0xf'))(new Redis(config[_0xf903('0xc')]));require(_0xf903('0x10'))['register'](socket);function respondWithRpcPromise(_0x5f5d60,_0x39a1a1,_0xebd10){return new BPromise(function(_0x23dcb0,_0x39ba04){return client[_0xf903('0x11')](_0x5f5d60,_0xebd10)[_0xf903('0x12')](function(_0xe420e9){logger[_0xf903('0x13')]('Dashboard,\x20%s,\x20%s',_0x39a1a1,_0xf903('0x14'));logger[_0xf903('0x15')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x39a1a1,_0xf903('0x14'),JSON[_0xf903('0x16')](_0xe420e9));if(_0xe420e9['error']){if(_0xe420e9['error'][_0xf903('0x17')]===0x1f4){logger[_0xf903('0x18')](_0xf903('0x19'),_0x39a1a1,_0xe420e9[_0xf903('0x18')][_0xf903('0x1a')]);return _0x39ba04(_0xe420e9[_0xf903('0x18')][_0xf903('0x1a')]);}logger['error']('Dashboard,\x20%s,\x20%s',_0x39a1a1,_0xe420e9[_0xf903('0x18')][_0xf903('0x1a')]);return _0x23dcb0(_0xe420e9['error'][_0xf903('0x1a')]);}else{logger[_0xf903('0x13')](_0xf903('0x19'),_0x39a1a1,'request\x20sent');_0x23dcb0(_0xe420e9[_0xf903('0x1b')][_0xf903('0x1a')]);}})[_0xf903('0x1c')](function(_0x2253a3){logger[_0xf903('0x18')](_0xf903('0x19'),_0x39a1a1,_0x2253a3);_0x39ba04(_0x2253a3);});});}