Built motion from commit (unavailable).|2.5.4
[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 _0x7d57=['ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','lodash','util','moment','bluebird'];(function(_0x163fa6,_0x4d925b){var _0x8548de=function(_0x58f5ec){while(--_0x58f5ec){_0x163fa6['push'](_0x163fa6['shift']());}};_0x8548de(++_0x4d925b);}(_0x7d57,0x1b4));var _0x77d5=function(_0x365e54,_0x44be74){_0x365e54=_0x365e54-0x0;var _0x13317a=_0x7d57[_0x365e54];return _0x13317a;};'use strict';var _=require(_0x77d5('0x0'));var util=require(_0x77d5('0x1'));var moment=require(_0x77d5('0x2'));var BPromise=require(_0x77d5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x77d5('0x4'));var db=require(_0x77d5('0x5'))['db'];var utils=require(_0x77d5('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x77d5('0x7'));var jayson=require(_0x77d5('0x8'));var client=jayson[_0x77d5('0x9')][_0x77d5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x342585,_0x56b3f5,_0x541be5){return new BPromise(function(_0x315d55,_0x7852ed){return client[_0x77d5('0xb')](_0x342585,_0x541be5)[_0x77d5('0xc')](function(_0x1e597b){logger[_0x77d5('0xd')](_0x77d5('0xe'),_0x56b3f5,_0x77d5('0xf'));logger['debug']('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0x56b3f5,_0x77d5('0xf'),JSON[_0x77d5('0x10')](_0x1e597b));if(_0x1e597b[_0x77d5('0x11')]){if(_0x1e597b[_0x77d5('0x11')][_0x77d5('0x12')]===0x1f4){logger['error'](_0x77d5('0xe'),_0x56b3f5,_0x1e597b[_0x77d5('0x11')][_0x77d5('0x13')]);return _0x7852ed(_0x1e597b['error'][_0x77d5('0x13')]);}logger[_0x77d5('0x11')](_0x77d5('0xe'),_0x56b3f5,_0x1e597b[_0x77d5('0x11')][_0x77d5('0x13')]);return _0x315d55(_0x1e597b[_0x77d5('0x11')][_0x77d5('0x13')]);}else{logger[_0x77d5('0xd')](_0x77d5('0xe'),_0x56b3f5,_0x77d5('0xf'));_0x315d55(_0x1e597b['result'][_0x77d5('0x13')]);}})['catch'](function(_0x2061fe){logger['error'](_0x77d5('0xe'),_0x56b3f5,_0x2061fe);_0x7852ed(_0x2061fe);});});}