Built motion from commit 953226e6.|2.6.32
[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 _0xca71=['message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','jayson/promise','client','then','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x17ee0e,_0x4193b7){var _0x519373=function(_0x5c6ec7){while(--_0x5c6ec7){_0x17ee0e['push'](_0x17ee0e['shift']());}};_0x519373(++_0x4193b7);}(_0xca71,0x10c));var _0x1ca7=function(_0x2b6f49,_0x3f5a45){_0x2b6f49=_0x2b6f49-0x0;var _0x26d444=_0xca71[_0x2b6f49];return _0x26d444;};'use strict';var _=require(_0x1ca7('0x0'));var util=require(_0x1ca7('0x1'));var moment=require(_0x1ca7('0x2'));var BPromise=require(_0x1ca7('0x3'));var rs=require(_0x1ca7('0x4'));var fs=require('fs');var Redis=require(_0x1ca7('0x5'));var db=require(_0x1ca7('0x6'))['db'];var utils=require(_0x1ca7('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1ca7('0x8'));var client=jayson[_0x1ca7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbca388,_0xf41e33,_0x439194){return new BPromise(function(_0x12c8b8,_0x5a085a){return client['request'](_0xbca388,_0x439194)[_0x1ca7('0xa')](function(_0x165c6b){logger['info'](_0x1ca7('0xb'),_0xf41e33,_0x1ca7('0xc'));logger[_0x1ca7('0xd')](_0x1ca7('0xe'),_0xf41e33,_0x1ca7('0xc'),JSON[_0x1ca7('0xf')](_0x165c6b));if(_0x165c6b[_0x1ca7('0x10')]){if(_0x165c6b[_0x1ca7('0x10')][_0x1ca7('0x11')]===0x1f4){logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xf41e33,_0x165c6b['error'][_0x1ca7('0x12')]);return _0x5a085a(_0x165c6b[_0x1ca7('0x10')][_0x1ca7('0x12')]);}logger[_0x1ca7('0x10')](_0x1ca7('0xb'),_0xf41e33,_0x165c6b['error'][_0x1ca7('0x12')]);return _0x12c8b8(_0x165c6b['error'][_0x1ca7('0x12')]);}else{logger[_0x1ca7('0x13')](_0x1ca7('0xb'),_0xf41e33,_0x1ca7('0xc'));_0x12c8b8(_0x165c6b[_0x1ca7('0x14')][_0x1ca7('0x12')]);}})[_0x1ca7('0x15')](function(_0x43be65){logger['error'](_0x1ca7('0xb'),_0xf41e33,_0x43be65);_0x5a085a(_0x43be65);});});}