41c79fb5f02deed375139da803d406eef58cc2fb
[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 _0xd609=['lodash','util','moment','randomstring','ioredis','../../config/logger','jayson/promise','request','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch'];(function(_0x5d9a0f,_0x2e8ec0){var _0x58b171=function(_0x2de433){while(--_0x2de433){_0x5d9a0f['push'](_0x5d9a0f['shift']());}};_0x58b171(++_0x2e8ec0);}(_0xd609,0x110));var _0x9d60=function(_0x434bd2,_0xe1eb35){_0x434bd2=_0x434bd2-0x0;var _0x5c3e7e=_0xd609[_0x434bd2];return _0x5c3e7e;};'use strict';var _=require(_0x9d60('0x0'));var util=require(_0x9d60('0x1'));var moment=require(_0x9d60('0x2'));var BPromise=require('bluebird');var rs=require(_0x9d60('0x3'));var fs=require('fs');var Redis=require(_0x9d60('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x9d60('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x9d60('0x6'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x40d4bc,_0x1ad698,_0x105a2a){return new BPromise(function(_0x554d9e,_0x4d6f42){return client[_0x9d60('0x7')](_0x40d4bc,_0x105a2a)['then'](function(_0x6ff277){logger['info'](_0x9d60('0x8'),_0x1ad698,_0x9d60('0x9'));logger['debug'](_0x9d60('0xa'),_0x1ad698,_0x9d60('0x9'),JSON[_0x9d60('0xb')](_0x6ff277));if(_0x6ff277[_0x9d60('0xc')]){if(_0x6ff277['error'][_0x9d60('0xd')]===0x1f4){logger[_0x9d60('0xc')](_0x9d60('0x8'),_0x1ad698,_0x6ff277[_0x9d60('0xc')][_0x9d60('0xe')]);return _0x4d6f42(_0x6ff277[_0x9d60('0xc')]['message']);}logger[_0x9d60('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1ad698,_0x6ff277[_0x9d60('0xc')][_0x9d60('0xe')]);return _0x554d9e(_0x6ff277[_0x9d60('0xc')][_0x9d60('0xe')]);}else{logger[_0x9d60('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x1ad698,_0x9d60('0x9'));_0x554d9e(_0x6ff277['result']['message']);}})[_0x9d60('0x10')](function(_0x379583){logger[_0x9d60('0xc')](_0x9d60('0x8'),_0x1ad698,_0x379583);_0x4d6f42(_0x379583);});});}