Built motion from commit (unavailable).|2.6.0
[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 _0xf26c=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','debug','request\x20sent','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','moment'];(function(_0xee6007,_0x3d766e){var _0x5b73ab=function(_0x382a0f){while(--_0x382a0f){_0xee6007['push'](_0xee6007['shift']());}};_0x5b73ab(++_0x3d766e);}(_0xf26c,0x9f));var _0xcf26=function(_0x16f5b7,_0x54e22c){_0x16f5b7=_0x16f5b7-0x0;var _0x2f8616=_0xf26c[_0x16f5b7];return _0x2f8616;};'use strict';var _=require(_0xcf26('0x0'));var util=require('util');var moment=require(_0xcf26('0x1'));var BPromise=require(_0xcf26('0x2'));var rs=require(_0xcf26('0x3'));var fs=require('fs');var Redis=require(_0xcf26('0x4'));var db=require(_0xcf26('0x5'))['db'];var utils=require(_0xcf26('0x6'));var logger=require('../../config/logger')(_0xcf26('0x7'));var config=require(_0xcf26('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xcf26('0x9')][_0xcf26('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x17632f,_0x3440ea,_0x260b95){return new BPromise(function(_0x4e090a,_0x66507b){return client[_0xcf26('0xb')](_0x17632f,_0x260b95)[_0xcf26('0xc')](function(_0x3c10c2){logger[_0xcf26('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3440ea,'request\x20sent');logger[_0xcf26('0xe')]('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x3440ea,_0xcf26('0xf'),JSON[_0xcf26('0x10')](_0x3c10c2));if(_0x3c10c2['error']){if(_0x3c10c2[_0xcf26('0x11')][_0xcf26('0x12')]===0x1f4){logger[_0xcf26('0x11')](_0xcf26('0x13'),_0x3440ea,_0x3c10c2['error'][_0xcf26('0x14')]);return _0x66507b(_0x3c10c2[_0xcf26('0x11')]['message']);}logger[_0xcf26('0x11')](_0xcf26('0x13'),_0x3440ea,_0x3c10c2['error'][_0xcf26('0x14')]);return _0x4e090a(_0x3c10c2[_0xcf26('0x11')][_0xcf26('0x14')]);}else{logger[_0xcf26('0xd')]('AnalyticFieldReport,\x20%s,\x20%s',_0x3440ea,_0xcf26('0xf'));_0x4e090a(_0x3c10c2[_0xcf26('0x15')][_0xcf26('0x14')]);}})[_0xcf26('0x16')](function(_0x49daf5){logger[_0xcf26('0x11')](_0xcf26('0x13'),_0x3440ea,_0x49daf5);_0x66507b(_0x49daf5);});});}