Built motion from commit 00bf23f6.|2.6.16
[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 _0x3c51=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','AnalyticCustomReport,\x20%s,\x20%s','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info'];(function(_0x3ea41f,_0x337284){var _0x1fd181=function(_0x344efa){while(--_0x344efa){_0x3ea41f['push'](_0x3ea41f['shift']());}};_0x1fd181(++_0x337284);}(_0x3c51,0x79));var _0x13c5=function(_0x3c88a8,_0xa040d1){_0x3c88a8=_0x3c88a8-0x0;var _0x370cf6=_0x3c51[_0x3c88a8];return _0x370cf6;};'use strict';var _=require(_0x13c5('0x0'));var util=require(_0x13c5('0x1'));var moment=require(_0x13c5('0x2'));var BPromise=require(_0x13c5('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x13c5('0x4'));var db=require(_0x13c5('0x5'))['db'];var utils=require(_0x13c5('0x6'));var logger=require(_0x13c5('0x7'))(_0x13c5('0x8'));var config=require(_0x13c5('0x9'));var jayson=require(_0x13c5('0xa'));var client=jayson[_0x13c5('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x13ee75,_0x28cb2c,_0x3e6212){return new BPromise(function(_0x367b6f,_0x5e48ef){return client[_0x13c5('0xc')](_0x13ee75,_0x3e6212)[_0x13c5('0xd')](function(_0x557e64){logger['info'](_0x13c5('0xe'),_0x28cb2c,'request\x20sent');logger[_0x13c5('0xf')](_0x13c5('0x10'),_0x28cb2c,_0x13c5('0x11'),JSON[_0x13c5('0x12')](_0x557e64));if(_0x557e64[_0x13c5('0x13')]){if(_0x557e64['error'][_0x13c5('0x14')]===0x1f4){logger[_0x13c5('0x13')](_0x13c5('0xe'),_0x28cb2c,_0x557e64[_0x13c5('0x13')][_0x13c5('0x15')]);return _0x5e48ef(_0x557e64[_0x13c5('0x13')]['message']);}logger[_0x13c5('0x13')]('AnalyticCustomReport,\x20%s,\x20%s',_0x28cb2c,_0x557e64[_0x13c5('0x13')][_0x13c5('0x15')]);return _0x367b6f(_0x557e64[_0x13c5('0x13')][_0x13c5('0x15')]);}else{logger[_0x13c5('0x16')](_0x13c5('0xe'),_0x28cb2c,_0x13c5('0x11'));_0x367b6f(_0x557e64['result'][_0x13c5('0x15')]);}})[_0x13c5('0x17')](function(_0x13567d){logger[_0x13c5('0x13')](_0x13c5('0xe'),_0x28cb2c,_0x13567d);_0x5e48ef(_0x13567d);});});}