Built motion from commit (unavailable).|2.0.83
[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 _0xce2f=['result','catch','lodash','util','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','MailTransferReport,\x20%s,\x20%s','info'];(function(_0x421261,_0x5213e2){var _0x25a25a=function(_0x16eb38){while(--_0x16eb38){_0x421261['push'](_0x421261['shift']());}};_0x25a25a(++_0x5213e2);}(_0xce2f,0xac));var _0xfce2=function(_0x52f1dc,_0x1118d7){_0x52f1dc=_0x52f1dc-0x0;var _0x1fdf3b=_0xce2f[_0x52f1dc];return _0x1fdf3b;};'use strict';var _=require(_0xfce2('0x0'));var util=require(_0xfce2('0x1'));var moment=require('moment');var BPromise=require(_0xfce2('0x2'));var rs=require(_0xfce2('0x3'));var fs=require('fs');var db=require(_0xfce2('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0xfce2('0x5'));var jayson=require(_0xfce2('0x6'));var client=jayson[_0xfce2('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3f61ac,_0x224273,_0x176465){return new BPromise(function(_0x4eafa5,_0x15686a){return client['request'](_0x3f61ac,_0x176465)['then'](function(_0x507689){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x224273,_0xfce2('0x8'));logger['debug'](_0xfce2('0x9'),_0x224273,_0xfce2('0x8'),JSON[_0xfce2('0xa')](_0x507689));if(_0x507689[_0xfce2('0xb')]){if(_0x507689[_0xfce2('0xb')]['code']===0x1f4){logger[_0xfce2('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x224273,_0x507689[_0xfce2('0xb')]['message']);return _0x15686a(_0x507689[_0xfce2('0xb')][_0xfce2('0xc')]);}logger[_0xfce2('0xb')](_0xfce2('0xd'),_0x224273,_0x507689[_0xfce2('0xb')][_0xfce2('0xc')]);return _0x4eafa5(_0x507689[_0xfce2('0xb')][_0xfce2('0xc')]);}else{logger[_0xfce2('0xe')](_0xfce2('0xd'),_0x224273,'request\x20sent');_0x4eafa5(_0x507689[_0xfce2('0xf')]['message']);}})[_0xfce2('0x10')](function(_0x214b99){logger[_0xfce2('0xb')](_0xfce2('0xd'),_0x224273,_0x214b99);_0x15686a(_0x214b99);});});}