Built motion from commit (unavailable).|2.4.20
[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 _0xa34d=['http','request','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x422905,_0x3bce3a){var _0x33dc6c=function(_0x4852c9){while(--_0x4852c9){_0x422905['push'](_0x422905['shift']());}};_0x33dc6c(++_0x3bce3a);}(_0xa34d,0x1d8));var _0xda34=function(_0x2641b0,_0x36b5d0){_0x2641b0=_0x2641b0-0x0;var _0x54731f=_0xa34d[_0x2641b0];return _0x54731f;};'use strict';var _=require(_0xda34('0x0'));var util=require(_0xda34('0x1'));var moment=require(_0xda34('0x2'));var BPromise=require('bluebird');var rs=require(_0xda34('0x3'));var fs=require('fs');var Redis=require(_0xda34('0x4'));var db=require(_0xda34('0x5'))['db'];var utils=require(_0xda34('0x6'));var logger=require(_0xda34('0x7'))(_0xda34('0x8'));var config=require(_0xda34('0x9'));var jayson=require(_0xda34('0xa'));var client=jayson[_0xda34('0xb')][_0xda34('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1cda63,_0x54a2a2,_0x3a034f){return new BPromise(function(_0x283339,_0x112fea){return client[_0xda34('0xd')](_0x1cda63,_0x3a034f)['then'](function(_0x4fbb25){logger[_0xda34('0xe')](_0xda34('0xf'),_0x54a2a2,_0xda34('0x10'));logger['debug']('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x54a2a2,_0xda34('0x10'),JSON[_0xda34('0x11')](_0x4fbb25));if(_0x4fbb25['error']){if(_0x4fbb25['error'][_0xda34('0x12')]===0x1f4){logger[_0xda34('0x13')](_0xda34('0xf'),_0x54a2a2,_0x4fbb25[_0xda34('0x13')]['message']);return _0x112fea(_0x4fbb25[_0xda34('0x13')]['message']);}logger[_0xda34('0x13')](_0xda34('0xf'),_0x54a2a2,_0x4fbb25['error'][_0xda34('0x14')]);return _0x283339(_0x4fbb25[_0xda34('0x13')][_0xda34('0x14')]);}else{logger[_0xda34('0xe')](_0xda34('0xf'),_0x54a2a2,'request\x20sent');_0x283339(_0x4fbb25['result'][_0xda34('0x14')]);}})[_0xda34('0x15')](function(_0x187677){logger[_0xda34('0x13')](_0xda34('0xf'),_0x54a2a2,_0x187677);_0x112fea(_0x187677);});});}