19865263307a7b18349f85464a2be74f41b33cc1
[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 _0x123b=['debug','MailTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','MailTransferReport,\x20%s,\x20%s','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x2bc095,_0x13a945){var _0x5e8a02=function(_0x37e0bb){while(--_0x37e0bb){_0x2bc095['push'](_0x2bc095['shift']());}};_0x5e8a02(++_0x13a945);}(_0x123b,0x191));var _0xb123=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x123b[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0xb123('0x0'));var util=require('util');var moment=require(_0xb123('0x1'));var BPromise=require(_0xb123('0x2'));var rs=require(_0xb123('0x3'));var fs=require('fs');var Redis=require(_0xb123('0x4'));var db=require(_0xb123('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb123('0x6'));var config=require(_0xb123('0x7'));var jayson=require(_0xb123('0x8'));var client=jayson[_0xb123('0x9')][_0xb123('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x15b1d4,_0x3e3386,_0x1d46c9){return new BPromise(function(_0x197d3d,_0x400756){return client[_0xb123('0xb')](_0x15b1d4,_0x1d46c9)[_0xb123('0xc')](function(_0x4270ff){logger['info']('MailTransferReport,\x20%s,\x20%s',_0x3e3386,'request\x20sent');logger[_0xb123('0xd')](_0xb123('0xe'),_0x3e3386,_0xb123('0xf'),JSON['stringify'](_0x4270ff));if(_0x4270ff['error']){if(_0x4270ff[_0xb123('0x10')][_0xb123('0x11')]===0x1f4){logger[_0xb123('0x10')]('MailTransferReport,\x20%s,\x20%s',_0x3e3386,_0x4270ff['error'][_0xb123('0x12')]);return _0x400756(_0x4270ff[_0xb123('0x10')][_0xb123('0x12')]);}logger['error'](_0xb123('0x13'),_0x3e3386,_0x4270ff[_0xb123('0x10')]['message']);return _0x197d3d(_0x4270ff[_0xb123('0x10')][_0xb123('0x12')]);}else{logger[_0xb123('0x14')](_0xb123('0x13'),_0x3e3386,_0xb123('0xf'));_0x197d3d(_0x4270ff[_0xb123('0x15')]['message']);}})[_0xb123('0x16')](function(_0x4e921d){logger[_0xb123('0x10')](_0xb123('0x13'),_0x3e3386,_0x4e921d);_0x400756(_0x4e921d);});});}