Built motion from commit (unavailable).|2.5.29
[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 _0xe7b9=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','catch','lodash','util','moment','ioredis','../../mysqldb','rpc','jayson/promise','request','then','info'];(function(_0x56915d,_0x32328f){var _0x46ac79=function(_0x72b04b){while(--_0x72b04b){_0x56915d['push'](_0x56915d['shift']());}};_0x46ac79(++_0x32328f);}(_0xe7b9,0x170));var _0x9e7b=function(_0x4a20bd,_0x3551f9){_0x4a20bd=_0x4a20bd-0x0;var _0x2c4865=_0xe7b9[_0x4a20bd];return _0x2c4865;};'use strict';var _=require(_0x9e7b('0x0'));var util=require(_0x9e7b('0x1'));var moment=require(_0x9e7b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9e7b('0x3'));var db=require(_0x9e7b('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9e7b('0x5'));var config=require('../../config/environment');var jayson=require(_0x9e7b('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1e2f86,_0x377a75,_0x13a37d){return new BPromise(function(_0x5ed982,_0x46e445){return client[_0x9e7b('0x7')](_0x1e2f86,_0x13a37d)[_0x9e7b('0x8')](function(_0x128bac){logger[_0x9e7b('0x9')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x377a75,'request\x20sent');logger['debug'](_0x9e7b('0xa'),_0x377a75,_0x9e7b('0xb'),JSON[_0x9e7b('0xc')](_0x128bac));if(_0x128bac[_0x9e7b('0xd')]){if(_0x128bac[_0x9e7b('0xd')][_0x9e7b('0xe')]===0x1f4){logger['error'](_0x9e7b('0xf'),_0x377a75,_0x128bac[_0x9e7b('0xd')][_0x9e7b('0x10')]);return _0x46e445(_0x128bac[_0x9e7b('0xd')]['message']);}logger[_0x9e7b('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x377a75,_0x128bac[_0x9e7b('0xd')][_0x9e7b('0x10')]);return _0x5ed982(_0x128bac['error']['message']);}else{logger[_0x9e7b('0x9')](_0x9e7b('0xf'),_0x377a75,_0x9e7b('0xb'));_0x5ed982(_0x128bac['result'][_0x9e7b('0x10')]);}})[_0x9e7b('0x11')](function(_0x231db2){logger[_0x9e7b('0xd')](_0x9e7b('0xf'),_0x377a75,_0x231db2);_0x46e445(_0x231db2);});});}