Skip to content

Commit 2a86e95

Browse files
author
Janny
committed
Merge pull request #2040 from strongloop/feature/add-promise-doc
Feature/add promise doc
2 parents 982b8ac + eb09681 commit 2a86e95

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

common/models/application.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,9 @@ module.exports = function(Application) {
108108
* @param {String} owner Owner's user ID.
109109
* @param {String} name Name of the application
110110
* @param {Object} options Other options
111-
* @param {Function} callback Callback function
111+
* @callback {Function} callback Callback function
112+
* @param {Error} err
113+
* @promise
112114
*/
113115
Application.register = function(owner, name, options, cb) {
114116
assert(owner, 'owner is required');
@@ -150,6 +152,7 @@ module.exports = function(Application) {
150152
* @param {Any} appId
151153
* @callback {Function} callback
152154
* @param {Error} err
155+
* @promise
153156
*/
154157
Application.resetKeys = function(appId, cb) {
155158
cb = cb || utils.createPromiseCallback();
@@ -176,7 +179,7 @@ module.exports = function(Application) {
176179
* - restApiKey
177180
* - windowsKey
178181
* - masterKey
179-
*
182+
* @promise
180183
*/
181184
Application.authenticate = function(appId, key, cb) {
182185
cb = cb || utils.createPromiseCallback();

common/models/user.js

+10
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ module.exports = function(User) {
7979
* @callback {Function} cb The callback function
8080
* @param {String|Error} err The error string or object
8181
* @param {AccessToken} token The generated access token object
82+
* @promise
8283
*/
8384
User.prototype.createAccessToken = function(ttl, options, cb) {
8485
if (cb === undefined && typeof options === 'function') {
@@ -169,6 +170,7 @@ module.exports = function(User) {
169170
* @callback {Function} callback Callback function
170171
* @param {Error} err Error object
171172
* @param {AccessToken} token Access token if login is successful
173+
* @promise
172174
*/
173175

174176
User.login = function(credentials, include, fn) {
@@ -281,6 +283,7 @@ module.exports = function(User) {
281283
* @param {String} accessTokenID
282284
* @callback {Function} callback
283285
* @param {Error} err
286+
* @promise
284287
*/
285288

286289
User.logout = function(tokenId, fn) {
@@ -304,6 +307,7 @@ module.exports = function(User) {
304307
* @callback {Function} callback Callback function
305308
* @param {Error} err Error object
306309
* @param {Boolean} isMatch Returns true if the given `password` matches record
310+
* @promise
307311
*/
308312

309313
User.prototype.hasPassword = function(plain, fn) {
@@ -350,6 +354,10 @@ module.exports = function(User) {
350354
* callback function. This function should NOT add the token to the user
351355
* object, instead simply execute the callback with the token! User saving
352356
* and email sending will be handled in the `verify()` method.
357+
* @callback {Function} fn Callback function.
358+
* @param {Error} err Error object.
359+
* @param {Object} object Contains email, token, uid.
360+
* @promise
353361
*/
354362

355363
User.prototype.verify = function(options, fn) {
@@ -463,6 +471,7 @@ module.exports = function(User) {
463471
* @param {String} redirect URL to redirect the user to once confirmed
464472
* @callback {Function} callback
465473
* @param {Error} err
474+
* @promise
466475
*/
467476
User.confirm = function(uid, token, redirect, fn) {
468477
fn = fn || utils.createPromiseCallback();
@@ -505,6 +514,7 @@ module.exports = function(User) {
505514
* @prop {String} email The user's email address
506515
* @callback {Function} callback
507516
* @param {Error} err
517+
* @promise
508518
*/
509519

510520
User.resetPassword = function(options, cb) {

lib/persisted-model.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -925,8 +925,10 @@ module.exports = function(registry) {
925925
* @callback {Function} [callback] Callback function called with `(err, conflicts)` arguments.
926926
* @param {Error} err Error object; see [Error object](http://docs.strongloop.com/display/LB/Error+object).
927927
* @param {Conflict[]} conflicts A list of changes that could not be replicated due to conflicts.
928-
* @param {Object] checkpoints The new checkpoints to use as the "since"
928+
* @param {Object} checkpoints The new checkpoints to use as the "since"
929929
* argument for the next replication.
930+
*
931+
* @promise
930932
*/
931933

932934
PersistedModel.replicate = function(since, targetModel, options, callback) {

0 commit comments

Comments
 (0)