Built motion from commit (unavailable).|2.5.25
[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 _0x6cbd=['then','info','request\x20sent','debug','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','result','catch','lodash','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0x4ec385,_0x436b9b){var _0x3450e8=function(_0x5ba282){while(--_0x5ba282){_0x4ec385['push'](_0x4ec385['shift']());}};_0x3450e8(++_0x436b9b);}(_0x6cbd,0xdb));var _0xd6cb=function(_0x5c351c,_0x2046d8){_0x5c351c=_0x5c351c-0x0;var _0x26f3b3=_0x6cbd[_0x5c351c];return _0x26f3b3;};'use strict';var _=require(_0xd6cb('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xd6cb('0x1'));var rs=require(_0xd6cb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xd6cb('0x3'))['db'];var utils=require(_0xd6cb('0x4'));var logger=require('../../config/logger')(_0xd6cb('0x5'));var config=require(_0xd6cb('0x6'));var jayson=require(_0xd6cb('0x7'));var client=jayson[_0xd6cb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5ec088,_0x3efab1,_0x3be80c){return new BPromise(function(_0x466535,_0x2a05b0){return client['request'](_0x5ec088,_0x3be80c)[_0xd6cb('0x9')](function(_0x33b51a){logger[_0xd6cb('0xa')]('AnalyticCustomReport,\x20%s,\x20%s',_0x3efab1,_0xd6cb('0xb'));logger[_0xd6cb('0xc')]('AnalyticCustomReport,\x20%s,\x20%s,\x20%s',_0x3efab1,'request\x20sent',JSON[_0xd6cb('0xd')](_0x33b51a));if(_0x33b51a[_0xd6cb('0xe')]){if(_0x33b51a[_0xd6cb('0xe')]['code']===0x1f4){logger[_0xd6cb('0xe')](_0xd6cb('0xf'),_0x3efab1,_0x33b51a[_0xd6cb('0xe')]['message']);return _0x2a05b0(_0x33b51a[_0xd6cb('0xe')]['message']);}logger['error'](_0xd6cb('0xf'),_0x3efab1,_0x33b51a[_0xd6cb('0xe')][_0xd6cb('0x10')]);return _0x466535(_0x33b51a[_0xd6cb('0xe')][_0xd6cb('0x10')]);}else{logger['info'](_0xd6cb('0xf'),_0x3efab1,_0xd6cb('0xb'));_0x466535(_0x33b51a[_0xd6cb('0x11')][_0xd6cb('0x10')]);}})[_0xd6cb('0x12')](function(_0x3e0c01){logger[_0xd6cb('0xe')](_0xd6cb('0xf'),_0x3efab1,_0x3e0c01);_0x2a05b0(_0x3e0c01);});});}