Built motion from commit (unavailable).|2.5.16
[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 _0xcae3=['message','result','catch','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticTreeReport,\x20%s,\x20%s','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code'];(function(_0x502c7d,_0x2f1285){var _0x30b7ed=function(_0x2d92f3){while(--_0x2d92f3){_0x502c7d['push'](_0x502c7d['shift']());}};_0x30b7ed(++_0x2f1285);}(_0xcae3,0x71));var _0x3cae=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xcae3[_0x2dafbe];return _0x58a45a;};'use strict';var _=require('lodash');var util=require(_0x3cae('0x0'));var moment=require('moment');var BPromise=require(_0x3cae('0x1'));var rs=require(_0x3cae('0x2'));var fs=require('fs');var Redis=require(_0x3cae('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x3cae('0x4'));var logger=require('../../config/logger')(_0x3cae('0x5'));var config=require(_0x3cae('0x6'));var jayson=require(_0x3cae('0x7'));var client=jayson[_0x3cae('0x8')][_0x3cae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x394750,_0x87555f,_0x49bb04){return new BPromise(function(_0x5d014c,_0x2e3633){return client['request'](_0x394750,_0x49bb04)[_0x3cae('0xa')](function(_0x2a5855){logger[_0x3cae('0xb')](_0x3cae('0xc'),_0x87555f,'request\x20sent');logger[_0x3cae('0xd')](_0x3cae('0xe'),_0x87555f,_0x3cae('0xf'),JSON[_0x3cae('0x10')](_0x2a5855));if(_0x2a5855[_0x3cae('0x11')]){if(_0x2a5855[_0x3cae('0x11')][_0x3cae('0x12')]===0x1f4){logger[_0x3cae('0x11')]('AnalyticTreeReport,\x20%s,\x20%s',_0x87555f,_0x2a5855[_0x3cae('0x11')]['message']);return _0x2e3633(_0x2a5855[_0x3cae('0x11')]['message']);}logger['error'](_0x3cae('0xc'),_0x87555f,_0x2a5855[_0x3cae('0x11')]['message']);return _0x5d014c(_0x2a5855[_0x3cae('0x11')][_0x3cae('0x13')]);}else{logger[_0x3cae('0xb')](_0x3cae('0xc'),_0x87555f,_0x3cae('0xf'));_0x5d014c(_0x2a5855[_0x3cae('0x14')]['message']);}})[_0x3cae('0x15')](function(_0x49fc57){logger[_0x3cae('0x11')](_0x3cae('0xc'),_0x87555f,_0x49fc57);_0x2e3633(_0x49fc57);});});}