ellipsis-default-storage
Advanced tools
Comparing version 0.1.1 to 0.1.2
53
index.js
var request = require('request'); | ||
module.exports = function(context) { | ||
module.exports = { | ||
return { | ||
putItem: function (itemId, itemType, item, onSuccess, onError) { | ||
request. | ||
post({ | ||
url: context.db.putItemUrl, | ||
form: {itemId: itemId, itemType: itemType, teamId: context.teamId, item: item} | ||
}, function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
onSuccess(response, body); | ||
} else { | ||
onError(error); | ||
} | ||
putItem: function (itemId, itemType, item, onSuccess, onError, context) { | ||
request. | ||
post({ | ||
url: context.db.putItemUrl, | ||
form: {itemId: itemId, itemType: itemType, teamId: context.teamId, item: item} | ||
}, function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
onSuccess(response, body); | ||
} else { | ||
onError(error); | ||
} | ||
); | ||
}, | ||
} | ||
); | ||
}, | ||
getItem: function (itemId, itemType, onSuccess, onError) { | ||
request. | ||
get( | ||
context.db.getItemUrl + "/" + itemId + "/" + itemType + "/" + context.teamId, | ||
function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
onSuccess(response, body); | ||
} else { | ||
onError(error); | ||
} | ||
getItem: function (itemId, itemType, onSuccess, onError, context) { | ||
request. | ||
get( | ||
context.db.getItemUrl + "/" + itemId + "/" + itemType + "/" + context.teamId, | ||
function (error, response, body) { | ||
if (!error && response.statusCode == 200) { | ||
onSuccess(response, body); | ||
} else { | ||
onError(error); | ||
} | ||
); | ||
} | ||
} | ||
); | ||
} | ||
}; |
{ | ||
"name": "ellipsis-default-storage", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Interface to the default storage for Ellipsis behaviors", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
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
1413
30