Built motion from commit 5293bb2a.|2.6.30
[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 _0xaa68=['message','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x346737,_0x3e6081){var _0x1ade2e=function(_0x15e50e){while(--_0x15e50e){_0x346737['push'](_0x346737['shift']());}};_0x1ade2e(++_0x3e6081);}(_0xaa68,0x94));var _0x8aa6=function(_0x1e8bff,_0x5553bd){_0x1e8bff=_0x1e8bff-0x0;var _0x442d64=_0xaa68[_0x1e8bff];return _0x442d64;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8aa6('0x0'));var BPromise=require(_0x8aa6('0x1'));var rs=require(_0x8aa6('0x2'));var fs=require('fs');var Redis=require(_0x8aa6('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x8aa6('0x4'));var logger=require(_0x8aa6('0x5'))(_0x8aa6('0x6'));var config=require(_0x8aa6('0x7'));var jayson=require(_0x8aa6('0x8'));var client=jayson['client'][_0x8aa6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x6ebb4f,_0x2c27aa,_0x5858c9){return new BPromise(function(_0x231f98,_0x365a0d){return client[_0x8aa6('0xa')](_0x6ebb4f,_0x5858c9)[_0x8aa6('0xb')](function(_0xe3f122){logger[_0x8aa6('0xc')](_0x8aa6('0xd'),_0x2c27aa,_0x8aa6('0xe'));logger[_0x8aa6('0xf')](_0x8aa6('0x10'),_0x2c27aa,_0x8aa6('0xe'),JSON[_0x8aa6('0x11')](_0xe3f122));if(_0xe3f122[_0x8aa6('0x12')]){if(_0xe3f122['error'][_0x8aa6('0x13')]===0x1f4){logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c27aa,_0xe3f122[_0x8aa6('0x12')]['message']);return _0x365a0d(_0xe3f122[_0x8aa6('0x12')][_0x8aa6('0x14')]);}logger[_0x8aa6('0x12')](_0x8aa6('0xd'),_0x2c27aa,_0xe3f122[_0x8aa6('0x12')][_0x8aa6('0x14')]);return _0x231f98(_0xe3f122['error'][_0x8aa6('0x14')]);}else{logger['info']('AnalyticDefaultReport,\x20%s,\x20%s',_0x2c27aa,_0x8aa6('0xe'));_0x231f98(_0xe3f122['result'][_0x8aa6('0x14')]);}})['catch'](function(_0x46e9dd){logger[_0x8aa6('0x12')](_0x8aa6('0xd'),_0x2c27aa,_0x46e9dd);_0x365a0d(_0x46e9dd);});});}