Built motion from commit (unavailable).|2.5.4
[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 _0x8123=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x5d69ec,_0x583d1f){var _0x61cb84=function(_0x29ee7a){while(--_0x29ee7a){_0x5d69ec['push'](_0x5d69ec['shift']());}};_0x61cb84(++_0x583d1f);}(_0x8123,0x137));var _0x3812=function(_0x382a62,_0x1baa5e){_0x382a62=_0x382a62-0x0;var _0x490a25=_0x8123[_0x382a62];return _0x490a25;};'use strict';var _=require(_0x3812('0x0'));var util=require(_0x3812('0x1'));var moment=require(_0x3812('0x2'));var BPromise=require(_0x3812('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3812('0x4'));var db=require(_0x3812('0x5'))['db'];var utils=require(_0x3812('0x6'));var logger=require('../../config/logger')(_0x3812('0x7'));var config=require(_0x3812('0x8'));var jayson=require(_0x3812('0x9'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x4b663c,_0x31dad9,_0xb2f492){return new BPromise(function(_0x317d9e,_0x3dac3f){return client['request'](_0x4b663c,_0xb2f492)['then'](function(_0x1a4b38){logger['info'](_0x3812('0xa'),_0x31dad9,_0x3812('0xb'));logger[_0x3812('0xc')](_0x3812('0xd'),_0x31dad9,'request\x20sent',JSON[_0x3812('0xe')](_0x1a4b38));if(_0x1a4b38[_0x3812('0xf')]){if(_0x1a4b38[_0x3812('0xf')]['code']===0x1f4){logger['error'](_0x3812('0xa'),_0x31dad9,_0x1a4b38[_0x3812('0xf')][_0x3812('0x10')]);return _0x3dac3f(_0x1a4b38[_0x3812('0xf')][_0x3812('0x10')]);}logger[_0x3812('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x31dad9,_0x1a4b38[_0x3812('0xf')][_0x3812('0x10')]);return _0x317d9e(_0x1a4b38['error'][_0x3812('0x10')]);}else{logger[_0x3812('0x11')](_0x3812('0xa'),_0x31dad9,_0x3812('0xb'));_0x317d9e(_0x1a4b38[_0x3812('0x12')][_0x3812('0x10')]);}})['catch'](function(_0x177bb9){logger[_0x3812('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x31dad9,_0x177bb9);_0x3dac3f(_0x177bb9);});});}