a2d332e4b7efcb54997d25b91f6f707b6e83e2ee
[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 _0x09e0=['then','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x585471,_0x5a9b54){var _0x26b3d4=function(_0x5a9194){while(--_0x5a9194){_0x585471['push'](_0x585471['shift']());}};_0x26b3d4(++_0x5a9b54);}(_0x09e0,0x1c3));var _0x009e=function(_0x3e8be9,_0x50ab41){_0x3e8be9=_0x3e8be9-0x0;var _0x5f083e=_0x09e0[_0x3e8be9];return _0x5f083e;};'use strict';var _=require(_0x009e('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x009e('0x1'));var rs=require(_0x009e('0x2'));var fs=require('fs');var Redis=require(_0x009e('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x009e('0x4'));var logger=require(_0x009e('0x5'))(_0x009e('0x6'));var config=require(_0x009e('0x7'));var jayson=require(_0x009e('0x8'));var client=jayson['client'][_0x009e('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3e8cdb,_0x1e0627,_0x1a01ed){return new BPromise(function(_0x35a17d,_0x465ef0){return client[_0x009e('0xa')](_0x3e8cdb,_0x1a01ed)[_0x009e('0xb')](function(_0x3e5bc3){logger['info'](_0x009e('0xc'),_0x1e0627,_0x009e('0xd'));logger[_0x009e('0xe')](_0x009e('0xf'),_0x1e0627,'request\x20sent',JSON[_0x009e('0x10')](_0x3e5bc3));if(_0x3e5bc3[_0x009e('0x11')]){if(_0x3e5bc3['error'][_0x009e('0x12')]===0x1f4){logger[_0x009e('0x11')](_0x009e('0xc'),_0x1e0627,_0x3e5bc3[_0x009e('0x11')]['message']);return _0x465ef0(_0x3e5bc3['error'][_0x009e('0x13')]);}logger[_0x009e('0x11')](_0x009e('0xc'),_0x1e0627,_0x3e5bc3[_0x009e('0x11')][_0x009e('0x13')]);return _0x35a17d(_0x3e5bc3[_0x009e('0x11')][_0x009e('0x13')]);}else{logger['info'](_0x009e('0xc'),_0x1e0627,_0x009e('0xd'));_0x35a17d(_0x3e5bc3[_0x009e('0x14')][_0x009e('0x13')]);}})[_0x009e('0x15')](function(_0x325d5c){logger[_0x009e('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x1e0627,_0x325d5c);_0x465ef0(_0x325d5c);});});}