Built motion from commit (unavailable).|2.4.18
[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 _0x8918=['client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x21c9b5,_0x224108){var _0x11549f=function(_0x533fb7){while(--_0x533fb7){_0x21c9b5['push'](_0x21c9b5['shift']());}};_0x11549f(++_0x224108);}(_0x8918,0x97));var _0x8891=function(_0x16539a,_0x31409a){_0x16539a=_0x16539a-0x0;var _0x200796=_0x8918[_0x16539a];return _0x200796;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x8891('0x0'));var rs=require(_0x8891('0x1'));var fs=require('fs');var Redis=require(_0x8891('0x2'));var db=require(_0x8891('0x3'))['db'];var utils=require(_0x8891('0x4'));var logger=require(_0x8891('0x5'))(_0x8891('0x6'));var config=require(_0x8891('0x7'));var jayson=require(_0x8891('0x8'));var client=jayson[_0x8891('0x9')][_0x8891('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2102de,_0x28146d,_0x5c5a42){return new BPromise(function(_0x4e50f5,_0x5bc7c0){return client[_0x8891('0xb')](_0x2102de,_0x5c5a42)['then'](function(_0x2ebbf8){logger[_0x8891('0xc')](_0x8891('0xd'),_0x28146d,_0x8891('0xe'));logger['debug'](_0x8891('0xf'),_0x28146d,_0x8891('0xe'),JSON[_0x8891('0x10')](_0x2ebbf8));if(_0x2ebbf8['error']){if(_0x2ebbf8[_0x8891('0x11')]['code']===0x1f4){logger[_0x8891('0x11')](_0x8891('0xd'),_0x28146d,_0x2ebbf8['error'][_0x8891('0x12')]);return _0x5bc7c0(_0x2ebbf8['error'][_0x8891('0x12')]);}logger[_0x8891('0x11')](_0x8891('0xd'),_0x28146d,_0x2ebbf8[_0x8891('0x11')]['message']);return _0x4e50f5(_0x2ebbf8[_0x8891('0x11')][_0x8891('0x12')]);}else{logger['info'](_0x8891('0xd'),_0x28146d,_0x8891('0xe'));_0x4e50f5(_0x2ebbf8['result'][_0x8891('0x12')]);}})[_0x8891('0x13')](function(_0x29c87e){logger['error'](_0x8891('0xd'),_0x28146d,_0x29c87e);_0x5bc7c0(_0x29c87e);});});}