nestjs-soap
Advanced tools
Comparing version 2.0.0 to 2.0.1
@@ -17,5 +17,3 @@ "use strict"; | ||
provide: clientName, | ||
useFactory: (soapService) => __awaiter(void 0, void 0, void 0, function* () { | ||
return yield soapService.createAsyncClient(); | ||
}), | ||
useFactory: (soapService) => __awaiter(void 0, void 0, void 0, function* () { return yield soapService.createAsyncClient(); }), | ||
inject: [soap_service_1.SoapService], | ||
@@ -22,0 +20,0 @@ }); |
@@ -33,13 +33,17 @@ "use strict"; | ||
createAsyncClient() { | ||
var _a; | ||
return __awaiter(this, void 0, void 0, function* () { | ||
const options = this.soapModuleOptions; | ||
const client = yield ((_a = soap_1.createClientAsync(options.uri, options.clientOptions)) === null || _a === void 0 ? void 0 : _a.catch((err) => { | ||
throw new common_1.ServiceUnavailableException(err); | ||
})); | ||
if (!options.auth) | ||
try { | ||
const client = yield soap_1.createClientAsync(options.uri, options.clientOptions); | ||
if (!options.auth) | ||
return client; | ||
const basicAuth = new soap_1.BasicAuthSecurity(options.auth.username, options.auth.password); | ||
client.setSecurity(basicAuth); | ||
return client; | ||
const basicAuth = new soap_1.BasicAuthSecurity(options.auth.username, options.auth.password); | ||
client.setSecurity(basicAuth); | ||
return client; | ||
} | ||
catch (err) { | ||
const logger = new common_1.Logger('SoapModule'); | ||
logger.error(`${err.message} \n - An error occurred while creating the soap client. Check the SOAP service URL and status.`); | ||
return null; | ||
} | ||
}); | ||
@@ -46,0 +50,0 @@ } |
{ | ||
"name": "nestjs-soap", | ||
"version": "2.0.0", | ||
"version": "2.0.1", | ||
"description": "Nestjs module wrapper for soap", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,2 +0,2 @@ | ||
<a href="https://www.npmjs.com/nestjs-soap" target="_blank"><img src="https://img.shields.io/npm/v/nestjs-soap.svg" alt="NPM Version" /></a> | ||
<a href="https://www.npmjs.com/nestjs-soap" target="_blank"><img src="https://img.shields.io/npm/v/nestjs-soap.svg?v2" alt="NPM Version" /></a> | ||
<a href="https://www.npmjs.com/nestjs-soap" target="_blank"><img src="https://img.shields.io/npm/l/nestjs-soap.svg" alt="Package License" /></a> | ||
@@ -146,3 +146,3 @@ <a href="https://www.npmjs.com/nestjs-soap" target="_blank"><img src="https://img.shields.io/npm/dm/nestjs-soap.svg" alt="NPM Downloads" /></a> | ||
`clientOptions`: The soap client options as in [soap repository](https://www.npmjs.com/package/soap#options) . | ||
`clientOptions`: The soap client options as in [soap repository](https://www.npmjs.com/package/soap#options). | ||
@@ -149,0 +149,0 @@ ### SoapModuleAsyncOptions |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24425
251
0