Built motion from commit db94841.|2.5.3
[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 _0x3b17=['randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b17,0xe2));var _0x73b1=function(_0x3b620d,_0x467a1e){_0x3b620d=_0x3b620d-0x0;var _0xabe614=_0x3b17[_0x3b620d];return _0xabe614;};'use strict';var _=require(_0x73b1('0x0'));var util=require(_0x73b1('0x1'));var moment=require(_0x73b1('0x2'));var BPromise=require(_0x73b1('0x3'));var rs=require(_0x73b1('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x73b1('0x5'))['db'];var utils=require(_0x73b1('0x6'));var logger=require(_0x73b1('0x7'))('rpc');var config=require(_0x73b1('0x8'));var jayson=require(_0x73b1('0x9'));var client=jayson[_0x73b1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d5437,_0x5a0615,_0x1a259c){return new BPromise(function(_0x46b55a,_0xf77b46){return client[_0x73b1('0xb')](_0x1d5437,_0x1a259c)[_0x73b1('0xc')](function(_0x129a9f){logger[_0x73b1('0xd')](_0x73b1('0xe'),_0x5a0615,_0x73b1('0xf'));logger[_0x73b1('0x10')](_0x73b1('0x11'),_0x5a0615,_0x73b1('0xf'),JSON[_0x73b1('0x12')](_0x129a9f));if(_0x129a9f[_0x73b1('0x13')]){if(_0x129a9f['error']['code']===0x1f4){logger['error'](_0x73b1('0xe'),_0x5a0615,_0x129a9f[_0x73b1('0x13')][_0x73b1('0x14')]);return _0xf77b46(_0x129a9f['error'][_0x73b1('0x14')]);}logger['error'](_0x73b1('0xe'),_0x5a0615,_0x129a9f[_0x73b1('0x13')][_0x73b1('0x14')]);return _0x46b55a(_0x129a9f[_0x73b1('0x13')][_0x73b1('0x14')]);}else{logger[_0x73b1('0xd')]('AnalyticTreeReport,\x20%s,\x20%s',_0x5a0615,_0x73b1('0xf'));_0x46b55a(_0x129a9f[_0x73b1('0x15')][_0x73b1('0x14')]);}})[_0x73b1('0x16')](function(_0x4127a2){logger[_0x73b1('0x13')](_0x73b1('0xe'),_0x5a0615,_0x4127a2);_0xf77b46(_0x4127a2);});});}