857638cb6f00c936fcec917ee9b581364706ef90
[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 _0x1cdb=['../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','MailTransferReport,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x1cdb,0xb2));var _0xb1cd=function(_0x4a2d46,_0x5e603b){_0x4a2d46=_0x4a2d46-0x0;var _0x31205b=_0x1cdb[_0x4a2d46];return _0x31205b;};'use strict';var _=require(_0xb1cd('0x0'));var util=require(_0xb1cd('0x1'));var moment=require(_0xb1cd('0x2'));var BPromise=require(_0xb1cd('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb1cd('0x4'));var db=require(_0xb1cd('0x5'))['db'];var utils=require(_0xb1cd('0x6'));var logger=require(_0xb1cd('0x7'))(_0xb1cd('0x8'));var config=require('../../config/environment');var jayson=require(_0xb1cd('0x9'));var client=jayson[_0xb1cd('0xa')][_0xb1cd('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3b2edb,_0x22b855,_0x9a1e0e){return new BPromise(function(_0x1df8cf,_0x5d6d3f){return client['request'](_0x3b2edb,_0x9a1e0e)[_0xb1cd('0xc')](function(_0x292104){logger[_0xb1cd('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x22b855,_0xb1cd('0xe'));logger[_0xb1cd('0xf')](_0xb1cd('0x10'),_0x22b855,'request\x20sent',JSON[_0xb1cd('0x11')](_0x292104));if(_0x292104['error']){if(_0x292104['error'][_0xb1cd('0x12')]===0x1f4){logger[_0xb1cd('0x13')](_0xb1cd('0x14'),_0x22b855,_0x292104[_0xb1cd('0x13')][_0xb1cd('0x15')]);return _0x5d6d3f(_0x292104[_0xb1cd('0x13')]['message']);}logger[_0xb1cd('0x13')](_0xb1cd('0x14'),_0x22b855,_0x292104['error'][_0xb1cd('0x15')]);return _0x1df8cf(_0x292104['error'][_0xb1cd('0x15')]);}else{logger[_0xb1cd('0xd')]('MailTransferReport,\x20%s,\x20%s',_0x22b855,_0xb1cd('0xe'));_0x1df8cf(_0x292104['result'][_0xb1cd('0x15')]);}})[_0xb1cd('0x16')](function(_0x1036fa){logger['error']('MailTransferReport,\x20%s,\x20%s',_0x22b855,_0x1036fa);_0x5d6d3f(_0x1036fa);});});}