Built motion from commit ddca4d0d.|2.5.47
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.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 _0xb29e=['debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','then','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0xd8d633,_0xbcd798){var _0x1edca0=function(_0x358e29){while(--_0x358e29){_0xd8d633['push'](_0xd8d633['shift']());}};_0x1edca0(++_0xbcd798);}(_0xb29e,0xba));var _0xeb29=function(_0x809dbd,_0xf5f241){_0x809dbd=_0x809dbd-0x0;var _0x5497bf=_0xb29e[_0x809dbd];return _0x5497bf;};'use strict';var _=require('lodash');var util=require(_0xeb29('0x0'));var moment=require(_0xeb29('0x1'));var BPromise=require(_0xeb29('0x2'));var rs=require(_0xeb29('0x3'));var fs=require('fs');var Redis=require(_0xeb29('0x4'));var db=require(_0xeb29('0x5'))['db'];var utils=require(_0xeb29('0x6'));var logger=require('../../config/logger')(_0xeb29('0x7'));var config=require('../../config/environment');var jayson=require(_0xeb29('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x35b3c0,_0xc12e29,_0x4523b8){return new BPromise(function(_0x48824b,_0x3b7d3c){return client['request'](_0x35b3c0,_0x4523b8)[_0xeb29('0x9')](function(_0x3dbb48){logger[_0xeb29('0xa')](_0xeb29('0xb'),_0xc12e29,'request\x20sent');logger[_0xeb29('0xc')](_0xeb29('0xd'),_0xc12e29,_0xeb29('0xe'),JSON['stringify'](_0x3dbb48));if(_0x3dbb48[_0xeb29('0xf')]){if(_0x3dbb48[_0xeb29('0xf')][_0xeb29('0x10')]===0x1f4){logger['error'](_0xeb29('0xb'),_0xc12e29,_0x3dbb48['error'][_0xeb29('0x11')]);return _0x3b7d3c(_0x3dbb48[_0xeb29('0xf')][_0xeb29('0x11')]);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0xc12e29,_0x3dbb48[_0xeb29('0xf')]['message']);return _0x48824b(_0x3dbb48[_0xeb29('0xf')]['message']);}else{logger['info'](_0xeb29('0xb'),_0xc12e29,_0xeb29('0xe'));_0x48824b(_0x3dbb48['result'][_0xeb29('0x11')]);}})['catch'](function(_0x11f8df){logger[_0xeb29('0xf')]('AnalyticFieldReport,\x20%s,\x20%s',_0xc12e29,_0x11f8df);_0x3b7d3c(_0x11f8df);});});}