Built motion from commit (unavailable).|2.5.4
[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 _0xfab5=['http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise'];(function(_0x4a8c94,_0x11e889){var _0x20d7e6=function(_0x391813){while(--_0x391813){_0x4a8c94['push'](_0x4a8c94['shift']());}};_0x20d7e6(++_0x11e889);}(_0xfab5,0xe9));var _0x5fab=function(_0x51f4f1,_0x4035f7){_0x51f4f1=_0x51f4f1-0x0;var _0x2656cb=_0xfab5[_0x51f4f1];return _0x2656cb;};'use strict';var _=require(_0x5fab('0x0'));var util=require(_0x5fab('0x1'));var moment=require('moment');var BPromise=require(_0x5fab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5fab('0x3'));var db=require(_0x5fab('0x4'))['db'];var utils=require(_0x5fab('0x5'));var logger=require('../../config/logger')(_0x5fab('0x6'));var config=require(_0x5fab('0x7'));var jayson=require(_0x5fab('0x8'));var client=jayson['client'][_0x5fab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x44b863,_0x35e962,_0x109842){return new BPromise(function(_0x4ed261,_0x143de6){return client[_0x5fab('0xa')](_0x44b863,_0x109842)[_0x5fab('0xb')](function(_0x573c8c){logger[_0x5fab('0xc')](_0x5fab('0xd'),_0x35e962,'request\x20sent');logger[_0x5fab('0xe')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x35e962,_0x5fab('0xf'),JSON[_0x5fab('0x10')](_0x573c8c));if(_0x573c8c[_0x5fab('0x11')]){if(_0x573c8c[_0x5fab('0x11')][_0x5fab('0x12')]===0x1f4){logger[_0x5fab('0x11')](_0x5fab('0xd'),_0x35e962,_0x573c8c['error'][_0x5fab('0x13')]);return _0x143de6(_0x573c8c[_0x5fab('0x11')][_0x5fab('0x13')]);}logger['error'](_0x5fab('0xd'),_0x35e962,_0x573c8c[_0x5fab('0x11')][_0x5fab('0x13')]);return _0x4ed261(_0x573c8c['error']['message']);}else{logger['info'](_0x5fab('0xd'),_0x35e962,_0x5fab('0xf'));_0x4ed261(_0x573c8c[_0x5fab('0x14')][_0x5fab('0x13')]);}})[_0x5fab('0x15')](function(_0x5c0505){logger[_0x5fab('0x11')](_0x5fab('0xd'),_0x35e962,_0x5c0505);_0x143de6(_0x5c0505);});});}