Built motion from commit (unavailable).|2.5.10
[motion2.git] / server / api / analyticTreeReport / analyticTreeReport.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 _0x645d=['AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info'];(function(_0x46aad9,_0x4fe2d){var _0xdf9492=function(_0x5c891f){while(--_0x5c891f){_0x46aad9['push'](_0x46aad9['shift']());}};_0xdf9492(++_0x4fe2d);}(_0x645d,0x71));var _0xd645=function(_0x7aef09,_0x192202){_0x7aef09=_0x7aef09-0x0;var _0x224203=_0x645d[_0x7aef09];return _0x224203;};'use strict';var _=require(_0xd645('0x0'));var util=require('util');var moment=require(_0xd645('0x1'));var BPromise=require('bluebird');var rs=require(_0xd645('0x2'));var fs=require('fs');var Redis=require(_0xd645('0x3'));var db=require(_0xd645('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd645('0x5'))(_0xd645('0x6'));var config=require(_0xd645('0x7'));var jayson=require(_0xd645('0x8'));var client=jayson[_0xd645('0x9')][_0xd645('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1ecf1,_0xfe2153,_0x2ec82a){return new BPromise(function(_0x3310ea,_0x31f2cb){return client['request'](_0x1ecf1,_0x2ec82a)[_0xd645('0xb')](function(_0x14aa37){logger[_0xd645('0xc')](_0xd645('0xd'),_0xfe2153,_0xd645('0xe'));logger[_0xd645('0xf')]('AnalyticTreeReport,\x20%s,\x20%s,\x20%s',_0xfe2153,_0xd645('0xe'),JSON[_0xd645('0x10')](_0x14aa37));if(_0x14aa37[_0xd645('0x11')]){if(_0x14aa37['error'][_0xd645('0x12')]===0x1f4){logger[_0xd645('0x11')](_0xd645('0xd'),_0xfe2153,_0x14aa37[_0xd645('0x11')][_0xd645('0x13')]);return _0x31f2cb(_0x14aa37['error'][_0xd645('0x13')]);}logger[_0xd645('0x11')](_0xd645('0xd'),_0xfe2153,_0x14aa37[_0xd645('0x11')][_0xd645('0x13')]);return _0x3310ea(_0x14aa37[_0xd645('0x11')][_0xd645('0x13')]);}else{logger[_0xd645('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0xfe2153,_0xd645('0xe'));_0x3310ea(_0x14aa37['result'][_0xd645('0x13')]);}})[_0xd645('0x14')](function(_0x4c120d){logger[_0xd645('0x11')](_0xd645('0xd'),_0xfe2153,_0x4c120d);_0x31f2cb(_0x4c120d);});});}