118e55b480f1205476d30341f4dc7dbdc3b79bdc
[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 _0xac58=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','code','message','error','lodash','util','moment','bluebird','randomstring'];(function(_0x5e1ebd,_0x66cd55){var _0x340581=function(_0x1945fb){while(--_0x1945fb){_0x5e1ebd['push'](_0x5e1ebd['shift']());}};_0x340581(++_0x66cd55);}(_0xac58,0xcd));var _0x8ac5=function(_0x35a6ef,_0x428e58){_0x35a6ef=_0x35a6ef-0x0;var _0x28b4e6=_0xac58[_0x35a6ef];return _0x28b4e6;};'use strict';var _=require(_0x8ac5('0x0'));var util=require(_0x8ac5('0x1'));var moment=require(_0x8ac5('0x2'));var BPromise=require(_0x8ac5('0x3'));var rs=require(_0x8ac5('0x4'));var fs=require('fs');var Redis=require(_0x8ac5('0x5'));var db=require(_0x8ac5('0x6'))['db'];var utils=require(_0x8ac5('0x7'));var logger=require(_0x8ac5('0x8'))(_0x8ac5('0x9'));var config=require(_0x8ac5('0xa'));var jayson=require(_0x8ac5('0xb'));var client=jayson[_0x8ac5('0xc')][_0x8ac5('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x570843,_0x2f7e41,_0x165b44){return new BPromise(function(_0xce03cb,_0x5a54b8){return client[_0x8ac5('0xe')](_0x570843,_0x165b44)['then'](function(_0x4832a8){logger['info'](_0x8ac5('0xf'),_0x2f7e41,_0x8ac5('0x10'));logger[_0x8ac5('0x11')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2f7e41,'request\x20sent',JSON['stringify'](_0x4832a8));if(_0x4832a8['error']){if(_0x4832a8['error'][_0x8ac5('0x12')]===0x1f4){logger['error'](_0x8ac5('0xf'),_0x2f7e41,_0x4832a8['error'][_0x8ac5('0x13')]);return _0x5a54b8(_0x4832a8[_0x8ac5('0x14')][_0x8ac5('0x13')]);}logger['error'](_0x8ac5('0xf'),_0x2f7e41,_0x4832a8['error'][_0x8ac5('0x13')]);return _0xce03cb(_0x4832a8[_0x8ac5('0x14')][_0x8ac5('0x13')]);}else{logger['info'](_0x8ac5('0xf'),_0x2f7e41,_0x8ac5('0x10'));_0xce03cb(_0x4832a8['result'][_0x8ac5('0x13')]);}})['catch'](function(_0x385919){logger[_0x8ac5('0x14')](_0x8ac5('0xf'),_0x2f7e41,_0x385919);_0x5a54b8(_0x385919);});});}