Built motion from commit b0a9a629.|2.6.33
[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 _0x95a7=['jayson/promise','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x95a7,0x1f2));var _0x795a=function(_0x5ec427,_0x1c69d8){_0x5ec427=_0x5ec427-0x0;var _0x2ff482=_0x95a7[_0x5ec427];return _0x2ff482;};'use strict';var _=require(_0x795a('0x0'));var util=require(_0x795a('0x1'));var moment=require(_0x795a('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x795a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x795a('0x4'));var logger=require(_0x795a('0x5'))(_0x795a('0x6'));var config=require(_0x795a('0x7'));var jayson=require(_0x795a('0x8'));var client=jayson['client'][_0x795a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5b3e9a,_0x2585b5,_0x22c8a4){return new BPromise(function(_0x3d1145,_0x30e8b4){return client[_0x795a('0xa')](_0x5b3e9a,_0x22c8a4)['then'](function(_0x5d5043){logger[_0x795a('0xb')](_0x795a('0xc'),_0x2585b5,'request\x20sent');logger[_0x795a('0xd')](_0x795a('0xe'),_0x2585b5,_0x795a('0xf'),JSON[_0x795a('0x10')](_0x5d5043));if(_0x5d5043[_0x795a('0x11')]){if(_0x5d5043[_0x795a('0x11')][_0x795a('0x12')]===0x1f4){logger[_0x795a('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x2585b5,_0x5d5043['error']['message']);return _0x30e8b4(_0x5d5043[_0x795a('0x11')][_0x795a('0x13')]);}logger[_0x795a('0x11')](_0x795a('0xc'),_0x2585b5,_0x5d5043['error'][_0x795a('0x13')]);return _0x3d1145(_0x5d5043[_0x795a('0x11')][_0x795a('0x13')]);}else{logger[_0x795a('0xb')](_0x795a('0xc'),_0x2585b5,'request\x20sent');_0x3d1145(_0x5d5043[_0x795a('0x14')][_0x795a('0x13')]);}})[_0x795a('0x15')](function(_0xee0cc9){logger[_0x795a('0x11')](_0x795a('0xc'),_0x2585b5,_0xee0cc9);_0x30e8b4(_0xee0cc9);});});}