Built motion from commit (unavailable).|2.5.31
[motion2.git] / server / api / analyticExtractedReport / analyticExtractedReport.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 _0x9330=['request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment'];(function(_0xabbd2f,_0x44d05a){var _0x34a040=function(_0x3736d9){while(--_0x3736d9){_0xabbd2f['push'](_0xabbd2f['shift']());}};_0x34a040(++_0x44d05a);}(_0x9330,0x1d8));var _0x0933=function(_0x345c73,_0x27c179){_0x345c73=_0x345c73-0x0;var _0x4b757f=_0x9330[_0x345c73];return _0x4b757f;};'use strict';var _=require(_0x0933('0x0'));var util=require(_0x0933('0x1'));var moment=require(_0x0933('0x2'));var BPromise=require(_0x0933('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0933('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0933('0x5'))(_0x0933('0x6'));var config=require(_0x0933('0x7'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1ba7b7,_0x3e339c,_0x465b74){return new BPromise(function(_0x3f5fb9,_0x4bc2af){return client[_0x0933('0x8')](_0x1ba7b7,_0x465b74)['then'](function(_0x2520f8){logger[_0x0933('0x9')](_0x0933('0xa'),_0x3e339c,_0x0933('0xb'));logger[_0x0933('0xc')](_0x0933('0xd'),_0x3e339c,_0x0933('0xb'),JSON[_0x0933('0xe')](_0x2520f8));if(_0x2520f8[_0x0933('0xf')]){if(_0x2520f8[_0x0933('0xf')][_0x0933('0x10')]===0x1f4){logger[_0x0933('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e339c,_0x2520f8[_0x0933('0xf')][_0x0933('0x11')]);return _0x4bc2af(_0x2520f8[_0x0933('0xf')][_0x0933('0x11')]);}logger[_0x0933('0xf')](_0x0933('0xa'),_0x3e339c,_0x2520f8['error'][_0x0933('0x11')]);return _0x3f5fb9(_0x2520f8[_0x0933('0xf')][_0x0933('0x11')]);}else{logger[_0x0933('0x9')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x3e339c,_0x0933('0xb'));_0x3f5fb9(_0x2520f8[_0x0933('0x12')]['message']);}})[_0x0933('0x13')](function(_0x3800f5){logger[_0x0933('0xf')](_0x0933('0xa'),_0x3e339c,_0x3800f5);_0x4bc2af(_0x3800f5);});});}