df815e77cb23c34d2950a511072e948c16e8cc1b
[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 _0x0313=['then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','moment','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','http','request'];(function(_0x4ba6d8,_0xc8950){var _0x46b6cf=function(_0x1e69af){while(--_0x1e69af){_0x4ba6d8['push'](_0x4ba6d8['shift']());}};_0x46b6cf(++_0xc8950);}(_0x0313,0x1f0));var _0x3031=function(_0x3146ce,_0x51d525){_0x3146ce=_0x3146ce-0x0;var _0x8a9db0=_0x0313[_0x3146ce];return _0x8a9db0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3031('0x0'));var BPromise=require(_0x3031('0x1'));var rs=require(_0x3031('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x3031('0x3'));var logger=require(_0x3031('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3031('0x5'));var client=jayson['client'][_0x3031('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x5d5303,_0x5c908a,_0x4b26cf){return new BPromise(function(_0x379000,_0x5e0cdd){return client[_0x3031('0x7')](_0x5d5303,_0x4b26cf)[_0x3031('0x8')](function(_0xb7370){logger[_0x3031('0x9')](_0x3031('0xa'),_0x5c908a,_0x3031('0xb'));logger['debug'](_0x3031('0xc'),_0x5c908a,_0x3031('0xb'),JSON[_0x3031('0xd')](_0xb7370));if(_0xb7370['error']){if(_0xb7370[_0x3031('0xe')][_0x3031('0xf')]===0x1f4){logger['error'](_0x3031('0xa'),_0x5c908a,_0xb7370[_0x3031('0xe')][_0x3031('0x10')]);return _0x5e0cdd(_0xb7370[_0x3031('0xe')][_0x3031('0x10')]);}logger[_0x3031('0xe')](_0x3031('0xa'),_0x5c908a,_0xb7370[_0x3031('0xe')][_0x3031('0x10')]);return _0x379000(_0xb7370[_0x3031('0xe')][_0x3031('0x10')]);}else{logger['info'](_0x3031('0xa'),_0x5c908a,_0x3031('0xb'));_0x379000(_0xb7370['result']['message']);}})[_0x3031('0x11')](function(_0x40243d){logger['error'](_0x3031('0xa'),_0x5c908a,_0x40243d);_0x5e0cdd(_0x40243d);});});}