Built motion from commit (unavailable).|2.5.20
[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 _0xcaca=['AnalyticCustomReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','AnalyticCustomReport,\x20%s,\x20%s'];(function(_0xb5115b,_0x5ae2f3){var _0x161361=function(_0x1e8b1d){while(--_0x1e8b1d){_0xb5115b['push'](_0xb5115b['shift']());}};_0x161361(++_0x5ae2f3);}(_0xcaca,0x126));var _0xacac=function(_0x5583e8,_0x2f7944){_0x5583e8=_0x5583e8-0x0;var _0x27cf7f=_0xcaca[_0x5583e8];return _0x27cf7f;};'use strict';var _=require(_0xacac('0x0'));var util=require(_0xacac('0x1'));var moment=require('moment');var BPromise=require(_0xacac('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xacac('0x3'));var db=require(_0xacac('0x4'))['db'];var utils=require(_0xacac('0x5'));var logger=require(_0xacac('0x6'))(_0xacac('0x7'));var config=require(_0xacac('0x8'));var jayson=require(_0xacac('0x9'));var client=jayson[_0xacac('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x21a03a,_0x506e58,_0x1aee57){return new BPromise(function(_0x151876,_0xf888ce){return client['request'](_0x21a03a,_0x1aee57)[_0xacac('0xb')](function(_0x235cf0){logger[_0xacac('0xc')](_0xacac('0xd'),_0x506e58,'request\x20sent');logger['debug'](_0xacac('0xe'),_0x506e58,_0xacac('0xf'),JSON[_0xacac('0x10')](_0x235cf0));if(_0x235cf0[_0xacac('0x11')]){if(_0x235cf0[_0xacac('0x11')][_0xacac('0x12')]===0x1f4){logger[_0xacac('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x506e58,_0x235cf0[_0xacac('0x11')][_0xacac('0x13')]);return _0xf888ce(_0x235cf0['error'][_0xacac('0x13')]);}logger[_0xacac('0x11')](_0xacac('0xd'),_0x506e58,_0x235cf0[_0xacac('0x11')]['message']);return _0x151876(_0x235cf0['error'][_0xacac('0x13')]);}else{logger[_0xacac('0xc')]('AnalyticCustomReport,\x20%s,\x20%s',_0x506e58,_0xacac('0xf'));_0x151876(_0x235cf0[_0xacac('0x14')]['message']);}})[_0xacac('0x15')](function(_0x282e78){logger[_0xacac('0x11')]('AnalyticCustomReport,\x20%s,\x20%s',_0x506e58,_0x282e78);_0xf888ce(_0x282e78);});});}