f3312ff0f734d99058d08746d69dbf455bd05a43
[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 _0x63c3=['code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error'];(function(_0x28b51e,_0xbf830){var _0x43b3a5=function(_0x504a08){while(--_0x504a08){_0x28b51e['push'](_0x28b51e['shift']());}};_0x43b3a5(++_0xbf830);}(_0x63c3,0xe0));var _0x363c=function(_0x1ed550,_0x50228f){_0x1ed550=_0x1ed550-0x0;var _0x2a5f26=_0x63c3[_0x1ed550];return _0x2a5f26;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x363c('0x0'));var BPromise=require(_0x363c('0x1'));var rs=require(_0x363c('0x2'));var fs=require('fs');var Redis=require(_0x363c('0x3'));var db=require(_0x363c('0x4'))['db'];var utils=require(_0x363c('0x5'));var logger=require(_0x363c('0x6'))(_0x363c('0x7'));var config=require(_0x363c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x363c('0x9')][_0x363c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x53cf6b,_0x3e0491,_0x1c8f0){return new BPromise(function(_0x4840d7,_0x53d031){return client['request'](_0x53cf6b,_0x1c8f0)[_0x363c('0xb')](function(_0x19283e){logger[_0x363c('0xc')](_0x363c('0xd'),_0x3e0491,_0x363c('0xe'));logger[_0x363c('0xf')](_0x363c('0x10'),_0x3e0491,_0x363c('0xe'),JSON['stringify'](_0x19283e));if(_0x19283e[_0x363c('0x11')]){if(_0x19283e[_0x363c('0x11')][_0x363c('0x12')]===0x1f4){logger['error'](_0x363c('0xd'),_0x3e0491,_0x19283e[_0x363c('0x11')][_0x363c('0x13')]);return _0x53d031(_0x19283e[_0x363c('0x11')][_0x363c('0x13')]);}logger[_0x363c('0x11')](_0x363c('0xd'),_0x3e0491,_0x19283e['error'][_0x363c('0x13')]);return _0x4840d7(_0x19283e[_0x363c('0x11')][_0x363c('0x13')]);}else{logger[_0x363c('0xc')](_0x363c('0xd'),_0x3e0491,'request\x20sent');_0x4840d7(_0x19283e[_0x363c('0x14')][_0x363c('0x13')]);}})[_0x363c('0x15')](function(_0x3a510b){logger[_0x363c('0x11')]('MailTransferReport,\x20%s,\x20%s',_0x3e0491,_0x3a510b);_0x53d031(_0x3a510b);});});}