Built motion from commit (unavailable).|2.4.18
[motion2.git] / server / api / dashboardItem / dashboardItem.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 _0xe7db=['rpc','../../config/environment','client','http','redis','defaults','./dashboardItem.socket','register','then','info','DashboardItem,\x20%s,\x20%s','request\x20sent','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger'];(function(_0x432245,_0xe78678){var _0x5e3c4e=function(_0x39d6be){while(--_0x39d6be){_0x432245['push'](_0x432245['shift']());}};_0x5e3c4e(++_0xe78678);}(_0xe7db,0x117));var _0xbe7d=function(_0xca04ff,_0xcb449f){_0xca04ff=_0xca04ff-0x0;var _0x6b547=_0xe7db[_0xca04ff];return _0x6b547;};'use strict';var _=require(_0xbe7d('0x0'));var util=require(_0xbe7d('0x1'));var moment=require(_0xbe7d('0x2'));var BPromise=require(_0xbe7d('0x3'));var rs=require(_0xbe7d('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbe7d('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xbe7d('0x6'))(_0xbe7d('0x7'));var config=require(_0xbe7d('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xbe7d('0x9')][_0xbe7d('0xa')]({'port':0x232a});config[_0xbe7d('0xb')]=_[_0xbe7d('0xc')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbe7d('0xb')]));require(_0xbe7d('0xd'))[_0xbe7d('0xe')](socket);function respondWithRpcPromise(_0x5c7401,_0x4df6b0,_0x413c68){return new BPromise(function(_0x7fd4d8,_0x4720aa){return client['request'](_0x5c7401,_0x413c68)[_0xbe7d('0xf')](function(_0x309e0d){logger[_0xbe7d('0x10')](_0xbe7d('0x11'),_0x4df6b0,_0xbe7d('0x12'));logger[_0xbe7d('0x13')](_0xbe7d('0x14'),_0x4df6b0,_0xbe7d('0x12'),JSON[_0xbe7d('0x15')](_0x309e0d));if(_0x309e0d[_0xbe7d('0x16')]){if(_0x309e0d[_0xbe7d('0x16')][_0xbe7d('0x17')]===0x1f4){logger['error'](_0xbe7d('0x11'),_0x4df6b0,_0x309e0d[_0xbe7d('0x16')][_0xbe7d('0x18')]);return _0x4720aa(_0x309e0d['error']['message']);}logger['error'](_0xbe7d('0x11'),_0x4df6b0,_0x309e0d[_0xbe7d('0x16')][_0xbe7d('0x18')]);return _0x7fd4d8(_0x309e0d[_0xbe7d('0x16')][_0xbe7d('0x18')]);}else{logger[_0xbe7d('0x10')]('DashboardItem,\x20%s,\x20%s',_0x4df6b0,_0xbe7d('0x12'));_0x7fd4d8(_0x309e0d[_0xbe7d('0x19')]['message']);}})['catch'](function(_0x55053a){logger['error'](_0xbe7d('0x11'),_0x4df6b0,_0x55053a);_0x4720aa(_0x55053a);});});}