Built motion from commit (unavailable).|2.5.2
[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 _0x9f0b=['ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','request','request\x20sent','debug','stringify','error','code','message','AnalyticTreeReport,\x20%s,\x20%s','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x9f0b,0xb0));var _0xb9f0=function(_0x3899d1,_0x4aa04c){_0x3899d1=_0x3899d1-0x0;var _0xeb4a7d=_0x9f0b[_0x3899d1];return _0xeb4a7d;};'use strict';var _=require(_0xb9f0('0x0'));var util=require('util');var moment=require(_0xb9f0('0x1'));var BPromise=require(_0xb9f0('0x2'));var rs=require(_0xb9f0('0x3'));var fs=require('fs');var Redis=require(_0xb9f0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xb9f0('0x5'));var logger=require(_0xb9f0('0x6'))('rpc');var config=require(_0xb9f0('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xb9f0('0x8')][_0xb9f0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x54dd17,_0x10753d,_0x9f7a19){return new BPromise(function(_0x188ef8,_0x6b60ac){return client[_0xb9f0('0xa')](_0x54dd17,_0x9f7a19)['then'](function(_0x12ce3f){logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x10753d,_0xb9f0('0xb'));logger[_0xb9f0('0xc')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x10753d,_0xb9f0('0xb'),JSON[_0xb9f0('0xd')](_0x12ce3f));if(_0x12ce3f['error']){if(_0x12ce3f[_0xb9f0('0xe')][_0xb9f0('0xf')]===0x1f4){logger[_0xb9f0('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x10753d,_0x12ce3f[_0xb9f0('0xe')][_0xb9f0('0x10')]);return _0x6b60ac(_0x12ce3f[_0xb9f0('0xe')][_0xb9f0('0x10')]);}logger[_0xb9f0('0xe')](_0xb9f0('0x11'),_0x10753d,_0x12ce3f[_0xb9f0('0xe')][_0xb9f0('0x10')]);return _0x188ef8(_0x12ce3f['error']['message']);}else{logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x10753d,_0xb9f0('0xb'));_0x188ef8(_0x12ce3f[_0xb9f0('0x12')][_0xb9f0('0x10')]);}})[_0xb9f0('0x13')](function(_0xc7096){logger[_0xb9f0('0xe')](_0xb9f0('0x11'),_0x10753d,_0xc7096);_0x6b60ac(_0xc7096);});});}