Built motion from commit (unavailable).|2.5.31
[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 _0x1478=['stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','then','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','MailTransferReport,\x20%s,\x20%s,\x20%s'];(function(_0x36bfef,_0x10a7f7){var _0x2ec20e=function(_0x385e2a){while(--_0x385e2a){_0x36bfef['push'](_0x36bfef['shift']());}};_0x2ec20e(++_0x10a7f7);}(_0x1478,0x145));var _0x8147=function(_0x323c59,_0x2fa7f5){_0x323c59=_0x323c59-0x0;var _0x4b2831=_0x1478[_0x323c59];return _0x4b2831;};'use strict';var _=require('lodash');var util=require(_0x8147('0x0'));var moment=require(_0x8147('0x1'));var BPromise=require(_0x8147('0x2'));var rs=require(_0x8147('0x3'));var fs=require('fs');var Redis=require(_0x8147('0x4'));var db=require(_0x8147('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x8147('0x6'));var config=require(_0x8147('0x7'));var jayson=require(_0x8147('0x8'));var client=jayson['client'][_0x8147('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2bea3a,_0x289934,_0x4f57c3){return new BPromise(function(_0x23ee1c,_0x3e8dcc){return client['request'](_0x2bea3a,_0x4f57c3)[_0x8147('0xa')](function(_0x4f7550){logger[_0x8147('0xb')](_0x8147('0xc'),_0x289934,_0x8147('0xd'));logger['debug'](_0x8147('0xe'),_0x289934,_0x8147('0xd'),JSON[_0x8147('0xf')](_0x4f7550));if(_0x4f7550[_0x8147('0x10')]){if(_0x4f7550[_0x8147('0x10')][_0x8147('0x11')]===0x1f4){logger[_0x8147('0x10')](_0x8147('0xc'),_0x289934,_0x4f7550[_0x8147('0x10')]['message']);return _0x3e8dcc(_0x4f7550[_0x8147('0x10')][_0x8147('0x12')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x289934,_0x4f7550[_0x8147('0x10')][_0x8147('0x12')]);return _0x23ee1c(_0x4f7550['error']['message']);}else{logger[_0x8147('0xb')](_0x8147('0xc'),_0x289934,_0x8147('0xd'));_0x23ee1c(_0x4f7550['result']['message']);}})[_0x8147('0x13')](function(_0x21916f){logger[_0x8147('0x10')](_0x8147('0xc'),_0x289934,_0x21916f);_0x3e8dcc(_0x21916f);});});}