17eeec8c4a8d6ad8026ec82d15dd475cf6a6aa87
[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 _0x8f22=['../../config/environment','request','then','info','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0xc9527b,_0x56da87){var _0x453cae=function(_0x24df7b){while(--_0x24df7b){_0xc9527b['push'](_0xc9527b['shift']());}};_0x453cae(++_0x56da87);}(_0x8f22,0x75));var _0x28f2=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x8f22[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x28f2('0x0'));var util=require(_0x28f2('0x1'));var moment=require(_0x28f2('0x2'));var BPromise=require(_0x28f2('0x3'));var rs=require(_0x28f2('0x4'));var fs=require('fs');var Redis=require(_0x28f2('0x5'));var db=require(_0x28f2('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x28f2('0x7'))(_0x28f2('0x8'));var config=require(_0x28f2('0x9'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x364cda,_0x64e1fb,_0x2a5055){return new BPromise(function(_0x3961fc,_0x4d69a9){return client[_0x28f2('0xa')](_0x364cda,_0x2a5055)[_0x28f2('0xb')](function(_0x46a0a2){logger[_0x28f2('0xc')](_0x28f2('0xd'),_0x64e1fb,_0x28f2('0xe'));logger[_0x28f2('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s,\x20%s',_0x64e1fb,_0x28f2('0xe'),JSON[_0x28f2('0x10')](_0x46a0a2));if(_0x46a0a2['error']){if(_0x46a0a2[_0x28f2('0x11')][_0x28f2('0x12')]===0x1f4){logger[_0x28f2('0x11')](_0x28f2('0xd'),_0x64e1fb,_0x46a0a2['error'][_0x28f2('0x13')]);return _0x4d69a9(_0x46a0a2[_0x28f2('0x11')][_0x28f2('0x13')]);}logger['error']('AnalyticDefaultReport,\x20%s,\x20%s',_0x64e1fb,_0x46a0a2['error'][_0x28f2('0x13')]);return _0x3961fc(_0x46a0a2['error'][_0x28f2('0x13')]);}else{logger['info'](_0x28f2('0xd'),_0x64e1fb,'request\x20sent');_0x3961fc(_0x46a0a2['result'][_0x28f2('0x13')]);}})[_0x28f2('0x14')](function(_0x210c1c){logger[_0x28f2('0x11')](_0x28f2('0xd'),_0x64e1fb,_0x210c1c);_0x4d69a9(_0x210c1c);});});}