b15d143b8a155050f1b8314d8892a225f832f273
[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 _0x0b96=['catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','AnalyticExtractedReport,\x20%s,\x20%s','message','result'];(function(_0x2ad008,_0x45c253){var _0x4538cf=function(_0xe143e4){while(--_0xe143e4){_0x2ad008['push'](_0x2ad008['shift']());}};_0x4538cf(++_0x45c253);}(_0x0b96,0xf1));var _0x60b9=function(_0x24df34,_0x50aa1a){_0x24df34=_0x24df34-0x0;var _0x3980e8=_0x0b96[_0x24df34];return _0x3980e8;};'use strict';var _=require(_0x60b9('0x0'));var util=require('util');var moment=require(_0x60b9('0x1'));var BPromise=require(_0x60b9('0x2'));var rs=require(_0x60b9('0x3'));var fs=require('fs');var Redis=require(_0x60b9('0x4'));var db=require(_0x60b9('0x5'))['db'];var utils=require(_0x60b9('0x6'));var logger=require(_0x60b9('0x7'))(_0x60b9('0x8'));var config=require(_0x60b9('0x9'));var jayson=require(_0x60b9('0xa'));var client=jayson[_0x60b9('0xb')][_0x60b9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x815970,_0x5ea969,_0x58c7a3){return new BPromise(function(_0x2f0efc,_0x49a727){return client[_0x60b9('0xd')](_0x815970,_0x58c7a3)['then'](function(_0x96a558){logger[_0x60b9('0xe')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x5ea969,'request\x20sent');logger['debug'](_0x60b9('0xf'),_0x5ea969,_0x60b9('0x10'),JSON[_0x60b9('0x11')](_0x96a558));if(_0x96a558['error']){if(_0x96a558['error'][_0x60b9('0x12')]===0x1f4){logger[_0x60b9('0x13')](_0x60b9('0x14'),_0x5ea969,_0x96a558[_0x60b9('0x13')][_0x60b9('0x15')]);return _0x49a727(_0x96a558['error'][_0x60b9('0x15')]);}logger[_0x60b9('0x13')](_0x60b9('0x14'),_0x5ea969,_0x96a558[_0x60b9('0x13')]['message']);return _0x2f0efc(_0x96a558[_0x60b9('0x13')][_0x60b9('0x15')]);}else{logger[_0x60b9('0xe')](_0x60b9('0x14'),_0x5ea969,_0x60b9('0x10'));_0x2f0efc(_0x96a558[_0x60b9('0x16')][_0x60b9('0x15')]);}})[_0x60b9('0x17')](function(_0x1154f1){logger[_0x60b9('0x13')](_0x60b9('0x14'),_0x5ea969,_0x1154f1);_0x49a727(_0x1154f1);});});}