@sap-cloud-sdk/mail-client
Advanced tools
Comparing version 2.7.1-20220811075847.0 to 2.7.1-20220811094957.0
# @sap-cloud-sdk/mail-client | ||
## 2.7.1-20220811075847.0 | ||
## 2.7.1-20220811094957.0 | ||
@@ -8,4 +8,4 @@ ### Patch Changes | ||
- Updated dependencies | ||
- @sap-cloud-sdk/connectivity@2.7.1-20220811075847.0 | ||
- @sap-cloud-sdk/util@2.7.1-20220811075847.0 | ||
- @sap-cloud-sdk/connectivity@2.7.1-20220811094957.0 | ||
- @sap-cloud-sdk/util@2.7.1-20220811094957.0 | ||
@@ -12,0 +12,0 @@ ## 2.7.0 |
import { DestinationOrFetchOptions } from '@sap-cloud-sdk/connectivity'; | ||
import { MailOptions, MailResponse } from './mail-client-types'; | ||
import { SocksProxy } from 'socks'; | ||
import { MailDestination, MailOptions, MailResponse } from './mail-client-types'; | ||
/** | ||
* @internal | ||
*/ | ||
export declare function buildSocksProxy(mailDestination: MailDestination): SocksProxy; | ||
/** | ||
* Sends e-mails to a target mail server defined in a given destination. | ||
@@ -5,0 +10,0 @@ * Builds a transport between the application and the mail server, sends mails sequentially by using the transport, then closes it. |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.sendMail = void 0; | ||
exports.sendMail = exports.buildSocksProxy = void 0; | ||
const connectivity_1 = require("@sap-cloud-sdk/connectivity"); | ||
@@ -51,19 +51,28 @@ const internal_1 = require("@sap-cloud-sdk/connectivity/internal"); | ||
} | ||
async function createSocket(mailDestination) { | ||
/** | ||
* @internal | ||
*/ | ||
function buildSocksProxy(mailDestination) { | ||
if (!mailDestination.proxyConfiguration) { | ||
throw Error('The proxy configuration is undefined, which is mandatory for creating a socket connection.'); | ||
} | ||
return { | ||
host: mailDestination.proxyConfiguration.host, | ||
port: mailDestination.proxyConfiguration.port, | ||
type: 5, | ||
// socks doc here: https://github.com/JoshGlazebrook/socks#socksclientoptions | ||
// see customAuthRequestHandler and customAuthResponseHandler for custom auth details. | ||
custom_auth_method: 0x80, | ||
custom_auth_request_handler: () => { | ||
var _a; | ||
return (0, socket_proxy_1.customAuthRequestHandler)((_a = mailDestination.proxyConfiguration) === null || _a === void 0 ? void 0 : _a['proxy-authentication']); | ||
}, | ||
custom_auth_response_size: 2, | ||
custom_auth_response_handler: socket_proxy_1.customAuthResponseHandler | ||
}; | ||
} | ||
exports.buildSocksProxy = buildSocksProxy; | ||
async function createSocket(mailDestination) { | ||
const connectionOptions = { | ||
proxy: { | ||
host: mailDestination.proxyConfiguration.host, | ||
port: mailDestination.proxyConfiguration.port, | ||
type: 5, | ||
custom_auth_method: 0x80, | ||
custom_auth_request_handler: () => { | ||
var _a; | ||
return (0, socket_proxy_1.customAuthRequestHandler)((_a = mailDestination.proxyConfiguration) === null || _a === void 0 ? void 0 : _a['proxy-authentication']); | ||
}, | ||
custom_auth_response_size: 2, | ||
custom_auth_response_handler: socket_proxy_1.customAuthResponseHandler | ||
}, | ||
proxy: buildSocksProxy(mailDestination), | ||
command: 'connect', | ||
@@ -70,0 +79,0 @@ destination: { |
{ | ||
"name": "@sap-cloud-sdk/mail-client", | ||
"version": "2.7.1-20220811075847.0", | ||
"version": "2.7.1-20220811094957.0", | ||
"description": "SAP Cloud SDK for JavaScript e-mail client", | ||
@@ -41,6 +41,6 @@ "homepage": "https://sap.github.io/cloud-sdk/docs/js/overview-cloud-sdk-for-javascript", | ||
"dependencies": { | ||
"@sap-cloud-sdk/connectivity": "^2.7.1-20220811075847.0", | ||
"@sap-cloud-sdk/util": "^2.7.1-20220811075847.0", | ||
"nodemailer": "^6.7.7", | ||
"socks": "^2.7.0" | ||
"@sap-cloud-sdk/connectivity": "^2.7.1-20220811094957.0", | ||
"@sap-cloud-sdk/util": "^2.7.1-20220811094957.0", | ||
"nodemailer": "6.7.7", | ||
"socks": "2.6.2" | ||
}, | ||
@@ -47,0 +47,0 @@ "devDependencies": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
38140
542
32
285
+ Addedarray-buffer-byte-length@1.0.1(transitive)
+ Addedarray.prototype.map@1.0.7(transitive)
+ Addeddata-view-buffer@1.0.1(transitive)
+ Addeddata-view-byte-length@1.0.1(transitive)
+ Addedes-abstract@1.23.6(transitive)
+ Addedfunction.prototype.name@1.1.7(transitive)
+ Addedip@1.1.9(transitive)
+ Addedis-negative-zero@2.0.3(transitive)
+ Addednodemailer@6.7.7(transitive)
+ Addedsocks@2.6.2(transitive)
- Removedarray-buffer-byte-length@1.0.2(transitive)
- Removedarray.prototype.map@1.0.8(transitive)
- Removeddata-view-buffer@1.0.2(transitive)
- Removeddata-view-byte-length@1.0.2(transitive)
- Removedes-abstract@1.23.7(transitive)
- Removedfunction.prototype.name@1.1.8(transitive)
- Removedip-address@9.0.5(transitive)
- Removedjsbn@1.1.0(transitive)
- Removednodemailer@6.9.16(transitive)
- Removedsocks@2.8.3(transitive)
- Removedsprintf-js@1.1.3(transitive)
Updatednodemailer@6.7.7
Updatedsocks@2.6.2