209da93d637ebd17cdbfb39bb0f76392c45eb900
[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 _0x54be=['catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result'];(function(_0x3ab8f6,_0x3ec4c4){var _0x114073=function(_0x310cd1){while(--_0x310cd1){_0x3ab8f6['push'](_0x3ab8f6['shift']());}};_0x114073(++_0x3ec4c4);}(_0x54be,0x143));var _0xe54b=function(_0x1003c5,_0x12ac5b){_0x1003c5=_0x1003c5-0x0;var _0x3a8ac1=_0x54be[_0x1003c5];return _0x3a8ac1;};'use strict';var _=require(_0xe54b('0x0'));var util=require('util');var moment=require(_0xe54b('0x1'));var BPromise=require('bluebird');var rs=require(_0xe54b('0x2'));var fs=require('fs');var Redis=require(_0xe54b('0x3'));var db=require(_0xe54b('0x4'))['db'];var utils=require(_0xe54b('0x5'));var logger=require(_0xe54b('0x6'))(_0xe54b('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xe54b('0x8')][_0xe54b('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2f4302,_0x114123,_0xa33c4c){return new BPromise(function(_0x4fc3af,_0xeb211a){return client[_0xe54b('0xa')](_0x2f4302,_0xa33c4c)[_0xe54b('0xb')](function(_0x310bd9){logger['info'](_0xe54b('0xc'),_0x114123,_0xe54b('0xd'));logger[_0xe54b('0xe')](_0xe54b('0xf'),_0x114123,_0xe54b('0xd'),JSON[_0xe54b('0x10')](_0x310bd9));if(_0x310bd9[_0xe54b('0x11')]){if(_0x310bd9[_0xe54b('0x11')][_0xe54b('0x12')]===0x1f4){logger['error'](_0xe54b('0xc'),_0x114123,_0x310bd9[_0xe54b('0x11')]['message']);return _0xeb211a(_0x310bd9['error'][_0xe54b('0x13')]);}logger[_0xe54b('0x11')](_0xe54b('0xc'),_0x114123,_0x310bd9[_0xe54b('0x11')][_0xe54b('0x13')]);return _0x4fc3af(_0x310bd9['error'][_0xe54b('0x13')]);}else{logger[_0xe54b('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x114123,_0xe54b('0xd'));_0x4fc3af(_0x310bd9[_0xe54b('0x15')][_0xe54b('0x13')]);}})[_0xe54b('0x16')](function(_0x1dd451){logger[_0xe54b('0x11')](_0xe54b('0xc'),_0x114123,_0x1dd451);_0xeb211a(_0x1dd451);});});}