Built motion from commit 85328c08.|2.5.50
[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 _0x4260=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http'];(function(_0x4aba15,_0x4e90aa){var _0x1c8122=function(_0x568dba){while(--_0x568dba){_0x4aba15['push'](_0x4aba15['shift']());}};_0x1c8122(++_0x4e90aa);}(_0x4260,0xa2));var _0x0426=function(_0x2d8fc2,_0x1c461d){_0x2d8fc2=_0x2d8fc2-0x0;var _0x3a9e53=_0x4260[_0x2d8fc2];return _0x3a9e53;};'use strict';var _=require(_0x0426('0x0'));var util=require(_0x0426('0x1'));var moment=require(_0x0426('0x2'));var BPromise=require(_0x0426('0x3'));var rs=require(_0x0426('0x4'));var fs=require('fs');var Redis=require(_0x0426('0x5'));var db=require(_0x0426('0x6'))['db'];var utils=require(_0x0426('0x7'));var logger=require(_0x0426('0x8'))(_0x0426('0x9'));var config=require(_0x0426('0xa'));var jayson=require(_0x0426('0xb'));var client=jayson['client'][_0x0426('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2d51e1,_0x48b14c,_0x50af26){return new BPromise(function(_0x576927,_0x5e74d8){return client[_0x0426('0xd')](_0x2d51e1,_0x50af26)[_0x0426('0xe')](function(_0x3a25bc){logger[_0x0426('0xf')](_0x0426('0x10'),_0x48b14c,_0x0426('0x11'));logger[_0x0426('0x12')](_0x0426('0x13'),_0x48b14c,_0x0426('0x11'),JSON[_0x0426('0x14')](_0x3a25bc));if(_0x3a25bc[_0x0426('0x15')]){if(_0x3a25bc[_0x0426('0x15')][_0x0426('0x16')]===0x1f4){logger[_0x0426('0x15')](_0x0426('0x10'),_0x48b14c,_0x3a25bc[_0x0426('0x15')]['message']);return _0x5e74d8(_0x3a25bc['error'][_0x0426('0x17')]);}logger[_0x0426('0x15')](_0x0426('0x10'),_0x48b14c,_0x3a25bc[_0x0426('0x15')][_0x0426('0x17')]);return _0x576927(_0x3a25bc[_0x0426('0x15')]['message']);}else{logger[_0x0426('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x48b14c,'request\x20sent');_0x576927(_0x3a25bc[_0x0426('0x18')][_0x0426('0x17')]);}})['catch'](function(_0x517315){logger[_0x0426('0x15')](_0x0426('0x10'),_0x48b14c,_0x517315);_0x5e74d8(_0x517315);});});}