748309b25471b2bd670ea6dd3906c5a9268f2559
[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 _0x702f=['util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x702f,0x1af));var _0xf702=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x702f[_0x2641f9];return _0x585741;};'use strict';var _=require(_0xf702('0x0'));var util=require(_0xf702('0x1'));var moment=require('moment');var BPromise=require(_0xf702('0x2'));var rs=require(_0xf702('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf702('0x4'))['db'];var utils=require(_0xf702('0x5'));var logger=require(_0xf702('0x6'))(_0xf702('0x7'));var config=require(_0xf702('0x8'));var jayson=require(_0xf702('0x9'));var client=jayson[_0xf702('0xa')][_0xf702('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1149bb,_0x576003,_0x1c7c78){return new BPromise(function(_0x28421f,_0x28fec8){return client[_0xf702('0xc')](_0x1149bb,_0x1c7c78)[_0xf702('0xd')](function(_0x422cd6){logger['info'](_0xf702('0xe'),_0x576003,_0xf702('0xf'));logger[_0xf702('0x10')](_0xf702('0x11'),_0x576003,_0xf702('0xf'),JSON[_0xf702('0x12')](_0x422cd6));if(_0x422cd6[_0xf702('0x13')]){if(_0x422cd6[_0xf702('0x13')][_0xf702('0x14')]===0x1f4){logger[_0xf702('0x13')](_0xf702('0xe'),_0x576003,_0x422cd6[_0xf702('0x13')][_0xf702('0x15')]);return _0x28fec8(_0x422cd6['error']['message']);}logger[_0xf702('0x13')](_0xf702('0xe'),_0x576003,_0x422cd6[_0xf702('0x13')][_0xf702('0x15')]);return _0x28421f(_0x422cd6['error'][_0xf702('0x15')]);}else{logger[_0xf702('0x16')](_0xf702('0xe'),_0x576003,'request\x20sent');_0x28421f(_0x422cd6['result']['message']);}})[_0xf702('0x17')](function(_0x30094c){logger[_0xf702('0x13')](_0xf702('0xe'),_0x576003,_0x30094c);_0x28fec8(_0x30094c);});});}