2c032a95e6aabf5538a984691e4f577c9daf84d9
[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 _0xf9a3=['stringify','error','code','message','catch','util','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x226e02,_0x2b3ef5){var _0x3833a7=function(_0x5a88db){while(--_0x5a88db){_0x226e02['push'](_0x226e02['shift']());}};_0x3833a7(++_0x2b3ef5);}(_0xf9a3,0xcd));var _0x3f9a=function(_0x4e6002,_0x30d889){_0x4e6002=_0x4e6002-0x0;var _0x26d527=_0xf9a3[_0x4e6002];return _0x26d527;};'use strict';var _=require('lodash');var util=require(_0x3f9a('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3f9a('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3f9a('0x2'))['db'];var utils=require(_0x3f9a('0x3'));var logger=require('../../config/logger')(_0x3f9a('0x4'));var config=require(_0x3f9a('0x5'));var jayson=require(_0x3f9a('0x6'));var client=jayson[_0x3f9a('0x7')][_0x3f9a('0x8')]({'port':0x232a});function respondWithRpcPromise(_0xd6ee87,_0x1d7e7b,_0x5e5517){return new BPromise(function(_0x4915d4,_0x187f81){return client[_0x3f9a('0x9')](_0xd6ee87,_0x5e5517)[_0x3f9a('0xa')](function(_0x5e1fdb){logger[_0x3f9a('0xb')](_0x3f9a('0xc'),_0x1d7e7b,_0x3f9a('0xd'));logger[_0x3f9a('0xe')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x1d7e7b,_0x3f9a('0xd'),JSON[_0x3f9a('0xf')](_0x5e1fdb));if(_0x5e1fdb[_0x3f9a('0x10')]){if(_0x5e1fdb[_0x3f9a('0x10')][_0x3f9a('0x11')]===0x1f4){logger[_0x3f9a('0x10')](_0x3f9a('0xc'),_0x1d7e7b,_0x5e1fdb['error'][_0x3f9a('0x12')]);return _0x187f81(_0x5e1fdb['error']['message']);}logger[_0x3f9a('0x10')](_0x3f9a('0xc'),_0x1d7e7b,_0x5e1fdb['error'][_0x3f9a('0x12')]);return _0x4915d4(_0x5e1fdb[_0x3f9a('0x10')][_0x3f9a('0x12')]);}else{logger['info'](_0x3f9a('0xc'),_0x1d7e7b,'request\x20sent');_0x4915d4(_0x5e1fdb['result'][_0x3f9a('0x12')]);}})[_0x3f9a('0x13')](function(_0xe47769){logger[_0x3f9a('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x1d7e7b,_0xe47769);_0x187f81(_0xe47769);});});}