944b02c8b897f2ff98d82e4f0079aeff24c7e797
[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 _0x2844=['result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','MailTransferReport,\x20%s,\x20%s','info'];(function(_0x932e07,_0x5d64bf){var _0x48c741=function(_0x36672d){while(--_0x36672d){_0x932e07['push'](_0x932e07['shift']());}};_0x48c741(++_0x5d64bf);}(_0x2844,0x1f0));var _0x4284=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0x2844[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x4284('0x0'));var util=require(_0x4284('0x1'));var moment=require(_0x4284('0x2'));var BPromise=require(_0x4284('0x3'));var rs=require(_0x4284('0x4'));var fs=require('fs');var Redis=require(_0x4284('0x5'));var db=require(_0x4284('0x6'))['db'];var utils=require(_0x4284('0x7'));var logger=require(_0x4284('0x8'))(_0x4284('0x9'));var config=require(_0x4284('0xa'));var jayson=require(_0x4284('0xb'));var client=jayson[_0x4284('0xc')][_0x4284('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x3392a7,_0x48ffd4,_0x5f2aaf){return new BPromise(function(_0x30e2a8,_0x3acdfc){return client[_0x4284('0xe')](_0x3392a7,_0x5f2aaf)[_0x4284('0xf')](function(_0x42e0c5){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x48ffd4,'request\x20sent');logger[_0x4284('0x10')](_0x4284('0x11'),_0x48ffd4,_0x4284('0x12'),JSON[_0x4284('0x13')](_0x42e0c5));if(_0x42e0c5['error']){if(_0x42e0c5[_0x4284('0x14')]['code']===0x1f4){logger[_0x4284('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x48ffd4,_0x42e0c5[_0x4284('0x14')][_0x4284('0x15')]);return _0x3acdfc(_0x42e0c5['error'][_0x4284('0x15')]);}logger['error'](_0x4284('0x16'),_0x48ffd4,_0x42e0c5[_0x4284('0x14')][_0x4284('0x15')]);return _0x30e2a8(_0x42e0c5[_0x4284('0x14')]['message']);}else{logger[_0x4284('0x17')](_0x4284('0x16'),_0x48ffd4,'request\x20sent');_0x30e2a8(_0x42e0c5[_0x4284('0x18')][_0x4284('0x15')]);}})[_0x4284('0x19')](function(_0x6a0be9){logger[_0x4284('0x14')](_0x4284('0x16'),_0x48ffd4,_0x6a0be9);_0x3acdfc(_0x6a0be9);});});}