Built motion from commit 97153652.|2.6.26
[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 _0x791a=['then','request\x20sent','debug','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','info','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','request'];(function(_0x1b5f76,_0x3943e2){var _0x167979=function(_0xa7c0d3){while(--_0xa7c0d3){_0x1b5f76['push'](_0x1b5f76['shift']());}};_0x167979(++_0x3943e2);}(_0x791a,0xc8));var _0xa791=function(_0x4ddc7a,_0x2ba072){_0x4ddc7a=_0x4ddc7a-0x0;var _0x4ba854=_0x791a[_0x4ddc7a];return _0x4ba854;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa791('0x0'));var BPromise=require(_0xa791('0x1'));var rs=require(_0xa791('0x2'));var fs=require('fs');var Redis=require(_0xa791('0x3'));var db=require(_0xa791('0x4'))['db'];var utils=require(_0xa791('0x5'));var logger=require(_0xa791('0x6'))(_0xa791('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa791('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x501933,_0x2b0882,_0x5182ec){return new BPromise(function(_0x5ab75d,_0x14a216){return client[_0xa791('0x9')](_0x501933,_0x5182ec)[_0xa791('0xa')](function(_0x332aae){logger['info']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b0882,_0xa791('0xb'));logger[_0xa791('0xc')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x2b0882,_0xa791('0xb'),JSON[_0xa791('0xd')](_0x332aae));if(_0x332aae[_0xa791('0xe')]){if(_0x332aae[_0xa791('0xe')][_0xa791('0xf')]===0x1f4){logger[_0xa791('0xe')](_0xa791('0x10'),_0x2b0882,_0x332aae['error'][_0xa791('0x11')]);return _0x14a216(_0x332aae[_0xa791('0xe')]['message']);}logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b0882,_0x332aae[_0xa791('0xe')][_0xa791('0x11')]);return _0x5ab75d(_0x332aae['error'][_0xa791('0x11')]);}else{logger[_0xa791('0x12')](_0xa791('0x10'),_0x2b0882,'request\x20sent');_0x5ab75d(_0x332aae[_0xa791('0x13')][_0xa791('0x11')]);}})[_0xa791('0x14')](function(_0x5ba565){logger['error']('AnalyticFieldReport,\x20%s,\x20%s',_0x2b0882,_0x5ba565);_0x14a216(_0x5ba565);});});}