Built motion from commit e6806ed6.|2.6.0
[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 _0xffd9=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','message','info','result','catch','lodash','moment','randomstring','ioredis','rpc','../../config/environment','http','request','then','MailTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x1ecd1c,_0x52608e){var _0x5ad48e=function(_0x1733f2){while(--_0x1733f2){_0x1ecd1c['push'](_0x1ecd1c['shift']());}};_0x5ad48e(++_0x52608e);}(_0xffd9,0x1db));var _0x9ffd=function(_0x4a3feb,_0x4f1350){_0x4a3feb=_0x4a3feb-0x0;var _0x5aa7eb=_0xffd9[_0x4a3feb];return _0x5aa7eb;};'use strict';var _=require(_0x9ffd('0x0'));var util=require('util');var moment=require(_0x9ffd('0x1'));var BPromise=require('bluebird');var rs=require(_0x9ffd('0x2'));var fs=require('fs');var Redis=require(_0x9ffd('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x9ffd('0x4'));var config=require(_0x9ffd('0x5'));var jayson=require('jayson/promise');var client=jayson['client'][_0x9ffd('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x578e74,_0x450b93,_0x5695ef){return new BPromise(function(_0x57bce9,_0x4e51ec){return client[_0x9ffd('0x7')](_0x578e74,_0x5695ef)[_0x9ffd('0x8')](function(_0x59f2c9){logger['info'](_0x9ffd('0x9'),_0x450b93,_0x9ffd('0xa'));logger[_0x9ffd('0xb')](_0x9ffd('0xc'),_0x450b93,'request\x20sent',JSON['stringify'](_0x59f2c9));if(_0x59f2c9[_0x9ffd('0xd')]){if(_0x59f2c9[_0x9ffd('0xd')]['code']===0x1f4){logger['error'](_0x9ffd('0x9'),_0x450b93,_0x59f2c9[_0x9ffd('0xd')][_0x9ffd('0xe')]);return _0x4e51ec(_0x59f2c9[_0x9ffd('0xd')][_0x9ffd('0xe')]);}logger[_0x9ffd('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x450b93,_0x59f2c9[_0x9ffd('0xd')][_0x9ffd('0xe')]);return _0x57bce9(_0x59f2c9[_0x9ffd('0xd')][_0x9ffd('0xe')]);}else{logger[_0x9ffd('0xf')](_0x9ffd('0x9'),_0x450b93,_0x9ffd('0xa'));_0x57bce9(_0x59f2c9[_0x9ffd('0x10')][_0x9ffd('0xe')]);}})[_0x9ffd('0x11')](function(_0xc1b9ca){logger[_0x9ffd('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x450b93,_0xc1b9ca);_0x4e51ec(_0xc1b9ca);});});}