5e84947da1aa7308f16d2b421c35592c0f60e2d4
[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 _0x3698=['catch','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','jayson/promise','client','http','request','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result'];(function(_0x328e04,_0x16ec5d){var _0x5f026d=function(_0x1af2a0){while(--_0x1af2a0){_0x328e04['push'](_0x328e04['shift']());}};_0x5f026d(++_0x16ec5d);}(_0x3698,0x141));var _0x8369=function(_0x43b88c,_0x46fb04){_0x43b88c=_0x43b88c-0x0;var _0x407299=_0x3698[_0x43b88c];return _0x407299;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x8369('0x0'));var BPromise=require(_0x8369('0x1'));var rs=require(_0x8369('0x2'));var fs=require('fs');var Redis=require(_0x8369('0x3'));var db=require(_0x8369('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8369('0x5'));var config=require('../../config/environment');var jayson=require(_0x8369('0x6'));var client=jayson[_0x8369('0x7')][_0x8369('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4b52f2,_0x2cfd74,_0x5c8f6c){return new BPromise(function(_0x146a12,_0x172da3){return client[_0x8369('0x9')](_0x4b52f2,_0x5c8f6c)[_0x8369('0xa')](function(_0x51a6cf){logger[_0x8369('0xb')](_0x8369('0xc'),_0x2cfd74,_0x8369('0xd'));logger['debug']('MailTransferReport,\x20%s,\x20%s,\x20%s',_0x2cfd74,_0x8369('0xd'),JSON[_0x8369('0xe')](_0x51a6cf));if(_0x51a6cf[_0x8369('0xf')]){if(_0x51a6cf[_0x8369('0xf')][_0x8369('0x10')]===0x1f4){logger[_0x8369('0xf')](_0x8369('0xc'),_0x2cfd74,_0x51a6cf['error']['message']);return _0x172da3(_0x51a6cf[_0x8369('0xf')][_0x8369('0x11')]);}logger[_0x8369('0xf')](_0x8369('0xc'),_0x2cfd74,_0x51a6cf['error']['message']);return _0x146a12(_0x51a6cf[_0x8369('0xf')][_0x8369('0x11')]);}else{logger[_0x8369('0xb')]('MailTransferReport,\x20%s,\x20%s',_0x2cfd74,_0x8369('0xd'));_0x146a12(_0x51a6cf[_0x8369('0x12')][_0x8369('0x11')]);}})[_0x8369('0x13')](function(_0x3096be){logger[_0x8369('0xf')]('MailTransferReport,\x20%s,\x20%s',_0x2cfd74,_0x3096be);_0x172da3(_0x3096be);});});}