Built motion from commit (unavailable).|2.4.21
[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 _0x17d1=['request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','code','error','message','result','lodash','util','randomstring','ioredis','../../config/logger','rpc','../../config/environment','http'];(function(_0x2d34d6,_0x397ff9){var _0x1d3d12=function(_0x558800){while(--_0x558800){_0x2d34d6['push'](_0x2d34d6['shift']());}};_0x1d3d12(++_0x397ff9);}(_0x17d1,0xc9));var _0x117d=function(_0x27505c,_0x3ab262){_0x27505c=_0x27505c-0x0;var _0x542f89=_0x17d1[_0x27505c];return _0x542f89;};'use strict';var _=require(_0x117d('0x0'));var util=require(_0x117d('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x117d('0x2'));var fs=require('fs');var Redis=require(_0x117d('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x117d('0x4'))(_0x117d('0x5'));var config=require(_0x117d('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x117d('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x47e0eb,_0x367f42,_0x10b8d2){return new BPromise(function(_0x5d0c51,_0x40dcdf){return client[_0x117d('0x8')](_0x47e0eb,_0x10b8d2)[_0x117d('0x9')](function(_0x26a774){logger[_0x117d('0xa')](_0x117d('0xb'),_0x367f42,_0x117d('0xc'));logger[_0x117d('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x367f42,_0x117d('0xc'),JSON[_0x117d('0xe')](_0x26a774));if(_0x26a774['error']){if(_0x26a774['error'][_0x117d('0xf')]===0x1f4){logger[_0x117d('0x10')](_0x117d('0xb'),_0x367f42,_0x26a774[_0x117d('0x10')]['message']);return _0x40dcdf(_0x26a774[_0x117d('0x10')]['message']);}logger[_0x117d('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x367f42,_0x26a774[_0x117d('0x10')][_0x117d('0x11')]);return _0x5d0c51(_0x26a774[_0x117d('0x10')][_0x117d('0x11')]);}else{logger['info'](_0x117d('0xb'),_0x367f42,_0x117d('0xc'));_0x5d0c51(_0x26a774[_0x117d('0x12')][_0x117d('0x11')]);}})['catch'](function(_0x223aae){logger[_0x117d('0x10')](_0x117d('0xb'),_0x367f42,_0x223aae);_0x40dcdf(_0x223aae);});});}