Built motion from commit f7863d46.|2.5.41
[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 _0x9f6b=['catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','rpc','jayson/promise','client','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result'];(function(_0x30faec,_0x18940b){var _0x29484f=function(_0x169ae8){while(--_0x169ae8){_0x30faec['push'](_0x30faec['shift']());}};_0x29484f(++_0x18940b);}(_0x9f6b,0x112));var _0xb9f6=function(_0x333253,_0x31f200){_0x333253=_0x333253-0x0;var _0x56587e=_0x9f6b[_0x333253];return _0x56587e;};'use strict';var _=require(_0xb9f6('0x0'));var util=require(_0xb9f6('0x1'));var moment=require(_0xb9f6('0x2'));var BPromise=require(_0xb9f6('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb9f6('0x4'));var db=require(_0xb9f6('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb9f6('0x6'));var config=require('../../config/environment');var jayson=require(_0xb9f6('0x7'));var client=jayson[_0xb9f6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x434b19,_0x3da18e,_0x407295){return new BPromise(function(_0x10baef,_0x3ae542){return client[_0xb9f6('0x9')](_0x434b19,_0x407295)[_0xb9f6('0xa')](function(_0x1f74b9){logger['info'](_0xb9f6('0xb'),_0x3da18e,_0xb9f6('0xc'));logger[_0xb9f6('0xd')](_0xb9f6('0xe'),_0x3da18e,_0xb9f6('0xc'),JSON[_0xb9f6('0xf')](_0x1f74b9));if(_0x1f74b9['error']){if(_0x1f74b9['error'][_0xb9f6('0x10')]===0x1f4){logger['error'](_0xb9f6('0xb'),_0x3da18e,_0x1f74b9[_0xb9f6('0x11')][_0xb9f6('0x12')]);return _0x3ae542(_0x1f74b9['error'][_0xb9f6('0x12')]);}logger[_0xb9f6('0x11')](_0xb9f6('0xb'),_0x3da18e,_0x1f74b9[_0xb9f6('0x11')][_0xb9f6('0x12')]);return _0x10baef(_0x1f74b9[_0xb9f6('0x11')][_0xb9f6('0x12')]);}else{logger['info'](_0xb9f6('0xb'),_0x3da18e,'request\x20sent');_0x10baef(_0x1f74b9[_0xb9f6('0x13')]['message']);}})[_0xb9f6('0x14')](function(_0x1aae88){logger[_0xb9f6('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3da18e,_0x1aae88);_0x3ae542(_0x1aae88);});});}