Built motion from commit 85f716e9.|2.6.8
[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 _0x8a18=['client','http','request','info','request\x20sent','debug','stringify','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x3e7eeb,_0x35a99c){var _0x5ae809=function(_0x1d2f0f){while(--_0x1d2f0f){_0x3e7eeb['push'](_0x3e7eeb['shift']());}};_0x5ae809(++_0x35a99c);}(_0x8a18,0x12a));var _0x88a1=function(_0x3e1c01,_0x3a99d0){_0x3e1c01=_0x3e1c01-0x0;var _0x153233=_0x8a18[_0x3e1c01];return _0x153233;};'use strict';var _=require(_0x88a1('0x0'));var util=require(_0x88a1('0x1'));var moment=require(_0x88a1('0x2'));var BPromise=require(_0x88a1('0x3'));var rs=require(_0x88a1('0x4'));var fs=require('fs');var Redis=require(_0x88a1('0x5'));var db=require(_0x88a1('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x88a1('0x7'))(_0x88a1('0x8'));var config=require(_0x88a1('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x88a1('0xa')][_0x88a1('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f3f39,_0x17572a,_0x2e613b){return new BPromise(function(_0x421276,_0x4edb59){return client[_0x88a1('0xc')](_0x4f3f39,_0x2e613b)['then'](function(_0x4f214e){logger[_0x88a1('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x17572a,_0x88a1('0xe'));logger[_0x88a1('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x17572a,_0x88a1('0xe'),JSON[_0x88a1('0x10')](_0x4f214e));if(_0x4f214e[_0x88a1('0x11')]){if(_0x4f214e[_0x88a1('0x11')][_0x88a1('0x12')]===0x1f4){logger[_0x88a1('0x11')](_0x88a1('0x13'),_0x17572a,_0x4f214e[_0x88a1('0x11')][_0x88a1('0x14')]);return _0x4edb59(_0x4f214e[_0x88a1('0x11')][_0x88a1('0x14')]);}logger[_0x88a1('0x11')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x17572a,_0x4f214e['error'][_0x88a1('0x14')]);return _0x421276(_0x4f214e[_0x88a1('0x11')]['message']);}else{logger['info'](_0x88a1('0x13'),_0x17572a,_0x88a1('0xe'));_0x421276(_0x4f214e['result'][_0x88a1('0x14')]);}})[_0x88a1('0x15')](function(_0x5a0f05){logger['error'](_0x88a1('0x13'),_0x17572a,_0x5a0f05);_0x4edb59(_0x5a0f05);});});}