c244cfa6ce1de5ca90adf194cf16841d6b800af3
[motion2.git] / server / api / analyticDefaultReport / analyticDefaultReport.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 _0x8130=['stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s'];(function(_0xf4f38c,_0x402145){var _0x3e5cdc=function(_0x333b89){while(--_0x333b89){_0xf4f38c['push'](_0xf4f38c['shift']());}};_0x3e5cdc(++_0x402145);}(_0x8130,0x146));var _0x0813=function(_0x1a128f,_0x1d1ae5){_0x1a128f=_0x1a128f-0x0;var _0x5b608b=_0x8130[_0x1a128f];return _0x5b608b;};'use strict';var _=require(_0x0813('0x0'));var util=require(_0x0813('0x1'));var moment=require('moment');var BPromise=require(_0x0813('0x2'));var rs=require(_0x0813('0x3'));var fs=require('fs');var Redis=require(_0x0813('0x4'));var db=require(_0x0813('0x5'))['db'];var utils=require(_0x0813('0x6'));var logger=require(_0x0813('0x7'))('rpc');var config=require(_0x0813('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0813('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2df45a,_0x2bbdfd,_0x19a508){return new BPromise(function(_0x2ab8f0,_0x115a90){return client[_0x0813('0xa')](_0x2df45a,_0x19a508)['then'](function(_0x44ec2c){logger[_0x0813('0xb')](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');logger['debug'](_0x0813('0xd'),_0x2bbdfd,'request\x20sent',JSON[_0x0813('0xe')](_0x44ec2c));if(_0x44ec2c['error']){if(_0x44ec2c[_0x0813('0xf')][_0x0813('0x10')]===0x1f4){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x115a90(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}logger['error'](_0x0813('0xc'),_0x2bbdfd,_0x44ec2c['error']['message']);return _0x2ab8f0(_0x44ec2c[_0x0813('0xf')][_0x0813('0x11')]);}else{logger['info'](_0x0813('0xc'),_0x2bbdfd,'request\x20sent');_0x2ab8f0(_0x44ec2c[_0x0813('0x12')][_0x0813('0x11')]);}})[_0x0813('0x13')](function(_0xee126d){logger[_0x0813('0xf')](_0x0813('0xc'),_0x2bbdfd,_0xee126d);_0x115a90(_0xee126d);});});}