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 _0x8a27=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','code','AnalyticFieldReport,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x5f5b0c,_0x21e7e1){var _0x26f660=function(_0x25e75c){while(--_0x25e75c){_0x5f5b0c['push'](_0x5f5b0c['shift']());}};_0x26f660(++_0x21e7e1);}(_0x8a27,0xc6));var _0x78a2=function(_0x4293f2,_0x46f36c){_0x4293f2=_0x4293f2-0x0;var _0x3c1dcc=_0x8a27[_0x4293f2];return _0x3c1dcc;};'use strict';var _=require(_0x78a2('0x0'));var util=require(_0x78a2('0x1'));var moment=require(_0x78a2('0x2'));var BPromise=require(_0x78a2('0x3'));var rs=require(_0x78a2('0x4'));var fs=require('fs');var Redis=require(_0x78a2('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x78a2('0x6'))(_0x78a2('0x7'));var config=require(_0x78a2('0x8'));var jayson=require(_0x78a2('0x9'));var client=jayson[_0x78a2('0xa')][_0x78a2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3fedbf,_0x1e9901,_0x37e128){return new BPromise(function(_0x26b20f,_0x17992d){return client[_0x78a2('0xc')](_0x3fedbf,_0x37e128)[_0x78a2('0xd')](function(_0x474753){logger[_0x78a2('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e9901,_0x78a2('0xf'));logger[_0x78a2('0x10')](_0x78a2('0x11'),_0x1e9901,_0x78a2('0xf'),JSON[_0x78a2('0x12')](_0x474753));if(_0x474753[_0x78a2('0x13')]){if(_0x474753[_0x78a2('0x13')][_0x78a2('0x14')]===0x1f4){logger[_0x78a2('0x13')](_0x78a2('0x15'),_0x1e9901,_0x474753[_0x78a2('0x13')][_0x78a2('0x16')]);return _0x17992d(_0x474753[_0x78a2('0x13')]['message']);}logger[_0x78a2('0x13')](_0x78a2('0x15'),_0x1e9901,_0x474753['error']['message']);return _0x26b20f(_0x474753[_0x78a2('0x13')][_0x78a2('0x16')]);}else{logger[_0x78a2('0xe')]('AnalyticFieldReport,\x20%s,\x20%s',_0x1e9901,_0x78a2('0xf'));_0x26b20f(_0x474753[_0x78a2('0x17')][_0x78a2('0x16')]);}})[_0x78a2('0x18')](function(_0x1a0361){logger[_0x78a2('0x13')](_0x78a2('0x15'),_0x1e9901,_0x1a0361);_0x17992d(_0x1a0361);});});}