Built motion from commit (unavailable).|2.5.5
[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 _0x656d=['AnalyticExtractedReport,\x20%s,\x20%s','message','lodash','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','stringify','error','code'];(function(_0x4bf299,_0x175b4c){var _0x5dc146=function(_0x418e07){while(--_0x418e07){_0x4bf299['push'](_0x4bf299['shift']());}};_0x5dc146(++_0x175b4c);}(_0x656d,0x158));var _0xd656=function(_0x2b0cc6,_0x2e23f3){_0x2b0cc6=_0x2b0cc6-0x0;var _0x51a860=_0x656d[_0x2b0cc6];return _0x51a860;};'use strict';var _=require(_0xd656('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd656('0x1'));var db=require(_0xd656('0x2'))['db'];var utils=require('../../config/utils');var logger=require(_0xd656('0x3'))(_0xd656('0x4'));var config=require('../../config/environment');var jayson=require(_0xd656('0x5'));var client=jayson[_0xd656('0x6')][_0xd656('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x1f4afd,_0x5bb1c8,_0x44b52d){return new BPromise(function(_0x477712,_0x3c1ec9){return client[_0xd656('0x8')](_0x1f4afd,_0x44b52d)[_0xd656('0x9')](function(_0x17a933){logger[_0xd656('0xa')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bb1c8,_0xd656('0xb'));logger[_0xd656('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x5bb1c8,'request\x20sent',JSON[_0xd656('0xd')](_0x17a933));if(_0x17a933[_0xd656('0xe')]){if(_0x17a933[_0xd656('0xe')][_0xd656('0xf')]===0x1f4){logger[_0xd656('0xe')](_0xd656('0x10'),_0x5bb1c8,_0x17a933[_0xd656('0xe')][_0xd656('0x11')]);return _0x3c1ec9(_0x17a933[_0xd656('0xe')][_0xd656('0x11')]);}logger[_0xd656('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bb1c8,_0x17a933['error']['message']);return _0x477712(_0x17a933[_0xd656('0xe')]['message']);}else{logger[_0xd656('0xa')](_0xd656('0x10'),_0x5bb1c8,'request\x20sent');_0x477712(_0x17a933['result'][_0xd656('0x11')]);}})['catch'](function(_0x12fcf2){logger['error']('AnalyticExtractedReport,\x20%s,\x20%s',_0x5bb1c8,_0x12fcf2);_0x3c1ec9(_0x12fcf2);});});}