Built motion from commit (unavailable).|2.4.18
[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 _0x9341=['client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x35541c,_0x156ccf){var _0x4a26c5=function(_0xea7f9b){while(--_0xea7f9b){_0x35541c['push'](_0x35541c['shift']());}};_0x4a26c5(++_0x156ccf);}(_0x9341,0x176));var _0x1934=function(_0x2c7615,_0x59e33e){_0x2c7615=_0x2c7615-0x0;var _0x3bf545=_0x9341[_0x2c7615];return _0x3bf545;};'use strict';var _=require(_0x1934('0x0'));var util=require(_0x1934('0x1'));var moment=require('moment');var BPromise=require(_0x1934('0x2'));var rs=require(_0x1934('0x3'));var fs=require('fs');var Redis=require(_0x1934('0x4'));var db=require(_0x1934('0x5'))['db'];var utils=require(_0x1934('0x6'));var logger=require(_0x1934('0x7'))('rpc');var config=require(_0x1934('0x8'));var jayson=require(_0x1934('0x9'));var client=jayson[_0x1934('0xa')][_0x1934('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xa2fc82,_0x43aad9,_0x1722ed){return new BPromise(function(_0x8e85c,_0x5620de){return client[_0x1934('0xc')](_0xa2fc82,_0x1722ed)[_0x1934('0xd')](function(_0x39d094){logger[_0x1934('0xe')](_0x1934('0xf'),_0x43aad9,_0x1934('0x10'));logger[_0x1934('0x11')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x43aad9,_0x1934('0x10'),JSON[_0x1934('0x12')](_0x39d094));if(_0x39d094['error']){if(_0x39d094[_0x1934('0x13')][_0x1934('0x14')]===0x1f4){logger[_0x1934('0x13')](_0x1934('0xf'),_0x43aad9,_0x39d094[_0x1934('0x13')][_0x1934('0x15')]);return _0x5620de(_0x39d094[_0x1934('0x13')][_0x1934('0x15')]);}logger[_0x1934('0x13')](_0x1934('0xf'),_0x43aad9,_0x39d094[_0x1934('0x13')]['message']);return _0x8e85c(_0x39d094['error'][_0x1934('0x15')]);}else{logger['info'](_0x1934('0xf'),_0x43aad9,_0x1934('0x10'));_0x8e85c(_0x39d094[_0x1934('0x16')][_0x1934('0x15')]);}})[_0x1934('0x17')](function(_0x493f6c){logger[_0x1934('0x13')](_0x1934('0xf'),_0x43aad9,_0x493f6c);_0x5620de(_0x493f6c);});});}