ff548ea0038888fc2737322664d90b83057c910b
[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 _0x2971=['ioredis','../../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','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x255315,_0x1551db){var _0x5874c4=function(_0x13a8cc){while(--_0x13a8cc){_0x255315['push'](_0x255315['shift']());}};_0x5874c4(++_0x1551db);}(_0x2971,0xee));var _0x1297=function(_0x2de5f5,_0x2fc330){_0x2de5f5=_0x2de5f5-0x0;var _0x3b38ee=_0x2971[_0x2de5f5];return _0x3b38ee;};'use strict';var _=require(_0x1297('0x0'));var util=require(_0x1297('0x1'));var moment=require(_0x1297('0x2'));var BPromise=require(_0x1297('0x3'));var rs=require(_0x1297('0x4'));var fs=require('fs');var Redis=require(_0x1297('0x5'));var db=require(_0x1297('0x6'))['db'];var utils=require(_0x1297('0x7'));var logger=require(_0x1297('0x8'))(_0x1297('0x9'));var config=require(_0x1297('0xa'));var jayson=require(_0x1297('0xb'));var client=jayson[_0x1297('0xc')][_0x1297('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3841fc,_0x1a7751,_0x1f25b4){return new BPromise(function(_0xe2ccfe,_0x1de2ac){return client[_0x1297('0xe')](_0x3841fc,_0x1f25b4)[_0x1297('0xf')](function(_0x54f79d){logger['info'](_0x1297('0x10'),_0x1a7751,_0x1297('0x11'));logger[_0x1297('0x12')](_0x1297('0x13'),_0x1a7751,_0x1297('0x11'),JSON[_0x1297('0x14')](_0x54f79d));if(_0x54f79d[_0x1297('0x15')]){if(_0x54f79d[_0x1297('0x15')][_0x1297('0x16')]===0x1f4){logger[_0x1297('0x15')](_0x1297('0x10'),_0x1a7751,_0x54f79d[_0x1297('0x15')]['message']);return _0x1de2ac(_0x54f79d['error'][_0x1297('0x17')]);}logger[_0x1297('0x15')](_0x1297('0x10'),_0x1a7751,_0x54f79d[_0x1297('0x15')][_0x1297('0x17')]);return _0xe2ccfe(_0x54f79d[_0x1297('0x15')][_0x1297('0x17')]);}else{logger[_0x1297('0x18')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1a7751,_0x1297('0x11'));_0xe2ccfe(_0x54f79d[_0x1297('0x19')][_0x1297('0x17')]);}})[_0x1297('0x1a')](function(_0x7b8f7f){logger[_0x1297('0x15')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1a7751,_0x7b8f7f);_0x1de2ac(_0x7b8f7f);});});}