31519780443b6e0283fa53bfd00432d1895ea069
[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 _0x9975=['error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','request','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0x9975,0x159));var _0x5997=function(_0xd1f67a,_0x3d6d7e){_0xd1f67a=_0xd1f67a-0x0;var _0x7d6ec1=_0x9975[_0xd1f67a];return _0x7d6ec1;};'use strict';var _=require(_0x5997('0x0'));var util=require(_0x5997('0x1'));var moment=require(_0x5997('0x2'));var BPromise=require(_0x5997('0x3'));var rs=require(_0x5997('0x4'));var fs=require('fs');var Redis=require(_0x5997('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5997('0x6'));var logger=require(_0x5997('0x7'))('rpc');var config=require(_0x5997('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5997('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1f12e3,_0x1e7d2c,_0x42c47a){return new BPromise(function(_0x3bb94b,_0x45f337){return client[_0x5997('0xa')](_0x1f12e3,_0x42c47a)['then'](function(_0x50850a){logger['info'](_0x5997('0xb'),_0x1e7d2c,'request\x20sent');logger[_0x5997('0xc')](_0x5997('0xd'),_0x1e7d2c,_0x5997('0xe'),JSON['stringify'](_0x50850a));if(_0x50850a['error']){if(_0x50850a[_0x5997('0xf')][_0x5997('0x10')]===0x1f4){logger[_0x5997('0xf')](_0x5997('0xb'),_0x1e7d2c,_0x50850a[_0x5997('0xf')][_0x5997('0x11')]);return _0x45f337(_0x50850a[_0x5997('0xf')][_0x5997('0x11')]);}logger[_0x5997('0xf')](_0x5997('0xb'),_0x1e7d2c,_0x50850a[_0x5997('0xf')]['message']);return _0x3bb94b(_0x50850a[_0x5997('0xf')][_0x5997('0x11')]);}else{logger['info'](_0x5997('0xb'),_0x1e7d2c,_0x5997('0xe'));_0x3bb94b(_0x50850a[_0x5997('0x12')]['message']);}})[_0x5997('0x13')](function(_0xb1b87){logger['error'](_0x5997('0xb'),_0x1e7d2c,_0xb1b87);_0x45f337(_0xb1b87);});});}