Built motion from commit (unavailable).|2.5.4
[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 _0x014e=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x500f38,_0x420d7d){var _0x29a07b=function(_0x5e3c11){while(--_0x5e3c11){_0x500f38['push'](_0x500f38['shift']());}};_0x29a07b(++_0x420d7d);}(_0x014e,0x1f2));var _0xe014=function(_0x28898,_0x438a8c){_0x28898=_0x28898-0x0;var _0x39e12b=_0x014e[_0x28898];return _0x39e12b;};'use strict';var _=require(_0xe014('0x0'));var util=require(_0xe014('0x1'));var moment=require(_0xe014('0x2'));var BPromise=require(_0xe014('0x3'));var rs=require(_0xe014('0x4'));var fs=require('fs');var Redis=require(_0xe014('0x5'));var db=require(_0xe014('0x6'))['db'];var utils=require(_0xe014('0x7'));var logger=require(_0xe014('0x8'))(_0xe014('0x9'));var config=require(_0xe014('0xa'));var jayson=require(_0xe014('0xb'));var client=jayson[_0xe014('0xc')][_0xe014('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x177515,_0x10a416,_0x58ea3d){return new BPromise(function(_0x223daa,_0x34798a){return client[_0xe014('0xe')](_0x177515,_0x58ea3d)['then'](function(_0x7d72f3){logger[_0xe014('0xf')](_0xe014('0x10'),_0x10a416,_0xe014('0x11'));logger[_0xe014('0x12')](_0xe014('0x13'),_0x10a416,_0xe014('0x11'),JSON[_0xe014('0x14')](_0x7d72f3));if(_0x7d72f3[_0xe014('0x15')]){if(_0x7d72f3['error'][_0xe014('0x16')]===0x1f4){logger[_0xe014('0x15')](_0xe014('0x10'),_0x10a416,_0x7d72f3[_0xe014('0x15')][_0xe014('0x17')]);return _0x34798a(_0x7d72f3['error'][_0xe014('0x17')]);}logger['error'](_0xe014('0x10'),_0x10a416,_0x7d72f3[_0xe014('0x15')][_0xe014('0x17')]);return _0x223daa(_0x7d72f3['error'][_0xe014('0x17')]);}else{logger[_0xe014('0xf')](_0xe014('0x10'),_0x10a416,_0xe014('0x11'));_0x223daa(_0x7d72f3[_0xe014('0x18')][_0xe014('0x17')]);}})['catch'](function(_0x4768c7){logger[_0xe014('0x15')](_0xe014('0x10'),_0x10a416,_0x4768c7);_0x34798a(_0x4768c7);});});}