Built motion from commit (unavailable).|2.2.0
[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 _0xfc52=['request\x20sent','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','Dashboard,\x20%s,\x20%s','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./dashboard.socket','register','request','then','info'];(function(_0x7fddc0,_0x551146){var _0x3a41b6=function(_0x28736d){while(--_0x28736d){_0x7fddc0['push'](_0x7fddc0['shift']());}};_0x3a41b6(++_0x551146);}(_0xfc52,0x132));var _0x2fc5=function(_0x36f82a,_0x4ec395){_0x36f82a=_0x36f82a-0x0;var _0x495067=_0xfc52[_0x36f82a];return _0x495067;};'use strict';var _=require(_0x2fc5('0x0'));var util=require(_0x2fc5('0x1'));var moment=require(_0x2fc5('0x2'));var BPromise=require('bluebird');var rs=require(_0x2fc5('0x3'));var fs=require('fs');var Redis=require(_0x2fc5('0x4'));var db=require(_0x2fc5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x2fc5('0x6'))(_0x2fc5('0x7'));var config=require(_0x2fc5('0x8'));var jayson=require(_0x2fc5('0x9'));var client=jayson['client'][_0x2fc5('0xa')]({'port':0x232a});config[_0x2fc5('0xb')]=_['defaults'](config[_0x2fc5('0xb')],{'host':'localhost','port':0x18eb});var socket=require(_0x2fc5('0xc'))(new Redis(config[_0x2fc5('0xb')]));require(_0x2fc5('0xd'))[_0x2fc5('0xe')](socket);function respondWithRpcPromise(_0x55bfaf,_0x55ce30,_0x54ef9d){return new BPromise(function(_0x2a45f1,_0x5a8768){return client[_0x2fc5('0xf')](_0x55bfaf,_0x54ef9d)[_0x2fc5('0x10')](function(_0x3c6456){logger[_0x2fc5('0x11')]('Dashboard,\x20%s,\x20%s',_0x55ce30,_0x2fc5('0x12'));logger['debug'](_0x2fc5('0x13'),_0x55ce30,_0x2fc5('0x12'),JSON[_0x2fc5('0x14')](_0x3c6456));if(_0x3c6456['error']){if(_0x3c6456[_0x2fc5('0x15')][_0x2fc5('0x16')]===0x1f4){logger['error'](_0x2fc5('0x17'),_0x55ce30,_0x3c6456[_0x2fc5('0x15')][_0x2fc5('0x18')]);return _0x5a8768(_0x3c6456[_0x2fc5('0x15')][_0x2fc5('0x18')]);}logger[_0x2fc5('0x15')]('Dashboard,\x20%s,\x20%s',_0x55ce30,_0x3c6456[_0x2fc5('0x15')][_0x2fc5('0x18')]);return _0x2a45f1(_0x3c6456['error'][_0x2fc5('0x18')]);}else{logger[_0x2fc5('0x11')](_0x2fc5('0x17'),_0x55ce30,_0x2fc5('0x12'));_0x2a45f1(_0x3c6456[_0x2fc5('0x19')]['message']);}})[_0x2fc5('0x1a')](function(_0x27dd85){logger[_0x2fc5('0x15')](_0x2fc5('0x17'),_0x55ce30,_0x27dd85);_0x5a8768(_0x27dd85);});});}