Comparing version
@@ -0,1 +1,7 @@ | ||
0.36.0 / 2021-01-13 | ||
=================== | ||
* [FIX] Extract required HttpClient functions to dedicated interface (#1132) | ||
* [FIX] pass *res* and *server* object into header() and method() (#1130) | ||
* [MAINTENANCE] refactor: use of Buffer.from instead of a deprecated new Buffer() (#1134) | ||
0.35.0 / 2020-11-17 | ||
@@ -2,0 +8,0 @@ =================== |
/// <reference types="node" /> | ||
import * as req from 'request'; | ||
import { IHeaders, IOptions } from './types'; | ||
export interface IExOptions { | ||
[key: string]: any; | ||
} | ||
import { IExOptions, IHeaders, IHttpClient, IOptions } from './types'; | ||
export interface IAttachment { | ||
@@ -21,3 +18,3 @@ name: string; | ||
*/ | ||
export declare class HttpClient { | ||
export declare class HttpClient implements IHttpClient { | ||
private _request; | ||
@@ -24,0 +21,0 @@ constructor(options?: IOptions); |
@@ -12,3 +12,3 @@ "use strict"; | ||
BasicAuthSecurity.prototype.addHeaders = function (headers) { | ||
headers.Authorization = 'Basic ' + new Buffer((this._username + ':' + this._password) || '').toString('base64'); | ||
headers.Authorization = 'Basic ' + Buffer.from((this._username + ':' + this._password) || '').toString('base64'); | ||
}; | ||
@@ -15,0 +15,0 @@ BasicAuthSecurity.prototype.toXML = function () { |
@@ -162,3 +162,3 @@ "use strict"; | ||
} | ||
this._process(xml, req, function (result, statusCode) { | ||
this._process(xml, req, res, function (result, statusCode) { | ||
_this_1._sendHttpResponse(res, statusCode, result); | ||
@@ -238,3 +238,3 @@ if (typeof _this_1.log === 'function') { | ||
}; | ||
Server.prototype._process = function (input, req, cb) { | ||
Server.prototype._process = function (input, req, res, cb) { | ||
var _this_1 = this; | ||
@@ -310,3 +310,3 @@ var pathname = url.parse(req.url).pathname.replace(/\/$/, ''); | ||
style: 'rpc' | ||
}, req, callback); | ||
}, req, res, callback); | ||
} | ||
@@ -329,3 +329,3 @@ else { | ||
style: 'document' | ||
}, req, callback, includeTimestamp); | ||
}, req, res, callback, includeTimestamp); | ||
} | ||
@@ -407,3 +407,3 @@ } | ||
}; | ||
Server.prototype._executeMethod = function (options, req, callback, includeTimestamp) { | ||
Server.prototype._executeMethod = function (options, req, res, callback, includeTimestamp) { | ||
var _this_1 = this; | ||
@@ -423,3 +423,3 @@ options = options || {}; | ||
if (typeof header === 'function') { | ||
return header(methodName, args, options.headers, req); | ||
return header(methodName, args, options.headers, req, res, _this_1); | ||
} | ||
@@ -487,3 +487,3 @@ else { | ||
}; | ||
var result = method(args, methodCallback, options.headers, req); | ||
var result = method(args, methodCallback, options.headers, req, res, this); | ||
if (typeof result !== 'undefined') { | ||
@@ -490,0 +490,0 @@ if (isPromiseLike(result)) { |
import * as req from 'request'; | ||
import { HttpClient } from './http'; | ||
export interface IHeaders { | ||
[k: string]: any; | ||
} | ||
export interface IExOptions { | ||
[key: string]: any; | ||
} | ||
export interface IHttpClient { | ||
request(rurl: string, data: any, callback: (error: any, res?: any, body?: any) => any, exheaders?: IHeaders, exoptions?: IExOptions, caller?: any): any; | ||
requestStream?(rurl: string, data: any, exheaders?: IHeaders, exoptions?: IExOptions, caller?: any): req.Request; | ||
} | ||
/** @deprecated use SoapMethod */ | ||
@@ -10,3 +16,3 @@ export declare type ISoapMethod = SoapMethod; | ||
export declare type SoapMethodAsync = (args: any, options?: any, extraHeaders?: any) => Promise<[any, any, any, any]>; | ||
export declare type ISoapServiceMethod = (args: any, callback?: (data: any) => void, headers?: any, req?: any) => any; | ||
export declare type ISoapServiceMethod = (args: any, callback?: (data: any) => void, headers?: any, req?: any, res?: any, sender?: any) => any; | ||
export interface ISoapFaultError { | ||
@@ -102,3 +108,3 @@ Fault: ISoapFault; | ||
/** provide your own http client that implements request(rurl, data, callback, exheaders, exoptions) */ | ||
httpClient?: HttpClient; | ||
httpClient?: IHttpClient; | ||
/** override the request module. */ | ||
@@ -105,0 +111,0 @@ request?: req.RequestAPI<req.Request, req.CoreOptions, req.RequiredUriUrl>; |
{ | ||
"name": "soap", | ||
"version": "0.35.0", | ||
"version": "0.36.0", | ||
"description": "A minimal node SOAP client", | ||
@@ -5,0 +5,0 @@ "engines": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
URL strings
Supply chain riskPackage contains fragments of external URLs or IP addresses, which the package may be accessing at runtime.
Found 1 instance in 1 package
449545
0.17%5676
0.05%