node-salesforce-connection
Advanced tools
Comparing version 2.1.0 to 2.2.0
{ | ||
"name": "node-salesforce-connection", | ||
"version": "2.1.0", | ||
"version": "2.2.0", | ||
"description": "A minimal library for connecting to Salesforce from Node.js", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
"use strict"; | ||
let https = require("https"); | ||
let urlEncoder = require("./urlencoder"); | ||
let xmlParser = require("./xmlparser"); | ||
let xmlBuilder = require("./xmlbuilder"); | ||
let xml = require("./xml"); | ||
@@ -170,12 +169,12 @@ // See README.md for documentation. | ||
} | ||
let requestBody = xmlBuilder( | ||
"soapenv:Envelope", | ||
' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="' + wsdl.targetNamespace + '"', | ||
{ | ||
let requestBody = xml.stringify({ | ||
name: "soapenv:Envelope", | ||
attributes: ' xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="' + wsdl.targetNamespace + '"', | ||
value: { | ||
"soapenv:Header": Object.assign({}, sessionHeader, headers), | ||
"soapenv:Body": {[method]: args} | ||
} | ||
); | ||
}); | ||
return this._request(httpsOptions, requestBody).then(response => { | ||
let resBody = xmlParser(response.body.toString())["soapenv:Envelope"]["soapenv:Body"]; | ||
let resBody = xml.parse(response.body.toString()).value["soapenv:Body"]; | ||
if (response.statusCode == 200) { | ||
@@ -223,10 +222,6 @@ return resBody[method + "Response"].result; | ||
asArray(x) { | ||
if (!x) return []; | ||
if (x instanceof Array) return x; | ||
return [x]; | ||
} | ||
} | ||
SalesforceConnection.prototype.asArray = xml.asArray; | ||
module.exports = SalesforceConnection; |
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
37963
443
5
2