Built motion from commit 85328c08.|2.5.50
[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 _0x89f9=['jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment'];(function(_0x2ca9d4,_0x51d5c6){var _0x258956=function(_0x47a0e5){while(--_0x47a0e5){_0x2ca9d4['push'](_0x2ca9d4['shift']());}};_0x258956(++_0x51d5c6);}(_0x89f9,0x19f));var _0x989f=function(_0x37f9ae,_0x577eaa){_0x37f9ae=_0x37f9ae-0x0;var _0x53fbb4=_0x89f9[_0x37f9ae];return _0x53fbb4;};'use strict';var _=require(_0x989f('0x0'));var util=require(_0x989f('0x1'));var moment=require(_0x989f('0x2'));var BPromise=require(_0x989f('0x3'));var rs=require(_0x989f('0x4'));var fs=require('fs');var Redis=require(_0x989f('0x5'));var db=require(_0x989f('0x6'))['db'];var utils=require(_0x989f('0x7'));var logger=require(_0x989f('0x8'))('rpc');var config=require(_0x989f('0x9'));var jayson=require(_0x989f('0xa'));var client=jayson[_0x989f('0xb')][_0x989f('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x307247,_0x47d120,_0x2838cc){return new BPromise(function(_0x1e71b6,_0xb66a36){return client[_0x989f('0xd')](_0x307247,_0x2838cc)[_0x989f('0xe')](function(_0x30bf90){logger[_0x989f('0xf')](_0x989f('0x10'),_0x47d120,_0x989f('0x11'));logger[_0x989f('0x12')](_0x989f('0x13'),_0x47d120,_0x989f('0x11'),JSON[_0x989f('0x14')](_0x30bf90));if(_0x30bf90[_0x989f('0x15')]){if(_0x30bf90['error'][_0x989f('0x16')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x47d120,_0x30bf90['error'][_0x989f('0x17')]);return _0xb66a36(_0x30bf90['error'][_0x989f('0x17')]);}logger[_0x989f('0x15')](_0x989f('0x10'),_0x47d120,_0x30bf90[_0x989f('0x15')][_0x989f('0x17')]);return _0x1e71b6(_0x30bf90['error']['message']);}else{logger[_0x989f('0xf')](_0x989f('0x10'),_0x47d120,_0x989f('0x11'));_0x1e71b6(_0x30bf90[_0x989f('0x18')][_0x989f('0x17')]);}})['catch'](function(_0x291e61){logger['error'](_0x989f('0x10'),_0x47d120,_0x291e61);_0xb66a36(_0x291e61);});});}