Built motion from commit (unavailable).|2.5.19
[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 _0x338c=['info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','util','bluebird','randomstring','../../config/utils','../../config/logger','jayson/promise','client','http','request','then'];(function(_0x46bec2,_0x36cde0){var _0x39b857=function(_0xf29a34){while(--_0xf29a34){_0x46bec2['push'](_0x46bec2['shift']());}};_0x39b857(++_0x36cde0);}(_0x338c,0xbe));var _0xc338=function(_0x2f78aa,_0x24eda1){_0x2f78aa=_0x2f78aa-0x0;var _0x39f79b=_0x338c[_0x2f78aa];return _0x39f79b;};'use strict';var _=require('lodash');var util=require(_0xc338('0x0'));var moment=require('moment');var BPromise=require(_0xc338('0x1'));var rs=require(_0xc338('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc338('0x3'));var logger=require(_0xc338('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc338('0x5'));var client=jayson[_0xc338('0x6')][_0xc338('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x387ce7,_0x4f1755,_0x4f52e0){return new BPromise(function(_0x2839a0,_0x3776c8){return client[_0xc338('0x8')](_0x387ce7,_0x4f52e0)[_0xc338('0x9')](function(_0xfb6669){logger[_0xc338('0xa')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4f1755,_0xc338('0xb'));logger[_0xc338('0xc')](_0xc338('0xd'),_0x4f1755,'request\x20sent',JSON['stringify'](_0xfb6669));if(_0xfb6669[_0xc338('0xe')]){if(_0xfb6669['error'][_0xc338('0xf')]===0x1f4){logger[_0xc338('0xe')](_0xc338('0x10'),_0x4f1755,_0xfb6669[_0xc338('0xe')][_0xc338('0x11')]);return _0x3776c8(_0xfb6669[_0xc338('0xe')][_0xc338('0x11')]);}logger[_0xc338('0xe')](_0xc338('0x10'),_0x4f1755,_0xfb6669[_0xc338('0xe')][_0xc338('0x11')]);return _0x2839a0(_0xfb6669['error']['message']);}else{logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x4f1755,_0xc338('0xb'));_0x2839a0(_0xfb6669[_0xc338('0x12')][_0xc338('0x11')]);}})[_0xc338('0x13')](function(_0x24782f){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x4f1755,_0x24782f);_0x3776c8(_0x24782f);});});}