8309ca597fc281760f3cfac8a104eea4fc0d6712
[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 _0x5fc7=['catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message'];(function(_0x44dd4d,_0x4f4660){var _0xf20fdd=function(_0x38f3a9){while(--_0x38f3a9){_0x44dd4d['push'](_0x44dd4d['shift']());}};_0xf20fdd(++_0x4f4660);}(_0x5fc7,0x1e1));var _0x75fc=function(_0x16dbfd,_0x2f9431){_0x16dbfd=_0x16dbfd-0x0;var _0x382254=_0x5fc7[_0x16dbfd];return _0x382254;};'use strict';var _=require(_0x75fc('0x0'));var util=require(_0x75fc('0x1'));var moment=require(_0x75fc('0x2'));var BPromise=require(_0x75fc('0x3'));var rs=require(_0x75fc('0x4'));var fs=require('fs');var Redis=require(_0x75fc('0x5'));var db=require(_0x75fc('0x6'))['db'];var utils=require(_0x75fc('0x7'));var logger=require(_0x75fc('0x8'))(_0x75fc('0x9'));var config=require(_0x75fc('0xa'));var jayson=require(_0x75fc('0xb'));var client=jayson['client'][_0x75fc('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xc85b45,_0x1430f3,_0x347ce8){return new BPromise(function(_0x17a1d5,_0x15f3bc){return client[_0x75fc('0xd')](_0xc85b45,_0x347ce8)[_0x75fc('0xe')](function(_0x957f42){logger[_0x75fc('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x1430f3,_0x75fc('0x10'));logger[_0x75fc('0x11')](_0x75fc('0x12'),_0x1430f3,_0x75fc('0x10'),JSON['stringify'](_0x957f42));if(_0x957f42[_0x75fc('0x13')]){if(_0x957f42[_0x75fc('0x13')][_0x75fc('0x14')]===0x1f4){logger[_0x75fc('0x13')](_0x75fc('0x15'),_0x1430f3,_0x957f42[_0x75fc('0x13')][_0x75fc('0x16')]);return _0x15f3bc(_0x957f42['error']['message']);}logger['error'](_0x75fc('0x15'),_0x1430f3,_0x957f42[_0x75fc('0x13')][_0x75fc('0x16')]);return _0x17a1d5(_0x957f42[_0x75fc('0x13')][_0x75fc('0x16')]);}else{logger[_0x75fc('0xf')](_0x75fc('0x15'),_0x1430f3,_0x75fc('0x10'));_0x17a1d5(_0x957f42['result'][_0x75fc('0x16')]);}})[_0x75fc('0x17')](function(_0x51011d){logger[_0x75fc('0x13')](_0x75fc('0x15'),_0x1430f3,_0x51011d);_0x15f3bc(_0x51011d);});});}