eb6f43b85def343185e3ac1e2f678c923659b173
[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 _0x54ca=['catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x32b292,_0x100e5e){var _0x490f77=function(_0x41da58){while(--_0x41da58){_0x32b292['push'](_0x32b292['shift']());}};_0x490f77(++_0x100e5e);}(_0x54ca,0x85));var _0xa54c=function(_0x81e39d,_0x4c3934){_0x81e39d=_0x81e39d-0x0;var _0x548fbb=_0x54ca[_0x81e39d];return _0x548fbb;};'use strict';var _=require('lodash');var util=require(_0xa54c('0x0'));var moment=require(_0xa54c('0x1'));var BPromise=require(_0xa54c('0x2'));var rs=require(_0xa54c('0x3'));var fs=require('fs');var Redis=require(_0xa54c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xa54c('0x5'));var logger=require(_0xa54c('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xa54c('0x7'));var client=jayson[_0xa54c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9a37b1,_0x26afb7,_0x432c23){return new BPromise(function(_0x8a2a4b,_0x1a9f30){return client[_0xa54c('0x9')](_0x9a37b1,_0x432c23)[_0xa54c('0xa')](function(_0x3f645b){logger[_0xa54c('0xb')](_0xa54c('0xc'),_0x26afb7,_0xa54c('0xd'));logger[_0xa54c('0xe')](_0xa54c('0xf'),_0x26afb7,_0xa54c('0xd'),JSON[_0xa54c('0x10')](_0x3f645b));if(_0x3f645b[_0xa54c('0x11')]){if(_0x3f645b['error'][_0xa54c('0x12')]===0x1f4){logger[_0xa54c('0x11')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x26afb7,_0x3f645b[_0xa54c('0x11')][_0xa54c('0x13')]);return _0x1a9f30(_0x3f645b[_0xa54c('0x11')]['message']);}logger[_0xa54c('0x11')](_0xa54c('0xc'),_0x26afb7,_0x3f645b[_0xa54c('0x11')][_0xa54c('0x13')]);return _0x8a2a4b(_0x3f645b[_0xa54c('0x11')][_0xa54c('0x13')]);}else{logger[_0xa54c('0xb')](_0xa54c('0xc'),_0x26afb7,_0xa54c('0xd'));_0x8a2a4b(_0x3f645b[_0xa54c('0x14')][_0xa54c('0x13')]);}})[_0xa54c('0x15')](function(_0x58b864){logger[_0xa54c('0x11')](_0xa54c('0xc'),_0x26afb7,_0x58b864);_0x1a9f30(_0x58b864);});});}