c1c75acafcc6c1ddde30fe3e6f1ab9e5d85e4e00
[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 _0xa298=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../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'];(function(_0x4af351,_0x328587){var _0x238615=function(_0x11800c){while(--_0x11800c){_0x4af351['push'](_0x4af351['shift']());}};_0x238615(++_0x328587);}(_0xa298,0xe4));var _0x8a29=function(_0x5239f6,_0x3bc30a){_0x5239f6=_0x5239f6-0x0;var _0xb66a8b=_0xa298[_0x5239f6];return _0xb66a8b;};'use strict';var _=require(_0x8a29('0x0'));var util=require('util');var moment=require(_0x8a29('0x1'));var BPromise=require(_0x8a29('0x2'));var rs=require(_0x8a29('0x3'));var fs=require('fs');var Redis=require(_0x8a29('0x4'));var db=require(_0x8a29('0x5'))['db'];var utils=require(_0x8a29('0x6'));var logger=require(_0x8a29('0x7'))('rpc');var config=require(_0x8a29('0x8'));var jayson=require(_0x8a29('0x9'));var client=jayson[_0x8a29('0xa')][_0x8a29('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2fab19,_0x33a841,_0x384e44){return new BPromise(function(_0x4422ab,_0x55da04){return client[_0x8a29('0xc')](_0x2fab19,_0x384e44)[_0x8a29('0xd')](function(_0x2bfc0f){logger[_0x8a29('0xe')](_0x8a29('0xf'),_0x33a841,_0x8a29('0x10'));logger[_0x8a29('0x11')](_0x8a29('0x12'),_0x33a841,'request\x20sent',JSON[_0x8a29('0x13')](_0x2bfc0f));if(_0x2bfc0f[_0x8a29('0x14')]){if(_0x2bfc0f[_0x8a29('0x14')][_0x8a29('0x15')]===0x1f4){logger[_0x8a29('0x14')]('AnalyticTreeReport,\x20%s,\x20%s',_0x33a841,_0x2bfc0f[_0x8a29('0x14')][_0x8a29('0x16')]);return _0x55da04(_0x2bfc0f['error'][_0x8a29('0x16')]);}logger[_0x8a29('0x14')](_0x8a29('0xf'),_0x33a841,_0x2bfc0f[_0x8a29('0x14')][_0x8a29('0x16')]);return _0x4422ab(_0x2bfc0f['error'][_0x8a29('0x16')]);}else{logger[_0x8a29('0xe')](_0x8a29('0xf'),_0x33a841,_0x8a29('0x10'));_0x4422ab(_0x2bfc0f[_0x8a29('0x17')][_0x8a29('0x16')]);}})[_0x8a29('0x18')](function(_0x455c22){logger[_0x8a29('0x14')](_0x8a29('0xf'),_0x33a841,_0x455c22);_0x55da04(_0x455c22);});});}