1ea835308c2b2273baa66e9c2fcdff5097b862fc
[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 _0x06c7=['request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s'];(function(_0x5cf793,_0x5081e9){var _0x3c74fd=function(_0xbc3966){while(--_0xbc3966){_0x5cf793['push'](_0x5cf793['shift']());}};_0x3c74fd(++_0x5081e9);}(_0x06c7,0x190));var _0x706c=function(_0x42fb5e,_0x29506b){_0x42fb5e=_0x42fb5e-0x0;var _0x3d5400=_0x06c7[_0x42fb5e];return _0x3d5400;};'use strict';var _=require('lodash');var util=require(_0x706c('0x0'));var moment=require(_0x706c('0x1'));var BPromise=require(_0x706c('0x2'));var rs=require(_0x706c('0x3'));var fs=require('fs');var Redis=require(_0x706c('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x706c('0x5'));var logger=require('../../config/logger')(_0x706c('0x6'));var config=require(_0x706c('0x7'));var jayson=require(_0x706c('0x8'));var client=jayson[_0x706c('0x9')][_0x706c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x31b41a,_0x1c65c8,_0x51bd4e){return new BPromise(function(_0x137088,_0x3ef0c5){return client[_0x706c('0xb')](_0x31b41a,_0x51bd4e)['then'](function(_0x3572c9){logger[_0x706c('0xc')](_0x706c('0xd'),_0x1c65c8,_0x706c('0xe'));logger[_0x706c('0xf')](_0x706c('0x10'),_0x1c65c8,_0x706c('0xe'),JSON[_0x706c('0x11')](_0x3572c9));if(_0x3572c9[_0x706c('0x12')]){if(_0x3572c9[_0x706c('0x12')][_0x706c('0x13')]===0x1f4){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x1c65c8,_0x3572c9[_0x706c('0x12')]['message']);return _0x3ef0c5(_0x3572c9['error'][_0x706c('0x14')]);}logger[_0x706c('0x12')](_0x706c('0xd'),_0x1c65c8,_0x3572c9['error'][_0x706c('0x14')]);return _0x137088(_0x3572c9[_0x706c('0x12')]['message']);}else{logger[_0x706c('0xc')](_0x706c('0xd'),_0x1c65c8,_0x706c('0xe'));_0x137088(_0x3572c9[_0x706c('0x15')][_0x706c('0x14')]);}})[_0x706c('0x16')](function(_0x1dc860){logger[_0x706c('0x12')](_0x706c('0xd'),_0x1c65c8,_0x1dc860);_0x3ef0c5(_0x1dc860);});});}