Built motion from commit (unavailable).|2.5.30
[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 _0x2d9e=['../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x7577b9,_0x4fe21c){var _0x2660c8=function(_0x3f94ae){while(--_0x3f94ae){_0x7577b9['push'](_0x7577b9['shift']());}};_0x2660c8(++_0x4fe21c);}(_0x2d9e,0x6b));var _0xe2d9=function(_0x243cee,_0x1a041c){_0x243cee=_0x243cee-0x0;var _0x3848b5=_0x2d9e[_0x243cee];return _0x3848b5;};'use strict';var _=require('lodash');var util=require(_0xe2d9('0x0'));var moment=require(_0xe2d9('0x1'));var BPromise=require(_0xe2d9('0x2'));var rs=require(_0xe2d9('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2d9('0x4'))['db'];var utils=require(_0xe2d9('0x5'));var logger=require(_0xe2d9('0x6'))(_0xe2d9('0x7'));var config=require(_0xe2d9('0x8'));var jayson=require(_0xe2d9('0x9'));var client=jayson[_0xe2d9('0xa')][_0xe2d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2b87cc,_0x5a507c,_0x521509){return new BPromise(function(_0x4956eb,_0xd2f083){return client[_0xe2d9('0xc')](_0x2b87cc,_0x521509)[_0xe2d9('0xd')](function(_0x5eac20){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x5a507c,_0xe2d9('0xe'));logger[_0xe2d9('0xf')](_0xe2d9('0x10'),_0x5a507c,_0xe2d9('0xe'),JSON[_0xe2d9('0x11')](_0x5eac20));if(_0x5eac20[_0xe2d9('0x12')]){if(_0x5eac20[_0xe2d9('0x12')]['code']===0x1f4){logger['error'](_0xe2d9('0x13'),_0x5a507c,_0x5eac20[_0xe2d9('0x12')][_0xe2d9('0x14')]);return _0xd2f083(_0x5eac20[_0xe2d9('0x12')][_0xe2d9('0x14')]);}logger[_0xe2d9('0x12')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5a507c,_0x5eac20[_0xe2d9('0x12')][_0xe2d9('0x14')]);return _0x4956eb(_0x5eac20['error'][_0xe2d9('0x14')]);}else{logger[_0xe2d9('0x15')]('AnalyticFieldReport,\x20%s,\x20%s',_0x5a507c,_0xe2d9('0xe'));_0x4956eb(_0x5eac20[_0xe2d9('0x16')]['message']);}})['catch'](function(_0x542d68){logger['error'](_0xe2d9('0x13'),_0x5a507c,_0x542d68);_0xd2f083(_0x542d68);});});}