Built motion from commit da617fac.|2.6.6
[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 _0xa89b=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','jayson/promise','client','http','then','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','info','result','catch'];(function(_0x5bfe0c,_0x16a2e4){var _0x2e3c3b=function(_0x3f20f4){while(--_0x3f20f4){_0x5bfe0c['push'](_0x5bfe0c['shift']());}};_0x2e3c3b(++_0x16a2e4);}(_0xa89b,0x134));var _0xba89=function(_0x3e6ac0,_0x34b200){_0x3e6ac0=_0x3e6ac0-0x0;var _0xe1dee5=_0xa89b[_0x3e6ac0];return _0xe1dee5;};'use strict';var _=require(_0xba89('0x0'));var util=require(_0xba89('0x1'));var moment=require(_0xba89('0x2'));var BPromise=require(_0xba89('0x3'));var rs=require(_0xba89('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba89('0x5'))['db'];var utils=require(_0xba89('0x6'));var logger=require(_0xba89('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0xba89('0x8'));var client=jayson[_0xba89('0x9')][_0xba89('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x434ab6,_0x2ff70a,_0x118935){return new BPromise(function(_0x1d3694,_0x40a9e2){return client['request'](_0x434ab6,_0x118935)[_0xba89('0xb')](function(_0xc1066b){logger['info'](_0xba89('0xc'),_0x2ff70a,'request\x20sent');logger[_0xba89('0xd')](_0xba89('0xe'),_0x2ff70a,_0xba89('0xf'),JSON['stringify'](_0xc1066b));if(_0xc1066b['error']){if(_0xc1066b[_0xba89('0x10')][_0xba89('0x11')]===0x1f4){logger[_0xba89('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x2ff70a,_0xc1066b['error'][_0xba89('0x12')]);return _0x40a9e2(_0xc1066b[_0xba89('0x10')][_0xba89('0x12')]);}logger[_0xba89('0x10')](_0xba89('0xc'),_0x2ff70a,_0xc1066b[_0xba89('0x10')][_0xba89('0x12')]);return _0x1d3694(_0xc1066b[_0xba89('0x10')][_0xba89('0x12')]);}else{logger[_0xba89('0x13')]('MailTransferReport,\x20%s,\x20%s',_0x2ff70a,'request\x20sent');_0x1d3694(_0xc1066b[_0xba89('0x14')][_0xba89('0x12')]);}})[_0xba89('0x15')](function(_0x43e819){logger[_0xba89('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x2ff70a,_0x43e819);_0x40a9e2(_0x43e819);});});}