Built motion from commit e6806ed6.|2.6.0
[motion2.git] / server / api / analyticCustomReport / analyticCustomReport.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 _0x7d2e=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','code','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','info','request\x20sent','debug'];(function(_0x310009,_0x39b034){var _0x234199=function(_0xd525b1){while(--_0xd525b1){_0x310009['push'](_0x310009['shift']());}};_0x234199(++_0x39b034);}(_0x7d2e,0x1ac));var _0xe7d2=function(_0x27af08,_0x192c31){_0x27af08=_0x27af08-0x0;var _0x49eb8e=_0x7d2e[_0x27af08];return _0x49eb8e;};'use strict';var _=require(_0xe7d2('0x0'));var util=require(_0xe7d2('0x1'));var moment=require(_0xe7d2('0x2'));var BPromise=require(_0xe7d2('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xe7d2('0x4'));var logger=require(_0xe7d2('0x5'))(_0xe7d2('0x6'));var config=require(_0xe7d2('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xe7d2('0x8')][_0xe7d2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x14d3ab,_0x49f964,_0x23d77d){return new BPromise(function(_0x8d777a,_0x5b192a){return client['request'](_0x14d3ab,_0x23d77d)['then'](function(_0x50b0a3){logger[_0xe7d2('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x49f964,_0xe7d2('0xb'));logger[_0xe7d2('0xc')](_0xe7d2('0xd'),_0x49f964,_0xe7d2('0xb'),JSON[_0xe7d2('0xe')](_0x50b0a3));if(_0x50b0a3['error']){if(_0x50b0a3['error'][_0xe7d2('0xf')]===0x1f4){logger[_0xe7d2('0x10')](_0xe7d2('0x11'),_0x49f964,_0x50b0a3['error'][_0xe7d2('0x12')]);return _0x5b192a(_0x50b0a3[_0xe7d2('0x10')]['message']);}logger[_0xe7d2('0x10')](_0xe7d2('0x11'),_0x49f964,_0x50b0a3[_0xe7d2('0x10')][_0xe7d2('0x12')]);return _0x8d777a(_0x50b0a3['error'][_0xe7d2('0x12')]);}else{logger[_0xe7d2('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x49f964,_0xe7d2('0xb'));_0x8d777a(_0x50b0a3[_0xe7d2('0x13')][_0xe7d2('0x12')]);}})[_0xe7d2('0x14')](function(_0x110c3b){logger[_0xe7d2('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x49f964,_0x110c3b);_0x5b192a(_0x110c3b);});});}