Built motion from commit 9d0783e6.|2.6.13
[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 _0x92f1=['rpc','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticDefaultReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x2b4aea,_0x19d8ae){var _0x164b9d=function(_0x4c8d4c){while(--_0x4c8d4c){_0x2b4aea['push'](_0x2b4aea['shift']());}};_0x164b9d(++_0x19d8ae);}(_0x92f1,0x149));var _0x192f=function(_0x5c0b91,_0x547a6d){_0x5c0b91=_0x5c0b91-0x0;var _0x106490=_0x92f1[_0x5c0b91];return _0x106490;};'use strict';var _=require(_0x192f('0x0'));var util=require('util');var moment=require(_0x192f('0x1'));var BPromise=require(_0x192f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x192f('0x3'));var db=require(_0x192f('0x4'))['db'];var utils=require(_0x192f('0x5'));var logger=require(_0x192f('0x6'))(_0x192f('0x7'));var config=require(_0x192f('0x8'));var jayson=require(_0x192f('0x9'));var client=jayson[_0x192f('0xa')][_0x192f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x27c290,_0x141247,_0x18a67b){return new BPromise(function(_0x8bcbf2,_0x3d454c){return client['request'](_0x27c290,_0x18a67b)[_0x192f('0xc')](function(_0x4d6cc7){logger[_0x192f('0xd')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x141247,_0x192f('0xe'));logger[_0x192f('0xf')](_0x192f('0x10'),_0x141247,_0x192f('0xe'),JSON[_0x192f('0x11')](_0x4d6cc7));if(_0x4d6cc7['error']){if(_0x4d6cc7[_0x192f('0x12')][_0x192f('0x13')]===0x1f4){logger[_0x192f('0x12')](_0x192f('0x14'),_0x141247,_0x4d6cc7[_0x192f('0x12')][_0x192f('0x15')]);return _0x3d454c(_0x4d6cc7[_0x192f('0x12')][_0x192f('0x15')]);}logger['error'](_0x192f('0x14'),_0x141247,_0x4d6cc7[_0x192f('0x12')]['message']);return _0x8bcbf2(_0x4d6cc7[_0x192f('0x12')][_0x192f('0x15')]);}else{logger[_0x192f('0xd')](_0x192f('0x14'),_0x141247,'request\x20sent');_0x8bcbf2(_0x4d6cc7[_0x192f('0x16')][_0x192f('0x15')]);}})[_0x192f('0x17')](function(_0x5ae832){logger[_0x192f('0x12')](_0x192f('0x14'),_0x141247,_0x5ae832);_0x3d454c(_0x5ae832);});});}