71f04fedc20a8450284e42e2174ccb409405dbbf
[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 _0x86c4=['message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','error','code','MailTransferReport,\x20%s,\x20%s'];(function(_0xf3b525,_0x419b48){var _0x1f98b3=function(_0x1050c9){while(--_0x1050c9){_0xf3b525['push'](_0xf3b525['shift']());}};_0x1f98b3(++_0x419b48);}(_0x86c4,0x172));var _0x486c=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x86c4[_0xa464c9];return _0x3d73c4;};'use strict';var _=require(_0x486c('0x0'));var util=require(_0x486c('0x1'));var moment=require(_0x486c('0x2'));var BPromise=require(_0x486c('0x3'));var rs=require(_0x486c('0x4'));var fs=require('fs');var Redis=require(_0x486c('0x5'));var db=require(_0x486c('0x6'))['db'];var utils=require(_0x486c('0x7'));var logger=require(_0x486c('0x8'))(_0x486c('0x9'));var config=require(_0x486c('0xa'));var jayson=require(_0x486c('0xb'));var client=jayson[_0x486c('0xc')][_0x486c('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1ec807,_0x2ea511,_0x48128a){return new BPromise(function(_0x2873ea,_0x3b858){return client[_0x486c('0xe')](_0x1ec807,_0x48128a)[_0x486c('0xf')](function(_0x172778){logger[_0x486c('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x2ea511,_0x486c('0x11'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2ea511,_0x486c('0x11'),JSON['stringify'](_0x172778));if(_0x172778[_0x486c('0x12')]){if(_0x172778[_0x486c('0x12')][_0x486c('0x13')]===0x1f4){logger[_0x486c('0x12')](_0x486c('0x14'),_0x2ea511,_0x172778[_0x486c('0x12')][_0x486c('0x15')]);return _0x3b858(_0x172778['error'][_0x486c('0x15')]);}logger[_0x486c('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x2ea511,_0x172778[_0x486c('0x12')][_0x486c('0x15')]);return _0x2873ea(_0x172778[_0x486c('0x12')]['message']);}else{logger['info'](_0x486c('0x14'),_0x2ea511,_0x486c('0x11'));_0x2873ea(_0x172778[_0x486c('0x16')][_0x486c('0x15')]);}})['catch'](function(_0x5ea75e){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x2ea511,_0x5ea75e);_0x3b858(_0x5ea75e);});});}