Built motion from commit 3770a7bd.|2.6.29
[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 _0x60aa=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','bluebird','randomstring','ioredis'];(function(_0x478755,_0x3b7f0e){var _0x18d7e5=function(_0x25e21b){while(--_0x25e21b){_0x478755['push'](_0x478755['shift']());}};_0x18d7e5(++_0x3b7f0e);}(_0x60aa,0x13e));var _0xa60a=function(_0x3a3df9,_0x260c41){_0x3a3df9=_0x3a3df9-0x0;var _0x5457e0=_0x60aa[_0x3a3df9];return _0x5457e0;};'use strict';var _=require('lodash');var util=require(_0xa60a('0x0'));var moment=require('moment');var BPromise=require(_0xa60a('0x1'));var rs=require(_0xa60a('0x2'));var fs=require('fs');var Redis=require(_0xa60a('0x3'));var db=require(_0xa60a('0x4'))['db'];var utils=require(_0xa60a('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0xa60a('0x6'));var jayson=require(_0xa60a('0x7'));var client=jayson[_0xa60a('0x8')][_0xa60a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5c9cbc,_0x38239e,_0x13bec1){return new BPromise(function(_0x5dc47c,_0x5c2371){return client[_0xa60a('0xa')](_0x5c9cbc,_0x13bec1)[_0xa60a('0xb')](function(_0x37bd78){logger[_0xa60a('0xc')](_0xa60a('0xd'),_0x38239e,_0xa60a('0xe'));logger[_0xa60a('0xf')](_0xa60a('0x10'),_0x38239e,_0xa60a('0xe'),JSON[_0xa60a('0x11')](_0x37bd78));if(_0x37bd78[_0xa60a('0x12')]){if(_0x37bd78['error'][_0xa60a('0x13')]===0x1f4){logger[_0xa60a('0x12')](_0xa60a('0xd'),_0x38239e,_0x37bd78[_0xa60a('0x12')][_0xa60a('0x14')]);return _0x5c2371(_0x37bd78[_0xa60a('0x12')]['message']);}logger[_0xa60a('0x12')](_0xa60a('0xd'),_0x38239e,_0x37bd78[_0xa60a('0x12')]['message']);return _0x5dc47c(_0x37bd78['error'][_0xa60a('0x14')]);}else{logger[_0xa60a('0xc')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x38239e,_0xa60a('0xe'));_0x5dc47c(_0x37bd78[_0xa60a('0x15')][_0xa60a('0x14')]);}})[_0xa60a('0x16')](function(_0x11556c){logger[_0xa60a('0x12')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x38239e,_0x11556c);_0x5c2371(_0x11556c);});});}