Built motion from commit 10af8726.|2.6.34
[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 _0xf529=['AnalyticCustomReport,\x20%s,\x20%s','catch','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x113aa2,_0x458d12){var _0x2216d7=function(_0x57b420){while(--_0x57b420){_0x113aa2['push'](_0x113aa2['shift']());}};_0x2216d7(++_0x458d12);}(_0xf529,0x8e));var _0x9f52=function(_0x2172c8,_0x5d37da){_0x2172c8=_0x2172c8-0x0;var _0x496673=_0xf529[_0x2172c8];return _0x496673;};'use strict';var _=require('lodash');var util=require(_0x9f52('0x0'));var moment=require(_0x9f52('0x1'));var BPromise=require('bluebird');var rs=require(_0x9f52('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f52('0x3'))['db'];var utils=require(_0x9f52('0x4'));var logger=require('../../config/logger')(_0x9f52('0x5'));var config=require(_0x9f52('0x6'));var jayson=require(_0x9f52('0x7'));var client=jayson[_0x9f52('0x8')][_0x9f52('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4404a6,_0x23b21e,_0x4cb05d){return new BPromise(function(_0x452c93,_0x29ff8a){return client[_0x9f52('0xa')](_0x4404a6,_0x4cb05d)['then'](function(_0x4a09c2){logger[_0x9f52('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x23b21e,_0x9f52('0xc'));logger['debug'](_0x9f52('0xd'),_0x23b21e,'request\x20sent',JSON[_0x9f52('0xe')](_0x4a09c2));if(_0x4a09c2[_0x9f52('0xf')]){if(_0x4a09c2[_0x9f52('0xf')][_0x9f52('0x10')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x23b21e,_0x4a09c2[_0x9f52('0xf')][_0x9f52('0x11')]);return _0x29ff8a(_0x4a09c2['error'][_0x9f52('0x11')]);}logger[_0x9f52('0xf')](_0x9f52('0x12'),_0x23b21e,_0x4a09c2[_0x9f52('0xf')][_0x9f52('0x11')]);return _0x452c93(_0x4a09c2[_0x9f52('0xf')][_0x9f52('0x11')]);}else{logger['info'](_0x9f52('0x12'),_0x23b21e,_0x9f52('0xc'));_0x452c93(_0x4a09c2['result'][_0x9f52('0x11')]);}})[_0x9f52('0x13')](function(_0x41d0de){logger[_0x9f52('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x23b21e,_0x41d0de);_0x29ff8a(_0x41d0de);});});}