Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / analyticExtractedReport / analyticExtractedReport.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 _0xc35d=['message','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x103e39,_0x7db66){var _0x3e95c3=function(_0x10b2af){while(--_0x10b2af){_0x103e39['push'](_0x103e39['shift']());}};_0x3e95c3(++_0x7db66);}(_0xc35d,0x12e));var _0xdc35=function(_0x26a53e,_0x1b83f5){_0x26a53e=_0x26a53e-0x0;var _0x328de0=_0xc35d[_0x26a53e];return _0x328de0;};'use strict';var _=require(_0xdc35('0x0'));var util=require(_0xdc35('0x1'));var moment=require(_0xdc35('0x2'));var BPromise=require('bluebird');var rs=require(_0xdc35('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xdc35('0x4'))['db'];var utils=require(_0xdc35('0x5'));var logger=require('../../config/logger')(_0xdc35('0x6'));var config=require(_0xdc35('0x7'));var jayson=require(_0xdc35('0x8'));var client=jayson['client'][_0xdc35('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x23cdff,_0x1aeb54,_0x56583c){return new BPromise(function(_0xe4b441,_0x1bb16d){return client[_0xdc35('0xa')](_0x23cdff,_0x56583c)['then'](function(_0x1e9d54){logger[_0xdc35('0xb')](_0xdc35('0xc'),_0x1aeb54,_0xdc35('0xd'));logger['debug'](_0xdc35('0xe'),_0x1aeb54,_0xdc35('0xd'),JSON[_0xdc35('0xf')](_0x1e9d54));if(_0x1e9d54[_0xdc35('0x10')]){if(_0x1e9d54['error'][_0xdc35('0x11')]===0x1f4){logger['error'](_0xdc35('0xc'),_0x1aeb54,_0x1e9d54[_0xdc35('0x10')][_0xdc35('0x12')]);return _0x1bb16d(_0x1e9d54[_0xdc35('0x10')][_0xdc35('0x12')]);}logger[_0xdc35('0x10')](_0xdc35('0xc'),_0x1aeb54,_0x1e9d54['error'][_0xdc35('0x12')]);return _0xe4b441(_0x1e9d54[_0xdc35('0x10')][_0xdc35('0x12')]);}else{logger['info'](_0xdc35('0xc'),_0x1aeb54,_0xdc35('0xd'));_0xe4b441(_0x1e9d54['result'][_0xdc35('0x12')]);}})[_0xdc35('0x13')](function(_0x43b3b3){logger[_0xdc35('0x10')](_0xdc35('0xc'),_0x1aeb54,_0x43b3b3);_0x1bb16d(_0x43b3b3);});});}