Built motion from commit 9d7072cc.|2.5.39
[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 _0x63b1=['stringify','code','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s'];(function(_0x2eda31,_0x485d48){var _0x1c2145=function(_0x5e46b4){while(--_0x5e46b4){_0x2eda31['push'](_0x2eda31['shift']());}};_0x1c2145(++_0x485d48);}(_0x63b1,0x103));var _0x163b=function(_0x2682d8,_0xaf9522){_0x2682d8=_0x2682d8-0x0;var _0x4720eb=_0x63b1[_0x2682d8];return _0x4720eb;};'use strict';var _=require(_0x163b('0x0'));var util=require(_0x163b('0x1'));var moment=require('moment');var BPromise=require(_0x163b('0x2'));var rs=require(_0x163b('0x3'));var fs=require('fs');var Redis=require(_0x163b('0x4'));var db=require(_0x163b('0x5'))['db'];var utils=require(_0x163b('0x6'));var logger=require('../../config/logger')(_0x163b('0x7'));var config=require(_0x163b('0x8'));var jayson=require(_0x163b('0x9'));var client=jayson[_0x163b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5807a9,_0x2d9e98,_0x511d47){return new BPromise(function(_0x464754,_0x519210){return client[_0x163b('0xb')](_0x5807a9,_0x511d47)[_0x163b('0xc')](function(_0x228669){logger[_0x163b('0xd')](_0x163b('0xe'),_0x2d9e98,_0x163b('0xf'));logger['debug'](_0x163b('0x10'),_0x2d9e98,_0x163b('0xf'),JSON[_0x163b('0x11')](_0x228669));if(_0x228669['error']){if(_0x228669['error'][_0x163b('0x12')]===0x1f4){logger[_0x163b('0x13')](_0x163b('0xe'),_0x2d9e98,_0x228669[_0x163b('0x13')][_0x163b('0x14')]);return _0x519210(_0x228669[_0x163b('0x13')]['message']);}logger['error'](_0x163b('0xe'),_0x2d9e98,_0x228669[_0x163b('0x13')][_0x163b('0x14')]);return _0x464754(_0x228669[_0x163b('0x13')]['message']);}else{logger[_0x163b('0xd')](_0x163b('0xe'),_0x2d9e98,'request\x20sent');_0x464754(_0x228669[_0x163b('0x15')][_0x163b('0x14')]);}})[_0x163b('0x16')](function(_0x217540){logger[_0x163b('0x13')](_0x163b('0xe'),_0x2d9e98,_0x217540);_0x519210(_0x217540);});});}