Built motion from commit 511216ff.|2.6.34
[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 _0xa153=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x59162a,_0x10e547){var _0x35e50d=function(_0x578425){while(--_0x578425){_0x59162a['push'](_0x59162a['shift']());}};_0x35e50d(++_0x10e547);}(_0xa153,0x85));var _0x3a15=function(_0xf8bfc3,_0x29cf48){_0xf8bfc3=_0xf8bfc3-0x0;var _0x4d7a6b=_0xa153[_0xf8bfc3];return _0x4d7a6b;};'use strict';var _=require(_0x3a15('0x0'));var util=require(_0x3a15('0x1'));var moment=require(_0x3a15('0x2'));var BPromise=require(_0x3a15('0x3'));var rs=require(_0x3a15('0x4'));var fs=require('fs');var Redis=require(_0x3a15('0x5'));var db=require(_0x3a15('0x6'))['db'];var utils=require(_0x3a15('0x7'));var logger=require(_0x3a15('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3a15('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x476fb0,_0xd33b23,_0x22eaf8){return new BPromise(function(_0x35b5cc,_0x46bde5){return client['request'](_0x476fb0,_0x22eaf8)[_0x3a15('0xa')](function(_0x21eee8){logger[_0x3a15('0xb')](_0x3a15('0xc'),_0xd33b23,_0x3a15('0xd'));logger[_0x3a15('0xe')](_0x3a15('0xf'),_0xd33b23,_0x3a15('0xd'),JSON[_0x3a15('0x10')](_0x21eee8));if(_0x21eee8['error']){if(_0x21eee8[_0x3a15('0x11')][_0x3a15('0x12')]===0x1f4){logger['error'](_0x3a15('0xc'),_0xd33b23,_0x21eee8['error']['message']);return _0x46bde5(_0x21eee8[_0x3a15('0x11')]['message']);}logger['error'](_0x3a15('0xc'),_0xd33b23,_0x21eee8['error'][_0x3a15('0x13')]);return _0x35b5cc(_0x21eee8[_0x3a15('0x11')][_0x3a15('0x13')]);}else{logger['info'](_0x3a15('0xc'),_0xd33b23,_0x3a15('0xd'));_0x35b5cc(_0x21eee8[_0x3a15('0x14')][_0x3a15('0x13')]);}})[_0x3a15('0x15')](function(_0x5a8111){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0xd33b23,_0x5a8111);_0x46bde5(_0x5a8111);});});}