Built motion from commit a61a4a20.|2.5.46
[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 _0x2fab=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','util','moment','bluebird'];(function(_0x7288e8,_0x48cb2d){var _0x1c682e=function(_0x310787){while(--_0x310787){_0x7288e8['push'](_0x7288e8['shift']());}};_0x1c682e(++_0x48cb2d);}(_0x2fab,0x173));var _0xb2fa=function(_0x88903a,_0x2edc8){_0x88903a=_0x88903a-0x0;var _0x5deaf9=_0x2fab[_0x88903a];return _0x5deaf9;};'use strict';var _=require('lodash');var util=require(_0xb2fa('0x0'));var moment=require(_0xb2fa('0x1'));var BPromise=require(_0xb2fa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb2fa('0x3'));var db=require(_0xb2fa('0x4'))['db'];var utils=require(_0xb2fa('0x5'));var logger=require(_0xb2fa('0x6'))(_0xb2fa('0x7'));var config=require(_0xb2fa('0x8'));var jayson=require(_0xb2fa('0x9'));var client=jayson['client'][_0xb2fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x141872,_0x9b1098,_0x58d4b3){return new BPromise(function(_0x2c8333,_0x243ee9){return client['request'](_0x141872,_0x58d4b3)[_0xb2fa('0xb')](function(_0x573a80){logger['info'](_0xb2fa('0xc'),_0x9b1098,_0xb2fa('0xd'));logger[_0xb2fa('0xe')](_0xb2fa('0xf'),_0x9b1098,'request\x20sent',JSON[_0xb2fa('0x10')](_0x573a80));if(_0x573a80[_0xb2fa('0x11')]){if(_0x573a80[_0xb2fa('0x11')]['code']===0x1f4){logger[_0xb2fa('0x11')](_0xb2fa('0xc'),_0x9b1098,_0x573a80['error'][_0xb2fa('0x12')]);return _0x243ee9(_0x573a80[_0xb2fa('0x11')][_0xb2fa('0x12')]);}logger[_0xb2fa('0x11')](_0xb2fa('0xc'),_0x9b1098,_0x573a80[_0xb2fa('0x11')][_0xb2fa('0x12')]);return _0x2c8333(_0x573a80[_0xb2fa('0x11')][_0xb2fa('0x12')]);}else{logger[_0xb2fa('0x13')](_0xb2fa('0xc'),_0x9b1098,'request\x20sent');_0x2c8333(_0x573a80[_0xb2fa('0x14')][_0xb2fa('0x12')]);}})[_0xb2fa('0x15')](function(_0x18338c){logger['error'](_0xb2fa('0xc'),_0x9b1098,_0x18338c);_0x243ee9(_0x18338c);});});}