Built motion from commit ffdca78c.|2.6.24
[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 _0xc7b8=['stringify','error','MailTransferReport,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x36ef35,_0x2c1f97){var _0x5a6b6a=function(_0x17d9fe){while(--_0x17d9fe){_0x36ef35['push'](_0x36ef35['shift']());}};_0x5a6b6a(++_0x2c1f97);}(_0xc7b8,0x192));var _0x8c7b=function(_0x1143f4,_0x214b1a){_0x1143f4=_0x1143f4-0x0;var _0x380aa4=_0xc7b8[_0x1143f4];return _0x380aa4;};'use strict';var _=require(_0x8c7b('0x0'));var util=require('util');var moment=require(_0x8c7b('0x1'));var BPromise=require(_0x8c7b('0x2'));var rs=require(_0x8c7b('0x3'));var fs=require('fs');var Redis=require(_0x8c7b('0x4'));var db=require(_0x8c7b('0x5'))['db'];var utils=require(_0x8c7b('0x6'));var logger=require(_0x8c7b('0x7'))(_0x8c7b('0x8'));var config=require(_0x8c7b('0x9'));var jayson=require(_0x8c7b('0xa'));var client=jayson['client'][_0x8c7b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0xb974e8,_0x4d33ed,_0x27f28b){return new BPromise(function(_0x91e169,_0x3b8258){return client['request'](_0xb974e8,_0x27f28b)[_0x8c7b('0xc')](function(_0x50e403){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x4d33ed,_0x8c7b('0xd'));logger[_0x8c7b('0xe')](_0x8c7b('0xf'),_0x4d33ed,'request\x20sent',JSON[_0x8c7b('0x10')](_0x50e403));if(_0x50e403['error']){if(_0x50e403[_0x8c7b('0x11')]['code']===0x1f4){logger[_0x8c7b('0x11')](_0x8c7b('0x12'),_0x4d33ed,_0x50e403['error'][_0x8c7b('0x13')]);return _0x3b8258(_0x50e403[_0x8c7b('0x11')]['message']);}logger[_0x8c7b('0x11')](_0x8c7b('0x12'),_0x4d33ed,_0x50e403[_0x8c7b('0x11')][_0x8c7b('0x13')]);return _0x91e169(_0x50e403[_0x8c7b('0x11')][_0x8c7b('0x13')]);}else{logger[_0x8c7b('0x14')]('MailTransferReport,\x20%s,\x20%s',_0x4d33ed,_0x8c7b('0xd'));_0x91e169(_0x50e403[_0x8c7b('0x15')][_0x8c7b('0x13')]);}})['catch'](function(_0x1c3f45){logger[_0x8c7b('0x11')](_0x8c7b('0x12'),_0x4d33ed,_0x1c3f45);_0x3b8258(_0x1c3f45);});});}