Built motion from commit (unavailable).|2.3.3
[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 _0xb19d=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x17a22b,_0x45308b){var _0x46d4e5=function(_0x1d3215){while(--_0x1d3215){_0x17a22b['push'](_0x17a22b['shift']());}};_0x46d4e5(++_0x45308b);}(_0xb19d,0xdb));var _0xdb19=function(_0x3cbe1c,_0x4bcabd){_0x3cbe1c=_0x3cbe1c-0x0;var _0x5ee08b=_0xb19d[_0x3cbe1c];return _0x5ee08b;};'use strict';var _=require(_0xdb19('0x0'));var util=require(_0xdb19('0x1'));var moment=require(_0xdb19('0x2'));var BPromise=require(_0xdb19('0x3'));var rs=require(_0xdb19('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdb19('0x5'))['db'];var utils=require(_0xdb19('0x6'));var logger=require(_0xdb19('0x7'))(_0xdb19('0x8'));var config=require('../../config/environment');var jayson=require(_0xdb19('0x9'));var client=jayson[_0xdb19('0xa')][_0xdb19('0xb')]({'port':0x232a});config[_0xdb19('0xc')]=_[_0xdb19('0xd')](config[_0xdb19('0xc')],{'host':_0xdb19('0xe'),'port':0x18eb});var socket=require(_0xdb19('0xf'))(new Redis(config['redis']));require(_0xdb19('0x10'))[_0xdb19('0x11')](socket);function respondWithRpcPromise(_0x22a45c,_0x4c4f36,_0x6ea605){return new BPromise(function(_0x2da654,_0x49163e){return client[_0xdb19('0x12')](_0x22a45c,_0x6ea605)['then'](function(_0x3ca12e){logger[_0xdb19('0x13')](_0xdb19('0x14'),_0x4c4f36,_0xdb19('0x15'));logger[_0xdb19('0x16')]('Dashboard,\x20%s,\x20%s,\x20%s',_0x4c4f36,_0xdb19('0x15'),JSON['stringify'](_0x3ca12e));if(_0x3ca12e['error']){if(_0x3ca12e[_0xdb19('0x17')][_0xdb19('0x18')]===0x1f4){logger[_0xdb19('0x17')]('Dashboard,\x20%s,\x20%s',_0x4c4f36,_0x3ca12e['error'][_0xdb19('0x19')]);return _0x49163e(_0x3ca12e['error'][_0xdb19('0x19')]);}logger[_0xdb19('0x17')](_0xdb19('0x14'),_0x4c4f36,_0x3ca12e[_0xdb19('0x17')]['message']);return _0x2da654(_0x3ca12e['error'][_0xdb19('0x19')]);}else{logger[_0xdb19('0x13')](_0xdb19('0x14'),_0x4c4f36,_0xdb19('0x15'));_0x2da654(_0x3ca12e[_0xdb19('0x1a')][_0xdb19('0x19')]);}})[_0xdb19('0x1b')](function(_0x153f52){logger[_0xdb19('0x17')]('Dashboard,\x20%s,\x20%s',_0x4c4f36,_0x153f52);_0x49163e(_0x153f52);});});}