Built motion from commit c738b9ac.|2.6.25
[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 _0x7903=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x4265d7,_0x445b71){var _0x3503db=function(_0x1066dc){while(--_0x1066dc){_0x4265d7['push'](_0x4265d7['shift']());}};_0x3503db(++_0x445b71);}(_0x7903,0x84));var _0x3790=function(_0x31f519,_0x1d4889){_0x31f519=_0x31f519-0x0;var _0x38138b=_0x7903[_0x31f519];return _0x38138b;};'use strict';var _=require(_0x3790('0x0'));var util=require(_0x3790('0x1'));var moment=require(_0x3790('0x2'));var BPromise=require(_0x3790('0x3'));var rs=require(_0x3790('0x4'));var fs=require('fs');var Redis=require(_0x3790('0x5'));var db=require(_0x3790('0x6'))['db'];var utils=require(_0x3790('0x7'));var logger=require(_0x3790('0x8'))(_0x3790('0x9'));var config=require(_0x3790('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x3790('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x43eae7,_0x404f7a,_0x1538f1){return new BPromise(function(_0x13c430,_0x14a07f){return client['request'](_0x43eae7,_0x1538f1)['then'](function(_0x46333d){logger[_0x3790('0xc')](_0x3790('0xd'),_0x404f7a,_0x3790('0xe'));logger[_0x3790('0xf')](_0x3790('0x10'),_0x404f7a,_0x3790('0xe'),JSON[_0x3790('0x11')](_0x46333d));if(_0x46333d[_0x3790('0x12')]){if(_0x46333d[_0x3790('0x12')][_0x3790('0x13')]===0x1f4){logger['error'](_0x3790('0xd'),_0x404f7a,_0x46333d[_0x3790('0x12')][_0x3790('0x14')]);return _0x14a07f(_0x46333d[_0x3790('0x12')][_0x3790('0x14')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x404f7a,_0x46333d[_0x3790('0x12')][_0x3790('0x14')]);return _0x13c430(_0x46333d[_0x3790('0x12')]['message']);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x404f7a,_0x3790('0xe'));_0x13c430(_0x46333d[_0x3790('0x15')][_0x3790('0x14')]);}})['catch'](function(_0x3fd7fa){logger['error'](_0x3790('0xd'),_0x404f7a,_0x3fd7fa);_0x14a07f(_0x3fd7fa);});});}