4e40f764044055d4708bb78eb3801dba707ea8c7
[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 _0x8735=['moment','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','catch','lodash','util'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x8735,0x1b6));var _0x5873=function(_0x2f5891,_0x2bf525){_0x2f5891=_0x2f5891-0x0;var _0x3b1459=_0x8735[_0x2f5891];return _0x3b1459;};'use strict';var _=require(_0x5873('0x0'));var util=require(_0x5873('0x1'));var moment=require(_0x5873('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x5873('0x3'))(_0x5873('0x4'));var config=require(_0x5873('0x5'));var jayson=require(_0x5873('0x6'));var client=jayson[_0x5873('0x7')][_0x5873('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x9c97c,_0x2d9a12,_0x2e0961){return new BPromise(function(_0x5b5695,_0x424a58){return client[_0x5873('0x9')](_0x9c97c,_0x2e0961)['then'](function(_0x3a9649){logger[_0x5873('0xa')](_0x5873('0xb'),_0x2d9a12,'request\x20sent');logger[_0x5873('0xc')](_0x5873('0xd'),_0x2d9a12,'request\x20sent',JSON[_0x5873('0xe')](_0x3a9649));if(_0x3a9649[_0x5873('0xf')]){if(_0x3a9649[_0x5873('0xf')][_0x5873('0x10')]===0x1f4){logger[_0x5873('0xf')](_0x5873('0xb'),_0x2d9a12,_0x3a9649['error'][_0x5873('0x11')]);return _0x424a58(_0x3a9649[_0x5873('0xf')][_0x5873('0x11')]);}logger[_0x5873('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x2d9a12,_0x3a9649[_0x5873('0xf')]['message']);return _0x5b5695(_0x3a9649['error'][_0x5873('0x11')]);}else{logger[_0x5873('0xa')]('MailTransferReport,\x20%s,\x20%s',_0x2d9a12,_0x5873('0x12'));_0x5b5695(_0x3a9649['result'][_0x5873('0x11')]);}})[_0x5873('0x13')](function(_0x957436){logger[_0x5873('0xf')](_0x5873('0xb'),_0x2d9a12,_0x957436);_0x424a58(_0x957436);});});}