Built motion from commit (unavailable).|2.5.14
[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 _0x2405=['request','info','AnalyticTreeReport,\x20%s,\x20%s','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x5014e4,_0x2969a2){var _0x4fe7d9=function(_0x59deea){while(--_0x59deea){_0x5014e4['push'](_0x5014e4['shift']());}};_0x4fe7d9(++_0x2969a2);}(_0x2405,0x184));var _0x5240=function(_0x4ec9e3,_0x15fbf4){_0x4ec9e3=_0x4ec9e3-0x0;var _0x2883ce=_0x2405[_0x4ec9e3];return _0x2883ce;};'use strict';var _=require(_0x5240('0x0'));var util=require(_0x5240('0x1'));var moment=require(_0x5240('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5240('0x3'));var db=require(_0x5240('0x4'))['db'];var utils=require(_0x5240('0x5'));var logger=require(_0x5240('0x6'))(_0x5240('0x7'));var config=require(_0x5240('0x8'));var jayson=require(_0x5240('0x9'));var client=jayson['client'][_0x5240('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4591e0,_0x3188a7,_0x55e94f){return new BPromise(function(_0xffa0b1,_0x3288b4){return client[_0x5240('0xb')](_0x4591e0,_0x55e94f)['then'](function(_0x366d10){logger[_0x5240('0xc')](_0x5240('0xd'),_0x3188a7,'request\x20sent');logger['debug'](_0x5240('0xe'),_0x3188a7,'request\x20sent',JSON[_0x5240('0xf')](_0x366d10));if(_0x366d10[_0x5240('0x10')]){if(_0x366d10[_0x5240('0x10')][_0x5240('0x11')]===0x1f4){logger[_0x5240('0x10')](_0x5240('0xd'),_0x3188a7,_0x366d10[_0x5240('0x10')][_0x5240('0x12')]);return _0x3288b4(_0x366d10[_0x5240('0x10')][_0x5240('0x12')]);}logger[_0x5240('0x10')](_0x5240('0xd'),_0x3188a7,_0x366d10[_0x5240('0x10')][_0x5240('0x12')]);return _0xffa0b1(_0x366d10[_0x5240('0x10')]['message']);}else{logger['info'](_0x5240('0xd'),_0x3188a7,_0x5240('0x13'));_0xffa0b1(_0x366d10['result'][_0x5240('0x12')]);}})[_0x5240('0x14')](function(_0x488ea2){logger[_0x5240('0x10')](_0x5240('0xd'),_0x3188a7,_0x488ea2);_0x3288b4(_0x488ea2);});});}