69127b039107742a3bcdec4c73c4dcc87f3a76c8
[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 _0x2b31=['code','MailTransferReport,\x20%s,\x20%s','message','info','result','catch','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then','request\x20sent','debug','stringify','error'];(function(_0x342c98,_0x1007d1){var _0x2325ba=function(_0x45ea75){while(--_0x45ea75){_0x342c98['push'](_0x342c98['shift']());}};_0x2325ba(++_0x1007d1);}(_0x2b31,0x1bf));var _0x12b3=function(_0x4a86b6,_0x564e1a){_0x4a86b6=_0x4a86b6-0x0;var _0x297d25=_0x2b31[_0x4a86b6];return _0x297d25;};'use strict';var _=require(_0x12b3('0x0'));var util=require(_0x12b3('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x12b3('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x12b3('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x12b3('0x4'));var config=require(_0x12b3('0x5'));var jayson=require(_0x12b3('0x6'));var client=jayson[_0x12b3('0x7')][_0x12b3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ca772,_0x61344a,_0x1da88b){return new BPromise(function(_0x33eea6,_0xb0ef4){return client[_0x12b3('0x9')](_0x3ca772,_0x1da88b)[_0x12b3('0xa')](function(_0x424345){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x61344a,_0x12b3('0xb'));logger[_0x12b3('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x61344a,_0x12b3('0xb'),JSON[_0x12b3('0xd')](_0x424345));if(_0x424345[_0x12b3('0xe')]){if(_0x424345['error'][_0x12b3('0xf')]===0x1f4){logger[_0x12b3('0xe')](_0x12b3('0x10'),_0x61344a,_0x424345[_0x12b3('0xe')][_0x12b3('0x11')]);return _0xb0ef4(_0x424345[_0x12b3('0xe')][_0x12b3('0x11')]);}logger[_0x12b3('0xe')](_0x12b3('0x10'),_0x61344a,_0x424345['error'][_0x12b3('0x11')]);return _0x33eea6(_0x424345[_0x12b3('0xe')][_0x12b3('0x11')]);}else{logger[_0x12b3('0x12')](_0x12b3('0x10'),_0x61344a,_0x12b3('0xb'));_0x33eea6(_0x424345[_0x12b3('0x13')][_0x12b3('0x11')]);}})[_0x12b3('0x14')](function(_0x333c85){logger[_0x12b3('0xe')](_0x12b3('0x10'),_0x61344a,_0x333c85);_0xb0ef4(_0x333c85);});});}