Built motion from commit (unavailable).|2.5.19
[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 _0x89d9=['catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','info','request\x20sent','stringify','error','message','AnalyticTreeReport,\x20%s,\x20%s','result'];(function(_0xcafa4b,_0x572040){var _0x4e3260=function(_0xfa5aba){while(--_0xfa5aba){_0xcafa4b['push'](_0xcafa4b['shift']());}};_0x4e3260(++_0x572040);}(_0x89d9,0x1bb));var _0x989d=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x89d9[_0x17d9e3];return _0x14192d;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x989d('0x0'));var BPromise=require(_0x989d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x989d('0x2'));var db=require(_0x989d('0x3'))['db'];var utils=require(_0x989d('0x4'));var logger=require(_0x989d('0x5'))('rpc');var config=require(_0x989d('0x6'));var jayson=require(_0x989d('0x7'));var client=jayson['client'][_0x989d('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xa3e08e,_0x6e6be7,_0xc5a871){return new BPromise(function(_0x24c464,_0x457a8c){return client['request'](_0xa3e08e,_0xc5a871)['then'](function(_0x2b9dcc){logger[_0x989d('0x9')]('AnalyticTreeReport,\x20%s,\x20%s',_0x6e6be7,'request\x20sent');logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x6e6be7,_0x989d('0xa'),JSON[_0x989d('0xb')](_0x2b9dcc));if(_0x2b9dcc[_0x989d('0xc')]){if(_0x2b9dcc[_0x989d('0xc')]['code']===0x1f4){logger[_0x989d('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x6e6be7,_0x2b9dcc[_0x989d('0xc')][_0x989d('0xd')]);return _0x457a8c(_0x2b9dcc[_0x989d('0xc')][_0x989d('0xd')]);}logger['error'](_0x989d('0xe'),_0x6e6be7,_0x2b9dcc[_0x989d('0xc')][_0x989d('0xd')]);return _0x24c464(_0x2b9dcc[_0x989d('0xc')]['message']);}else{logger[_0x989d('0x9')]('AnalyticTreeReport,\x20%s,\x20%s',_0x6e6be7,'request\x20sent');_0x24c464(_0x2b9dcc[_0x989d('0xf')]['message']);}})[_0x989d('0x10')](function(_0x367b31){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x6e6be7,_0x367b31);_0x457a8c(_0x367b31);});});}