Built motion from commit (unavailable).|2.5.4
[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 _0x4b28=['message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboardItem.socket','register','then','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4b28,0x1c3));var _0x84b2=function(_0x30b0b1,_0x22c5bb){_0x30b0b1=_0x30b0b1-0x0;var _0x20571b=_0x4b28[_0x30b0b1];return _0x20571b;};'use strict';var _=require(_0x84b2('0x0'));var util=require(_0x84b2('0x1'));var moment=require(_0x84b2('0x2'));var BPromise=require(_0x84b2('0x3'));var rs=require(_0x84b2('0x4'));var fs=require('fs');var Redis=require(_0x84b2('0x5'));var db=require(_0x84b2('0x6'))['db'];var utils=require(_0x84b2('0x7'));var logger=require(_0x84b2('0x8'))(_0x84b2('0x9'));var config=require('../../config/environment');var jayson=require(_0x84b2('0xa'));var client=jayson[_0x84b2('0xb')][_0x84b2('0xc')]({'port':0x232a});config[_0x84b2('0xd')]=_[_0x84b2('0xe')](config[_0x84b2('0xd')],{'host':_0x84b2('0xf'),'port':0x18eb});var socket=require(_0x84b2('0x10'))(new Redis(config[_0x84b2('0xd')]));require(_0x84b2('0x11'))[_0x84b2('0x12')](socket);function respondWithRpcPromise(_0x4a5c6c,_0x50209f,_0x4aae19){return new BPromise(function(_0x44447d,_0x135e43){return client['request'](_0x4a5c6c,_0x4aae19)[_0x84b2('0x13')](function(_0x46191e){logger['info'](_0x84b2('0x14'),_0x50209f,'request\x20sent');logger[_0x84b2('0x15')](_0x84b2('0x16'),_0x50209f,'request\x20sent',JSON[_0x84b2('0x17')](_0x46191e));if(_0x46191e[_0x84b2('0x18')]){if(_0x46191e[_0x84b2('0x18')]['code']===0x1f4){logger[_0x84b2('0x18')](_0x84b2('0x14'),_0x50209f,_0x46191e[_0x84b2('0x18')][_0x84b2('0x19')]);return _0x135e43(_0x46191e[_0x84b2('0x18')][_0x84b2('0x19')]);}logger[_0x84b2('0x18')](_0x84b2('0x14'),_0x50209f,_0x46191e[_0x84b2('0x18')][_0x84b2('0x19')]);return _0x44447d(_0x46191e['error'][_0x84b2('0x19')]);}else{logger[_0x84b2('0x1a')]('DashboardItem,\x20%s,\x20%s',_0x50209f,'request\x20sent');_0x44447d(_0x46191e[_0x84b2('0x1b')][_0x84b2('0x19')]);}})['catch'](function(_0x4b2c18){logger[_0x84b2('0x18')](_0x84b2('0x14'),_0x50209f,_0x4b2c18);_0x135e43(_0x4b2c18);});});}