Built motion from commit (unavailable).|2.5.4
[motion2.git] / server / api / mailServerOut / mailServerOut.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 _0xa477=['util','moment','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','MailServerOut,\x20%s,\x20%s','debug','MailServerOut,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','info','result','lodash'];(function(_0x5cd051,_0x577459){var _0x498333=function(_0x59f9b8){while(--_0x59f9b8){_0x5cd051['push'](_0x5cd051['shift']());}};_0x498333(++_0x577459);}(_0xa477,0x12b));var _0x7a47=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xa477[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x7a47('0x0'));var util=require(_0x7a47('0x1'));var moment=require(_0x7a47('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x7a47('0x3'));var logger=require('../../config/logger')(_0x7a47('0x4'));var config=require(_0x7a47('0x5'));var jayson=require(_0x7a47('0x6'));var client=jayson[_0x7a47('0x7')][_0x7a47('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2cd0f5,_0x4ea198,_0x46739c){return new BPromise(function(_0x34e515,_0x2f14b6){return client[_0x7a47('0x9')](_0x2cd0f5,_0x46739c)['then'](function(_0x15350a){logger['info'](_0x7a47('0xa'),_0x4ea198,'request\x20sent');logger[_0x7a47('0xb')](_0x7a47('0xc'),_0x4ea198,_0x7a47('0xd'),JSON[_0x7a47('0xe')](_0x15350a));if(_0x15350a['error']){if(_0x15350a['error'][_0x7a47('0xf')]===0x1f4){logger[_0x7a47('0x10')](_0x7a47('0xa'),_0x4ea198,_0x15350a[_0x7a47('0x10')]['message']);return _0x2f14b6(_0x15350a[_0x7a47('0x10')][_0x7a47('0x11')]);}logger[_0x7a47('0x10')](_0x7a47('0xa'),_0x4ea198,_0x15350a[_0x7a47('0x10')][_0x7a47('0x11')]);return _0x34e515(_0x15350a[_0x7a47('0x10')][_0x7a47('0x11')]);}else{logger[_0x7a47('0x12')](_0x7a47('0xa'),_0x4ea198,_0x7a47('0xd'));_0x34e515(_0x15350a[_0x7a47('0x13')][_0x7a47('0x11')]);}})['catch'](function(_0x2e6a57){logger[_0x7a47('0x10')]('MailServerOut,\x20%s,\x20%s',_0x4ea198,_0x2e6a57);_0x2f14b6(_0x2e6a57);});});}