9848aeb6576b79c4de5c6182315ccdd6e0946f25
[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 _0x2834=['catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message'];(function(_0x97435b,_0x3972c7){var _0x30feb9=function(_0x43d373){while(--_0x43d373){_0x97435b['push'](_0x97435b['shift']());}};_0x30feb9(++_0x3972c7);}(_0x2834,0xdd));var _0x4283=function(_0x340218,_0x23bf82){_0x340218=_0x340218-0x0;var _0x251553=_0x2834[_0x340218];return _0x251553;};'use strict';var _=require(_0x4283('0x0'));var util=require(_0x4283('0x1'));var moment=require(_0x4283('0x2'));var BPromise=require(_0x4283('0x3'));var rs=require(_0x4283('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4283('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x4283('0x6'));var config=require(_0x4283('0x7'));var jayson=require(_0x4283('0x8'));var client=jayson[_0x4283('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xbcb9e6,_0x1d0752,_0x399a5d){return new BPromise(function(_0xb6acab,_0xcb65f0){return client[_0x4283('0xa')](_0xbcb9e6,_0x399a5d)[_0x4283('0xb')](function(_0x1a81ba){logger[_0x4283('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x1d0752,_0x4283('0xd'));logger[_0x4283('0xe')](_0x4283('0xf'),_0x1d0752,'request\x20sent',JSON[_0x4283('0x10')](_0x1a81ba));if(_0x1a81ba[_0x4283('0x11')]){if(_0x1a81ba[_0x4283('0x11')][_0x4283('0x12')]===0x1f4){logger[_0x4283('0x11')](_0x4283('0x13'),_0x1d0752,_0x1a81ba[_0x4283('0x11')][_0x4283('0x14')]);return _0xcb65f0(_0x1a81ba[_0x4283('0x11')][_0x4283('0x14')]);}logger[_0x4283('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x1d0752,_0x1a81ba[_0x4283('0x11')]['message']);return _0xb6acab(_0x1a81ba['error'][_0x4283('0x14')]);}else{logger[_0x4283('0xc')](_0x4283('0x13'),_0x1d0752,'request\x20sent');_0xb6acab(_0x1a81ba['result']['message']);}})[_0x4283('0x15')](function(_0x4d2df5){logger['error'](_0x4283('0x13'),_0x1d0752,_0x4d2df5);_0xcb65f0(_0x4d2df5);});});}