Built motion from commit cf5ff673.|2.5.41
[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 _0xa1e0=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','request','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird'];(function(_0x470ff5,_0xd519ff){var _0x2d15b7=function(_0x5bb10f){while(--_0x5bb10f){_0x470ff5['push'](_0x470ff5['shift']());}};_0x2d15b7(++_0xd519ff);}(_0xa1e0,0xe3));var _0x0a1e=function(_0x5288de,_0x5777e5){_0x5288de=_0x5288de-0x0;var _0x4fb7c0=_0xa1e0[_0x5288de];return _0x4fb7c0;};'use strict';var _=require(_0x0a1e('0x0'));var util=require(_0x0a1e('0x1'));var moment=require(_0x0a1e('0x2'));var BPromise=require(_0x0a1e('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0a1e('0x4'))['db'];var utils=require(_0x0a1e('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x0a1e('0x6'));var jayson=require(_0x0a1e('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x108dd4,_0x19e330,_0x19899f){return new BPromise(function(_0x14dffe,_0x13c5f6){return client[_0x0a1e('0x8')](_0x108dd4,_0x19899f)[_0x0a1e('0x9')](function(_0x39acbb){logger['info'](_0x0a1e('0xa'),_0x19e330,_0x0a1e('0xb'));logger[_0x0a1e('0xc')](_0x0a1e('0xd'),_0x19e330,_0x0a1e('0xb'),JSON[_0x0a1e('0xe')](_0x39acbb));if(_0x39acbb['error']){if(_0x39acbb[_0x0a1e('0xf')][_0x0a1e('0x10')]===0x1f4){logger[_0x0a1e('0xf')](_0x0a1e('0xa'),_0x19e330,_0x39acbb[_0x0a1e('0xf')]['message']);return _0x13c5f6(_0x39acbb[_0x0a1e('0xf')]['message']);}logger[_0x0a1e('0xf')](_0x0a1e('0xa'),_0x19e330,_0x39acbb[_0x0a1e('0xf')][_0x0a1e('0x11')]);return _0x14dffe(_0x39acbb[_0x0a1e('0xf')][_0x0a1e('0x11')]);}else{logger[_0x0a1e('0x12')](_0x0a1e('0xa'),_0x19e330,_0x0a1e('0xb'));_0x14dffe(_0x39acbb[_0x0a1e('0x13')]['message']);}})[_0x0a1e('0x14')](function(_0x59675a){logger['error'](_0x0a1e('0xa'),_0x19e330,_0x59675a);_0x13c5f6(_0x59675a);});});}