04757c7e6c02d1c8e7d8e76e84120442df687ee0
[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 _0x20bf=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x5eb250,_0x10e901){var _0xdab1b2=function(_0x5131fe){while(--_0x5131fe){_0x5eb250['push'](_0x5eb250['shift']());}};_0xdab1b2(++_0x10e901);}(_0x20bf,0x1c6));var _0xf20b=function(_0x35f271,_0x23c908){_0x35f271=_0x35f271-0x0;var _0x2d32bf=_0x20bf[_0x35f271];return _0x2d32bf;};'use strict';var _=require(_0xf20b('0x0'));var util=require(_0xf20b('0x1'));var moment=require(_0xf20b('0x2'));var BPromise=require(_0xf20b('0x3'));var rs=require(_0xf20b('0x4'));var fs=require('fs');var Redis=require(_0xf20b('0x5'));var db=require(_0xf20b('0x6'))['db'];var utils=require(_0xf20b('0x7'));var logger=require(_0xf20b('0x8'))(_0xf20b('0x9'));var config=require(_0xf20b('0xa'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x407104,_0x49d919,_0x3eac27){return new BPromise(function(_0x6aa791,_0x20128a){return client['request'](_0x407104,_0x3eac27)[_0xf20b('0xb')](function(_0x12e892){logger[_0xf20b('0xc')](_0xf20b('0xd'),_0x49d919,_0xf20b('0xe'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x49d919,_0xf20b('0xe'),JSON['stringify'](_0x12e892));if(_0x12e892[_0xf20b('0xf')]){if(_0x12e892[_0xf20b('0xf')][_0xf20b('0x10')]===0x1f4){logger[_0xf20b('0xf')](_0xf20b('0xd'),_0x49d919,_0x12e892['error'][_0xf20b('0x11')]);return _0x20128a(_0x12e892[_0xf20b('0xf')]['message']);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x49d919,_0x12e892[_0xf20b('0xf')][_0xf20b('0x11')]);return _0x6aa791(_0x12e892[_0xf20b('0xf')][_0xf20b('0x11')]);}else{logger[_0xf20b('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x49d919,_0xf20b('0xe'));_0x6aa791(_0x12e892[_0xf20b('0x12')][_0xf20b('0x11')]);}})[_0xf20b('0x13')](function(_0x5b58d2){logger['error'](_0xf20b('0xd'),_0x49d919,_0x5b58d2);_0x20128a(_0x5b58d2);});});}