8281f0e76e0e97d8c658d4707cdda6ba2e9e4ef6
[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 _0xaf00=['request\x20sent','stringify','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x4727de,_0x404703){var _0x382a88=function(_0x2a540f){while(--_0x2a540f){_0x4727de['push'](_0x4727de['shift']());}};_0x382a88(++_0x404703);}(_0xaf00,0xc8));var _0x0af0=function(_0x43f881,_0xd6e5a2){_0x43f881=_0x43f881-0x0;var _0x365c14=_0xaf00[_0x43f881];return _0x365c14;};'use strict';var _=require(_0x0af0('0x0'));var util=require(_0x0af0('0x1'));var moment=require(_0x0af0('0x2'));var BPromise=require(_0x0af0('0x3'));var rs=require(_0x0af0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0af0('0x5'))['db'];var utils=require(_0x0af0('0x6'));var logger=require(_0x0af0('0x7'))(_0x0af0('0x8'));var config=require('../../config/environment');var jayson=require(_0x0af0('0x9'));var client=jayson[_0x0af0('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x112415,_0x5ea88b,_0x10c63a){return new BPromise(function(_0x34a571,_0x1e0f14){return client[_0x0af0('0xb')](_0x112415,_0x10c63a)[_0x0af0('0xc')](function(_0x58b7ff){logger[_0x0af0('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x5ea88b,'request\x20sent');logger[_0x0af0('0xe')](_0x0af0('0xf'),_0x5ea88b,_0x0af0('0x10'),JSON[_0x0af0('0x11')](_0x58b7ff));if(_0x58b7ff[_0x0af0('0x12')]){if(_0x58b7ff[_0x0af0('0x12')][_0x0af0('0x13')]===0x1f4){logger[_0x0af0('0x12')](_0x0af0('0x14'),_0x5ea88b,_0x58b7ff[_0x0af0('0x12')][_0x0af0('0x15')]);return _0x1e0f14(_0x58b7ff[_0x0af0('0x12')][_0x0af0('0x15')]);}logger['error'](_0x0af0('0x14'),_0x5ea88b,_0x58b7ff[_0x0af0('0x12')][_0x0af0('0x15')]);return _0x34a571(_0x58b7ff[_0x0af0('0x12')]['message']);}else{logger[_0x0af0('0xd')](_0x0af0('0x14'),_0x5ea88b,_0x0af0('0x10'));_0x34a571(_0x58b7ff[_0x0af0('0x16')][_0x0af0('0x15')]);}})[_0x0af0('0x17')](function(_0x5d7f54){logger['error'](_0x0af0('0x14'),_0x5ea88b,_0x5d7f54);_0x1e0f14(_0x5d7f54);});});}