Built motion from commit 14588770.|2.5.38
[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 _0x22ce=['moment','bluebird','../../config/logger','jayson/promise','client','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util'];(function(_0x932ac4,_0x4c3e71){var _0xe3420e=function(_0x4cdd40){while(--_0x4cdd40){_0x932ac4['push'](_0x932ac4['shift']());}};_0xe3420e(++_0x4c3e71);}(_0x22ce,0xc6));var _0xe22c=function(_0x43f15e,_0x3fcdcd){_0x43f15e=_0x43f15e-0x0;var _0x155dd6=_0x22ce[_0x43f15e];return _0x155dd6;};'use strict';var _=require(_0xe22c('0x0'));var util=require(_0xe22c('0x1'));var moment=require(_0xe22c('0x2'));var BPromise=require(_0xe22c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe22c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xe22c('0x5'));var client=jayson[_0xe22c('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x361833,_0x13eb51,_0xc8c2a3){return new BPromise(function(_0x184be0,_0x241803){return client[_0xe22c('0x7')](_0x361833,_0xc8c2a3)[_0xe22c('0x8')](function(_0xcaa7bf){logger[_0xe22c('0x9')](_0xe22c('0xa'),_0x13eb51,'request\x20sent');logger[_0xe22c('0xb')](_0xe22c('0xc'),_0x13eb51,_0xe22c('0xd'),JSON[_0xe22c('0xe')](_0xcaa7bf));if(_0xcaa7bf[_0xe22c('0xf')]){if(_0xcaa7bf[_0xe22c('0xf')][_0xe22c('0x10')]===0x1f4){logger[_0xe22c('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x13eb51,_0xcaa7bf[_0xe22c('0xf')][_0xe22c('0x11')]);return _0x241803(_0xcaa7bf[_0xe22c('0xf')][_0xe22c('0x11')]);}logger[_0xe22c('0xf')](_0xe22c('0xa'),_0x13eb51,_0xcaa7bf[_0xe22c('0xf')]['message']);return _0x184be0(_0xcaa7bf[_0xe22c('0xf')]['message']);}else{logger[_0xe22c('0x9')](_0xe22c('0xa'),_0x13eb51,_0xe22c('0xd'));_0x184be0(_0xcaa7bf[_0xe22c('0x12')][_0xe22c('0x11')]);}})[_0xe22c('0x13')](function(_0x5890a7){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x13eb51,_0x5890a7);_0x241803(_0x5890a7);});});}