Built motion from commit (unavailable).|2.5.14
[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 _0x5afb=['message','result','lodash','util','bluebird','randomstring','../../config/logger','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x1cca0b,_0x1a1e2f){var _0x12f70a=function(_0x375dfa){while(--_0x375dfa){_0x1cca0b['push'](_0x1cca0b['shift']());}};_0x12f70a(++_0x1a1e2f);}(_0x5afb,0x17e));var _0xb5af=function(_0x1d4eed,_0x4922b2){_0x1d4eed=_0x1d4eed-0x0;var _0x10911b=_0x5afb[_0x1d4eed];return _0x10911b;};'use strict';var _=require(_0xb5af('0x0'));var util=require(_0xb5af('0x1'));var moment=require('moment');var BPromise=require(_0xb5af('0x2'));var rs=require(_0xb5af('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb5af('0x4'))(_0xb5af('0x5'));var config=require('../../config/environment');var jayson=require(_0xb5af('0x6'));var client=jayson['client'][_0xb5af('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x576050,_0x15feef,_0x5148ba){return new BPromise(function(_0x4c7f82,_0x56bcfc){return client[_0xb5af('0x8')](_0x576050,_0x5148ba)[_0xb5af('0x9')](function(_0x49ca46){logger[_0xb5af('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x15feef,_0xb5af('0xb'));logger[_0xb5af('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x15feef,_0xb5af('0xb'),JSON[_0xb5af('0xd')](_0x49ca46));if(_0x49ca46[_0xb5af('0xe')]){if(_0x49ca46[_0xb5af('0xe')][_0xb5af('0xf')]===0x1f4){logger['error'](_0xb5af('0x10'),_0x15feef,_0x49ca46[_0xb5af('0xe')][_0xb5af('0x11')]);return _0x56bcfc(_0x49ca46['error']['message']);}logger[_0xb5af('0xe')](_0xb5af('0x10'),_0x15feef,_0x49ca46[_0xb5af('0xe')][_0xb5af('0x11')]);return _0x4c7f82(_0x49ca46[_0xb5af('0xe')][_0xb5af('0x11')]);}else{logger[_0xb5af('0xa')](_0xb5af('0x10'),_0x15feef,_0xb5af('0xb'));_0x4c7f82(_0x49ca46[_0xb5af('0x12')][_0xb5af('0x11')]);}})['catch'](function(_0x563801){logger['error'](_0xb5af('0x10'),_0x15feef,_0x563801);_0x56bcfc(_0x563801);});});}