fcd7c797e15287389fe4bbc0b3e38b1c05d91d2e
[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 _0x9e13=['lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch'];(function(_0x435193,_0x24b26b){var _0x429c61=function(_0x2dd5e9){while(--_0x2dd5e9){_0x435193['push'](_0x435193['shift']());}};_0x429c61(++_0x24b26b);}(_0x9e13,0x187));var _0x39e1=function(_0x50044a,_0x5c15d7){_0x50044a=_0x50044a-0x0;var _0x5dc1ad=_0x9e13[_0x50044a];return _0x5dc1ad;};'use strict';var _=require(_0x39e1('0x0'));var util=require(_0x39e1('0x1'));var moment=require(_0x39e1('0x2'));var BPromise=require(_0x39e1('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x39e1('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x39e1('0x5'));var logger=require(_0x39e1('0x6'))(_0x39e1('0x7'));var config=require(_0x39e1('0x8'));var jayson=require(_0x39e1('0x9'));var client=jayson['client'][_0x39e1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x126fd2,_0x2807dd,_0x186696){return new BPromise(function(_0x324c67,_0x2938c4){return client[_0x39e1('0xb')](_0x126fd2,_0x186696)['then'](function(_0x33f1a6){logger['info'](_0x39e1('0xc'),_0x2807dd,_0x39e1('0xd'));logger[_0x39e1('0xe')](_0x39e1('0xf'),_0x2807dd,_0x39e1('0xd'),JSON[_0x39e1('0x10')](_0x33f1a6));if(_0x33f1a6[_0x39e1('0x11')]){if(_0x33f1a6['error'][_0x39e1('0x12')]===0x1f4){logger[_0x39e1('0x11')](_0x39e1('0xc'),_0x2807dd,_0x33f1a6[_0x39e1('0x11')][_0x39e1('0x13')]);return _0x2938c4(_0x33f1a6[_0x39e1('0x11')][_0x39e1('0x13')]);}logger[_0x39e1('0x11')](_0x39e1('0xc'),_0x2807dd,_0x33f1a6[_0x39e1('0x11')][_0x39e1('0x13')]);return _0x324c67(_0x33f1a6[_0x39e1('0x11')]['message']);}else{logger[_0x39e1('0x14')](_0x39e1('0xc'),_0x2807dd,_0x39e1('0xd'));_0x324c67(_0x33f1a6[_0x39e1('0x15')]['message']);}})[_0x39e1('0x16')](function(_0x55932a){logger[_0x39e1('0x11')](_0x39e1('0xc'),_0x2807dd,_0x55932a);_0x2938c4(_0x55932a);});});}