c71d8cbcb4e8e62e43167c947737e82ea91a4a09
[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 _0xaefa=['bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','stringify','error','code','message','AnalyticTreeReport,\x20%s,\x20%s','result','catch','lodash','util','moment'];(function(_0x59611,_0x3f5bcd){var _0x4bf24b=function(_0x2ae136){while(--_0x2ae136){_0x59611['push'](_0x59611['shift']());}};_0x4bf24b(++_0x3f5bcd);}(_0xaefa,0x1e0));var _0xaaef=function(_0x2d7dbd,_0x15ed9f){_0x2d7dbd=_0x2d7dbd-0x0;var _0x5224e6=_0xaefa[_0x2d7dbd];return _0x5224e6;};'use strict';var _=require(_0xaaef('0x0'));var util=require(_0xaaef('0x1'));var moment=require(_0xaaef('0x2'));var BPromise=require(_0xaaef('0x3'));var rs=require(_0xaaef('0x4'));var fs=require('fs');var Redis=require(_0xaaef('0x5'));var db=require(_0xaaef('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xaaef('0x7'))('rpc');var config=require(_0xaaef('0x8'));var jayson=require(_0xaaef('0x9'));var client=jayson[_0xaaef('0xa')][_0xaaef('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x268edf,_0x13d278,_0x52cad5){return new BPromise(function(_0x37ac65,_0x98d683){return client['request'](_0x268edf,_0x52cad5)[_0xaaef('0xc')](function(_0x4126fe){logger[_0xaaef('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x13d278,_0xaaef('0xe'));logger[_0xaaef('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x13d278,_0xaaef('0xe'),JSON[_0xaaef('0x10')](_0x4126fe));if(_0x4126fe[_0xaaef('0x11')]){if(_0x4126fe[_0xaaef('0x11')][_0xaaef('0x12')]===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x13d278,_0x4126fe[_0xaaef('0x11')][_0xaaef('0x13')]);return _0x98d683(_0x4126fe['error'][_0xaaef('0x13')]);}logger[_0xaaef('0x11')](_0xaaef('0x14'),_0x13d278,_0x4126fe[_0xaaef('0x11')][_0xaaef('0x13')]);return _0x37ac65(_0x4126fe[_0xaaef('0x11')][_0xaaef('0x13')]);}else{logger[_0xaaef('0xd')](_0xaaef('0x14'),_0x13d278,_0xaaef('0xe'));_0x37ac65(_0x4126fe[_0xaaef('0x15')][_0xaaef('0x13')]);}})[_0xaaef('0x16')](function(_0x42b304){logger[_0xaaef('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x13d278,_0x42b304);_0x98d683(_0x42b304);});});}