Built motion from commit (unavailable).|2.4.17
[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 _0x3b33=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x10a505,_0x2303fa){var _0x4f1254=function(_0xb1296f){while(--_0xb1296f){_0x10a505['push'](_0x10a505['shift']());}};_0x4f1254(++_0x2303fa);}(_0x3b33,0x1b1));var _0x33b3=function(_0x5be33f,_0x2f2f6d){_0x5be33f=_0x5be33f-0x0;var _0x591c8f=_0x3b33[_0x5be33f];return _0x591c8f;};'use strict';var _=require(_0x33b3('0x0'));var util=require(_0x33b3('0x1'));var moment=require('moment');var BPromise=require(_0x33b3('0x2'));var rs=require(_0x33b3('0x3'));var fs=require('fs');var Redis=require(_0x33b3('0x4'));var db=require(_0x33b3('0x5'))['db'];var utils=require(_0x33b3('0x6'));var logger=require(_0x33b3('0x7'))(_0x33b3('0x8'));var config=require(_0x33b3('0x9'));var jayson=require(_0x33b3('0xa'));var client=jayson[_0x33b3('0xb')][_0x33b3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x48f442,_0x27a112,_0x145c77){return new BPromise(function(_0x342055,_0x3dbe45){return client[_0x33b3('0xd')](_0x48f442,_0x145c77)['then'](function(_0x374c43){logger[_0x33b3('0xe')](_0x33b3('0xf'),_0x27a112,_0x33b3('0x10'));logger['debug'](_0x33b3('0x11'),_0x27a112,'request\x20sent',JSON['stringify'](_0x374c43));if(_0x374c43[_0x33b3('0x12')]){if(_0x374c43[_0x33b3('0x12')][_0x33b3('0x13')]===0x1f4){logger[_0x33b3('0x12')](_0x33b3('0xf'),_0x27a112,_0x374c43[_0x33b3('0x12')][_0x33b3('0x14')]);return _0x3dbe45(_0x374c43[_0x33b3('0x12')][_0x33b3('0x14')]);}logger[_0x33b3('0x12')](_0x33b3('0xf'),_0x27a112,_0x374c43[_0x33b3('0x12')][_0x33b3('0x14')]);return _0x342055(_0x374c43[_0x33b3('0x12')][_0x33b3('0x14')]);}else{logger[_0x33b3('0xe')](_0x33b3('0xf'),_0x27a112,'request\x20sent');_0x342055(_0x374c43['result'][_0x33b3('0x14')]);}})[_0x33b3('0x15')](function(_0xc4e09){logger[_0x33b3('0x12')](_0x33b3('0xf'),_0x27a112,_0xc4e09);_0x3dbe45(_0xc4e09);});});}