0ab35eb25ef52951f6258993e0e02dd5e346f653
[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 _0xfc73=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','../../config/environment','client','request','info','request\x20sent','debug','stringify','code','error','AnalyticExtractedReport,\x20%s,\x20%s','message'];(function(_0x70f557,_0x50e9ce){var _0x4e840b=function(_0x4d9f52){while(--_0x4d9f52){_0x70f557['push'](_0x70f557['shift']());}};_0x4e840b(++_0x50e9ce);}(_0xfc73,0x190));var _0x3fc7=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xfc73[_0x4e676e];return _0x336a3c;};'use strict';var _=require(_0x3fc7('0x0'));var util=require(_0x3fc7('0x1'));var moment=require(_0x3fc7('0x2'));var BPromise=require(_0x3fc7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3fc7('0x4'));var db=require(_0x3fc7('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x3fc7('0x6'));var config=require(_0x3fc7('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x3fc7('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x16a843,_0x595f79,_0x3068db){return new BPromise(function(_0x57f2b5,_0x1c4cab){return client[_0x3fc7('0x9')](_0x16a843,_0x3068db)['then'](function(_0x257b44){logger[_0x3fc7('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x3fc7('0xb'));logger[_0x3fc7('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x595f79,'request\x20sent',JSON[_0x3fc7('0xd')](_0x257b44));if(_0x257b44['error']){if(_0x257b44['error'][_0x3fc7('0xe')]===0x1f4){logger[_0x3fc7('0xf')](_0x3fc7('0x10'),_0x595f79,_0x257b44[_0x3fc7('0xf')]['message']);return _0x1c4cab(_0x257b44[_0x3fc7('0xf')][_0x3fc7('0x11')]);}logger[_0x3fc7('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x257b44['error']['message']);return _0x57f2b5(_0x257b44['error']['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x595f79,_0x3fc7('0xb'));_0x57f2b5(_0x257b44['result']['message']);}})[_0x3fc7('0x12')](function(_0x989094){logger[_0x3fc7('0xf')](_0x3fc7('0x10'),_0x595f79,_0x989094);_0x1c4cab(_0x989094);});});}