250e431e29ce9b7320d50ee2002b93be89188da1
[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 _0xfb63=['message','MailTransferReport,\x20%s,\x20%s','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','then','info','debug','request\x20sent','stringify','error','code'];(function(_0x32bce8,_0x54f965){var _0x38badc=function(_0x1ed1ee){while(--_0x1ed1ee){_0x32bce8['push'](_0x32bce8['shift']());}};_0x38badc(++_0x54f965);}(_0xfb63,0xdf));var _0x3fb6=function(_0xcad371,_0x548e8d){_0xcad371=_0xcad371-0x0;var _0x18f0df=_0xfb63[_0xcad371];return _0x18f0df;};'use strict';var _=require(_0x3fb6('0x0'));var util=require(_0x3fb6('0x1'));var moment=require(_0x3fb6('0x2'));var BPromise=require(_0x3fb6('0x3'));var rs=require(_0x3fb6('0x4'));var fs=require('fs');var Redis=require(_0x3fb6('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x3fb6('0x6'));var logger=require(_0x3fb6('0x7'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3fb6('0x8'));var client=jayson[_0x3fb6('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e6bcb,_0x5ce84d,_0xe84c7a){return new BPromise(function(_0x1e945d,_0x3fac33){return client['request'](_0x4e6bcb,_0xe84c7a)[_0x3fb6('0xa')](function(_0x809bf7){logger[_0x3fb6('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x5ce84d,'request\x20sent');logger[_0x3fb6('0xc')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x5ce84d,_0x3fb6('0xd'),JSON[_0x3fb6('0xe')](_0x809bf7));if(_0x809bf7[_0x3fb6('0xf')]){if(_0x809bf7[_0x3fb6('0xf')][_0x3fb6('0x10')]===0x1f4){logger[_0x3fb6('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x5ce84d,_0x809bf7['error']['message']);return _0x3fac33(_0x809bf7[_0x3fb6('0xf')][_0x3fb6('0x11')]);}logger[_0x3fb6('0xf')](_0x3fb6('0x12'),_0x5ce84d,_0x809bf7[_0x3fb6('0xf')]['message']);return _0x1e945d(_0x809bf7[_0x3fb6('0xf')][_0x3fb6('0x11')]);}else{logger['info'](_0x3fb6('0x12'),_0x5ce84d,'request\x20sent');_0x1e945d(_0x809bf7[_0x3fb6('0x13')]['message']);}})['catch'](function(_0x38bd2b){logger[_0x3fb6('0xf')](_0x3fb6('0x12'),_0x5ce84d,_0x38bd2b);_0x3fac33(_0x38bd2b);});});}