Built motion from commit 4c281f94.|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 _0xf026=['util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch'];(function(_0x739e47,_0x311adb){var _0x4274a6=function(_0x20ef75){while(--_0x20ef75){_0x739e47['push'](_0x739e47['shift']());}};_0x4274a6(++_0x311adb);}(_0xf026,0x108));var _0x6f02=function(_0x5627e1,_0x1b2dbf){_0x5627e1=_0x5627e1-0x0;var _0x2f013f=_0xf026[_0x5627e1];return _0x2f013f;};'use strict';var _=require('lodash');var util=require(_0x6f02('0x0'));var moment=require(_0x6f02('0x1'));var BPromise=require(_0x6f02('0x2'));var rs=require(_0x6f02('0x3'));var fs=require('fs');var Redis=require(_0x6f02('0x4'));var db=require(_0x6f02('0x5'))['db'];var utils=require(_0x6f02('0x6'));var logger=require(_0x6f02('0x7'))(_0x6f02('0x8'));var config=require(_0x6f02('0x9'));var jayson=require(_0x6f02('0xa'));var client=jayson[_0x6f02('0xb')][_0x6f02('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x4100c9,_0x3d3e50,_0x53bce0){return new BPromise(function(_0x46da78,_0x5538a8){return client[_0x6f02('0xd')](_0x4100c9,_0x53bce0)['then'](function(_0x34278a){logger[_0x6f02('0xe')](_0x6f02('0xf'),_0x3d3e50,_0x6f02('0x10'));logger[_0x6f02('0x11')](_0x6f02('0x12'),_0x3d3e50,_0x6f02('0x10'),JSON['stringify'](_0x34278a));if(_0x34278a[_0x6f02('0x13')]){if(_0x34278a['error'][_0x6f02('0x14')]===0x1f4){logger[_0x6f02('0x13')](_0x6f02('0xf'),_0x3d3e50,_0x34278a[_0x6f02('0x13')]['message']);return _0x5538a8(_0x34278a[_0x6f02('0x13')][_0x6f02('0x15')]);}logger[_0x6f02('0x13')](_0x6f02('0xf'),_0x3d3e50,_0x34278a[_0x6f02('0x13')][_0x6f02('0x15')]);return _0x46da78(_0x34278a[_0x6f02('0x13')][_0x6f02('0x15')]);}else{logger[_0x6f02('0xe')](_0x6f02('0xf'),_0x3d3e50,_0x6f02('0x10'));_0x46da78(_0x34278a[_0x6f02('0x16')]['message']);}})[_0x6f02('0x17')](function(_0x5ab9a9){logger[_0x6f02('0x13')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x3d3e50,_0x5ab9a9);_0x5538a8(_0x5ab9a9);});});}