Built motion from commit 936e8062.|2.5.33
[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 _0xe5b6=['code','DashboardItem,\x20%s,\x20%s','message','info','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','register','request','then','request\x20sent','debug','stringify','error'];(function(_0x5e4dcd,_0x3e8c0f){var _0x196dbb=function(_0x42b7ab){while(--_0x42b7ab){_0x5e4dcd['push'](_0x5e4dcd['shift']());}};_0x196dbb(++_0x3e8c0f);}(_0xe5b6,0xd1));var _0x6e5b=function(_0x33b1ce,_0x18f967){_0x33b1ce=_0x33b1ce-0x0;var _0x27cc81=_0xe5b6[_0x33b1ce];return _0x27cc81;};'use strict';var _=require(_0x6e5b('0x0'));var util=require(_0x6e5b('0x1'));var moment=require('moment');var BPromise=require(_0x6e5b('0x2'));var rs=require(_0x6e5b('0x3'));var fs=require('fs');var Redis=require(_0x6e5b('0x4'));var db=require(_0x6e5b('0x5'))['db'];var utils=require(_0x6e5b('0x6'));var logger=require(_0x6e5b('0x7'))(_0x6e5b('0x8'));var config=require(_0x6e5b('0x9'));var jayson=require(_0x6e5b('0xa'));var client=jayson['client'][_0x6e5b('0xb')]({'port':0x232a});config[_0x6e5b('0xc')]=_[_0x6e5b('0xd')](config[_0x6e5b('0xc')],{'host':_0x6e5b('0xe'),'port':0x18eb});var socket=require(_0x6e5b('0xf'))(new Redis(config[_0x6e5b('0xc')]));require('./dashboardItem.socket')[_0x6e5b('0x10')](socket);function respondWithRpcPromise(_0x50205f,_0xbabc5f,_0x21279a){return new BPromise(function(_0x4ce52e,_0x418c43){return client[_0x6e5b('0x11')](_0x50205f,_0x21279a)[_0x6e5b('0x12')](function(_0x4d7377){logger['info']('DashboardItem,\x20%s,\x20%s',_0xbabc5f,_0x6e5b('0x13'));logger[_0x6e5b('0x14')]('DashboardItem,\x20%s,\x20%s,\x20%s',_0xbabc5f,_0x6e5b('0x13'),JSON[_0x6e5b('0x15')](_0x4d7377));if(_0x4d7377[_0x6e5b('0x16')]){if(_0x4d7377[_0x6e5b('0x16')][_0x6e5b('0x17')]===0x1f4){logger[_0x6e5b('0x16')](_0x6e5b('0x18'),_0xbabc5f,_0x4d7377[_0x6e5b('0x16')][_0x6e5b('0x19')]);return _0x418c43(_0x4d7377[_0x6e5b('0x16')]['message']);}logger[_0x6e5b('0x16')]('DashboardItem,\x20%s,\x20%s',_0xbabc5f,_0x4d7377[_0x6e5b('0x16')]['message']);return _0x4ce52e(_0x4d7377[_0x6e5b('0x16')]['message']);}else{logger[_0x6e5b('0x1a')](_0x6e5b('0x18'),_0xbabc5f,'request\x20sent');_0x4ce52e(_0x4d7377[_0x6e5b('0x1b')][_0x6e5b('0x19')]);}})[_0x6e5b('0x1c')](function(_0x40e18e){logger[_0x6e5b('0x16')](_0x6e5b('0x18'),_0xbabc5f,_0x40e18e);_0x418c43(_0x40e18e);});});}