Built motion from commit 14588770.|2.5.38
[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 _0x3c96=['http','request','then','info','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x1565e3,_0x39e7cb){var _0x25be7e=function(_0x382081){while(--_0x382081){_0x1565e3['push'](_0x1565e3['shift']());}};_0x25be7e(++_0x39e7cb);}(_0x3c96,0x1f1));var _0x63c9=function(_0x8152f9,_0x488273){_0x8152f9=_0x8152f9-0x0;var _0x2bcd1f=_0x3c96[_0x8152f9];return _0x2bcd1f;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x63c9('0x0'));var BPromise=require(_0x63c9('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x63c9('0x2'))['db'];var utils=require(_0x63c9('0x3'));var logger=require(_0x63c9('0x4'))(_0x63c9('0x5'));var config=require(_0x63c9('0x6'));var jayson=require(_0x63c9('0x7'));var client=jayson[_0x63c9('0x8')][_0x63c9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x274056,_0x1d14ee,_0x8066d4){return new BPromise(function(_0x57d25c,_0x459a1f){return client[_0x63c9('0xa')](_0x274056,_0x8066d4)[_0x63c9('0xb')](function(_0x357c1b){logger[_0x63c9('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1d14ee,_0x63c9('0xd'));logger[_0x63c9('0xe')](_0x63c9('0xf'),_0x1d14ee,_0x63c9('0xd'),JSON[_0x63c9('0x10')](_0x357c1b));if(_0x357c1b[_0x63c9('0x11')]){if(_0x357c1b[_0x63c9('0x11')][_0x63c9('0x12')]===0x1f4){logger[_0x63c9('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x1d14ee,_0x357c1b[_0x63c9('0x11')][_0x63c9('0x13')]);return _0x459a1f(_0x357c1b[_0x63c9('0x11')]['message']);}logger['error'](_0x63c9('0x14'),_0x1d14ee,_0x357c1b['error']['message']);return _0x57d25c(_0x357c1b['error']['message']);}else{logger[_0x63c9('0xc')](_0x63c9('0x14'),_0x1d14ee,_0x63c9('0xd'));_0x57d25c(_0x357c1b[_0x63c9('0x15')][_0x63c9('0x13')]);}})[_0x63c9('0x16')](function(_0x54ea7c){logger[_0x63c9('0x11')](_0x63c9('0x14'),_0x1d14ee,_0x54ea7c);_0x459a1f(_0x54ea7c);});});}