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 _0x3397=['request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0xa8883,_0x1f107f){var _0x479426=function(_0x4e56b9){while(--_0x4e56b9){_0xa8883['push'](_0xa8883['shift']());}};_0x479426(++_0x1f107f);}(_0x3397,0xe3));var _0x7339=function(_0x1a0ef3,_0x535bbf){_0x1a0ef3=_0x1a0ef3-0x0;var _0x2b86da=_0x3397[_0x1a0ef3];return _0x2b86da;};'use strict';var _=require(_0x7339('0x0'));var util=require(_0x7339('0x1'));var moment=require('moment');var BPromise=require(_0x7339('0x2'));var rs=require(_0x7339('0x3'));var fs=require('fs');var Redis=require(_0x7339('0x4'));var db=require(_0x7339('0x5'))['db'];var utils=require(_0x7339('0x6'));var logger=require(_0x7339('0x7'))(_0x7339('0x8'));var config=require(_0x7339('0x9'));var jayson=require(_0x7339('0xa'));var client=jayson[_0x7339('0xb')][_0x7339('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x51d200,_0x399f07,_0x4d2f8e){return new BPromise(function(_0x536914,_0x517967){return client[_0x7339('0xd')](_0x51d200,_0x4d2f8e)[_0x7339('0xe')](function(_0x125289){logger[_0x7339('0xf')](_0x7339('0x10'),_0x399f07,_0x7339('0x11'));logger[_0x7339('0x12')](_0x7339('0x13'),_0x399f07,_0x7339('0x11'),JSON[_0x7339('0x14')](_0x125289));if(_0x125289[_0x7339('0x15')]){if(_0x125289[_0x7339('0x15')]['code']===0x1f4){logger[_0x7339('0x15')]('MailTransferReport,\x20%s,\x20%s',_0x399f07,_0x125289[_0x7339('0x15')][_0x7339('0x16')]);return _0x517967(_0x125289['error'][_0x7339('0x16')]);}logger['error'](_0x7339('0x10'),_0x399f07,_0x125289['error']['message']);return _0x536914(_0x125289[_0x7339('0x15')]['message']);}else{logger[_0x7339('0xf')](_0x7339('0x10'),_0x399f07,'request\x20sent');_0x536914(_0x125289[_0x7339('0x17')][_0x7339('0x16')]);}})['catch'](function(_0x496548){logger['error'](_0x7339('0x10'),_0x399f07,_0x496548);_0x517967(_0x496548);});});}