backandsdk
Advanced tools
Comparing version 0.1.6 to 0.1.7
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ 'use strict'; |
@@ -0,0 +0,0 @@ //////////////////////////////////////////////////////////////////////////////////////////////////// |
@@ -174,20 +174,42 @@ /* | ||
}; | ||
BackandSdk.prototype.delete = function (uri, json) { | ||
var backand = this; | ||
var deferred = q.defer(); | ||
request( | ||
{ | ||
method: 'DELETE', | ||
url: backand.serverUrl + uri, | ||
json: json, | ||
headers: backand.getHeader() | ||
}, | ||
function (error, response, data) { | ||
data = backand.handleResponse(deferred, error, response, data) | ||
if (!data) { | ||
return false; | ||
} | ||
} | ||
); | ||
return deferred.promise; | ||
}; | ||
BackandSdk.prototype.formatErrorMessage = function(response, error) { | ||
var str = ""; | ||
if(response){ | ||
if(response.statusCode){ | ||
str += 'Status code: "' + response.statusCode + " "; | ||
} | ||
if(response.statusCode){ | ||
str += 'Status code: "' + response.statusCode + " "; | ||
} | ||
if(typeof response.body === 'object'){ | ||
str += JSON.stringify(response.body); | ||
}else { | ||
str += response.body; | ||
} | ||
str += " "; | ||
if(typeof response.body === 'object'){ | ||
str += JSON.stringify(response.body); | ||
}else { | ||
str += response.body; | ||
if(response.request && response.request.href) { | ||
str += ' requestUrl: ' + response.request.href; | ||
} | ||
} | ||
str += " "; | ||
if(response.request && response.request.href) { | ||
str += ' requestUrl: ' + response.request.href; | ||
} | ||
if(error) { | ||
@@ -194,0 +216,0 @@ str += error; |
@@ -0,0 +0,0 @@ /** |
{ | ||
"name": "backandsdk", | ||
"version": "0.1.6", | ||
"version": "0.1.7", | ||
"description": "Backand sdk for node.js", | ||
@@ -5,0 +5,0 @@ "author": "Ygal Bellaiche", |
@@ -0,0 +0,0 @@ # Node.Js sdk for [Backand](www.backand.com) |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
@@ -0,0 +0,0 @@ /** |
Sorry, the diff of this file is not supported yet
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
20054
592
3