Built motion from commit 092f8824.|2.5.49
[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 _0x843b=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch'];(function(_0x1f53ac,_0x243d37){var _0x46b128=function(_0x13bd22){while(--_0x13bd22){_0x1f53ac['push'](_0x1f53ac['shift']());}};_0x46b128(++_0x243d37);}(_0x843b,0x1f4));var _0xb843=function(_0x39295d,_0x42edbe){_0x39295d=_0x39295d-0x0;var _0x389c10=_0x843b[_0x39295d];return _0x389c10;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xb843('0x0'));var rs=require(_0xb843('0x1'));var fs=require('fs');var Redis=require(_0xb843('0x2'));var db=require(_0xb843('0x3'))['db'];var utils=require(_0xb843('0x4'));var logger=require('../../config/logger')(_0xb843('0x5'));var config=require('../../config/environment');var jayson=require(_0xb843('0x6'));var client=jayson['client'][_0xb843('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x4d1b2c,_0x4a9115,_0x42cd56){return new BPromise(function(_0x3b39a8,_0x2adbef){return client[_0xb843('0x8')](_0x4d1b2c,_0x42cd56)[_0xb843('0x9')](function(_0x38e98a){logger[_0xb843('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x4a9115,_0xb843('0xb'));logger[_0xb843('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x4a9115,_0xb843('0xb'),JSON[_0xb843('0xd')](_0x38e98a));if(_0x38e98a['error']){if(_0x38e98a[_0xb843('0xe')][_0xb843('0xf')]===0x1f4){logger[_0xb843('0xe')](_0xb843('0x10'),_0x4a9115,_0x38e98a['error'][_0xb843('0x11')]);return _0x2adbef(_0x38e98a[_0xb843('0xe')][_0xb843('0x11')]);}logger[_0xb843('0xe')]('MailTransferReport,\x20%s,\x20%s',_0x4a9115,_0x38e98a[_0xb843('0xe')][_0xb843('0x11')]);return _0x3b39a8(_0x38e98a['error']['message']);}else{logger[_0xb843('0xa')](_0xb843('0x10'),_0x4a9115,_0xb843('0xb'));_0x3b39a8(_0x38e98a[_0xb843('0x12')][_0xb843('0x11')]);}})[_0xb843('0x13')](function(_0x59e1c9){logger[_0xb843('0xe')](_0xb843('0x10'),_0x4a9115,_0x59e1c9);_0x2adbef(_0x59e1c9);});});}