Built motion from commit 3c2ce842.|2.6.31
[motion2.git] / server / api / analyticDefaultReport / analyticDefaultReport.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 _0x6470=['AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','code','message','error','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent'];(function(_0x54947f,_0x542848){var _0x290689=function(_0x307550){while(--_0x307550){_0x54947f['push'](_0x54947f['shift']());}};_0x290689(++_0x542848);}(_0x6470,0x67));var _0x0647=function(_0xe1e32f,_0x42c4d6){_0xe1e32f=_0xe1e32f-0x0;var _0x27447f=_0x6470[_0xe1e32f];return _0x27447f;};'use strict';var _=require(_0x0647('0x0'));var util=require(_0x0647('0x1'));var moment=require(_0x0647('0x2'));var BPromise=require(_0x0647('0x3'));var rs=require(_0x0647('0x4'));var fs=require('fs');var Redis=require(_0x0647('0x5'));var db=require(_0x0647('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0647('0x7'))('rpc');var config=require(_0x0647('0x8'));var jayson=require(_0x0647('0x9'));var client=jayson[_0x0647('0xa')][_0x0647('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2e6893,_0x51cf52,_0x5b5f29){return new BPromise(function(_0x4618c6,_0xbd1f1d){return client[_0x0647('0xc')](_0x2e6893,_0x5b5f29)[_0x0647('0xd')](function(_0x32bf63){logger[_0x0647('0xe')](_0x0647('0xf'),_0x51cf52,_0x0647('0x10'));logger['debug'](_0x0647('0x11'),_0x51cf52,_0x0647('0x10'),JSON[_0x0647('0x12')](_0x32bf63));if(_0x32bf63['error']){if(_0x32bf63['error'][_0x0647('0x13')]===0x1f4){logger['error'](_0x0647('0xf'),_0x51cf52,_0x32bf63['error'][_0x0647('0x14')]);return _0xbd1f1d(_0x32bf63['error']['message']);}logger['error'](_0x0647('0xf'),_0x51cf52,_0x32bf63[_0x0647('0x15')][_0x0647('0x14')]);return _0x4618c6(_0x32bf63['error'][_0x0647('0x14')]);}else{logger[_0x0647('0xe')](_0x0647('0xf'),_0x51cf52,_0x0647('0x10'));_0x4618c6(_0x32bf63[_0x0647('0x16')]['message']);}})[_0x0647('0x17')](function(_0xe221c8){logger['error'](_0x0647('0xf'),_0x51cf52,_0xe221c8);_0xbd1f1d(_0xe221c8);});});}