Built motion from commit (unavailable).|2.4.8
[motion2.git] / server / api / analyticTreeReport / analyticTreeReport.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 _0x346f=['request','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','info','catch','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client'];(function(_0x555c1b,_0x7a7ad0){var _0x4e17e6=function(_0xfef553){while(--_0xfef553){_0x555c1b['push'](_0x555c1b['shift']());}};_0x4e17e6(++_0x7a7ad0);}(_0x346f,0x14b));var _0xf346=function(_0x308408,_0x505bfd){_0x308408=_0x308408-0x0;var _0x519fa2=_0x346f[_0x308408];return _0x519fa2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xf346('0x0'));var BPromise=require('bluebird');var rs=require(_0xf346('0x1'));var fs=require('fs');var Redis=require(_0xf346('0x2'));var db=require(_0xf346('0x3'))['db'];var utils=require(_0xf346('0x4'));var logger=require(_0xf346('0x5'))(_0xf346('0x6'));var config=require(_0xf346('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xf346('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x37b7ae,_0x4cf12e,_0x4e582b){return new BPromise(function(_0xcfaba6,_0x2b7f75){return client[_0xf346('0x9')](_0x37b7ae,_0x4e582b)['then'](function(_0x343e71){logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x4cf12e,_0xf346('0xa'));logger[_0xf346('0xb')](_0xf346('0xc'),_0x4cf12e,'request\x20sent',JSON[_0xf346('0xd')](_0x343e71));if(_0x343e71[_0xf346('0xe')]){if(_0x343e71[_0xf346('0xe')][_0xf346('0xf')]===0x1f4){logger[_0xf346('0xe')](_0xf346('0x10'),_0x4cf12e,_0x343e71['error'][_0xf346('0x11')]);return _0x2b7f75(_0x343e71[_0xf346('0xe')][_0xf346('0x11')]);}logger['error'](_0xf346('0x10'),_0x4cf12e,_0x343e71[_0xf346('0xe')][_0xf346('0x11')]);return _0xcfaba6(_0x343e71[_0xf346('0xe')][_0xf346('0x11')]);}else{logger[_0xf346('0x12')]('AnalyticTreeReport,\x20%s,\x20%s',_0x4cf12e,_0xf346('0xa'));_0xcfaba6(_0x343e71['result'][_0xf346('0x11')]);}})[_0xf346('0x13')](function(_0x58103d){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x4cf12e,_0x58103d);_0x2b7f75(_0x58103d);});});}