b1d92f1f32c1adb43947d3de8800f505a626c467
[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 _0x1f55=['info','AnalyticFieldReport,\x20%s,\x20%s','debug','error','message','request\x20sent','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then'];(function(_0x48910d,_0xe8d0e1){var _0x1b4c22=function(_0x4d41a6){while(--_0x4d41a6){_0x48910d['push'](_0x48910d['shift']());}};_0x1b4c22(++_0xe8d0e1);}(_0x1f55,0xb0));var _0x51f5=function(_0x285f24,_0x3bb660){_0x285f24=_0x285f24-0x0;var _0x5b614d=_0x1f55[_0x285f24];return _0x5b614d;};'use strict';var _=require(_0x51f5('0x0'));var util=require('util');var moment=require(_0x51f5('0x1'));var BPromise=require(_0x51f5('0x2'));var rs=require(_0x51f5('0x3'));var fs=require('fs');var Redis=require(_0x51f5('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x51f5('0x5'));var logger=require(_0x51f5('0x6'))(_0x51f5('0x7'));var config=require(_0x51f5('0x8'));var jayson=require(_0x51f5('0x9'));var client=jayson[_0x51f5('0xa')][_0x51f5('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x23c441,_0xfed11b,_0x30cbc1){return new BPromise(function(_0x267960,_0x314b0c){return client['request'](_0x23c441,_0x30cbc1)[_0x51f5('0xc')](function(_0x487abd){logger[_0x51f5('0xd')](_0x51f5('0xe'),_0xfed11b,'request\x20sent');logger[_0x51f5('0xf')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0xfed11b,'request\x20sent',JSON['stringify'](_0x487abd));if(_0x487abd[_0x51f5('0x10')]){if(_0x487abd[_0x51f5('0x10')]['code']===0x1f4){logger['error'](_0x51f5('0xe'),_0xfed11b,_0x487abd[_0x51f5('0x10')][_0x51f5('0x11')]);return _0x314b0c(_0x487abd[_0x51f5('0x10')][_0x51f5('0x11')]);}logger[_0x51f5('0x10')](_0x51f5('0xe'),_0xfed11b,_0x487abd[_0x51f5('0x10')]['message']);return _0x267960(_0x487abd[_0x51f5('0x10')]['message']);}else{logger[_0x51f5('0xd')](_0x51f5('0xe'),_0xfed11b,_0x51f5('0x12'));_0x267960(_0x487abd[_0x51f5('0x13')][_0x51f5('0x11')]);}})[_0x51f5('0x14')](function(_0x48777a){logger[_0x51f5('0x10')]('AnalyticFieldReport,\x20%s,\x20%s',_0xfed11b,_0x48777a);_0x314b0c(_0x48777a);});});}