Built motion from commit (unavailable).|2.5.6
[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 _0xba93=['then','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','catch','lodash','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','request'];(function(_0x25a6c6,_0x222572){var _0x1a2ee0=function(_0x1bcd75){while(--_0x1bcd75){_0x25a6c6['push'](_0x25a6c6['shift']());}};_0x1a2ee0(++_0x222572);}(_0xba93,0x117));var _0x3ba9=function(_0x19dfcc,_0x325656){_0x19dfcc=_0x19dfcc-0x0;var _0x10a833=_0xba93[_0x19dfcc];return _0x10a833;};'use strict';var _=require(_0x3ba9('0x0'));var util=require('util');var moment=require(_0x3ba9('0x1'));var BPromise=require('bluebird');var rs=require(_0x3ba9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3ba9('0x3'))['db'];var utils=require(_0x3ba9('0x4'));var logger=require(_0x3ba9('0x5'))('rpc');var config=require(_0x3ba9('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x3ba9('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0xc80f39,_0x1cc533,_0x54c77c){return new BPromise(function(_0x4d178f,_0x33f0dd){return client[_0x3ba9('0x8')](_0xc80f39,_0x54c77c)[_0x3ba9('0x9')](function(_0x500f86){logger['info'](_0x3ba9('0xa'),_0x1cc533,'request\x20sent');logger['debug'](_0x3ba9('0xb'),_0x1cc533,_0x3ba9('0xc'),JSON[_0x3ba9('0xd')](_0x500f86));if(_0x500f86[_0x3ba9('0xe')]){if(_0x500f86[_0x3ba9('0xe')]['code']===0x1f4){logger[_0x3ba9('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1cc533,_0x500f86[_0x3ba9('0xe')]['message']);return _0x33f0dd(_0x500f86['error']['message']);}logger[_0x3ba9('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1cc533,_0x500f86[_0x3ba9('0xe')][_0x3ba9('0xf')]);return _0x4d178f(_0x500f86['error'][_0x3ba9('0xf')]);}else{logger[_0x3ba9('0x10')](_0x3ba9('0xa'),_0x1cc533,_0x3ba9('0xc'));_0x4d178f(_0x500f86['result'][_0x3ba9('0xf')]);}})[_0x3ba9('0x11')](function(_0x26fb2d){logger[_0x3ba9('0xe')](_0x3ba9('0xa'),_0x1cc533,_0x26fb2d);_0x33f0dd(_0x26fb2d);});});}