Built motion from commit 43538d75.|2.5.35
[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 _0x918a=['lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','request\x20sent','debug','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result'];(function(_0x19cdd5,_0x28ff5b){var _0x4aea51=function(_0x506980){while(--_0x506980){_0x19cdd5['push'](_0x19cdd5['shift']());}};_0x4aea51(++_0x28ff5b);}(_0x918a,0x118));var _0xa918=function(_0x3b67a5,_0x172b75){_0x3b67a5=_0x3b67a5-0x0;var _0x57102f=_0x918a[_0x3b67a5];return _0x57102f;};'use strict';var _=require(_0xa918('0x0'));var util=require(_0xa918('0x1'));var moment=require(_0xa918('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa918('0x3'));var db=require(_0xa918('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa918('0x5'))(_0xa918('0x6'));var config=require('../../config/environment');var jayson=require(_0xa918('0x7'));var client=jayson[_0xa918('0x8')][_0xa918('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x593871,_0x3e858c,_0x43dfdd){return new BPromise(function(_0x97a99c,_0x39605f){return client[_0xa918('0xa')](_0x593871,_0x43dfdd)['then'](function(_0x45559a){logger[_0xa918('0xb')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3e858c,_0xa918('0xc'));logger[_0xa918('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x3e858c,_0xa918('0xc'),JSON[_0xa918('0xe')](_0x45559a));if(_0x45559a[_0xa918('0xf')]){if(_0x45559a[_0xa918('0xf')][_0xa918('0x10')]===0x1f4){logger[_0xa918('0xf')](_0xa918('0x11'),_0x3e858c,_0x45559a['error']['message']);return _0x39605f(_0x45559a['error'][_0xa918('0x12')]);}logger['error'](_0xa918('0x11'),_0x3e858c,_0x45559a[_0xa918('0xf')]['message']);return _0x97a99c(_0x45559a[_0xa918('0xf')][_0xa918('0x12')]);}else{logger[_0xa918('0xb')](_0xa918('0x11'),_0x3e858c,_0xa918('0xc'));_0x97a99c(_0x45559a[_0xa918('0x13')][_0xa918('0x12')]);}})['catch'](function(_0x3bcd5e){logger[_0xa918('0xf')](_0xa918('0x11'),_0x3e858c,_0x3bcd5e);_0x39605f(_0x3bcd5e);});});}