Built motion from commit (unavailable).|2.5.0
[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 _0x8d57=['error','message','info','result','lodash','util','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x2bf5f4,_0x369192){var _0x38cbcf=function(_0x3234e9){while(--_0x3234e9){_0x2bf5f4['push'](_0x2bf5f4['shift']());}};_0x38cbcf(++_0x369192);}(_0x8d57,0xaf));var _0x78d5=function(_0x57486e,_0x32283b){_0x57486e=_0x57486e-0x0;var _0x5f110b=_0x8d57[_0x57486e];return _0x5f110b;};'use strict';var _=require(_0x78d5('0x0'));var util=require(_0x78d5('0x1'));var moment=require('moment');var BPromise=require(_0x78d5('0x2'));var rs=require(_0x78d5('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x78d5('0x4'));var logger=require('../../config/logger')(_0x78d5('0x5'));var config=require(_0x78d5('0x6'));var jayson=require(_0x78d5('0x7'));var client=jayson[_0x78d5('0x8')][_0x78d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3d4e9,_0xf2e912,_0x339aa9){return new BPromise(function(_0x5beaa7,_0x208b1f){return client[_0x78d5('0xa')](_0x3d4e9,_0x339aa9)['then'](function(_0x1d9786){logger['info'](_0x78d5('0xb'),_0xf2e912,_0x78d5('0xc'));logger[_0x78d5('0xd')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xf2e912,'request\x20sent',JSON[_0x78d5('0xe')](_0x1d9786));if(_0x1d9786[_0x78d5('0xf')]){if(_0x1d9786['error']['code']===0x1f4){logger[_0x78d5('0xf')](_0x78d5('0xb'),_0xf2e912,_0x1d9786[_0x78d5('0xf')][_0x78d5('0x10')]);return _0x208b1f(_0x1d9786['error'][_0x78d5('0x10')]);}logger['error'](_0x78d5('0xb'),_0xf2e912,_0x1d9786[_0x78d5('0xf')][_0x78d5('0x10')]);return _0x5beaa7(_0x1d9786[_0x78d5('0xf')][_0x78d5('0x10')]);}else{logger[_0x78d5('0x11')](_0x78d5('0xb'),_0xf2e912,'request\x20sent');_0x5beaa7(_0x1d9786[_0x78d5('0x12')][_0x78d5('0x10')]);}})['catch'](function(_0x240e5e){logger[_0x78d5('0xf')](_0x78d5('0xb'),_0xf2e912,_0x240e5e);_0x208b1f(_0x240e5e);});});}