Built motion from commit (unavailable).|2.5.2
[motion2.git] / server / api / mailTransferReport / mailTransferReport.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 _0xcab5=['client','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x4099ee,_0x38495a){var _0x1b7bfc=function(_0x5f5388){while(--_0x5f5388){_0x4099ee['push'](_0x4099ee['shift']());}};_0x1b7bfc(++_0x38495a);}(_0xcab5,0x185));var _0x5cab=function(_0x585ca7,_0x5a88dd){_0x585ca7=_0x585ca7-0x0;var _0x439a9e=_0xcab5[_0x585ca7];return _0x439a9e;};'use strict';var _=require(_0x5cab('0x0'));var util=require(_0x5cab('0x1'));var moment=require(_0x5cab('0x2'));var BPromise=require(_0x5cab('0x3'));var rs=require(_0x5cab('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5cab('0x5'))['db'];var utils=require(_0x5cab('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x5cab('0x7')][_0x5cab('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1a0511,_0x3ed66c,_0x13154d){return new BPromise(function(_0x3cb344,_0x3a02d1){return client[_0x5cab('0x9')](_0x1a0511,_0x13154d)[_0x5cab('0xa')](function(_0x34d3ac){logger['info'](_0x5cab('0xb'),_0x3ed66c,_0x5cab('0xc'));logger[_0x5cab('0xd')](_0x5cab('0xe'),_0x3ed66c,'request\x20sent',JSON[_0x5cab('0xf')](_0x34d3ac));if(_0x34d3ac[_0x5cab('0x10')]){if(_0x34d3ac[_0x5cab('0x10')][_0x5cab('0x11')]===0x1f4){logger[_0x5cab('0x10')](_0x5cab('0xb'),_0x3ed66c,_0x34d3ac['error'][_0x5cab('0x12')]);return _0x3a02d1(_0x34d3ac['error'][_0x5cab('0x12')]);}logger[_0x5cab('0x10')](_0x5cab('0xb'),_0x3ed66c,_0x34d3ac[_0x5cab('0x10')]['message']);return _0x3cb344(_0x34d3ac[_0x5cab('0x10')]['message']);}else{logger[_0x5cab('0x13')](_0x5cab('0xb'),_0x3ed66c,'request\x20sent');_0x3cb344(_0x34d3ac[_0x5cab('0x14')][_0x5cab('0x12')]);}})[_0x5cab('0x15')](function(_0x262fda){logger[_0x5cab('0x10')](_0x5cab('0xb'),_0x3ed66c,_0x262fda);_0x3a02d1(_0x262fda);});});}