Built motion from commit c738b9ac.|2.6.25
[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 _0x64a3=['lodash','util','moment','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','AnalyticExtractedReport,\x20%s,\x20%s','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch'];(function(_0x4a08d7,_0x15b246){var _0x103c59=function(_0x8f8b83){while(--_0x8f8b83){_0x4a08d7['push'](_0x4a08d7['shift']());}};_0x103c59(++_0x15b246);}(_0x64a3,0xe7));var _0x364a=function(_0x24abca,_0x4f96e4){_0x24abca=_0x24abca-0x0;var _0x2ac376=_0x64a3[_0x24abca];return _0x2ac376;};'use strict';var _=require(_0x364a('0x0'));var util=require(_0x364a('0x1'));var moment=require(_0x364a('0x2'));var BPromise=require('bluebird');var rs=require(_0x364a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x364a('0x4'))['db'];var utils=require(_0x364a('0x5'));var logger=require('../../config/logger')(_0x364a('0x6'));var config=require('../../config/environment');var jayson=require(_0x364a('0x7'));var client=jayson[_0x364a('0x8')][_0x364a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x48fc81,_0x224cf3,_0x1e341a){return new BPromise(function(_0x4fb3c5,_0x16f298){return client[_0x364a('0xa')](_0x48fc81,_0x1e341a)[_0x364a('0xb')](function(_0x1b014d){logger[_0x364a('0xc')](_0x364a('0xd'),_0x224cf3,'request\x20sent');logger[_0x364a('0xe')](_0x364a('0xf'),_0x224cf3,'request\x20sent',JSON[_0x364a('0x10')](_0x1b014d));if(_0x1b014d[_0x364a('0x11')]){if(_0x1b014d[_0x364a('0x11')][_0x364a('0x12')]===0x1f4){logger[_0x364a('0x11')](_0x364a('0xd'),_0x224cf3,_0x1b014d[_0x364a('0x11')][_0x364a('0x13')]);return _0x16f298(_0x1b014d['error']['message']);}logger[_0x364a('0x11')](_0x364a('0xd'),_0x224cf3,_0x1b014d[_0x364a('0x11')][_0x364a('0x13')]);return _0x4fb3c5(_0x1b014d[_0x364a('0x11')][_0x364a('0x13')]);}else{logger[_0x364a('0xc')](_0x364a('0xd'),_0x224cf3,'request\x20sent');_0x4fb3c5(_0x1b014d['result'][_0x364a('0x13')]);}})[_0x364a('0x14')](function(_0x5ec3cc){logger[_0x364a('0x11')](_0x364a('0xd'),_0x224cf3,_0x5ec3cc);_0x16f298(_0x5ec3cc);});});}