c16694c54626ca12ca59e3c2c6eaa6e2c667896f
[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 _0xf3c0=['jayson/promise','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','message','result','util','moment','bluebird','ioredis','../../config/utils','rpc'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xf3c0,0xd2));var _0x0f3c=function(_0x377ac0,_0x5c6208){_0x377ac0=_0x377ac0-0x0;var _0x230711=_0xf3c0[_0x377ac0];return _0x230711;};'use strict';var _=require('lodash');var util=require(_0x0f3c('0x0'));var moment=require(_0x0f3c('0x1'));var BPromise=require(_0x0f3c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0f3c('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0f3c('0x4'));var logger=require('../../config/logger')(_0x0f3c('0x5'));var config=require('../../config/environment');var jayson=require(_0x0f3c('0x6'));var client=jayson[_0x0f3c('0x7')][_0x0f3c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4ea94d,_0x40b347,_0x3286a7){return new BPromise(function(_0xca6331,_0x5af601){return client['request'](_0x4ea94d,_0x3286a7)[_0x0f3c('0x9')](function(_0x3716b5){logger[_0x0f3c('0xa')](_0x0f3c('0xb'),_0x40b347,_0x0f3c('0xc'));logger[_0x0f3c('0xd')](_0x0f3c('0xe'),_0x40b347,_0x0f3c('0xc'),JSON['stringify'](_0x3716b5));if(_0x3716b5['error']){if(_0x3716b5[_0x0f3c('0xf')]['code']===0x1f4){logger['error'](_0x0f3c('0xb'),_0x40b347,_0x3716b5[_0x0f3c('0xf')][_0x0f3c('0x10')]);return _0x5af601(_0x3716b5[_0x0f3c('0xf')][_0x0f3c('0x10')]);}logger['error'](_0x0f3c('0xb'),_0x40b347,_0x3716b5[_0x0f3c('0xf')][_0x0f3c('0x10')]);return _0xca6331(_0x3716b5[_0x0f3c('0xf')][_0x0f3c('0x10')]);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x40b347,_0x0f3c('0xc'));_0xca6331(_0x3716b5[_0x0f3c('0x11')][_0x0f3c('0x10')]);}})['catch'](function(_0x2565cf){logger['error'](_0x0f3c('0xb'),_0x40b347,_0x2565cf);_0x5af601(_0x2565cf);});});}