Built motion from commit 85328c08.|2.5.50
[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 _0xc24f=['randomstring','../../config/utils','../../config/environment','jayson/promise','http','info','request\x20sent','debug','error','code','MailTransferReport,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird'];(function(_0x2d6fdb,_0x1c8f67){var _0x42a6e1=function(_0x5dc7b2){while(--_0x5dc7b2){_0x2d6fdb['push'](_0x2d6fdb['shift']());}};_0x42a6e1(++_0x1c8f67);}(_0xc24f,0x184));var _0xfc24=function(_0x15ab62,_0x3facd8){_0x15ab62=_0x15ab62-0x0;var _0x161be8=_0xc24f[_0x15ab62];return _0x161be8;};'use strict';var _=require(_0xfc24('0x0'));var util=require('util');var moment=require(_0xfc24('0x1'));var BPromise=require(_0xfc24('0x2'));var rs=require(_0xfc24('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xfc24('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xfc24('0x5'));var jayson=require(_0xfc24('0x6'));var client=jayson['client'][_0xfc24('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5460d8,_0x11dd13,_0x496e0e){return new BPromise(function(_0x51ed90,_0x22a7de){return client['request'](_0x5460d8,_0x496e0e)['then'](function(_0xbfdb14){logger[_0xfc24('0x8')]('MailTransferReport,\x20%s,\x20%s',_0x11dd13,_0xfc24('0x9'));logger[_0xfc24('0xa')]('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x11dd13,_0xfc24('0x9'),JSON['stringify'](_0xbfdb14));if(_0xbfdb14['error']){if(_0xbfdb14[_0xfc24('0xb')][_0xfc24('0xc')]===0x1f4){logger[_0xfc24('0xb')](_0xfc24('0xd'),_0x11dd13,_0xbfdb14[_0xfc24('0xb')][_0xfc24('0xe')]);return _0x22a7de(_0xbfdb14['error'][_0xfc24('0xe')]);}logger['error'](_0xfc24('0xd'),_0x11dd13,_0xbfdb14[_0xfc24('0xb')]['message']);return _0x51ed90(_0xbfdb14[_0xfc24('0xb')][_0xfc24('0xe')]);}else{logger['info'](_0xfc24('0xd'),_0x11dd13,_0xfc24('0x9'));_0x51ed90(_0xbfdb14[_0xfc24('0xf')][_0xfc24('0xe')]);}})[_0xfc24('0x10')](function(_0x249ef0){logger[_0xfc24('0xb')](_0xfc24('0xd'),_0x11dd13,_0x249ef0);_0x22a7de(_0x249ef0);});});}