Built motion from commit (unavailable).|2.4.20
[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 _0x8f20=['catch','lodash','util','moment','randomstring','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x3fdd09,_0x2853f7){var _0x2be280=function(_0x419408){while(--_0x419408){_0x3fdd09['push'](_0x3fdd09['shift']());}};_0x2be280(++_0x2853f7);}(_0x8f20,0x1b6));var _0x08f2=function(_0x250669,_0xb15e88){_0x250669=_0x250669-0x0;var _0x131447=_0x8f20[_0x250669];return _0x131447;};'use strict';var _=require(_0x08f2('0x0'));var util=require(_0x08f2('0x1'));var moment=require(_0x08f2('0x2'));var BPromise=require('bluebird');var rs=require(_0x08f2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x08f2('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x08f2('0x5'))('rpc');var config=require(_0x08f2('0x6'));var jayson=require(_0x08f2('0x7'));var client=jayson['client'][_0x08f2('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2358ea,_0x464ee5,_0x4cb9e7){return new BPromise(function(_0xd082a,_0x2f0115){return client['request'](_0x2358ea,_0x4cb9e7)[_0x08f2('0x9')](function(_0x2c6858){logger[_0x08f2('0xa')](_0x08f2('0xb'),_0x464ee5,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x464ee5,_0x08f2('0xc'),JSON[_0x08f2('0xd')](_0x2c6858));if(_0x2c6858[_0x08f2('0xe')]){if(_0x2c6858[_0x08f2('0xe')][_0x08f2('0xf')]===0x1f4){logger[_0x08f2('0xe')](_0x08f2('0xb'),_0x464ee5,_0x2c6858[_0x08f2('0xe')][_0x08f2('0x10')]);return _0x2f0115(_0x2c6858[_0x08f2('0xe')]['message']);}logger[_0x08f2('0xe')](_0x08f2('0xb'),_0x464ee5,_0x2c6858[_0x08f2('0xe')]['message']);return _0xd082a(_0x2c6858['error'][_0x08f2('0x10')]);}else{logger[_0x08f2('0xa')](_0x08f2('0xb'),_0x464ee5,'request\x20sent');_0xd082a(_0x2c6858[_0x08f2('0x11')][_0x08f2('0x10')]);}})[_0x08f2('0x12')](function(_0x18ae09){logger[_0x08f2('0xe')](_0x08f2('0xb'),_0x464ee5,_0x18ae09);_0x2f0115(_0x18ae09);});});}