Comparing version 0.1.5 to 0.1.6
@@ -6,8 +6,10 @@ var _ = require('lodash'); | ||
function Clang(config) { | ||
var me = this; | ||
if (!(this instanceof Clang)) { | ||
if (!(me instanceof Clang)) { | ||
return new Clang(config); | ||
} | ||
this.config = _.clone(config || {}); | ||
this.api = null; | ||
me.config = _.clone(config || {}); | ||
me.config.version = me.config.version || '1.23'; //api version known to be working | ||
me.api = null; | ||
} | ||
@@ -21,3 +23,3 @@ | ||
soap.createClient('https://secure.myclang.com/app/api/soap/public/index.php?wsdl', function(err, result) { | ||
soap.createClient('https://secure.myclang.com/app/api/soap/public/index.php?wsdl&version=' + me.config.version, function(err, result) { | ||
if (err) { | ||
@@ -148,6 +150,7 @@ return callback(err); | ||
if (err) { | ||
if (err.message.match(/<faultcode>107<\/faultcode>/) && | ||
err.message.match(/customer already member of/) ) | ||
return callback(null, [{msg: true, warning: err.message}]); | ||
return callback(err); | ||
if (err.body && | ||
err.body.match(/<faultcode>107<\/faultcode>/) && | ||
err.body.match(/customer already member of/) ) | ||
return callback(null, [{msg: true, warning: err.body}]); | ||
return callback(err.body || err.message); | ||
} | ||
@@ -154,0 +157,0 @@ //Check for No SOAP Fault, but result code not 0 |
{ | ||
"name": "clang", | ||
"version": "0.1.5", | ||
"version": "0.1.6", | ||
"description": "Node.js api wrapper for Clang's SOAP api", | ||
@@ -5,0 +5,0 @@ "author": "Christiaan Westerbeek <chris@devotis.nl>", |
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
223570
6493