3fa8603983ca9530a72642af2799c2fc7df021e1
[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 _0x13c8=['../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','randomstring','ioredis'];(function(_0x5e688e,_0x5ba453){var _0x1f5c20=function(_0x559a4d){while(--_0x559a4d){_0x5e688e['push'](_0x5e688e['shift']());}};_0x1f5c20(++_0x5ba453);}(_0x13c8,0x1a1));var _0x813c=function(_0x4d1ee9,_0x394a78){_0x4d1ee9=_0x4d1ee9-0x0;var _0x9a5456=_0x13c8[_0x4d1ee9];return _0x9a5456;};'use strict';var _=require(_0x813c('0x0'));var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x813c('0x1'));var fs=require('fs');var Redis=require(_0x813c('0x2'));var db=require(_0x813c('0x3'))['db'];var utils=require(_0x813c('0x4'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x813c('0x5'));var client=jayson[_0x813c('0x6')][_0x813c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x18f09a,_0x3320c8,_0x116d23){return new BPromise(function(_0x1cd145,_0x46f89c){return client[_0x813c('0x8')](_0x18f09a,_0x116d23)[_0x813c('0x9')](function(_0x5884b4){logger[_0x813c('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x3320c8,_0x813c('0xb'));logger[_0x813c('0xc')](_0x813c('0xd'),_0x3320c8,_0x813c('0xb'),JSON['stringify'](_0x5884b4));if(_0x5884b4['error']){if(_0x5884b4[_0x813c('0xe')][_0x813c('0xf')]===0x1f4){logger[_0x813c('0xe')](_0x813c('0x10'),_0x3320c8,_0x5884b4[_0x813c('0xe')][_0x813c('0x11')]);return _0x46f89c(_0x5884b4[_0x813c('0xe')][_0x813c('0x11')]);}logger[_0x813c('0xe')](_0x813c('0x10'),_0x3320c8,_0x5884b4[_0x813c('0xe')][_0x813c('0x11')]);return _0x1cd145(_0x5884b4[_0x813c('0xe')][_0x813c('0x11')]);}else{logger['info'](_0x813c('0x10'),_0x3320c8,_0x813c('0xb'));_0x1cd145(_0x5884b4[_0x813c('0x12')][_0x813c('0x11')]);}})[_0x813c('0x13')](function(_0x425a7d){logger[_0x813c('0xe')](_0x813c('0x10'),_0x3320c8,_0x425a7d);_0x46f89c(_0x425a7d);});});}