4ea0699d4bb3daf3d2ecb11ed18b7fffca4bce62
[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 _0x49ad=['info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x4095db,_0x287ac6){var _0xc97464=function(_0x2b33c2){while(--_0x2b33c2){_0x4095db['push'](_0x4095db['shift']());}};_0xc97464(++_0x287ac6);}(_0x49ad,0x13e));var _0xd49a=function(_0x586c70,_0x4a8cb3){_0x586c70=_0x586c70-0x0;var _0x26db79=_0x49ad[_0x586c70];return _0x26db79;};'use strict';var _=require(_0xd49a('0x0'));var util=require(_0xd49a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xd49a('0x2'));var fs=require('fs');var Redis=require(_0xd49a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd49a('0x4'));var logger=require(_0xd49a('0x5'))(_0xd49a('0x6'));var config=require(_0xd49a('0x7'));var jayson=require(_0xd49a('0x8'));var client=jayson['client'][_0xd49a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x253c39,_0x20f775,_0x3aca69){return new BPromise(function(_0x2a5020,_0x5f04c2){return client[_0xd49a('0xa')](_0x253c39,_0x3aca69)[_0xd49a('0xb')](function(_0x461a38){logger[_0xd49a('0xc')](_0xd49a('0xd'),_0x20f775,_0xd49a('0xe'));logger[_0xd49a('0xf')](_0xd49a('0x10'),_0x20f775,_0xd49a('0xe'),JSON[_0xd49a('0x11')](_0x461a38));if(_0x461a38[_0xd49a('0x12')]){if(_0x461a38[_0xd49a('0x12')][_0xd49a('0x13')]===0x1f4){logger[_0xd49a('0x12')](_0xd49a('0xd'),_0x20f775,_0x461a38[_0xd49a('0x12')][_0xd49a('0x14')]);return _0x5f04c2(_0x461a38[_0xd49a('0x12')]['message']);}logger['error'](_0xd49a('0xd'),_0x20f775,_0x461a38[_0xd49a('0x12')]['message']);return _0x2a5020(_0x461a38['error']['message']);}else{logger[_0xd49a('0xc')](_0xd49a('0xd'),_0x20f775,_0xd49a('0xe'));_0x2a5020(_0x461a38['result']['message']);}})[_0xd49a('0x15')](function(_0x343d9d){logger[_0xd49a('0x12')](_0xd49a('0xd'),_0x20f775,_0x343d9d);_0x5f04c2(_0x343d9d);});});}