e3f47f56b6f446679ca53f5851a2c8a7e6b5079e
[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 _0xba8b=['bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment'];(function(_0x4ce632,_0x53f8aa){var _0x211ab0=function(_0x19f360){while(--_0x19f360){_0x4ce632['push'](_0x4ce632['shift']());}};_0x211ab0(++_0x53f8aa);}(_0xba8b,0x173));var _0xbba8=function(_0x4ae6ef,_0xc2af80){_0x4ae6ef=_0x4ae6ef-0x0;var _0x3cbb4e=_0xba8b[_0x4ae6ef];return _0x3cbb4e;};'use strict';var _=require(_0xbba8('0x0'));var util=require(_0xbba8('0x1'));var moment=require(_0xbba8('0x2'));var BPromise=require(_0xbba8('0x3'));var rs=require(_0xbba8('0x4'));var fs=require('fs');var Redis=require(_0xbba8('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xbba8('0x6'));var logger=require('../../config/logger')(_0xbba8('0x7'));var config=require(_0xbba8('0x8'));var jayson=require(_0xbba8('0x9'));var client=jayson[_0xbba8('0xa')][_0xbba8('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1a96b8,_0x5f1b1e,_0x4a8998){return new BPromise(function(_0x265dab,_0x4341c8){return client['request'](_0x1a96b8,_0x4a8998)[_0xbba8('0xc')](function(_0xdaf01a){logger[_0xbba8('0xd')](_0xbba8('0xe'),_0x5f1b1e,_0xbba8('0xf'));logger['debug'](_0xbba8('0x10'),_0x5f1b1e,_0xbba8('0xf'),JSON[_0xbba8('0x11')](_0xdaf01a));if(_0xdaf01a['error']){if(_0xdaf01a[_0xbba8('0x12')][_0xbba8('0x13')]===0x1f4){logger[_0xbba8('0x12')](_0xbba8('0xe'),_0x5f1b1e,_0xdaf01a[_0xbba8('0x12')]['message']);return _0x4341c8(_0xdaf01a[_0xbba8('0x12')]['message']);}logger['error'](_0xbba8('0xe'),_0x5f1b1e,_0xdaf01a[_0xbba8('0x12')][_0xbba8('0x14')]);return _0x265dab(_0xdaf01a[_0xbba8('0x12')]['message']);}else{logger[_0xbba8('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x5f1b1e,'request\x20sent');_0x265dab(_0xdaf01a['result']['message']);}})[_0xbba8('0x15')](function(_0x2ae25b){logger['error'](_0xbba8('0xe'),_0x5f1b1e,_0x2ae25b);_0x4341c8(_0x2ae25b);});});}