Built motion from commit (unavailable).|2.5.7
[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 _0x551d=['error','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s'];(function(_0x4c12ec,_0x2e9103){var _0x3ae42c=function(_0x5a728f){while(--_0x5a728f){_0x4c12ec['push'](_0x4c12ec['shift']());}};_0x3ae42c(++_0x2e9103);}(_0x551d,0x194));var _0xd551=function(_0x54f859,_0x59d463){_0x54f859=_0x54f859-0x0;var _0x17a08b=_0x551d[_0x54f859];return _0x17a08b;};'use strict';var _=require(_0xd551('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd551('0x1'));var rs=require(_0xd551('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd551('0x3'))['db'];var utils=require(_0xd551('0x4'));var logger=require(_0xd551('0x5'))(_0xd551('0x6'));var config=require(_0xd551('0x7'));var jayson=require(_0xd551('0x8'));var client=jayson[_0xd551('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x87766b,_0x34ec7b,_0x3200f1){return new BPromise(function(_0x5d7548,_0x1ecf7f){return client[_0xd551('0xa')](_0x87766b,_0x3200f1)['then'](function(_0x4c72b6){logger[_0xd551('0xb')](_0xd551('0xc'),_0x34ec7b,_0xd551('0xd'));logger[_0xd551('0xe')](_0xd551('0xf'),_0x34ec7b,_0xd551('0xd'),JSON['stringify'](_0x4c72b6));if(_0x4c72b6[_0xd551('0x10')]){if(_0x4c72b6['error']['code']===0x1f4){logger[_0xd551('0x10')]('AnalyticTreeReport,\x20%s,\x20%s',_0x34ec7b,_0x4c72b6['error'][_0xd551('0x11')]);return _0x1ecf7f(_0x4c72b6['error'][_0xd551('0x11')]);}logger[_0xd551('0x10')](_0xd551('0xc'),_0x34ec7b,_0x4c72b6[_0xd551('0x10')][_0xd551('0x11')]);return _0x5d7548(_0x4c72b6[_0xd551('0x10')][_0xd551('0x11')]);}else{logger[_0xd551('0xb')]('AnalyticTreeReport,\x20%s,\x20%s',_0x34ec7b,_0xd551('0xd'));_0x5d7548(_0x4c72b6[_0xd551('0x12')][_0xd551('0x11')]);}})[_0xd551('0x13')](function(_0x2a1b2a){logger['error'](_0xd551('0xc'),_0x34ec7b,_0x2a1b2a);_0x1ecf7f(_0x2a1b2a);});});}