069f3a4f7ffbb1a58b35247a415c1f8f06463201
[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 _0x4844=['request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s'];(function(_0x77d286,_0x1ddc6d){var _0x5446a5=function(_0x45e2cf){while(--_0x45e2cf){_0x77d286['push'](_0x77d286['shift']());}};_0x5446a5(++_0x1ddc6d);}(_0x4844,0x1a6));var _0x4484=function(_0x151286,_0x552e90){_0x151286=_0x151286-0x0;var _0x23cef1=_0x4844[_0x151286];return _0x23cef1;};'use strict';var _=require(_0x4484('0x0'));var util=require(_0x4484('0x1'));var moment=require(_0x4484('0x2'));var BPromise=require(_0x4484('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4484('0x4'));var db=require(_0x4484('0x5'))['db'];var utils=require(_0x4484('0x6'));var logger=require(_0x4484('0x7'))(_0x4484('0x8'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x4484('0x9')][_0x4484('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x252be7,_0x31edd9,_0x4eb6a2){return new BPromise(function(_0x2db47f,_0x20cc37){return client[_0x4484('0xb')](_0x252be7,_0x4eb6a2)[_0x4484('0xc')](function(_0x4afde4){logger[_0x4484('0xd')](_0x4484('0xe'),_0x31edd9,_0x4484('0xf'));logger['debug'](_0x4484('0x10'),_0x31edd9,'request\x20sent',JSON[_0x4484('0x11')](_0x4afde4));if(_0x4afde4['error']){if(_0x4afde4[_0x4484('0x12')][_0x4484('0x13')]===0x1f4){logger[_0x4484('0x12')](_0x4484('0xe'),_0x31edd9,_0x4afde4[_0x4484('0x12')][_0x4484('0x14')]);return _0x20cc37(_0x4afde4[_0x4484('0x12')][_0x4484('0x14')]);}logger[_0x4484('0x12')](_0x4484('0xe'),_0x31edd9,_0x4afde4[_0x4484('0x12')][_0x4484('0x14')]);return _0x2db47f(_0x4afde4[_0x4484('0x12')][_0x4484('0x14')]);}else{logger[_0x4484('0xd')](_0x4484('0xe'),_0x31edd9,_0x4484('0xf'));_0x2db47f(_0x4afde4[_0x4484('0x15')]['message']);}})[_0x4484('0x16')](function(_0x2df3d4){logger[_0x4484('0x12')](_0x4484('0xe'),_0x31edd9,_0x2df3d4);_0x20cc37(_0x2df3d4);});});}