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 _0xc29c=['bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x40395f,_0x1555a7){var _0x1384a7=function(_0x3c0345){while(--_0x3c0345){_0x40395f['push'](_0x40395f['shift']());}};_0x1384a7(++_0x1555a7);}(_0xc29c,0x129));var _0xcc29=function(_0x126fb9,_0x122c59){_0x126fb9=_0x126fb9-0x0;var _0xc8a3b1=_0xc29c[_0x126fb9];return _0xc8a3b1;};'use strict';var _=require(_0xcc29('0x0'));var util=require(_0xcc29('0x1'));var moment=require(_0xcc29('0x2'));var BPromise=require(_0xcc29('0x3'));var rs=require(_0xcc29('0x4'));var fs=require('fs');var Redis=require(_0xcc29('0x5'));var db=require(_0xcc29('0x6'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcc29('0x7'));var config=require(_0xcc29('0x8'));var jayson=require(_0xcc29('0x9'));var client=jayson[_0xcc29('0xa')][_0xcc29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2cd118,_0x5352a3,_0x5a21c5){return new BPromise(function(_0x4a9a0d,_0xa7231b){return client[_0xcc29('0xc')](_0x2cd118,_0x5a21c5)[_0xcc29('0xd')](function(_0x43ea24){logger[_0xcc29('0xe')](_0xcc29('0xf'),_0x5352a3,_0xcc29('0x10'));logger[_0xcc29('0x11')](_0xcc29('0x12'),_0x5352a3,_0xcc29('0x10'),JSON[_0xcc29('0x13')](_0x43ea24));if(_0x43ea24[_0xcc29('0x14')]){if(_0x43ea24['error'][_0xcc29('0x15')]===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x5352a3,_0x43ea24[_0xcc29('0x14')][_0xcc29('0x16')]);return _0xa7231b(_0x43ea24[_0xcc29('0x14')][_0xcc29('0x16')]);}logger[_0xcc29('0x14')](_0xcc29('0xf'),_0x5352a3,_0x43ea24[_0xcc29('0x14')]['message']);return _0x4a9a0d(_0x43ea24[_0xcc29('0x14')]['message']);}else{logger[_0xcc29('0xe')](_0xcc29('0xf'),_0x5352a3,_0xcc29('0x10'));_0x4a9a0d(_0x43ea24[_0xcc29('0x17')][_0xcc29('0x16')]);}})[_0xcc29('0x18')](function(_0x28efb8){logger[_0xcc29('0x14')]('AnalyticTreeReport,\x20%s,\x20%s',_0x5352a3,_0x28efb8);_0xa7231b(_0x28efb8);});});}