Built motion from commit 85328c08.|2.5.50
[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 _0x42f4=['info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x9e95a9,_0x1686b0){var _0x580883=function(_0x310407){while(--_0x310407){_0x9e95a9['push'](_0x9e95a9['shift']());}};_0x580883(++_0x1686b0);}(_0x42f4,0x13e));var _0x442f=function(_0x138836,_0x229129){_0x138836=_0x138836-0x0;var _0x322688=_0x42f4[_0x138836];return _0x322688;};'use strict';var _=require(_0x442f('0x0'));var util=require(_0x442f('0x1'));var moment=require(_0x442f('0x2'));var BPromise=require(_0x442f('0x3'));var rs=require(_0x442f('0x4'));var fs=require('fs');var Redis=require(_0x442f('0x5'));var db=require(_0x442f('0x6'))['db'];var utils=require(_0x442f('0x7'));var logger=require(_0x442f('0x8'))('rpc');var config=require(_0x442f('0x9'));var jayson=require(_0x442f('0xa'));var client=jayson['client'][_0x442f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3a6c04,_0x173a42,_0x4a36dc){return new BPromise(function(_0x3a067b,_0x5a4516){return client['request'](_0x3a6c04,_0x4a36dc)['then'](function(_0xf10037){logger[_0x442f('0xc')](_0x442f('0xd'),_0x173a42,_0x442f('0xe'));logger[_0x442f('0xf')](_0x442f('0x10'),_0x173a42,_0x442f('0xe'),JSON[_0x442f('0x11')](_0xf10037));if(_0xf10037[_0x442f('0x12')]){if(_0xf10037[_0x442f('0x12')][_0x442f('0x13')]===0x1f4){logger[_0x442f('0x12')](_0x442f('0xd'),_0x173a42,_0xf10037[_0x442f('0x12')][_0x442f('0x14')]);return _0x5a4516(_0xf10037[_0x442f('0x12')][_0x442f('0x14')]);}logger[_0x442f('0x12')](_0x442f('0xd'),_0x173a42,_0xf10037[_0x442f('0x12')][_0x442f('0x14')]);return _0x3a067b(_0xf10037[_0x442f('0x12')][_0x442f('0x14')]);}else{logger[_0x442f('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x173a42,_0x442f('0xe'));_0x3a067b(_0xf10037['result'][_0x442f('0x14')]);}})[_0x442f('0x15')](function(_0x221ca3){logger[_0x442f('0x12')](_0x442f('0xd'),_0x173a42,_0x221ca3);_0x5a4516(_0x221ca3);});});}