Built motion from commit (unavailable).|2.5.14
[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 _0xa87a=['then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','socket.io-emitter','register','request'];(function(_0x4bd3e5,_0x211303){var _0x39fa28=function(_0x102ab2){while(--_0x102ab2){_0x4bd3e5['push'](_0x4bd3e5['shift']());}};_0x39fa28(++_0x211303);}(_0xa87a,0x1e6));var _0xaa87=function(_0x30faec,_0x18940b){_0x30faec=_0x30faec-0x0;var _0x29484f=_0xa87a[_0x30faec];return _0x29484f;};'use strict';var _=require(_0xaa87('0x0'));var util=require('util');var moment=require(_0xaa87('0x1'));var BPromise=require(_0xaa87('0x2'));var rs=require(_0xaa87('0x3'));var fs=require('fs');var Redis=require(_0xaa87('0x4'));var db=require(_0xaa87('0x5'))['db'];var utils=require(_0xaa87('0x6'));var logger=require('../../config/logger')(_0xaa87('0x7'));var config=require(_0xaa87('0x8'));var jayson=require(_0xaa87('0x9'));var client=jayson[_0xaa87('0xa')][_0xaa87('0xb')]({'port':0x232a});config['redis']=_[_0xaa87('0xc')](config[_0xaa87('0xd')],{'host':_0xaa87('0xe'),'port':0x18eb});var socket=require(_0xaa87('0xf'))(new Redis(config[_0xaa87('0xd')]));require('./dashboard.socket')[_0xaa87('0x10')](socket);function respondWithRpcPromise(_0x54cf9d,_0x4ffbe5,_0x231ca5){return new BPromise(function(_0x221391,_0xbe713d){return client[_0xaa87('0x11')](_0x54cf9d,_0x231ca5)[_0xaa87('0x12')](function(_0x47ab2d){logger[_0xaa87('0x13')](_0xaa87('0x14'),_0x4ffbe5,_0xaa87('0x15'));logger[_0xaa87('0x16')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x4ffbe5,'request\x20sent',JSON[_0xaa87('0x17')](_0x47ab2d));if(_0x47ab2d[_0xaa87('0x18')]){if(_0x47ab2d[_0xaa87('0x18')][_0xaa87('0x19')]===0x1f4){logger['error'](_0xaa87('0x14'),_0x4ffbe5,_0x47ab2d[_0xaa87('0x18')][_0xaa87('0x1a')]);return _0xbe713d(_0x47ab2d[_0xaa87('0x18')]['message']);}logger['error']('Dashboard,\x20%s,\x20%s',_0x4ffbe5,_0x47ab2d[_0xaa87('0x18')][_0xaa87('0x1a')]);return _0x221391(_0x47ab2d['error']['message']);}else{logger[_0xaa87('0x13')](_0xaa87('0x14'),_0x4ffbe5,_0xaa87('0x15'));_0x221391(_0x47ab2d[_0xaa87('0x1b')][_0xaa87('0x1a')]);}})['catch'](function(_0x5564d0){logger[_0xaa87('0x18')]('Dashboard,\x20%s,\x20%s',_0x4ffbe5,_0x5564d0);_0xbe713d(_0x5564d0);});});}