Built motion from commit (unavailable).|2.5.14
[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 _0xf580=['info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','AnalyticTreeReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x1def1f,_0x230a88){var _0x3fb6ad=function(_0x52a66f){while(--_0x52a66f){_0x1def1f['push'](_0x1def1f['shift']());}};_0x3fb6ad(++_0x230a88);}(_0xf580,0x71));var _0x0f58=function(_0xdb7468,_0x4efe3b){_0xdb7468=_0xdb7468-0x0;var _0x438ed0=_0xf580[_0xdb7468];return _0x438ed0;};'use strict';var _=require(_0x0f58('0x0'));var util=require(_0x0f58('0x1'));var moment=require(_0x0f58('0x2'));var BPromise=require(_0x0f58('0x3'));var rs=require(_0x0f58('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0f58('0x5'))['db'];var utils=require(_0x0f58('0x6'));var logger=require(_0x0f58('0x7'))(_0x0f58('0x8'));var config=require('../../config/environment');var jayson=require(_0x0f58('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x2da258,_0x24bed4,_0x1da550){return new BPromise(function(_0x26a2be,_0x333780){return client[_0x0f58('0xa')](_0x2da258,_0x1da550)['then'](function(_0x5881fd){logger['info'](_0x0f58('0xb'),_0x24bed4,_0x0f58('0xc'));logger[_0x0f58('0xd')](_0x0f58('0xe'),_0x24bed4,'request\x20sent',JSON[_0x0f58('0xf')](_0x5881fd));if(_0x5881fd[_0x0f58('0x10')]){if(_0x5881fd[_0x0f58('0x10')][_0x0f58('0x11')]===0x1f4){logger[_0x0f58('0x10')](_0x0f58('0xb'),_0x24bed4,_0x5881fd[_0x0f58('0x10')][_0x0f58('0x12')]);return _0x333780(_0x5881fd[_0x0f58('0x10')]['message']);}logger['error'](_0x0f58('0xb'),_0x24bed4,_0x5881fd[_0x0f58('0x10')][_0x0f58('0x12')]);return _0x26a2be(_0x5881fd[_0x0f58('0x10')][_0x0f58('0x12')]);}else{logger[_0x0f58('0x13')](_0x0f58('0xb'),_0x24bed4,_0x0f58('0xc'));_0x26a2be(_0x5881fd[_0x0f58('0x14')]['message']);}})[_0x0f58('0x15')](function(_0x2b05ca){logger[_0x0f58('0x10')](_0x0f58('0xb'),_0x24bed4,_0x2b05ca);_0x333780(_0x2b05ca);});});}