Built motion from commit b0a9a629.|2.6.33
[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 _0xa768=['message','result','catch','util','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x338c63,_0x49c4f1){var _0x55e011=function(_0x1b890c){while(--_0x1b890c){_0x338c63['push'](_0x338c63['shift']());}};_0x55e011(++_0x49c4f1);}(_0xa768,0x147));var _0x8a76=function(_0x4c6b9a,_0x4ae81b){_0x4c6b9a=_0x4c6b9a-0x0;var _0x2f8515=_0xa768[_0x4c6b9a];return _0x2f8515;};'use strict';var _=require('lodash');var util=require(_0x8a76('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x8a76('0x1'));var db=require('../../mysqldb')['db'];var utils=require(_0x8a76('0x2'));var logger=require('../../config/logger')(_0x8a76('0x3'));var config=require('../../config/environment');var jayson=require(_0x8a76('0x4'));var client=jayson[_0x8a76('0x5')][_0x8a76('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x39541d,_0x3532d8,_0x17c7dc){return new BPromise(function(_0x454826,_0x2bc8aa){return client[_0x8a76('0x7')](_0x39541d,_0x17c7dc)[_0x8a76('0x8')](function(_0x43ece3){logger[_0x8a76('0x9')](_0x8a76('0xa'),_0x3532d8,_0x8a76('0xb'));logger[_0x8a76('0xc')](_0x8a76('0xd'),_0x3532d8,_0x8a76('0xb'),JSON['stringify'](_0x43ece3));if(_0x43ece3[_0x8a76('0xe')]){if(_0x43ece3[_0x8a76('0xe')]['code']===0x1f4){logger[_0x8a76('0xe')](_0x8a76('0xa'),_0x3532d8,_0x43ece3['error'][_0x8a76('0xf')]);return _0x2bc8aa(_0x43ece3['error']['message']);}logger[_0x8a76('0xe')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3532d8,_0x43ece3[_0x8a76('0xe')][_0x8a76('0xf')]);return _0x454826(_0x43ece3[_0x8a76('0xe')]['message']);}else{logger[_0x8a76('0x9')](_0x8a76('0xa'),_0x3532d8,'request\x20sent');_0x454826(_0x43ece3[_0x8a76('0x10')][_0x8a76('0xf')]);}})[_0x8a76('0x11')](function(_0xf33424){logger[_0x8a76('0xe')](_0x8a76('0xa'),_0x3532d8,_0xf33424);_0x2bc8aa(_0xf33424);});});}