9792367078e65422195ed8bc91c91a0d2f285eb6
[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 _0x901a=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','info','Dashboard,\x20%s,\x20%s','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','lodash','util','moment'];(function(_0xb96f30,_0x1ec6a1){var _0xd8d174=function(_0x10bb33){while(--_0x10bb33){_0xb96f30['push'](_0xb96f30['shift']());}};_0xd8d174(++_0x1ec6a1);}(_0x901a,0x19d));var _0xa901=function(_0x4b039d,_0x55b356){_0x4b039d=_0x4b039d-0x0;var _0x4497ce=_0x901a[_0x4b039d];return _0x4497ce;};'use strict';var _=require(_0xa901('0x0'));var util=require(_0xa901('0x1'));var moment=require(_0xa901('0x2'));var BPromise=require(_0xa901('0x3'));var rs=require(_0xa901('0x4'));var fs=require('fs');var Redis=require(_0xa901('0x5'));var db=require(_0xa901('0x6'))['db'];var utils=require(_0xa901('0x7'));var logger=require(_0xa901('0x8'))(_0xa901('0x9'));var config=require(_0xa901('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xa901('0xb')][_0xa901('0xc')]({'port':0x232a});config[_0xa901('0xd')]=_[_0xa901('0xe')](config[_0xa901('0xd')],{'host':_0xa901('0xf'),'port':0x18eb});var socket=require(_0xa901('0x10'))(new Redis(config[_0xa901('0xd')]));require(_0xa901('0x11'))[_0xa901('0x12')](socket);function respondWithRpcPromise(_0x763676,_0x3fbc3e,_0x57cb04){return new BPromise(function(_0x505157,_0x40f21a){return client[_0xa901('0x13')](_0x763676,_0x57cb04)[_0xa901('0x14')](function(_0x5debf9){logger[_0xa901('0x15')](_0xa901('0x16'),_0x3fbc3e,'request\x20sent');logger[_0xa901('0x17')](_0xa901('0x18'),_0x3fbc3e,'request\x20sent',JSON[_0xa901('0x19')](_0x5debf9));if(_0x5debf9[_0xa901('0x1a')]){if(_0x5debf9['error'][_0xa901('0x1b')]===0x1f4){logger[_0xa901('0x1a')](_0xa901('0x16'),_0x3fbc3e,_0x5debf9[_0xa901('0x1a')][_0xa901('0x1c')]);return _0x40f21a(_0x5debf9['error'][_0xa901('0x1c')]);}logger[_0xa901('0x1a')]('Dashboard,\x20%s,\x20%s',_0x3fbc3e,_0x5debf9[_0xa901('0x1a')][_0xa901('0x1c')]);return _0x505157(_0x5debf9['error'][_0xa901('0x1c')]);}else{logger[_0xa901('0x15')](_0xa901('0x16'),_0x3fbc3e,_0xa901('0x1d'));_0x505157(_0x5debf9[_0xa901('0x1e')][_0xa901('0x1c')]);}})[_0xa901('0x1f')](function(_0xc34a0a){logger[_0xa901('0x1a')]('Dashboard,\x20%s,\x20%s',_0x3fbc3e,_0xc34a0a);_0x40f21a(_0xc34a0a);});});}