Built motion from commit 753c950e.|2.5.42
[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 _0x8b9e=['error','code','message','info','result','catch','lodash','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify'];(function(_0xf44d98,_0x12a472){var _0x5ebb04=function(_0x930c33){while(--_0x930c33){_0xf44d98['push'](_0xf44d98['shift']());}};_0x5ebb04(++_0x12a472);}(_0x8b9e,0x6f));var _0xe8b9=function(_0x300491,_0x19e47c){_0x300491=_0x300491-0x0;var _0x1cfba8=_0x8b9e[_0x300491];return _0x1cfba8;};'use strict';var _=require(_0xe8b9('0x0'));var util=require(_0xe8b9('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xe8b9('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe8b9('0x3'))['db'];var utils=require(_0xe8b9('0x4'));var logger=require('../../config/logger')(_0xe8b9('0x5'));var config=require(_0xe8b9('0x6'));var jayson=require(_0xe8b9('0x7'));var client=jayson[_0xe8b9('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x153c37,_0x4918b9,_0x392a58){return new BPromise(function(_0xa81853,_0x47bfff){return client['request'](_0x153c37,_0x392a58)[_0xe8b9('0x9')](function(_0x512571){logger['info'](_0xe8b9('0xa'),_0x4918b9,_0xe8b9('0xb'));logger[_0xe8b9('0xc')](_0xe8b9('0xd'),_0x4918b9,_0xe8b9('0xb'),JSON[_0xe8b9('0xe')](_0x512571));if(_0x512571['error']){if(_0x512571[_0xe8b9('0xf')][_0xe8b9('0x10')]===0x1f4){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x4918b9,_0x512571[_0xe8b9('0xf')][_0xe8b9('0x11')]);return _0x47bfff(_0x512571[_0xe8b9('0xf')][_0xe8b9('0x11')]);}logger[_0xe8b9('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x4918b9,_0x512571[_0xe8b9('0xf')][_0xe8b9('0x11')]);return _0xa81853(_0x512571[_0xe8b9('0xf')][_0xe8b9('0x11')]);}else{logger[_0xe8b9('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x4918b9,_0xe8b9('0xb'));_0xa81853(_0x512571[_0xe8b9('0x13')][_0xe8b9('0x11')]);}})[_0xe8b9('0x14')](function(_0xff666e){logger[_0xe8b9('0xf')](_0xe8b9('0xa'),_0x4918b9,_0xff666e);_0x47bfff(_0xff666e);});});}