Built motion from commit (unavailable).|2.5.13
[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 _0x27a9=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0x2b7166,_0x4de3ba){var _0x5d416e=function(_0x47583a){while(--_0x47583a){_0x2b7166['push'](_0x2b7166['shift']());}};_0x5d416e(++_0x4de3ba);}(_0x27a9,0xac));var _0x927a=function(_0x3e95cb,_0x4f5933){_0x3e95cb=_0x3e95cb-0x0;var _0x2c2e48=_0x27a9[_0x3e95cb];return _0x2c2e48;};'use strict';var _=require(_0x927a('0x0'));var util=require(_0x927a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x927a('0x2'));var fs=require('fs');var Redis=require(_0x927a('0x3'));var db=require(_0x927a('0x4'))['db'];var utils=require(_0x927a('0x5'));var logger=require(_0x927a('0x6'))(_0x927a('0x7'));var config=require(_0x927a('0x8'));var jayson=require(_0x927a('0x9'));var client=jayson['client'][_0x927a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x11132f,_0x12943f,_0x2539e1){return new BPromise(function(_0x384c71,_0xd8a3ec){return client['request'](_0x11132f,_0x2539e1)[_0x927a('0xb')](function(_0x408a30){logger[_0x927a('0xc')](_0x927a('0xd'),_0x12943f,_0x927a('0xe'));logger[_0x927a('0xf')](_0x927a('0x10'),_0x12943f,_0x927a('0xe'),JSON[_0x927a('0x11')](_0x408a30));if(_0x408a30['error']){if(_0x408a30[_0x927a('0x12')]['code']===0x1f4){logger[_0x927a('0x12')](_0x927a('0xd'),_0x12943f,_0x408a30['error'][_0x927a('0x13')]);return _0xd8a3ec(_0x408a30['error'][_0x927a('0x13')]);}logger['error'](_0x927a('0xd'),_0x12943f,_0x408a30[_0x927a('0x12')][_0x927a('0x13')]);return _0x384c71(_0x408a30[_0x927a('0x12')][_0x927a('0x13')]);}else{logger[_0x927a('0xc')](_0x927a('0xd'),_0x12943f,'request\x20sent');_0x384c71(_0x408a30[_0x927a('0x14')][_0x927a('0x13')]);}})[_0x927a('0x15')](function(_0x224f6d){logger[_0x927a('0x12')](_0x927a('0xd'),_0x12943f,_0x224f6d);_0xd8a3ec(_0x224f6d);});});}