Built motion from commit (unavailable).|2.4.20
[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 _0x9ce5=['then','request\x20sent','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error','message','DashboardItem,\x20%s,\x20%s','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0x9ce5,0xb2));var _0x59ce=function(_0x45d1fd,_0x463212){_0x45d1fd=_0x45d1fd-0x0;var _0xd0e542=_0x9ce5[_0x45d1fd];return _0xd0e542;};'use strict';var _=require(_0x59ce('0x0'));var util=require(_0x59ce('0x1'));var moment=require(_0x59ce('0x2'));var BPromise=require(_0x59ce('0x3'));var rs=require(_0x59ce('0x4'));var fs=require('fs');var Redis=require(_0x59ce('0x5'));var db=require(_0x59ce('0x6'))['db'];var utils=require(_0x59ce('0x7'));var logger=require('../../config/logger')(_0x59ce('0x8'));var config=require(_0x59ce('0x9'));var jayson=require(_0x59ce('0xa'));var client=jayson['client'][_0x59ce('0xb')]({'port':0x232a});config[_0x59ce('0xc')]=_[_0x59ce('0xd')](config[_0x59ce('0xc')],{'host':_0x59ce('0xe'),'port':0x18eb});var socket=require(_0x59ce('0xf'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0x59ce('0x10')](socket);function respondWithRpcPromise(_0x26a38e,_0x30a6bb,_0x53e511){return new BPromise(function(_0x1b4f48,_0x577e00){return client[_0x59ce('0x11')](_0x26a38e,_0x53e511)[_0x59ce('0x12')](function(_0x28811b){logger['info']('DashboardItem,\x20%s,\x20%s',_0x30a6bb,_0x59ce('0x13'));logger['debug'](_0x59ce('0x14'),_0x30a6bb,_0x59ce('0x13'),JSON[_0x59ce('0x15')](_0x28811b));if(_0x28811b[_0x59ce('0x16')]){if(_0x28811b[_0x59ce('0x16')]['code']===0x1f4){logger[_0x59ce('0x16')]('DashboardItem,\x20%s,\x20%s',_0x30a6bb,_0x28811b[_0x59ce('0x16')][_0x59ce('0x17')]);return _0x577e00(_0x28811b['error']['message']);}logger[_0x59ce('0x16')](_0x59ce('0x18'),_0x30a6bb,_0x28811b[_0x59ce('0x16')][_0x59ce('0x17')]);return _0x1b4f48(_0x28811b['error']['message']);}else{logger[_0x59ce('0x19')]('DashboardItem,\x20%s,\x20%s',_0x30a6bb,_0x59ce('0x13'));_0x1b4f48(_0x28811b[_0x59ce('0x1a')]['message']);}})[_0x59ce('0x1b')](function(_0x51f71a){logger[_0x59ce('0x16')](_0x59ce('0x18'),_0x30a6bb,_0x51f71a);_0x577e00(_0x51f71a);});});}