240dba4bd1646ff71cae9fe8fabe1d59916a9ea0
[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 _0xa496=['info','request\x20sent','debug','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x338f45,_0x3b28c6){var _0xc327b9=function(_0x510aa1){while(--_0x510aa1){_0x338f45['push'](_0x338f45['shift']());}};_0xc327b9(++_0x3b28c6);}(_0xa496,0x82));var _0x6a49=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xa496[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x6a49('0x0'));var util=require(_0x6a49('0x1'));var moment=require(_0x6a49('0x2'));var BPromise=require(_0x6a49('0x3'));var rs=require(_0x6a49('0x4'));var fs=require('fs');var Redis=require(_0x6a49('0x5'));var db=require(_0x6a49('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a49('0x7'))('rpc');var config=require(_0x6a49('0x8'));var jayson=require(_0x6a49('0x9'));var client=jayson[_0x6a49('0xa')][_0x6a49('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5ad013,_0x397326,_0x225421){return new BPromise(function(_0x59a8e7,_0x260089){return client[_0x6a49('0xc')](_0x5ad013,_0x225421)[_0x6a49('0xd')](function(_0x278212){logger[_0x6a49('0xe')]('AnalyticTreeReport,\x20%s,\x20%s',_0x397326,_0x6a49('0xf'));logger[_0x6a49('0x10')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x397326,_0x6a49('0xf'),JSON[_0x6a49('0x11')](_0x278212));if(_0x278212[_0x6a49('0x12')]){if(_0x278212[_0x6a49('0x12')][_0x6a49('0x13')]===0x1f4){logger[_0x6a49('0x12')](_0x6a49('0x14'),_0x397326,_0x278212[_0x6a49('0x12')][_0x6a49('0x15')]);return _0x260089(_0x278212[_0x6a49('0x12')][_0x6a49('0x15')]);}logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x397326,_0x278212[_0x6a49('0x12')][_0x6a49('0x15')]);return _0x59a8e7(_0x278212[_0x6a49('0x12')][_0x6a49('0x15')]);}else{logger[_0x6a49('0xe')](_0x6a49('0x14'),_0x397326,_0x6a49('0xf'));_0x59a8e7(_0x278212[_0x6a49('0x16')][_0x6a49('0x15')]);}})[_0x6a49('0x17')](function(_0x40c3a5){logger[_0x6a49('0x12')](_0x6a49('0x14'),_0x397326,_0x40c3a5);_0x260089(_0x40c3a5);});});}