38bea316f7207942339cd2614e14e960d2c7a1a5
[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 _0xfd3f=['request','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','MailTransferReport,\x20%s,\x20%s','result','catch','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5b0b47,_0x299098){var _0x33988c=function(_0x8d220a){while(--_0x8d220a){_0x5b0b47['push'](_0x5b0b47['shift']());}};_0x33988c(++_0x299098);}(_0xfd3f,0xdd));var _0xffd3=function(_0x879e31,_0x139d02){_0x879e31=_0x879e31-0x0;var _0x3467e8=_0xfd3f[_0x879e31];return _0x3467e8;};'use strict';var _=require('lodash');var util=require(_0xffd3('0x0'));var moment=require(_0xffd3('0x1'));var BPromise=require(_0xffd3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xffd3('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xffd3('0x4'));var logger=require('../../config/logger')(_0xffd3('0x5'));var config=require(_0xffd3('0x6'));var jayson=require(_0xffd3('0x7'));var client=jayson[_0xffd3('0x8')][_0xffd3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xb5b4eb,_0x732838,_0x1f796b){return new BPromise(function(_0x223b08,_0x47535c){return client[_0xffd3('0xa')](_0xb5b4eb,_0x1f796b)['then'](function(_0x31825b){logger[_0xffd3('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x732838,_0xffd3('0xc'));logger[_0xffd3('0xd')](_0xffd3('0xe'),_0x732838,_0xffd3('0xc'),JSON['stringify'](_0x31825b));if(_0x31825b[_0xffd3('0xf')]){if(_0x31825b[_0xffd3('0xf')][_0xffd3('0x10')]===0x1f4){logger[_0xffd3('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x732838,_0x31825b[_0xffd3('0xf')][_0xffd3('0x11')]);return _0x47535c(_0x31825b[_0xffd3('0xf')]['message']);}logger[_0xffd3('0xf')](_0xffd3('0x12'),_0x732838,_0x31825b[_0xffd3('0xf')]['message']);return _0x223b08(_0x31825b['error'][_0xffd3('0x11')]);}else{logger[_0xffd3('0xb')](_0xffd3('0x12'),_0x732838,_0xffd3('0xc'));_0x223b08(_0x31825b[_0xffd3('0x13')][_0xffd3('0x11')]);}})[_0xffd3('0x14')](function(_0x42f975){logger[_0xffd3('0xf')](_0xffd3('0x12'),_0x732838,_0x42f975);_0x47535c(_0x42f975);});});}