Built motion from commit a61a4a20.|2.5.46
[motion2.git] / server / api / analyticCustomReport / analyticCustomReport.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 _0xa4c9=['request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','request','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x5c8f64,_0x59f34c){var _0x2418fa=function(_0x559d8b){while(--_0x559d8b){_0x5c8f64['push'](_0x5c8f64['shift']());}};_0x2418fa(++_0x59f34c);}(_0xa4c9,0xfe));var _0x9a4c=function(_0xbf15d3,_0x27015a){_0xbf15d3=_0xbf15d3-0x0;var _0x2afc1f=_0xa4c9[_0xbf15d3];return _0x2afc1f;};'use strict';var _=require(_0x9a4c('0x0'));var util=require(_0x9a4c('0x1'));var moment=require('moment');var BPromise=require(_0x9a4c('0x2'));var rs=require(_0x9a4c('0x3'));var fs=require('fs');var Redis=require(_0x9a4c('0x4'));var db=require(_0x9a4c('0x5'))['db'];var utils=require(_0x9a4c('0x6'));var logger=require(_0x9a4c('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9a4c('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51e8d9,_0x2a0bec,_0x4e9314){return new BPromise(function(_0x8e8d69,_0xc61279){return client[_0x9a4c('0x9')](_0x51e8d9,_0x4e9314)['then'](function(_0x26b33e){logger[_0x9a4c('0xa')](_0x9a4c('0xb'),_0x2a0bec,_0x9a4c('0xc'));logger['debug'](_0x9a4c('0xd'),_0x2a0bec,_0x9a4c('0xc'),JSON['stringify'](_0x26b33e));if(_0x26b33e[_0x9a4c('0xe')]){if(_0x26b33e[_0x9a4c('0xe')][_0x9a4c('0xf')]===0x1f4){logger[_0x9a4c('0xe')](_0x9a4c('0xb'),_0x2a0bec,_0x26b33e['error'][_0x9a4c('0x10')]);return _0xc61279(_0x26b33e[_0x9a4c('0xe')][_0x9a4c('0x10')]);}logger[_0x9a4c('0xe')](_0x9a4c('0xb'),_0x2a0bec,_0x26b33e['error']['message']);return _0x8e8d69(_0x26b33e[_0x9a4c('0xe')]['message']);}else{logger[_0x9a4c('0xa')](_0x9a4c('0xb'),_0x2a0bec,'request\x20sent');_0x8e8d69(_0x26b33e[_0x9a4c('0x11')][_0x9a4c('0x10')]);}})[_0x9a4c('0x12')](function(_0x486652){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x2a0bec,_0x486652);_0xc61279(_0x486652);});});}