Built motion from commit (unavailable).|2.5.30
[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 _0xf8c4=['message','result','catch','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5233fd,_0x13b2fc){var _0x1b596b=function(_0x4b71e0){while(--_0x4b71e0){_0x5233fd['push'](_0x5233fd['shift']());}};_0x1b596b(++_0x13b2fc);}(_0xf8c4,0x17d));var _0x4f8c=function(_0x21353c,_0x2ea587){_0x21353c=_0x21353c-0x0;var _0xa99120=_0xf8c4[_0x21353c];return _0xa99120;};'use strict';var _=require(_0x4f8c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x4f8c('0x1'));var rs=require(_0x4f8c('0x2'));var fs=require('fs');var Redis=require(_0x4f8c('0x3'));var db=require(_0x4f8c('0x4'))['db'];var utils=require(_0x4f8c('0x5'));var logger=require('../../config/logger')(_0x4f8c('0x6'));var config=require('../../config/environment');var jayson=require(_0x4f8c('0x7'));var client=jayson[_0x4f8c('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2f6376,_0x1fce69,_0x592d53){return new BPromise(function(_0x566012,_0x426bf7){return client['request'](_0x2f6376,_0x592d53)[_0x4f8c('0x9')](function(_0x14d61c){logger[_0x4f8c('0xa')](_0x4f8c('0xb'),_0x1fce69,_0x4f8c('0xc'));logger[_0x4f8c('0xd')](_0x4f8c('0xe'),_0x1fce69,'request\x20sent',JSON[_0x4f8c('0xf')](_0x14d61c));if(_0x14d61c[_0x4f8c('0x10')]){if(_0x14d61c[_0x4f8c('0x10')][_0x4f8c('0x11')]===0x1f4){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x1fce69,_0x14d61c[_0x4f8c('0x10')][_0x4f8c('0x12')]);return _0x426bf7(_0x14d61c['error'][_0x4f8c('0x12')]);}logger[_0x4f8c('0x10')](_0x4f8c('0xb'),_0x1fce69,_0x14d61c[_0x4f8c('0x10')][_0x4f8c('0x12')]);return _0x566012(_0x14d61c['error']['message']);}else{logger[_0x4f8c('0xa')](_0x4f8c('0xb'),_0x1fce69,_0x4f8c('0xc'));_0x566012(_0x14d61c[_0x4f8c('0x13')][_0x4f8c('0x12')]);}})[_0x4f8c('0x14')](function(_0x5de5b4){logger['error'](_0x4f8c('0xb'),_0x1fce69,_0x5de5b4);_0x426bf7(_0x5de5b4);});});}