Built motion from commit fe909640.|2.6.8
[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 _0x9e0f=['Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x39b4ce,_0xf4a169){var _0x99b024=function(_0x1ad6aa){while(--_0x1ad6aa){_0x39b4ce['push'](_0x39b4ce['shift']());}};_0x99b024(++_0xf4a169);}(_0x9e0f,0x115));var _0xf9e0=function(_0x58e4a4,_0xfc0742){_0x58e4a4=_0x58e4a4-0x0;var _0x580654=_0x9e0f[_0x58e4a4];return _0x580654;};'use strict';var _=require(_0xf9e0('0x0'));var util=require(_0xf9e0('0x1'));var moment=require(_0xf9e0('0x2'));var BPromise=require('bluebird');var rs=require(_0xf9e0('0x3'));var fs=require('fs');var Redis=require(_0xf9e0('0x4'));var db=require(_0xf9e0('0x5'))['db'];var utils=require(_0xf9e0('0x6'));var logger=require(_0xf9e0('0x7'))(_0xf9e0('0x8'));var config=require(_0xf9e0('0x9'));var jayson=require(_0xf9e0('0xa'));var client=jayson[_0xf9e0('0xb')][_0xf9e0('0xc')]({'port':0x232a});config['redis']=_[_0xf9e0('0xd')](config[_0xf9e0('0xe')],{'host':_0xf9e0('0xf'),'port':0x18eb});var socket=require(_0xf9e0('0x10'))(new Redis(config[_0xf9e0('0xe')]));require('./dashboard.socket')['register'](socket);function respondWithRpcPromise(_0x224251,_0x2e8f67,_0x1bcda9){return new BPromise(function(_0x55a9f2,_0x3b1ec7){return client[_0xf9e0('0x11')](_0x224251,_0x1bcda9)[_0xf9e0('0x12')](function(_0x4c5fb4){logger[_0xf9e0('0x13')](_0xf9e0('0x14'),_0x2e8f67,_0xf9e0('0x15'));logger[_0xf9e0('0x16')](_0xf9e0('0x17'),_0x2e8f67,_0xf9e0('0x15'),JSON[_0xf9e0('0x18')](_0x4c5fb4));if(_0x4c5fb4[_0xf9e0('0x19')]){if(_0x4c5fb4[_0xf9e0('0x19')][_0xf9e0('0x1a')]===0x1f4){logger[_0xf9e0('0x19')](_0xf9e0('0x14'),_0x2e8f67,_0x4c5fb4[_0xf9e0('0x19')][_0xf9e0('0x1b')]);return _0x3b1ec7(_0x4c5fb4[_0xf9e0('0x19')][_0xf9e0('0x1b')]);}logger[_0xf9e0('0x19')](_0xf9e0('0x14'),_0x2e8f67,_0x4c5fb4['error']['message']);return _0x55a9f2(_0x4c5fb4['error'][_0xf9e0('0x1b')]);}else{logger[_0xf9e0('0x13')](_0xf9e0('0x14'),_0x2e8f67,_0xf9e0('0x15'));_0x55a9f2(_0x4c5fb4[_0xf9e0('0x1c')][_0xf9e0('0x1b')]);}})[_0xf9e0('0x1d')](function(_0x494eaa){logger[_0xf9e0('0x19')](_0xf9e0('0x14'),_0x2e8f67,_0x494eaa);_0x3b1ec7(_0x494eaa);});});}