Built motion from commit d6d69adf.|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 _0xbbc9=['randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x3794db,_0x5e1968){var _0x3a7499=function(_0x1f4241){while(--_0x1f4241){_0x3794db['push'](_0x3794db['shift']());}};_0x3a7499(++_0x5e1968);}(_0xbbc9,0x15a));var _0x9bbc=function(_0x4efa2a,_0x1dbe0e){_0x4efa2a=_0x4efa2a-0x0;var _0x1055f7=_0xbbc9[_0x4efa2a];return _0x1055f7;};'use strict';var _=require(_0x9bbc('0x0'));var util=require(_0x9bbc('0x1'));var moment=require(_0x9bbc('0x2'));var BPromise=require(_0x9bbc('0x3'));var rs=require(_0x9bbc('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9bbc('0x5'))['db'];var utils=require(_0x9bbc('0x6'));var logger=require(_0x9bbc('0x7'))(_0x9bbc('0x8'));var config=require(_0x9bbc('0x9'));var jayson=require(_0x9bbc('0xa'));var client=jayson[_0x9bbc('0xb')][_0x9bbc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x396af3,_0x40d49f,_0x2825b4){return new BPromise(function(_0x4ccd0a,_0x421e32){return client['request'](_0x396af3,_0x2825b4)[_0x9bbc('0xd')](function(_0x3ced5f){logger[_0x9bbc('0xe')](_0x9bbc('0xf'),_0x40d49f,_0x9bbc('0x10'));logger[_0x9bbc('0x11')](_0x9bbc('0x12'),_0x40d49f,_0x9bbc('0x10'),JSON[_0x9bbc('0x13')](_0x3ced5f));if(_0x3ced5f[_0x9bbc('0x14')]){if(_0x3ced5f[_0x9bbc('0x14')][_0x9bbc('0x15')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x40d49f,_0x3ced5f[_0x9bbc('0x14')]['message']);return _0x421e32(_0x3ced5f[_0x9bbc('0x14')]['message']);}logger[_0x9bbc('0x14')](_0x9bbc('0xf'),_0x40d49f,_0x3ced5f[_0x9bbc('0x14')][_0x9bbc('0x16')]);return _0x4ccd0a(_0x3ced5f[_0x9bbc('0x14')][_0x9bbc('0x16')]);}else{logger[_0x9bbc('0xe')](_0x9bbc('0xf'),_0x40d49f,_0x9bbc('0x10'));_0x4ccd0a(_0x3ced5f[_0x9bbc('0x17')][_0x9bbc('0x16')]);}})[_0x9bbc('0x18')](function(_0x48daee){logger[_0x9bbc('0x14')](_0x9bbc('0xf'),_0x40d49f,_0x48daee);_0x421e32(_0x48daee);});});}