Built motion from commit 6db1674d.|2.6.23
[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 _0x024f=['debug','stringify','error','message','result','catch','lodash','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent'];(function(_0x327059,_0x4641d9){var _0x23e828=function(_0x4dd823){while(--_0x4dd823){_0x327059['push'](_0x327059['shift']());}};_0x23e828(++_0x4641d9);}(_0x024f,0x16e));var _0xf024=function(_0x109312,_0x4e1fa3){_0x109312=_0x109312-0x0;var _0x3c29d5=_0x024f[_0x109312];return _0x3c29d5;};'use strict';var _=require(_0xf024('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xf024('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xf024('0x2'));var db=require(_0xf024('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xf024('0x4'));var jayson=require(_0xf024('0x5'));var client=jayson[_0xf024('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3ea42b,_0x24f71b,_0xb36316){return new BPromise(function(_0xc8860a,_0x2a723a){return client[_0xf024('0x7')](_0x3ea42b,_0xb36316)[_0xf024('0x8')](function(_0x3f18bd){logger[_0xf024('0x9')](_0xf024('0xa'),_0x24f71b,_0xf024('0xb'));logger[_0xf024('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x24f71b,_0xf024('0xb'),JSON[_0xf024('0xd')](_0x3f18bd));if(_0x3f18bd[_0xf024('0xe')]){if(_0x3f18bd[_0xf024('0xe')]['code']===0x1f4){logger['error'](_0xf024('0xa'),_0x24f71b,_0x3f18bd[_0xf024('0xe')][_0xf024('0xf')]);return _0x2a723a(_0x3f18bd['error']['message']);}logger[_0xf024('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x24f71b,_0x3f18bd['error'][_0xf024('0xf')]);return _0xc8860a(_0x3f18bd[_0xf024('0xe')]['message']);}else{logger[_0xf024('0x9')](_0xf024('0xa'),_0x24f71b,_0xf024('0xb'));_0xc8860a(_0x3f18bd[_0xf024('0x10')][_0xf024('0xf')]);}})[_0xf024('0x11')](function(_0x378111){logger[_0xf024('0xe')](_0xf024('0xa'),_0x24f71b,_0x378111);_0x2a723a(_0x378111);});});}