Built motion from commit c116dc8b.|2.6.30
[motion2.git] / server / api / analyticCustomReport / analyticCustomReport.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 _0xd784=['result','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0x2b4fb8,_0x58ccb0){var _0x438d11=function(_0x470ec0){while(--_0x470ec0){_0x2b4fb8['push'](_0x2b4fb8['shift']());}};_0x438d11(++_0x58ccb0);}(_0xd784,0x1a4));var _0x4d78=function(_0x5a4c33,_0x349bbe){_0x5a4c33=_0x5a4c33-0x0;var _0x18ee91=_0xd784[_0x5a4c33];return _0x18ee91;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4d78('0x0'));var BPromise=require(_0x4d78('0x1'));var rs=require(_0x4d78('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4d78('0x3'))['db'];var utils=require(_0x4d78('0x4'));var logger=require(_0x4d78('0x5'))('rpc');var config=require(_0x4d78('0x6'));var jayson=require(_0x4d78('0x7'));var client=jayson[_0x4d78('0x8')][_0x4d78('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6e99e6,_0x3d7e5a,_0x83eba1){return new BPromise(function(_0x35e983,_0x2cd51d){return client['request'](_0x6e99e6,_0x83eba1)[_0x4d78('0xa')](function(_0x45f9c0){logger[_0x4d78('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3d7e5a,'request\x20sent');logger[_0x4d78('0xc')](_0x4d78('0xd'),_0x3d7e5a,_0x4d78('0xe'),JSON[_0x4d78('0xf')](_0x45f9c0));if(_0x45f9c0[_0x4d78('0x10')]){if(_0x45f9c0[_0x4d78('0x10')][_0x4d78('0x11')]===0x1f4){logger[_0x4d78('0x10')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3d7e5a,_0x45f9c0['error']['message']);return _0x2cd51d(_0x45f9c0[_0x4d78('0x10')][_0x4d78('0x12')]);}logger[_0x4d78('0x10')](_0x4d78('0x13'),_0x3d7e5a,_0x45f9c0[_0x4d78('0x10')][_0x4d78('0x12')]);return _0x35e983(_0x45f9c0[_0x4d78('0x10')]['message']);}else{logger[_0x4d78('0xb')](_0x4d78('0x13'),_0x3d7e5a,'request\x20sent');_0x35e983(_0x45f9c0[_0x4d78('0x14')][_0x4d78('0x12')]);}})[_0x4d78('0x15')](function(_0x2aa364){logger[_0x4d78('0x10')](_0x4d78('0x13'),_0x3d7e5a,_0x2aa364);_0x2cd51d(_0x2aa364);});});}