Built motion from commit bab6f49e.|2.6.17
[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 _0x8d84=['result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','error','message','info'];(function(_0x2a8f20,_0x146e8e){var _0x2c972a=function(_0x52aeac){while(--_0x52aeac){_0x2a8f20['push'](_0x2a8f20['shift']());}};_0x2c972a(++_0x146e8e);}(_0x8d84,0xfe));var _0x48d8=function(_0x3089cc,_0x35d67a){_0x3089cc=_0x3089cc-0x0;var _0x48fc83=_0x8d84[_0x3089cc];return _0x48fc83;};'use strict';var _=require(_0x48d8('0x0'));var util=require(_0x48d8('0x1'));var moment=require(_0x48d8('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x48d8('0x3'));var db=require(_0x48d8('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x48d8('0x5'))(_0x48d8('0x6'));var config=require(_0x48d8('0x7'));var jayson=require(_0x48d8('0x8'));var client=jayson[_0x48d8('0x9')][_0x48d8('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x185938,_0x159889,_0x400545){return new BPromise(function(_0x2543e1,_0x210d4e){return client['request'](_0x185938,_0x400545)[_0x48d8('0xb')](function(_0x389b5d){logger['info'](_0x48d8('0xc'),_0x159889,_0x48d8('0xd'));logger[_0x48d8('0xe')](_0x48d8('0xf'),_0x159889,'request\x20sent',JSON['stringify'](_0x389b5d));if(_0x389b5d[_0x48d8('0x10')]){if(_0x389b5d[_0x48d8('0x10')]['code']===0x1f4){logger[_0x48d8('0x10')](_0x48d8('0xc'),_0x159889,_0x389b5d[_0x48d8('0x10')][_0x48d8('0x11')]);return _0x210d4e(_0x389b5d[_0x48d8('0x10')]['message']);}logger[_0x48d8('0x10')](_0x48d8('0xc'),_0x159889,_0x389b5d[_0x48d8('0x10')]['message']);return _0x2543e1(_0x389b5d['error'][_0x48d8('0x11')]);}else{logger[_0x48d8('0x12')](_0x48d8('0xc'),_0x159889,'request\x20sent');_0x2543e1(_0x389b5d[_0x48d8('0x13')][_0x48d8('0x11')]);}})[_0x48d8('0x14')](function(_0x31ef49){logger[_0x48d8('0x10')](_0x48d8('0xc'),_0x159889,_0x31ef49);_0x210d4e(_0x31ef49);});});}