Built motion from commit 85328c08.|2.5.50
[motion2.git] / server / api / analyticFieldReport / analyticFieldReport.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 _0x3a2d=['../../config/environment','jayson/promise','http','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','rpc'];(function(_0xc21ae,_0x173f65){var _0x358c22=function(_0x2445d3){while(--_0x2445d3){_0xc21ae['push'](_0xc21ae['shift']());}};_0x358c22(++_0x173f65);}(_0x3a2d,0xeb));var _0xd3a2=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3a2d[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0xd3a2('0x0'));var util=require(_0xd3a2('0x1'));var moment=require(_0xd3a2('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3a2('0x3'));var db=require(_0xd3a2('0x4'))['db'];var utils=require(_0xd3a2('0x5'));var logger=require('../../config/logger')(_0xd3a2('0x6'));var config=require(_0xd3a2('0x7'));var jayson=require(_0xd3a2('0x8'));var client=jayson['client'][_0xd3a2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x18102c,_0x2173aa,_0x4c8ff7){return new BPromise(function(_0x1da390,_0x56da4e){return client[_0xd3a2('0xa')](_0x18102c,_0x4c8ff7)[_0xd3a2('0xb')](function(_0x341f9c){logger[_0xd3a2('0xc')](_0xd3a2('0xd'),_0x2173aa,_0xd3a2('0xe'));logger[_0xd3a2('0xf')](_0xd3a2('0x10'),_0x2173aa,'request\x20sent',JSON[_0xd3a2('0x11')](_0x341f9c));if(_0x341f9c['error']){if(_0x341f9c[_0xd3a2('0x12')][_0xd3a2('0x13')]===0x1f4){logger[_0xd3a2('0x12')](_0xd3a2('0xd'),_0x2173aa,_0x341f9c['error'][_0xd3a2('0x14')]);return _0x56da4e(_0x341f9c[_0xd3a2('0x12')][_0xd3a2('0x14')]);}logger[_0xd3a2('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2173aa,_0x341f9c['error']['message']);return _0x1da390(_0x341f9c[_0xd3a2('0x12')][_0xd3a2('0x14')]);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2173aa,_0xd3a2('0xe'));_0x1da390(_0x341f9c[_0xd3a2('0x15')]['message']);}})['catch'](function(_0x2cfca9){logger[_0xd3a2('0x12')](_0xd3a2('0xd'),_0x2173aa,_0x2cfca9);_0x56da4e(_0x2cfca9);});});}