Built motion from commit (unavailable).|2.5.13
[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 _0x4b57=['error','message','request\x20sent','result','catch','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x3fd1f8,_0x4b98f0){var _0x551c77=function(_0x1fe889){while(--_0x1fe889){_0x3fd1f8['push'](_0x3fd1f8['shift']());}};_0x551c77(++_0x4b98f0);}(_0x4b57,0x101));var _0x74b5=function(_0x1177d5,_0x22b649){_0x1177d5=_0x1177d5-0x0;var _0xc3ddc2=_0x4b57[_0x1177d5];return _0xc3ddc2;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x74b5('0x0'));var rs=require(_0x74b5('0x1'));var fs=require('fs');var Redis=require(_0x74b5('0x2'));var db=require(_0x74b5('0x3'))['db'];var utils=require(_0x74b5('0x4'));var logger=require(_0x74b5('0x5'))(_0x74b5('0x6'));var config=require(_0x74b5('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0x74b5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x475c3e,_0x14308c,_0x1d660c){return new BPromise(function(_0x4fe277,_0x12d340){return client[_0x74b5('0x9')](_0x475c3e,_0x1d660c)[_0x74b5('0xa')](function(_0x4c0708){logger[_0x74b5('0xb')](_0x74b5('0xc'),_0x14308c,'request\x20sent');logger[_0x74b5('0xd')](_0x74b5('0xe'),_0x14308c,'request\x20sent',JSON[_0x74b5('0xf')](_0x4c0708));if(_0x4c0708[_0x74b5('0x10')]){if(_0x4c0708[_0x74b5('0x10')]['code']===0x1f4){logger[_0x74b5('0x10')](_0x74b5('0xc'),_0x14308c,_0x4c0708['error'][_0x74b5('0x11')]);return _0x12d340(_0x4c0708[_0x74b5('0x10')][_0x74b5('0x11')]);}logger[_0x74b5('0x10')](_0x74b5('0xc'),_0x14308c,_0x4c0708[_0x74b5('0x10')][_0x74b5('0x11')]);return _0x4fe277(_0x4c0708['error'][_0x74b5('0x11')]);}else{logger[_0x74b5('0xb')]('AnalyticTreeReport,\x20%s,\x20%s',_0x14308c,_0x74b5('0x12'));_0x4fe277(_0x4c0708[_0x74b5('0x13')][_0x74b5('0x11')]);}})[_0x74b5('0x14')](function(_0x27fbed){logger[_0x74b5('0x10')](_0x74b5('0xc'),_0x14308c,_0x27fbed);_0x12d340(_0x27fbed);});});}