Built motion from commit db94841.|2.5.3
[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 _0x41b6=['rpc','jayson/promise','client','http','request','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0xf60a0e,_0x1e1b18){var _0x26eeda=function(_0x2b20f4){while(--_0x2b20f4){_0xf60a0e['push'](_0xf60a0e['shift']());}};_0x26eeda(++_0x1e1b18);}(_0x41b6,0x1db));var _0x641b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x41b6[_0x2dafbe];return _0x58a45a;};'use strict';var _=require(_0x641b('0x0'));var util=require(_0x641b('0x1'));var moment=require(_0x641b('0x2'));var BPromise=require(_0x641b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x641b('0x4'));var db=require(_0x641b('0x5'))['db'];var utils=require(_0x641b('0x6'));var logger=require(_0x641b('0x7'))(_0x641b('0x8'));var config=require('../../config/environment');var jayson=require(_0x641b('0x9'));var client=jayson[_0x641b('0xa')][_0x641b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xca454c,_0xc5b1ee,_0x32eb74){return new BPromise(function(_0x5ae2a9,_0x54365a){return client[_0x641b('0xc')](_0xca454c,_0x32eb74)[_0x641b('0xd')](function(_0x4a48ae){logger[_0x641b('0xe')](_0x641b('0xf'),_0xc5b1ee,_0x641b('0x10'));logger['debug'](_0x641b('0x11'),_0xc5b1ee,'request\x20sent',JSON[_0x641b('0x12')](_0x4a48ae));if(_0x4a48ae[_0x641b('0x13')]){if(_0x4a48ae['error']['code']===0x1f4){logger[_0x641b('0x13')](_0x641b('0xf'),_0xc5b1ee,_0x4a48ae[_0x641b('0x13')][_0x641b('0x14')]);return _0x54365a(_0x4a48ae[_0x641b('0x13')][_0x641b('0x14')]);}logger[_0x641b('0x13')](_0x641b('0xf'),_0xc5b1ee,_0x4a48ae[_0x641b('0x13')]['message']);return _0x5ae2a9(_0x4a48ae['error'][_0x641b('0x14')]);}else{logger[_0x641b('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0xc5b1ee,_0x641b('0x10'));_0x5ae2a9(_0x4a48ae[_0x641b('0x15')]['message']);}})[_0x641b('0x16')](function(_0x4b63f8){logger[_0x641b('0x13')](_0x641b('0xf'),_0xc5b1ee,_0x4b63f8);_0x54365a(_0x4b63f8);});});}