Built motion from commit 52c8a02d.|2.6.29
[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 _0x2235=['request\x20sent','stringify','error','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','debug','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x10743d,_0x4cf792){var _0x54e952=function(_0x2c75c5){while(--_0x2c75c5){_0x10743d['push'](_0x10743d['shift']());}};_0x54e952(++_0x4cf792);}(_0x2235,0xa0));var _0x5223=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x2235[_0x3ab9ee];return _0x82ee88;};'use strict';var _=require('lodash');var util=require(_0x5223('0x0'));var moment=require(_0x5223('0x1'));var BPromise=require('bluebird');var rs=require(_0x5223('0x2'));var fs=require('fs');var Redis=require(_0x5223('0x3'));var db=require(_0x5223('0x4'))['db'];var utils=require(_0x5223('0x5'));var logger=require('../../config/logger')(_0x5223('0x6'));var config=require('../../config/environment');var jayson=require(_0x5223('0x7'));var client=jayson[_0x5223('0x8')][_0x5223('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x321d72,_0x44ad7a,_0x24c809){return new BPromise(function(_0x4f302b,_0xcac5b8){return client[_0x5223('0xa')](_0x321d72,_0x24c809)[_0x5223('0xb')](function(_0xabfcc4){logger[_0x5223('0xc')](_0x5223('0xd'),_0x44ad7a,'request\x20sent');logger[_0x5223('0xe')](_0x5223('0xf'),_0x44ad7a,_0x5223('0x10'),JSON[_0x5223('0x11')](_0xabfcc4));if(_0xabfcc4[_0x5223('0x12')]){if(_0xabfcc4[_0x5223('0x12')]['code']===0x1f4){logger[_0x5223('0x12')](_0x5223('0xd'),_0x44ad7a,_0xabfcc4['error']['message']);return _0xcac5b8(_0xabfcc4[_0x5223('0x12')][_0x5223('0x13')]);}logger['error'](_0x5223('0xd'),_0x44ad7a,_0xabfcc4[_0x5223('0x12')][_0x5223('0x13')]);return _0x4f302b(_0xabfcc4[_0x5223('0x12')][_0x5223('0x13')]);}else{logger[_0x5223('0xc')](_0x5223('0xd'),_0x44ad7a,_0x5223('0x10'));_0x4f302b(_0xabfcc4[_0x5223('0x14')][_0x5223('0x13')]);}})[_0x5223('0x15')](function(_0x220778){logger[_0x5223('0x12')](_0x5223('0xd'),_0x44ad7a,_0x220778);_0xcac5b8(_0x220778);});});}