Built motion from commit (unavailable).|2.5.6
[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 _0x33d1=['util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./dashboard.socket','register','request','then','info','request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','Dashboard,\x20%s,\x20%s','message','result'];(function(_0x1fee8d,_0x3d5f91){var _0x32adf9=function(_0x55b2ed){while(--_0x55b2ed){_0x1fee8d['push'](_0x1fee8d['shift']());}};_0x32adf9(++_0x3d5f91);}(_0x33d1,0x16c));var _0x133d=function(_0xdde9ff,_0x4b24ff){_0xdde9ff=_0xdde9ff-0x0;var _0x5b4b63=_0x33d1[_0xdde9ff];return _0x5b4b63;};'use strict';var _=require('lodash');var util=require(_0x133d('0x0'));var moment=require('moment');var BPromise=require(_0x133d('0x1'));var rs=require(_0x133d('0x2'));var fs=require('fs');var Redis=require(_0x133d('0x3'));var db=require(_0x133d('0x4'))['db'];var utils=require(_0x133d('0x5'));var logger=require(_0x133d('0x6'))(_0x133d('0x7'));var config=require(_0x133d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x133d('0x9')][_0x133d('0xa')]({'port':0x232a});config[_0x133d('0xb')]=_[_0x133d('0xc')](config[_0x133d('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x133d('0xd'))(new Redis(config[_0x133d('0xb')]));require(_0x133d('0xe'))[_0x133d('0xf')](socket);function respondWithRpcPromise(_0x466513,_0x14c769,_0x1a5e19){return new BPromise(function(_0x1d13ac,_0x3f1c0a){return client[_0x133d('0x10')](_0x466513,_0x1a5e19)[_0x133d('0x11')](function(_0x54c9fd){logger[_0x133d('0x12')]('Dashboard,\x20%s,\x20%s',_0x14c769,_0x133d('0x13'));logger['debug'](_0x133d('0x14'),_0x14c769,_0x133d('0x13'),JSON[_0x133d('0x15')](_0x54c9fd));if(_0x54c9fd['error']){if(_0x54c9fd[_0x133d('0x16')]['code']===0x1f4){logger[_0x133d('0x16')](_0x133d('0x17'),_0x14c769,_0x54c9fd['error'][_0x133d('0x18')]);return _0x3f1c0a(_0x54c9fd[_0x133d('0x16')][_0x133d('0x18')]);}logger[_0x133d('0x16')]('Dashboard,\x20%s,\x20%s',_0x14c769,_0x54c9fd['error'][_0x133d('0x18')]);return _0x1d13ac(_0x54c9fd['error'][_0x133d('0x18')]);}else{logger[_0x133d('0x12')]('Dashboard,\x20%s,\x20%s',_0x14c769,_0x133d('0x13'));_0x1d13ac(_0x54c9fd[_0x133d('0x19')][_0x133d('0x18')]);}})['catch'](function(_0x2e8922){logger[_0x133d('0x16')](_0x133d('0x17'),_0x14c769,_0x2e8922);_0x3f1c0a(_0x2e8922);});});}