Built motion from commit da24aabd.|2.6.20
[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 _0xc56f=['../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0xc56f,0xd8));var _0xfc56=function(_0x2763f2,_0x416af8){_0x2763f2=_0x2763f2-0x0;var _0x3ef471=_0xc56f[_0x2763f2];return _0x3ef471;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xfc56('0x0'));var BPromise=require(_0xfc56('0x1'));var rs=require(_0xfc56('0x2'));var fs=require('fs');var Redis=require(_0xfc56('0x3'));var db=require(_0xfc56('0x4'))['db'];var utils=require(_0xfc56('0x5'));var logger=require(_0xfc56('0x6'))('rpc');var config=require(_0xfc56('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xfc56('0x8')][_0xfc56('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x9a3fcb,_0x82f54a,_0x4a699c){return new BPromise(function(_0x21ce4b,_0x54b9e3){return client[_0xfc56('0xa')](_0x9a3fcb,_0x4a699c)[_0xfc56('0xb')](function(_0x26c753){logger['info'](_0xfc56('0xc'),_0x82f54a,_0xfc56('0xd'));logger[_0xfc56('0xe')](_0xfc56('0xf'),_0x82f54a,_0xfc56('0xd'),JSON[_0xfc56('0x10')](_0x26c753));if(_0x26c753['error']){if(_0x26c753[_0xfc56('0x11')][_0xfc56('0x12')]===0x1f4){logger[_0xfc56('0x11')](_0xfc56('0xc'),_0x82f54a,_0x26c753['error'][_0xfc56('0x13')]);return _0x54b9e3(_0x26c753[_0xfc56('0x11')][_0xfc56('0x13')]);}logger[_0xfc56('0x11')](_0xfc56('0xc'),_0x82f54a,_0x26c753[_0xfc56('0x11')]['message']);return _0x21ce4b(_0x26c753[_0xfc56('0x11')][_0xfc56('0x13')]);}else{logger['info'](_0xfc56('0xc'),_0x82f54a,_0xfc56('0xd'));_0x21ce4b(_0x26c753[_0xfc56('0x14')]['message']);}})[_0xfc56('0x15')](function(_0x5e5496){logger[_0xfc56('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x82f54a,_0x5e5496);_0x54b9e3(_0x5e5496);});});}