00c189778f8e34cf188db936bdc6987437c4cab7
[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 _0x7840=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','bluebird'];(function(_0x4a3d0f,_0x4ac17a){var _0x254d8e=function(_0x20d5b1){while(--_0x20d5b1){_0x4a3d0f['push'](_0x4a3d0f['shift']());}};_0x254d8e(++_0x4ac17a);}(_0x7840,0x1e4));var _0x0784=function(_0x4c54c0,_0x1f9b82){_0x4c54c0=_0x4c54c0-0x0;var _0x9dd09d=_0x7840[_0x4c54c0];return _0x9dd09d;};'use strict';var _=require(_0x0784('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x0784('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0784('0x2'));var db=require(_0x0784('0x3'))['db'];var utils=require(_0x0784('0x4'));var logger=require(_0x0784('0x5'))('rpc');var config=require(_0x0784('0x6'));var jayson=require(_0x0784('0x7'));var client=jayson[_0x0784('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xe47192,_0x4c6ec2,_0x470352){return new BPromise(function(_0x4d7ea3,_0x36696c){return client['request'](_0xe47192,_0x470352)['then'](function(_0x4a34a7){logger[_0x0784('0x9')](_0x0784('0xa'),_0x4c6ec2,_0x0784('0xb'));logger[_0x0784('0xc')](_0x0784('0xd'),_0x4c6ec2,'request\x20sent',JSON['stringify'](_0x4a34a7));if(_0x4a34a7[_0x0784('0xe')]){if(_0x4a34a7['error']['code']===0x1f4){logger['error'](_0x0784('0xa'),_0x4c6ec2,_0x4a34a7[_0x0784('0xe')][_0x0784('0xf')]);return _0x36696c(_0x4a34a7['error'][_0x0784('0xf')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x4c6ec2,_0x4a34a7[_0x0784('0xe')][_0x0784('0xf')]);return _0x4d7ea3(_0x4a34a7[_0x0784('0xe')][_0x0784('0xf')]);}else{logger[_0x0784('0x9')]('AnalyticCustomReport,\x20%s,\x20%s',_0x4c6ec2,_0x0784('0xb'));_0x4d7ea3(_0x4a34a7[_0x0784('0x10')][_0x0784('0xf')]);}})[_0x0784('0x11')](function(_0x4a72a4){logger[_0x0784('0xe')](_0x0784('0xa'),_0x4c6ec2,_0x4a72a4);_0x36696c(_0x4a72a4);});});}