Built motion from commit (unavailable).|2.5.31
[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 _0xbcbe=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','info','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','AnalyticTreeReport,\x20%s,\x20%s','message','result','catch'];(function(_0x3e2760,_0x57f161){var _0x4713b8=function(_0x3fba27){while(--_0x3fba27){_0x3e2760['push'](_0x3e2760['shift']());}};_0x4713b8(++_0x57f161);}(_0xbcbe,0x19e));var _0xebcb=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbcbe[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xebcb('0x0'));var util=require(_0xebcb('0x1'));var moment=require(_0xebcb('0x2'));var BPromise=require(_0xebcb('0x3'));var rs=require(_0xebcb('0x4'));var fs=require('fs');var Redis=require(_0xebcb('0x5'));var db=require(_0xebcb('0x6'))['db'];var utils=require(_0xebcb('0x7'));var logger=require(_0xebcb('0x8'))(_0xebcb('0x9'));var config=require(_0xebcb('0xa'));var jayson=require(_0xebcb('0xb'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x38d31d,_0x2cd0b7,_0x4ef518){return new BPromise(function(_0x37b974,_0x559993){return client[_0xebcb('0xc')](_0x38d31d,_0x4ef518)['then'](function(_0x41b59f){logger[_0xebcb('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x2cd0b7,'request\x20sent');logger[_0xebcb('0xe')](_0xebcb('0xf'),_0x2cd0b7,_0xebcb('0x10'),JSON[_0xebcb('0x11')](_0x41b59f));if(_0x41b59f[_0xebcb('0x12')]){if(_0x41b59f[_0xebcb('0x12')]['code']===0x1f4){logger[_0xebcb('0x12')](_0xebcb('0x13'),_0x2cd0b7,_0x41b59f['error'][_0xebcb('0x14')]);return _0x559993(_0x41b59f['error'][_0xebcb('0x14')]);}logger[_0xebcb('0x12')](_0xebcb('0x13'),_0x2cd0b7,_0x41b59f[_0xebcb('0x12')][_0xebcb('0x14')]);return _0x37b974(_0x41b59f[_0xebcb('0x12')][_0xebcb('0x14')]);}else{logger[_0xebcb('0xd')](_0xebcb('0x13'),_0x2cd0b7,_0xebcb('0x10'));_0x37b974(_0x41b59f[_0xebcb('0x15')][_0xebcb('0x14')]);}})[_0xebcb('0x16')](function(_0x4c7a7d){logger['error'](_0xebcb('0x13'),_0x2cd0b7,_0x4c7a7d);_0x559993(_0x4c7a7d);});});}