592491e2dbe9ec5f2856842584b8d409134e2fe3
[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 _0x491f=['result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4025f7,_0x3d5c13){var _0x32f0e6=function(_0x17e6d4){while(--_0x17e6d4){_0x4025f7['push'](_0x4025f7['shift']());}};_0x32f0e6(++_0x3d5c13);}(_0x491f,0x189));var _0xf491=function(_0x48d482,_0x751e48){_0x48d482=_0x48d482-0x0;var _0x3a93c0=_0x491f[_0x48d482];return _0x3a93c0;};'use strict';var _=require('lodash');var util=require(_0xf491('0x0'));var moment=require(_0xf491('0x1'));var BPromise=require(_0xf491('0x2'));var rs=require(_0xf491('0x3'));var fs=require('fs');var Redis=require(_0xf491('0x4'));var db=require(_0xf491('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xf491('0x6'))(_0xf491('0x7'));var config=require(_0xf491('0x8'));var jayson=require(_0xf491('0x9'));var client=jayson[_0xf491('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x8c1964,_0x3530cc,_0x386ee8){return new BPromise(function(_0x5de652,_0x189813){return client[_0xf491('0xb')](_0x8c1964,_0x386ee8)['then'](function(_0x5bb9b8){logger[_0xf491('0xc')](_0xf491('0xd'),_0x3530cc,_0xf491('0xe'));logger[_0xf491('0xf')](_0xf491('0x10'),_0x3530cc,_0xf491('0xe'),JSON[_0xf491('0x11')](_0x5bb9b8));if(_0x5bb9b8['error']){if(_0x5bb9b8[_0xf491('0x12')][_0xf491('0x13')]===0x1f4){logger[_0xf491('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x3530cc,_0x5bb9b8[_0xf491('0x12')][_0xf491('0x14')]);return _0x189813(_0x5bb9b8[_0xf491('0x12')][_0xf491('0x14')]);}logger[_0xf491('0x12')](_0xf491('0xd'),_0x3530cc,_0x5bb9b8['error']['message']);return _0x5de652(_0x5bb9b8[_0xf491('0x12')][_0xf491('0x14')]);}else{logger['info'](_0xf491('0xd'),_0x3530cc,_0xf491('0xe'));_0x5de652(_0x5bb9b8[_0xf491('0x15')][_0xf491('0x14')]);}})[_0xf491('0x16')](function(_0x2af7cd){logger[_0xf491('0x12')](_0xf491('0xd'),_0x3530cc,_0x2af7cd);_0x189813(_0x2af7cd);});});}