Built motion from commit (unavailable).|2.5.21
[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 _0x0387=['rpc','../../config/environment','client','request','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x131151,_0x5b870a){var _0x3ff792=function(_0x86f3af){while(--_0x86f3af){_0x131151['push'](_0x131151['shift']());}};_0x3ff792(++_0x5b870a);}(_0x0387,0x11f));var _0x7038=function(_0x1bfc59,_0x591301){_0x1bfc59=_0x1bfc59-0x0;var _0x34b0cf=_0x0387[_0x1bfc59];return _0x34b0cf;};'use strict';var _=require(_0x7038('0x0'));var util=require('util');var moment=require(_0x7038('0x1'));var BPromise=require(_0x7038('0x2'));var rs=require(_0x7038('0x3'));var fs=require('fs');var Redis=require(_0x7038('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7038('0x5'));var logger=require(_0x7038('0x6'))(_0x7038('0x7'));var config=require(_0x7038('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x7038('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xf8dff7,_0x141b12,_0x4bef52){return new BPromise(function(_0x140966,_0x1ae2a8){return client[_0x7038('0xa')](_0xf8dff7,_0x4bef52)['then'](function(_0x4ba09f){logger[_0x7038('0xb')](_0x7038('0xc'),_0x141b12,_0x7038('0xd'));logger[_0x7038('0xe')](_0x7038('0xf'),_0x141b12,'request\x20sent',JSON['stringify'](_0x4ba09f));if(_0x4ba09f['error']){if(_0x4ba09f['error'][_0x7038('0x10')]===0x1f4){logger[_0x7038('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x141b12,_0x4ba09f[_0x7038('0x11')]['message']);return _0x1ae2a8(_0x4ba09f[_0x7038('0x11')][_0x7038('0x12')]);}logger[_0x7038('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x141b12,_0x4ba09f['error'][_0x7038('0x12')]);return _0x140966(_0x4ba09f[_0x7038('0x11')][_0x7038('0x12')]);}else{logger[_0x7038('0xb')](_0x7038('0xc'),_0x141b12,_0x7038('0xd'));_0x140966(_0x4ba09f[_0x7038('0x13')][_0x7038('0x12')]);}})[_0x7038('0x14')](function(_0x2fbc35){logger[_0x7038('0x11')](_0x7038('0xc'),_0x141b12,_0x2fbc35);_0x1ae2a8(_0x2fbc35);});});}