0d209f368428cde71f7f23c8956a7096b590d7f7
[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 _0x300a=['../../config/environment','jayson/promise','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc'];(function(_0x164eca,_0x555e28){var _0x2ce562=function(_0x148ca6){while(--_0x148ca6){_0x164eca['push'](_0x164eca['shift']());}};_0x2ce562(++_0x555e28);}(_0x300a,0x139));var _0xa300=function(_0x2c2390,_0x37ef1c){_0x2c2390=_0x2c2390-0x0;var _0x478b7e=_0x300a[_0x2c2390];return _0x478b7e;};'use strict';var _=require('lodash');var util=require(_0xa300('0x0'));var moment=require(_0xa300('0x1'));var BPromise=require(_0xa300('0x2'));var rs=require(_0xa300('0x3'));var fs=require('fs');var Redis=require(_0xa300('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xa300('0x5'))(_0xa300('0x6'));var config=require(_0xa300('0x7'));var jayson=require(_0xa300('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xd48836,_0x279e20,_0x2b6156){return new BPromise(function(_0x2b0db3,_0x4232ea){return client[_0xa300('0x9')](_0xd48836,_0x2b6156)[_0xa300('0xa')](function(_0x3d4015){logger[_0xa300('0xb')](_0xa300('0xc'),_0x279e20,_0xa300('0xd'));logger[_0xa300('0xe')](_0xa300('0xf'),_0x279e20,'request\x20sent',JSON['stringify'](_0x3d4015));if(_0x3d4015[_0xa300('0x10')]){if(_0x3d4015['error'][_0xa300('0x11')]===0x1f4){logger[_0xa300('0x10')](_0xa300('0xc'),_0x279e20,_0x3d4015[_0xa300('0x10')][_0xa300('0x12')]);return _0x4232ea(_0x3d4015['error'][_0xa300('0x12')]);}logger[_0xa300('0x10')](_0xa300('0xc'),_0x279e20,_0x3d4015[_0xa300('0x10')][_0xa300('0x12')]);return _0x2b0db3(_0x3d4015[_0xa300('0x10')][_0xa300('0x12')]);}else{logger[_0xa300('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x279e20,_0xa300('0xd'));_0x2b0db3(_0x3d4015['result']['message']);}})[_0xa300('0x13')](function(_0x34625a){logger[_0xa300('0x10')](_0xa300('0xc'),_0x279e20,_0x34625a);_0x4232ea(_0x34625a);});});}