Built motion from commit (unavailable).|2.4.20
[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 _0x2116=['AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then'];(function(_0x2087f8,_0x431471){var _0x4b6c44=function(_0x5806b7){while(--_0x5806b7){_0x2087f8['push'](_0x2087f8['shift']());}};_0x4b6c44(++_0x431471);}(_0x2116,0x67));var _0x6211=function(_0x2442dd,_0x269ded){_0x2442dd=_0x2442dd-0x0;var _0x9d4594=_0x2116[_0x2442dd];return _0x9d4594;};'use strict';var _=require('lodash');var util=require(_0x6211('0x0'));var moment=require('moment');var BPromise=require(_0x6211('0x1'));var rs=require(_0x6211('0x2'));var fs=require('fs');var Redis=require(_0x6211('0x3'));var db=require(_0x6211('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6211('0x5'))(_0x6211('0x6'));var config=require(_0x6211('0x7'));var jayson=require(_0x6211('0x8'));var client=jayson['client'][_0x6211('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x57f7e7,_0x2355c7,_0x320562){return new BPromise(function(_0x365e65,_0x31914a){return client[_0x6211('0xa')](_0x57f7e7,_0x320562)[_0x6211('0xb')](function(_0x10bb82){logger['info'](_0x6211('0xc'),_0x2355c7,_0x6211('0xd'));logger[_0x6211('0xe')](_0x6211('0xf'),_0x2355c7,_0x6211('0xd'),JSON[_0x6211('0x10')](_0x10bb82));if(_0x10bb82[_0x6211('0x11')]){if(_0x10bb82['error'][_0x6211('0x12')]===0x1f4){logger['error'](_0x6211('0xc'),_0x2355c7,_0x10bb82[_0x6211('0x11')][_0x6211('0x13')]);return _0x31914a(_0x10bb82['error'][_0x6211('0x13')]);}logger[_0x6211('0x11')](_0x6211('0xc'),_0x2355c7,_0x10bb82['error']['message']);return _0x365e65(_0x10bb82[_0x6211('0x11')][_0x6211('0x13')]);}else{logger[_0x6211('0x14')](_0x6211('0xc'),_0x2355c7,_0x6211('0xd'));_0x365e65(_0x10bb82[_0x6211('0x15')][_0x6211('0x13')]);}})[_0x6211('0x16')](function(_0x5b64e9){logger[_0x6211('0x11')](_0x6211('0xc'),_0x2355c7,_0x5b64e9);_0x31914a(_0x5b64e9);});});}