c8dfbbef6d596545e529af2e65faa9dddd9b6f2e
[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 _0x113b=['AnalyticExtractedReport,\x20%s,\x20%s','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','http','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x35d9b7,_0x584f6e){var _0x1717cd=function(_0x39d2ac){while(--_0x39d2ac){_0x35d9b7['push'](_0x35d9b7['shift']());}};_0x1717cd(++_0x584f6e);}(_0x113b,0x19d));var _0xb113=function(_0x5e8428,_0x95410e){_0x5e8428=_0x5e8428-0x0;var _0x403818=_0x113b[_0x5e8428];return _0x403818;};'use strict';var _=require(_0xb113('0x0'));var util=require('util');var moment=require(_0xb113('0x1'));var BPromise=require(_0xb113('0x2'));var rs=require(_0xb113('0x3'));var fs=require('fs');var Redis=require(_0xb113('0x4'));var db=require(_0xb113('0x5'))['db'];var utils=require(_0xb113('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0xb113('0x7'));var client=jayson['client'][_0xb113('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x121405,_0x5ca75e,_0x1a1b1a){return new BPromise(function(_0x424db4,_0x485d23){return client['request'](_0x121405,_0x1a1b1a)['then'](function(_0xd4d36a){logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ca75e,'request\x20sent');logger['debug'](_0xb113('0x9'),_0x5ca75e,'request\x20sent',JSON['stringify'](_0xd4d36a));if(_0xd4d36a[_0xb113('0xa')]){if(_0xd4d36a[_0xb113('0xa')][_0xb113('0xb')]===0x1f4){logger[_0xb113('0xa')](_0xb113('0xc'),_0x5ca75e,_0xd4d36a['error'][_0xb113('0xd')]);return _0x485d23(_0xd4d36a[_0xb113('0xa')][_0xb113('0xd')]);}logger[_0xb113('0xa')](_0xb113('0xc'),_0x5ca75e,_0xd4d36a[_0xb113('0xa')][_0xb113('0xd')]);return _0x424db4(_0xd4d36a[_0xb113('0xa')][_0xb113('0xd')]);}else{logger['info'](_0xb113('0xc'),_0x5ca75e,_0xb113('0xe'));_0x424db4(_0xd4d36a[_0xb113('0xf')]['message']);}})[_0xb113('0x10')](function(_0x3bc877){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ca75e,_0x3bc877);_0x485d23(_0x3bc877);});});}