Built motion from commit b0a9a629.|2.6.33
[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 _0x5ebc=['info','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','AnalyticCustomReport,\x20%s,\x20%s','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1ec1ff,_0x1064d9){var _0x153fc0=function(_0x428b08){while(--_0x428b08){_0x1ec1ff['push'](_0x1ec1ff['shift']());}};_0x153fc0(++_0x1064d9);}(_0x5ebc,0x14f));var _0xc5eb=function(_0x39096d,_0x51f8a0){_0x39096d=_0x39096d-0x0;var _0x13da4f=_0x5ebc[_0x39096d];return _0x13da4f;};'use strict';var _=require(_0xc5eb('0x0'));var util=require(_0xc5eb('0x1'));var moment=require(_0xc5eb('0x2'));var BPromise=require(_0xc5eb('0x3'));var rs=require(_0xc5eb('0x4'));var fs=require('fs');var Redis=require(_0xc5eb('0x5'));var db=require(_0xc5eb('0x6'))['db'];var utils=require(_0xc5eb('0x7'));var logger=require(_0xc5eb('0x8'))(_0xc5eb('0x9'));var config=require('../../config/environment');var jayson=require(_0xc5eb('0xa'));var client=jayson[_0xc5eb('0xb')][_0xc5eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c10e0,_0x16718f,_0x15362c){return new BPromise(function(_0xd92d63,_0x1609d5){return client[_0xc5eb('0xd')](_0x5c10e0,_0x15362c)[_0xc5eb('0xe')](function(_0x469637){logger[_0xc5eb('0xf')]('AnalyticCustomReport,\x20%s,\x20%s',_0x16718f,'request\x20sent');logger[_0xc5eb('0x10')](_0xc5eb('0x11'),_0x16718f,_0xc5eb('0x12'),JSON['stringify'](_0x469637));if(_0x469637[_0xc5eb('0x13')]){if(_0x469637['error'][_0xc5eb('0x14')]===0x1f4){logger[_0xc5eb('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x16718f,_0x469637['error'][_0xc5eb('0x15')]);return _0x1609d5(_0x469637['error'][_0xc5eb('0x15')]);}logger[_0xc5eb('0x13')](_0xc5eb('0x16'),_0x16718f,_0x469637[_0xc5eb('0x13')]['message']);return _0xd92d63(_0x469637[_0xc5eb('0x13')]['message']);}else{logger[_0xc5eb('0xf')](_0xc5eb('0x16'),_0x16718f,_0xc5eb('0x12'));_0xd92d63(_0x469637[_0xc5eb('0x17')][_0xc5eb('0x15')]);}})[_0xc5eb('0x18')](function(_0x3e590e){logger[_0xc5eb('0x13')](_0xc5eb('0x16'),_0x16718f,_0x3e590e);_0x1609d5(_0x3e590e);});});}