Built motion from commit (unavailable).|2.5.9
[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 _0x55ea=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result'];(function(_0x424c22,_0x56ee97){var _0x734b3e=function(_0x510b6d){while(--_0x510b6d){_0x424c22['push'](_0x424c22['shift']());}};_0x734b3e(++_0x56ee97);}(_0x55ea,0xc9));var _0xa55e=function(_0x356db4,_0x36dbfe){_0x356db4=_0x356db4-0x0;var _0x2a9100=_0x55ea[_0x356db4];return _0x2a9100;};'use strict';var _=require(_0xa55e('0x0'));var util=require(_0xa55e('0x1'));var moment=require(_0xa55e('0x2'));var BPromise=require('bluebird');var rs=require(_0xa55e('0x3'));var fs=require('fs');var Redis=require(_0xa55e('0x4'));var db=require(_0xa55e('0x5'))['db'];var utils=require(_0xa55e('0x6'));var logger=require(_0xa55e('0x7'))('rpc');var config=require(_0xa55e('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x5a009c,_0x38378e,_0x20f2ac){return new BPromise(function(_0x30b885,_0xca9526){return client[_0xa55e('0x9')](_0x5a009c,_0x20f2ac)[_0xa55e('0xa')](function(_0x32f6f7){logger[_0xa55e('0xb')](_0xa55e('0xc'),_0x38378e,'request\x20sent');logger['debug'](_0xa55e('0xd'),_0x38378e,_0xa55e('0xe'),JSON[_0xa55e('0xf')](_0x32f6f7));if(_0x32f6f7[_0xa55e('0x10')]){if(_0x32f6f7[_0xa55e('0x10')]['code']===0x1f4){logger[_0xa55e('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x38378e,_0x32f6f7[_0xa55e('0x10')][_0xa55e('0x11')]);return _0xca9526(_0x32f6f7[_0xa55e('0x10')][_0xa55e('0x11')]);}logger[_0xa55e('0x10')](_0xa55e('0xc'),_0x38378e,_0x32f6f7[_0xa55e('0x10')][_0xa55e('0x11')]);return _0x30b885(_0x32f6f7[_0xa55e('0x10')]['message']);}else{logger[_0xa55e('0xb')](_0xa55e('0xc'),_0x38378e,_0xa55e('0xe'));_0x30b885(_0x32f6f7[_0xa55e('0x12')][_0xa55e('0x11')]);}})[_0xa55e('0x13')](function(_0x585d3a){logger[_0xa55e('0x10')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x38378e,_0x585d3a);_0xca9526(_0x585d3a);});});}