Built motion from commit (unavailable).|2.5.11
[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 _0x3a21=['jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticTreeReport,\x20%s,\x20%s','message','info','result','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x41ac5c,_0x300a26){var _0xeb9c12=function(_0x587593){while(--_0x587593){_0x41ac5c['push'](_0x41ac5c['shift']());}};_0xeb9c12(++_0x300a26);}(_0x3a21,0x117));var _0x13a2=function(_0x1bbbe1,_0x4d7456){_0x1bbbe1=_0x1bbbe1-0x0;var _0x1f8839=_0x3a21[_0x1bbbe1];return _0x1f8839;};'use strict';var _=require('lodash');var util=require(_0x13a2('0x0'));var moment=require(_0x13a2('0x1'));var BPromise=require(_0x13a2('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13a2('0x3'));var db=require(_0x13a2('0x4'))['db'];var utils=require(_0x13a2('0x5'));var logger=require(_0x13a2('0x6'))(_0x13a2('0x7'));var config=require(_0x13a2('0x8'));var jayson=require(_0x13a2('0x9'));var client=jayson[_0x13a2('0xa')][_0x13a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x409f1b,_0x59d905,_0x4c9eb7){return new BPromise(function(_0x4ae8b7,_0x10d0c2){return client[_0x13a2('0xc')](_0x409f1b,_0x4c9eb7)[_0x13a2('0xd')](function(_0x2b3a65){logger['info']('AnalyticTreeReport,\x20%s,\x20%s',_0x59d905,_0x13a2('0xe'));logger[_0x13a2('0xf')](_0x13a2('0x10'),_0x59d905,'request\x20sent',JSON[_0x13a2('0x11')](_0x2b3a65));if(_0x2b3a65[_0x13a2('0x12')]){if(_0x2b3a65['error'][_0x13a2('0x13')]===0x1f4){logger[_0x13a2('0x12')](_0x13a2('0x14'),_0x59d905,_0x2b3a65[_0x13a2('0x12')][_0x13a2('0x15')]);return _0x10d0c2(_0x2b3a65[_0x13a2('0x12')][_0x13a2('0x15')]);}logger[_0x13a2('0x12')](_0x13a2('0x14'),_0x59d905,_0x2b3a65[_0x13a2('0x12')][_0x13a2('0x15')]);return _0x4ae8b7(_0x2b3a65[_0x13a2('0x12')][_0x13a2('0x15')]);}else{logger[_0x13a2('0x16')](_0x13a2('0x14'),_0x59d905,'request\x20sent');_0x4ae8b7(_0x2b3a65[_0x13a2('0x17')]['message']);}})['catch'](function(_0x19e988){logger[_0x13a2('0x12')]('AnalyticTreeReport,\x20%s,\x20%s',_0x59d905,_0x19e988);_0x10d0c2(_0x19e988);});});}