nodejitsu-api
Advanced tools
Comparing version 0.2.2 to 0.2.3
@@ -29,3 +29,4 @@ /* | ||
// | ||
Apps.prototype.list = function (username, callback) { | ||
Apps.prototype.list = function (callback) { | ||
var username = this.options.get('username'); | ||
this.request('GET', ['apps', username], callback, function (res, result) { | ||
@@ -50,9 +51,10 @@ callback(null, result.apps || res.statusCode); | ||
// | ||
// ### function view (name, callback) | ||
// #### @name {string} Name of the application to view | ||
// ### function view (appName, callback) | ||
// #### @appName {string} Name of the application to view | ||
// #### @callback {function} Continuation to pass control to when complete | ||
// Views the application specified by `name`. | ||
// | ||
Apps.prototype.view = function (name, callback) { | ||
this.request('GET', ['apps', name], callback, function (res, result) { | ||
Apps.prototype.view = function (appName, callback) { | ||
var username = this.options.get('username'); | ||
this.request('GET', ['apps', username, appName], callback, function (res, result) { | ||
callback(null, result.app || res.statusCode); | ||
@@ -64,3 +66,3 @@ }) | ||
// ### function update (name, attrs, callback) | ||
// #### @name {string} Name of the application to update | ||
// #### @appName {string} Name of the application to update | ||
// #### @attrs {Object} Attributes to update for this application. | ||
@@ -70,4 +72,5 @@ // #### @callback {function} Continuation to pass control to when complete | ||
// | ||
Apps.prototype.update = function (name, attrs, callback) { | ||
this.request('PUT', ['apps', name], attrs, callback, function (res, result) { | ||
Apps.prototype.update = function (appName, attrs, callback) { | ||
var username = this.options.get('username'); | ||
this.request('PUT', ['apps', username, appName], attrs, callback, function (res, result) { | ||
callback(null, result || res.statusCode); | ||
@@ -78,9 +81,10 @@ }); | ||
// | ||
// ### function destroy (name, callback) | ||
// #### @name {string} Name of the application to destroy | ||
// ### function destroy (appName, callback) | ||
// #### @appName {string} Name of the application to destroy | ||
// #### @callback {function} Continuation to pass control to when complete | ||
// Destroys the application with `name` for the authenticated user. | ||
// | ||
Apps.prototype.destroy = function (name, callback) { | ||
this.request('DELETE', ['apps', name], callback, function (res, result) { | ||
Apps.prototype.destroy = function (appName, callback) { | ||
var username = this.options.get('username'); | ||
this.request('DELETE', ['apps', username, appName], callback, function (res, result) { | ||
callback(null, result || res.statusCode); | ||
@@ -91,9 +95,10 @@ }) | ||
// | ||
// ### function start (name, callback) | ||
// #### @name {string} Name of the application to start | ||
// ### function start (appName, callback) | ||
// #### @appName {string} Name of the application to start | ||
// #### @callback {function} Continuation to pass control to when complete | ||
// Starts the application with `name` for the authenticated user. | ||
// | ||
Apps.prototype.start = function (name, callback) { | ||
this.request('POST', ['apps', name, 'start'], callback, function (res, result) { | ||
Apps.prototype.start = function (appName, callback) { | ||
var username = this.options.get('username'); | ||
this.request('POST', ['apps', username, appName, 'start'], callback, function (res, result) { | ||
callback(null, result || res.statusCode); | ||
@@ -104,9 +109,10 @@ }); | ||
// | ||
// ### function restart (name, callback) | ||
// #### @name {string} Name of the application to start | ||
// ### function restart (appName, callback) | ||
// #### @appName {string} Name of the application to start | ||
// #### @callback {function} Continuation to pass control to when complete | ||
// Starts the application with `name` for the authenticated user. | ||
// | ||
Apps.prototype.restart = function (name, callback) { | ||
this.request('POST', ['apps', name, 'restart'], callback, function (res, result) { | ||
Apps.prototype.restart = function (appName, callback) { | ||
var username = this.options.get('username'); | ||
this.request('POST', ['apps', username, appName, 'restart'], callback, function (res, result) { | ||
callback(null, result || res.statusCode); | ||
@@ -117,9 +123,10 @@ }); | ||
// | ||
// ### function stop (name, callback) | ||
// #### @name {string} Name of the application to stop. | ||
// ### function stop (appName, callback) | ||
// #### @appName {string} Name of the application to stop. | ||
// #### @callback {function} Continuation to pass control to when complete | ||
// Stops the application with `name` for the authenticated user. | ||
// | ||
Apps.prototype.stop = function (name, callback) { | ||
this.request('POST', ['apps', name, 'stop'], callback, function (res, result) { | ||
Apps.prototype.stop = function (appName, callback) { | ||
var username = this.options.get('username'); | ||
this.request('POST', ['apps', username, appName, 'stop'], callback, function (res, result) { | ||
callback(null, result || res.statusCode); | ||
@@ -126,0 +133,0 @@ }); |
@@ -25,4 +25,4 @@ /* | ||
// | ||
// ### function byApp (appId, amount, callback) | ||
// #### @appId {string} the name of the application to retrieve | ||
// ### function byApp (appName, amount, callback) | ||
// #### @appName {string} Name of the application to retrieve | ||
// #### @amount {number} the number of lines to retrieve | ||
@@ -32,3 +32,4 @@ // #### @callback {function} Continuation to pass control to when complete. | ||
// | ||
Logs.prototype.byApp = function (name, amount, callback) { | ||
Logs.prototype.byApp = function (appName, amount, callback) { | ||
var username = this.options.get('username'); | ||
var options = { | ||
@@ -40,3 +41,3 @@ from: 'NOW-1DAY', | ||
this.request('POST', ['logs', name], options, callback, function (res, result) { | ||
this.request('POST', ['logs', username, appName], options, callback, function (res, result) { | ||
callback(null, result); | ||
@@ -52,3 +53,4 @@ }); | ||
// | ||
Logs.prototype.byUser = function (username, amount, callback) { | ||
Logs.prototype.byUser = function (amount, callback) { | ||
var username = this.options.get('username'); | ||
var options = { | ||
@@ -55,0 +57,0 @@ from: 'NOW-1DAY', |
@@ -25,10 +25,10 @@ /* | ||
// | ||
// ### function list (name, callback) | ||
// #### @name {string} Name of the application to list snapshots for. | ||
// ### function list (appName, callback) | ||
// #### @appName {string} Name of the application to list snapshots for. | ||
// #### @callback {function} Continuation to pass control to when complete | ||
// Lists all applications for the authenticated user | ||
// | ||
Snapshots.prototype.list = function (name, callback) { | ||
Snapshots.prototype.list = function (appName, callback) { | ||
var username = this.options.get('username'); | ||
this.request('GET', ['apps', username, name, 'snapshots'], callback, function (res, result) { | ||
this.request('GET', ['apps', username, appName, 'snapshots'], callback, function (res, result) { | ||
callback(null, result.snapshots); | ||
@@ -39,3 +39,3 @@ }); | ||
// | ||
// ### function create (name, snapshot, callback) | ||
// ### function create (appName, snapshotName, filename, callback) | ||
// #### @appName {string} Name of the application to create a snapshot for. | ||
@@ -49,4 +49,4 @@ // #### @snapshotName {string} Snapshot name | ||
Snapshots.prototype.create = function (appName, snapshotName, filename, callback) { | ||
var username = this.options.get('username'); | ||
var url = ['apps', username, appName, 'snapshots', snapshotName]; | ||
var username = this.options.get('username'), | ||
url = ['apps', username, appName, 'snapshots', snapshotName]; | ||
@@ -59,4 +59,5 @@ this.upload(url, 'application/octet-stream', filename, callback, function (res, body) { | ||
// | ||
// ### function create (name, snapshot, callback) | ||
// #### @name {string} Name of the application to destroy a snapshot for. | ||
// ### function create (appName, snapshotName, callback) | ||
// #### @appName {string} Name of the application to destroy a snapshot for. | ||
// #### @snapshotName {string} Name of the snapshot to destroy. | ||
// #### @callback {function} Continuation to pass control to when complete | ||
@@ -76,5 +77,5 @@ // Destroys a snapshot for the application with `app.name = name` and | ||
// | ||
// ### function activate (name, snapshot, callback) | ||
// #### @name {string} Name of the application to activate a snapshot for. | ||
// #### @snapshot {string} Name of the snapshot to activate. | ||
// ### function activate (appName, snapshotName, callback) | ||
// #### @appName {string} Name of the application to activate a snapshot for. | ||
// #### @snapshotName {string} Name of the snapshot to activate. | ||
// #### @callback {function} Continuation to pass control to when complete | ||
@@ -81,0 +82,0 @@ // Activates a snapshot for the application with `app.name = name` and |
@@ -60,9 +60,8 @@ /* | ||
// | ||
// ### function view (username, callback) | ||
// #### @username {string} Username to view data for. | ||
// ### function view (callback) | ||
// #### @callback {function} Continuation to pass control to when complete. | ||
// Retrieves data for the specified user. | ||
// | ||
Users.prototype.view = function (username, callback) { | ||
this.request('GET', ['users', username], callback, function (res, result) { | ||
Users.prototype.view = function (callback) { | ||
this.request('GET', ['users', this.options.get('username')], callback, function (res, result) { | ||
callback(null, result); | ||
@@ -73,3 +72,3 @@ }); | ||
// | ||
// ### function create (user, callback) | ||
// ### function confirm (user, callback) | ||
// #### @user {Object} Properties for the user to confirm. | ||
@@ -90,5 +89,10 @@ // #### @callback {function} Continuation to pass control to when complete | ||
// #### @callback {function} Continuation to pass control to when complete | ||
// request an password reset email. | ||
// Request an password reset email. | ||
// | ||
Users.prototype.forgot = function (username, params, callback) { | ||
if (!callback && typeof params == 'function') { | ||
callback = params; | ||
params = {}; | ||
} | ||
this.request('POST', ['users', username, 'forgot'], params, callback, function (res, result) { | ||
@@ -99,6 +103,12 @@ return callback(null, result); | ||
Users.prototype.update = function (username, object, callback) { | ||
this.request('PUT', ['users', username], object, callback, function (res, result) { | ||
// | ||
// ### function update (object, callback) | ||
// #### @object {Object} Updated information about user | ||
// #### @callback {function} Continuation to pass control to when complete | ||
// Update user account information. | ||
// | ||
Users.prototype.update = function (object, callback) { | ||
this.request('PUT', ['users', this.options.get('username')], object, callback, function (res, result) { | ||
callback(null, result); | ||
}); | ||
} |
{ | ||
"name": "nodejitsu-api", | ||
"version": "0.2.2", | ||
"version": "0.2.3", | ||
"description": "nodejitsu API client wrapper", | ||
@@ -5,0 +5,0 @@ "homepage": "http://github.com/nodejitsu/nodejitsu-api", |
@@ -17,3 +17,3 @@ # nodejitsu-api/node.js | ||
client.apps.list('marak', function(err, result){ | ||
client.apps.list(function(err, result){ | ||
if (err) { | ||
@@ -79,2 +79,3 @@ console.log(err); | ||
* `apps.stop` | ||
* `apps.destroy` | ||
* **client.databases**: Manage your databases. Methods include: | ||
@@ -97,5 +98,8 @@ * `databases.create` | ||
* `users.forgot` | ||
* `users.update` | ||
and many more... | ||
## License | ||
MIT. |
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
27184
702
103
0