diff --git a/.gitignore b/.gitignore
index 6cadcfc65..b07d5b3c7 100644
--- a/.gitignore
+++ b/.gitignore
@@ -9,4 +9,5 @@ integration/test_logs
.DS_Store
.idea/
integration/test_logs
+out/
diff --git a/.travis.yml b/.travis.yml
index 28561741c..fc6cec052 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,7 +1,7 @@
---
language: node_js
node_js:
-- '5'
+- '6.11.4'
branches:
only:
diff --git a/jsdoc-conf.json b/jsdoc-conf.json
new file mode 100644
index 000000000..b6ad74174
--- /dev/null
+++ b/jsdoc-conf.json
@@ -0,0 +1,20 @@
+{
+ "plugins": ["node_modules/jsdoc-babel"],
+ "babel": {
+ "plugins": ["transform-flow-strip-types"]
+ },
+ "source": {
+ "include": ["./package.json", "./README.md"],
+ "excludePattern": "(^|\\/|\\\\)_"
+ },
+ "templates": {
+ "default": {
+ "outputSourceFiles": false
+ },
+ "cleverLinks": false,
+ "monospaceLinks": false
+ },
+ "opts": {
+ "recurse": true
+ }
+}
\ No newline at end of file
diff --git a/package.json b/package.json
index b83f6e76c..a1c5b5c81 100644
--- a/package.json
+++ b/package.json
@@ -53,12 +53,15 @@
"gulp-uglify": "^2.1.2",
"jasmine-reporters": "~2.2.1",
"jest-cli": "^19.0.2",
+ "jsdoc": "^3.5.5",
+ "jsdoc-babel": "^0.3.0",
"vinyl-source-stream": "^1.1.0"
},
"scripts": {
"build": "./build_releases.sh",
"release": "./build_releases.sh && npm publish",
- "test": "PARSE_BUILD=node jest"
+ "test": "PARSE_BUILD=node jest",
+ "docs": "jsdoc -c ./jsdoc-conf.json ./src"
},
"jest": {
"automock": true,
diff --git a/src/Analytics.js b/src/Analytics.js
index f3a21e40a..ed7d04d39 100644
--- a/src/Analytics.js
+++ b/src/Analytics.js
@@ -19,6 +19,7 @@ import type ParsePromise from './ParsePromise';
*
* @class Parse.Analytics
* @static
+ * @hideconstructor
*/
/**
@@ -44,6 +45,7 @@ import type ParsePromise from './ParsePromise';
* There is a default limit of 8 dimensions per event tracked.
*
* @method track
+ * @name Parse.Analytics.track
* @param {String} name The name of the custom event to report to Parse as
* having happened.
* @param {Object} dimensions The dictionary of information by which to
diff --git a/src/Cloud.js b/src/Cloud.js
index f2dc1ffd5..74c91fa4c 100644
--- a/src/Cloud.js
+++ b/src/Cloud.js
@@ -24,11 +24,13 @@ import ParsePromise from './ParsePromise';
*
* @class Parse.Cloud
* @static
+ * @hideconstructor
*/
/**
* Makes a call to a cloud function.
* @method run
+ * @name Parse.Cloud.run
* @param {String} name The function name.
* @param {Object} data The parameters to send to the cloud function.
* @param {Object} options A Backbone-style options object
diff --git a/src/CoreManager.js b/src/CoreManager.js
index 8dac29644..020a9b8ae 100644
--- a/src/CoreManager.js
+++ b/src/CoreManager.js
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2015-present, Parse, LLC.
* All rights reserved.
*
diff --git a/src/FacebookUtils.js b/src/FacebookUtils.js
index 0fb3ce4ab..090650834 100644
--- a/src/FacebookUtils.js
+++ b/src/FacebookUtils.js
@@ -93,6 +93,7 @@ var provider = {
* Provides a set of utilities for using Parse with Facebook.
* @class Parse.FacebookUtils
* @static
+ * @hideconstructor
*/
var FacebookUtils = {
/**
@@ -105,6 +106,7 @@ var FacebookUtils = {
* with these arguments.
*
* @method init
+ * @name Parse.FacebookUtils.init
* @param {Object} options Facebook options argument as described here:
*
@@ -141,6 +143,7 @@ var FacebookUtils = {
* Gets whether the user has their account linked to Facebook.
*
* @method isLinked
+ * @name Parse.FacebookUtils.isLinked
* @param {Parse.User} user User to check for a facebook link.
* The user must be logged in on this device.
* @return {Boolean} true if the user has their account
@@ -156,13 +159,15 @@ var FacebookUtils = {
* creates, in the case where it is a new user) a Parse.User.
*
* @method logIn
- * @param {String, Object} permissions The permissions required for Facebook
+ * @name Parse.FacebookUtils.logIn
+ * @param {(String|Object)} permissions The permissions required for Facebook
* log in. This is a comma-separated string of permissions.
* Alternatively, supply a Facebook authData object as described in our
* REST API docs if you want to handle getting facebook auth tokens
* yourself.
* @param {Object} options Standard options object with success and error
* callbacks.
+ * @returns {Parse.Promise}
*/
logIn(permissions, options) {
if (!permissions || typeof permissions === 'string') {
@@ -191,15 +196,17 @@ var FacebookUtils = {
* the account to the Parse.User.
*
* @method link
+ * @name Parse.FacebookUtils.link
* @param {Parse.User} user User to link to Facebook. This must be the
* current user.
- * @param {String, Object} permissions The permissions required for Facebook
+ * @param {(String|Object)} permissions The permissions required for Facebook
* log in. This is a comma-separated string of permissions.
* Alternatively, supply a Facebook authData object as described in our
* REST API docs if you want to handle getting facebook auth tokens
* yourself.
* @param {Object} options Standard options object with success and error
* callbacks.
+ * @returns {Parse.Promise}
*/
link(user, permissions, options) {
if (!permissions || typeof permissions === 'string') {
@@ -226,10 +233,12 @@ var FacebookUtils = {
* Unlinks the Parse.User from a Facebook account.
*
* @method unlink
+ * @name Parse.FacebookUtils.unlink
* @param {Parse.User} user User to unlink from Facebook. This must be the
* current user.
* @param {Object} options Standard options object with success and error
* callbacks.
+ * @returns {Parse.Promise}
*/
unlink: function(user, options) {
if (!initialized) {
diff --git a/src/LiveQueryClient.js b/src/LiveQueryClient.js
index e6a43a273..292f03c37 100644
--- a/src/LiveQueryClient.js
+++ b/src/LiveQueryClient.js
@@ -78,16 +78,6 @@ let generateInterval = (k) => {
*
* javascriptKey and masterKey are used for verifying the LiveQueryClient when it tries
* to connect to the LiveQuery server
- *
- * @class Parse.LiveQueryClient
- * @constructor
- * @param {Object} options
- * @param {string} options.applicationId - applicationId of your Parse app
- * @param {string} options.serverURL - the URL of your LiveQuery server
- * @param {string} options.javascriptKey (optional)
- * @param {string} options.masterKey (optional) Your Parse Master Key. (Node.js only!)
- * @param {string} options.sessionToken (optional)
- *
*
* We expose three events to help you monitor the status of the LiveQueryClient.
*
@@ -119,10 +109,9 @@ let generateInterval = (k) => {
* client.on('error', (error) => {
*
* });
- *
- *
+ * @alias Parse.LiveQueryClient
*/
-export default class LiveQueryClient extends EventEmitter {
+class LiveQueryClient extends EventEmitter {
attempts: number;
id: number;
requestId: number;
@@ -136,6 +125,14 @@ export default class LiveQueryClient extends EventEmitter {
socket: any;
state: string;
+ /**
+ * @param {Object} options
+ * @param {string} options.applicationId - applicationId of your Parse app
+ * @param {string} options.serverURL - the URL of your LiveQuery server
+ * @param {string} options.javascriptKey (optional)
+ * @param {string} options.masterKey (optional) Your Parse Master Key. (Node.js only!)
+ * @param {string} options.sessionToken (optional)
+ */
constructor({
applicationId,
serverURL,
@@ -177,7 +174,6 @@ export default class LiveQueryClient extends EventEmitter {
* here for more details. The subscription you get is the same subscription you get
* from our Standard API.
*
- * @method subscribe
* @param {Object} query - the ParseQuery you want to subscribe to
* @param {string} sessionToken (optional)
* @return {Object} subscription
@@ -218,7 +214,6 @@ export default class LiveQueryClient extends EventEmitter {
/**
* After calling unsubscribe you'll stop receiving events from the subscription object.
*
- * @method unsubscribe
* @param {Object} subscription - subscription you would like to unsubscribe from.
*/
unsubscribe(subscription: Object) {
@@ -240,7 +235,6 @@ export default class LiveQueryClient extends EventEmitter {
* After open is called, the LiveQueryClient will try to send a connect request
* to the LiveQuery server.
*
- * @method open
*/
open() {
let WebSocketImplementation = this._getWebSocketImplementation();
@@ -303,7 +297,6 @@ export default class LiveQueryClient extends EventEmitter {
* This method will close the WebSocket connection to this LiveQueryClient,
* cancel the auto reconnect and unsubscribe all subscriptions based on it.
*
- * @method close
*/
close() {
if (this.state === CLIENT_STATE.INITIALIZED || this.state === CLIENT_STATE.DISCONNECTED) {
@@ -448,3 +441,5 @@ export default class LiveQueryClient extends EventEmitter {
}).bind(this), time);
}
}
+
+export default LiveQueryClient;
diff --git a/src/LiveQuerySubscription.js b/src/LiveQuerySubscription.js
index 1df90182e..71850926f 100644
--- a/src/LiveQuerySubscription.js
+++ b/src/LiveQuerySubscription.js
@@ -1,4 +1,4 @@
-/**
+/*
* Copyright (c) 2015-present, Parse, LLC.
* All rights reserved.
*
@@ -16,10 +16,6 @@ import CoreManager from './CoreManager';
* Extends events.EventEmitter
* cloud functions.
*
- * @constructor
- * @param {string} id - subscription id
- * @param {string} query - query to subscribe to
- * @param {string} sessionToken - optional session token
*
*
Open Event - When you call query.subscribe(), we send a subscribe request to * the LiveQuery server, when we get the confirmation from the LiveQuery server, @@ -88,9 +84,14 @@ import CoreManager from './CoreManager'; * * });
* - * + * @alias Parse.LiveQuerySubscription */ -export default class Subscription extends EventEmitter { +class Subscription extends EventEmitter { + /* + * @param {string} id - subscription id + * @param {string} query - query to subscribe to + * @param {string} sessionToken - optional session token + */ constructor(id, query, sessionToken) { super(); this.id = id; @@ -99,7 +100,7 @@ export default class Subscription extends EventEmitter { } /** - * @method unsubscribe + * closes the subscription */ unsubscribe() { let _this = this; @@ -110,3 +111,5 @@ export default class Subscription extends EventEmitter { }); } } + +export default Subscription; diff --git a/src/Parse.js b/src/Parse.js index 872f4ae19..d5bfb809e 100644 --- a/src/Parse.js +++ b/src/Parse.js @@ -16,14 +16,15 @@ import RESTController from './RESTController'; /** * Contains all Parse API classes and functions. - * @class Parse * @static + * @global + * @class + * @hideconstructor */ var Parse = { /** * Call this method first to set up your authentication tokens for Parse. * You can get your keys from the Data Browser on parse.com. - * @method initialize * @param {String} applicationId Your Parse Application ID. * @param {String} javaScriptKey (optional) Your Parse JavaScript Key (Not needed for parse-server) * @param {String} masterKey (optional) Your Parse Master Key. (Node.js only!) @@ -48,6 +49,11 @@ var Parse = { }; /** These legacy setters may eventually be deprecated **/ +/** + * @member Parse.applicationId + * @type string + * @static + */ Object.defineProperty(Parse, 'applicationId', { get() { return CoreManager.get('APPLICATION_ID'); @@ -56,6 +62,12 @@ Object.defineProperty(Parse, 'applicationId', { CoreManager.set('APPLICATION_ID', value); } }); + +/** + * @member Parse.javaScriptKey + * @type string + * @static + */ Object.defineProperty(Parse, 'javaScriptKey', { get() { return CoreManager.get('JAVASCRIPT_KEY'); @@ -64,6 +76,12 @@ Object.defineProperty(Parse, 'javaScriptKey', { CoreManager.set('JAVASCRIPT_KEY', value); } }); + +/** + * @member Parse.masterKey + * @type string + * @static + */ Object.defineProperty(Parse, 'masterKey', { get() { return CoreManager.get('MASTER_KEY'); @@ -72,6 +90,12 @@ Object.defineProperty(Parse, 'masterKey', { CoreManager.set('MASTER_KEY', value); } }); + +/** + * @member Parse.serverURL + * @type string + * @static + */ Object.defineProperty(Parse, 'serverURL', { get() { return CoreManager.get('SERVER_URL'); @@ -80,6 +104,11 @@ Object.defineProperty(Parse, 'serverURL', { CoreManager.set('SERVER_URL', value); } }); +/** + * @member Parse.liveQueryServerURL + * @type string + * @static + */ Object.defineProperty(Parse, 'liveQueryServerURL', { get() { return CoreManager.get('LIVEQUERY_SERVER_URL'); @@ -88,7 +117,7 @@ Object.defineProperty(Parse, 'liveQueryServerURL', { CoreManager.set('LIVEQUERY_SERVER_URL', value); } }); -/** End setters **/ +/* End setters */ Parse.ACL = require('./ParseACL').default; Parse.Analytics = require('./Analytics'); diff --git a/src/ParseACL.js b/src/ParseACL.js index ba944a6f6..4b63edbc3 100644 --- a/src/ParseACL.js +++ b/src/ParseACL.js @@ -24,16 +24,18 @@ var PUBLIC_KEY = '*'; * permission for only that user. * If the argument is any other JSON object, that object will be interpretted * as a serialized ACL created with toJSON(). - * @class Parse.ACL - * @constructor - * + * *An ACL, or Access Control List can be added to any
* Parse.Object to restrict access to only a subset of users
* of your application.
Parse.Error.
- * @param {String} message A detailed description of the error.
+ * @alias Parse.Error
*/
-export default class ParseError {
+class ParseError {
+ /**
+ * @param {Number} code An error code constant from Parse.Error.
+ * @param {String} message A detailed description of the error.
+ */
constructor(code, message) {
this.code = code;
this.message = message;
@@ -493,3 +494,5 @@ ParseError.FILE_READ_ERROR = 601;
* @final
*/
ParseError.X_DOMAIN_REQUEST = 602;
+
+export default ParseError;
diff --git a/src/ParseFile.js b/src/ParseFile.js
index 8e179e638..06f71d8d8 100644
--- a/src/ParseFile.js
+++ b/src/ParseFile.js
@@ -49,39 +49,40 @@ function b64Digit(number: number): string {
/**
* A Parse.File is a local representation of a file that is saved to the Parse
* cloud.
- * @class Parse.File
- * @constructor
- * @param name {String} The file's name. This will be prefixed by a unique
- * value once the file has finished saving. The file name must begin with
- * an alphanumeric character, and consist of alphanumeric characters,
- * periods, spaces, underscores, or dashes.
- * @param data {Array} The data for the file, as either:
- * 1. an Array of byte value Numbers, or
- * 2. an Object like { base64: "..." } with a base64-encoded String.
- * 3. a File object selected with a file upload control. (3) only works
- * in Firefox 3.6+, Safari 6.0.2+, Chrome 7+, and IE 10+.
- * For example:
- * var fileUploadControl = $("#profilePhotoFileUpload")[0];
- * if (fileUploadControl.files.length > 0) {
- * var file = fileUploadControl.files[0];
- * var name = "photo.jpg";
- * var parseFile = new Parse.File(name, file);
- * parseFile.save().then(function() {
- * // The file has been saved to Parse.
- * }, function(error) {
- * // The file either could not be read, or could not be saved to Parse.
- * });
- * }
- * @param type {String} Optional Content-Type header to use for the file. If
- * this is omitted, the content type will be inferred from the name's
- * extension.
+ * @alias Parse.File
*/
-export default class ParseFile {
+class ParseFile {
_name: string;
_url: ?string;
_source: FileSource;
_previousSave: ?ParsePromise;
+ /**
+ * @param name {String} The file's name. This will be prefixed by a unique
+ * value once the file has finished saving. The file name must begin with
+ * an alphanumeric character, and consist of alphanumeric characters,
+ * periods, spaces, underscores, or dashes.
+ * @param data {Array} The data for the file, as either:
+ * 1. an Array of byte value Numbers, or
+ * 2. an Object like { base64: "..." } with a base64-encoded String.
+ * 3. a File object selected with a file upload control. (3) only works
+ * in Firefox 3.6+, Safari 6.0.2+, Chrome 7+, and IE 10+.
+ * For example:
+ * var fileUploadControl = $("#profilePhotoFileUpload")[0];
+ * if (fileUploadControl.files.length > 0) {
+ * var file = fileUploadControl.files[0];
+ * var name = "photo.jpg";
+ * var parseFile = new Parse.File(name, file);
+ * parseFile.save().then(function() {
+ * // The file has been saved to Parse.
+ * }, function(error) {
+ * // The file either could not be read, or could not be saved to Parse.
+ * });
+ * }
+ * @param type {String} Optional Content-Type header to use for the file. If
+ * this is omitted, the content type will be inferred from the name's
+ * extension.
+ */
constructor(name: string, data?: FileData, type?: string) {
var specifiedType = type || '';
@@ -129,7 +130,6 @@ export default class ParseFile {
* Gets the name of the file. Before save is called, this is the filename
* given by the user. After save is called, that name gets prefixed with a
* unique identifier.
- * @method name
* @return {String}
*/
name(): string {
@@ -139,7 +139,6 @@ export default class ParseFile {
/**
* Gets the url of the file. It is only available after you save the file or
* after you get the file from a Parse.Object.
- * @method url
* @param {Object} options An object to specify url options
* @return {String}
*/
@@ -157,7 +156,6 @@ export default class ParseFile {
/**
* Saves the file to the Parse cloud.
- * @method save
* @param {Object} options A Backbone-style options object.
* @return {Parse.Promise} Promise that is resolved when the save finishes.
*/
@@ -272,3 +270,5 @@ var DefaultController = {
};
CoreManager.setFileController(DefaultController);
+
+export default ParseFile;
diff --git a/src/ParseGeoPoint.js b/src/ParseGeoPoint.js
index c531f2bf9..433c0d287 100644
--- a/src/ParseGeoPoint.js
+++ b/src/ParseGeoPoint.js
@@ -20,9 +20,6 @@ import ParsePromise from './ParsePromise';
* new GeoPoint({latitude: 30, longitude: 30})
* new GeoPoint() // defaults to (0, 0)
*
- * @class Parse.GeoPoint
- * @constructor
- *
* Represents a latitude / longitude point that may be associated * with a key in a ParseObject or used as a reference point for geo queries. * This allows proximity-based queries on the key.
@@ -34,11 +31,16 @@ import ParsePromise from './ParsePromise'; * var object = new Parse.Object("PlaceObject"); * object.set("location", point); * object.save(); + * @alias Parse.GeoPoint */ -export default class ParseGeoPoint { +class ParseGeoPoint { _latitude: number; _longitude: number; + /** + * @param {(Number[]|Object|Number)} options Either a list of coordinate pairs, an object with `latitude`, `longitude`, or the latitude or the point. + * @param {Number} longitude The longitude of the GeoPoint + */ constructor( arg1: ArrayYou won't normally call this method directly. It is recommended that
- * you use a subclass of Parse.Object instead, created by calling
- * extend.
However, if you don't want to use a subclass, or aren't sure which - * subclass is appropriate, you can use this form:
- * var object = new Parse.Object("ClassName");
- *
- * That is basically equivalent to:
- * var MyClass = Parse.Object.extend("ClassName");
- * var object = new MyClass();
- *
- *
- * @class Parse.Object
- * @constructor
- * @param {String} className The class name for the object
- * @param {Object} attributes The initial set of data to store in the object.
- * @param {Object} options The options for this object instance.
+ *
+ * You won't normally call this method directly. It is recommended that
+ * you use a subclass of Parse.Object instead, created by calling
+ * extend.
However, if you don't want to use a subclass, or aren't sure which + * subclass is appropriate, you can use this form:
+ * var object = new Parse.Object("ClassName");
+ *
+ * That is basically equivalent to:
+ * var MyClass = Parse.Object.extend("ClassName");
+ * var object = new MyClass();
+ *
+ *
+ * @alias Parse.Object
*/
-export default class ParseObject {
+class ParseObject {
/**
- * The ID of this object, unique within its class.
- * @property id
- * @type String
+ * @param {String} className The class name for the object
+ * @param {Object} attributes The initial set of data to store in the object.
+ * @param {Object} options The options for this object instance.
*/
- id: ?string;
- _localId: ?string;
- _objCount: number;
- className: string;
-
constructor(className: ?string | { className: string, [attr: string]: mixed }, attributes?: { [attr: string]: mixed }, options?: { ignoreValidation: boolean }) {
// Enable legacy initializers
if (typeof this.initialize === 'function') {
@@ -143,6 +134,16 @@ export default class ParseObject {
}
}
+ /**
+ * The ID of this object, unique within its class.
+ * @property id
+ * @type String
+ */
+ id: ?string;
+ _localId: ?string;
+ _objCount: number;
+ className: string;
+
/** Prototype getters / setters **/
get attributes(): AttributeMap {
@@ -407,7 +408,6 @@ export default class ParseObject {
/**
* Returns a JSON version of the object suitable for saving to Parse.
- * @method toJSON
* @return {Object}
*/
toJSON(seen: Arraytrue if the attribute contains a value that is not
* null or undefined.
- * @method has
* @param {String} attr The string name of the attribute.
* @return {Boolean}
*/
@@ -603,7 +597,6 @@ export default class ParseObject {
*
* game.set("finished", true);
*
- * @method set
* @param {String} key The key to set.
* @param {} value The value to give it.
* @param {Object} options A set of options for the set.
@@ -697,7 +690,6 @@ export default class ParseObject {
/**
* Remove an attribute from the model. This is a noop if the attribute doesn't
* exist.
- * @method unset
* @param {String} attr The string name of an attribute.
*/
unset(attr: string, options?: { [opt: string]: mixed }): ParseObject | boolean {
@@ -710,7 +702,6 @@ export default class ParseObject {
* Atomically increments the value of the given attribute the next time the
* object is saved. If no amount is specified, 1 is used by default.
*
- * @method increment
* @param attr {String} The key.
* @param amount {Number} The amount to increment by (optional).
*/
@@ -727,9 +718,9 @@ export default class ParseObject {
/**
* Atomically add an object to the end of the array associated with a given
* key.
- * @method add
* @param attr {String} The key.
* @param item {} The item to add.
+ * @return {(ParseObject|Boolean)}
*/
add(attr: string, item: mixed): ParseObject | boolean {
return this.set(attr, new AddOp([item]));
@@ -738,9 +729,8 @@ export default class ParseObject {
/**
* Atomically add the objects to the end of the array associated with a given
* key.
- * @method addAll
* @param attr {String} The key.
- * @param items {[]} The items to add.
+ * @param items {Object[]} The items to add.
*/
addAll(attr: string, items: Arrayset and
* save. Your implementation should return
*
- * @method validate
* @param {Object} attrs The current data to validate.
* @return {} False if the data is valid. An error object otherwise.
* @see Parse.Object#set
@@ -932,7 +911,6 @@ export default class ParseObject {
/**
* Returns the ACL for this object.
- * @method getACL
* @returns {Parse.ACL} An instance of Parse.ACL.
* @see Parse.Object#get
*/
@@ -946,7 +924,6 @@ export default class ParseObject {
/**
* Sets the ACL to be used for this object.
- * @method setACL
* @param {Parse.ACL} acl An instance of Parse.ACL.
* @param {Object} options Optional Backbone-like options object to be
* passed in to set.
@@ -959,7 +936,6 @@ export default class ParseObject {
/**
* Clears any changes to this object made since the last call to save()
- * @method revert
*/
revert(): void {
this._clearPendingOps();
@@ -967,7 +943,7 @@ export default class ParseObject {
/**
* Clears all attributes on a model
- * @method clear
+ * @return {(ParseObject | boolean)}
*/
clear(): ParseObject | boolean {
var attributes = this.attributes;
@@ -988,7 +964,6 @@ export default class ParseObject {
* Fetch the model from the server. If the server's representation of the
* model differs from its current attributes, they will be overriden.
*
- * @method fetch
* @param {Object} options A Backbone-style callback object.
* Valid options are:Parse.Object.
* @param {Object} options A Backbone-style callback object.
* @static
@@ -1218,7 +1190,6 @@ export default class ParseObject {
* });
*
*
- * @method fetchAllIfNeeded
* @param {Array} list A list of Parse.Object.
* @param {Object} options A Backbone-style callback object.
* @static
@@ -1286,7 +1257,6 @@ export default class ParseObject {
* });
*
*
- * @method destroyAll
* @param {Array} list A list of Parse.Object.
* @param {Object} options A Backbone-style callback object.
* @static
@@ -1330,7 +1300,6 @@ export default class ParseObject {
* });
*
*
- * @method saveAll
* @param {Array} list A list of Parse.Object.
* @param {Object} options A Backbone-style callback object.
* @static
@@ -1367,7 +1336,6 @@ export default class ParseObject {
* pointerToFoo.id = "myObjectId";
*
*
- * @method createWithoutData
* @param {String} id The ID of the object to create a reference to.
* @static
* @return {Parse.Object} A Parse.Object reference.
@@ -1380,7 +1348,6 @@ export default class ParseObject {
/**
* Creates a new instance of a Parse Object from a JSON representation.
- * @method fromJSON
* @param {Object} json The JSON map of the Object's data
* @param {boolean} override In single instance mode, all old server data
* is overwritten if this is set to true
@@ -1425,7 +1392,6 @@ export default class ParseObject {
* When objects of that class are retrieved from a query, they will be
* instantiated with this subclass.
* This is only necessary when using ES6 subclassing.
- * @method registerSubclass
* @param {String} className The class name of the subclass
* @param {Class} constructor The subclass
*/
@@ -1478,7 +1444,6 @@ export default class ParseObject {
* Class properties
* });
*
- * @method extend
* @param {String} className The name of the Parse class backing this model.
* @param {Object} protoProps Instance properties to add to instances of the
* class returned from this method.
@@ -1577,7 +1542,7 @@ export default class ParseObject {
* share the same attributes, and stay synchronized with each other.
* This is disabled by default in server environments, since it can lead to
* security issues.
- * @method enableSingleInstance
+ * @static
*/
static enableSingleInstance() {
singleInstance = true;
@@ -1589,7 +1554,7 @@ export default class ParseObject {
* share the same attributes, and stay synchronized with each other.
* When disabled, you can have two instances of the same object in memory
* without them sharing attributes.
- * @method disableSingleInstance
+ * @static
*/
static disableSingleInstance() {
singleInstance = false;
@@ -1888,3 +1853,5 @@ var DefaultController = {
}
CoreManager.setObjectController(DefaultController);
+
+export default ParseObject;
diff --git a/src/ParsePolygon.js b/src/ParsePolygon.js
index 0eed04c50..8219b5cee 100644
--- a/src/ParsePolygon.js
+++ b/src/ParsePolygon.js
@@ -17,9 +17,7 @@ import ParseGeoPoint from './ParseGeoPoint';
* new Polygon([[0,0],[0,1],[1,1],[1,0]])
* new Polygon([GeoPoint, GeoPoint, GeoPoint])
*
- * @class Parse.GeoPoint
- * @constructor
- *
+ *
* Represents a coordinates that may be associated * with a key in a ParseObject or used as a reference point for geo queries. * This allows proximity-based queries on the key.
@@ -29,10 +27,14 @@ import ParseGeoPoint from './ParseGeoPoint'; * var object = new Parse.Object("PlaceObject"); * object.set("area", polygon); * object.save(); + * @alias Parse.Polygon */ -export default class ParsePolygon { +class ParsePolygon { _coordinates: Array; + /** + * @param {(Number[][]|Parse.GeoPoint[])} coordinates An Array of coordinate pairs + */ constructor( arg1: Array, ) { @@ -55,7 +57,6 @@ export default class ParsePolygon { /** * Returns a JSON representation of the GeoPoint, suitable for Parse. - * @method toJSON * @return {Object} */ toJSON(): { __type: string; coordinates: Array;} { @@ -66,6 +67,11 @@ export default class ParsePolygon { }; } + /** + * Checks if two polygons are equal + * @param {(Parse.Polygon|Object)} other + * @returns {Boolean} + */ equals(other: mixed): boolean { if (!(other instanceof ParsePolygon) || (this.coordinates.length !== other.coordinates.length)) { return false; @@ -82,6 +88,11 @@ export default class ParsePolygon { return isEqual; } + /** + * + * @param {Parse.GeoPoint} point + * @returns {Boolean} wether the points is contained into the polygon + */ containsPoint(point: ParseGeoPoint): boolean { let minX = this._coordinates[0][0]; let maxX = this._coordinates[0][0]; @@ -119,8 +130,9 @@ export default class ParsePolygon { } /** - * Throws an exception if the given lat-long is out of bounds. - * @return {Array} + * Validates that the list of coordinates can form a valid polygon + * @param {Array} coords the list of coordinated to validate as a polygon + * @throws {TypeError} */ static _validate(coords: Array) { if (!Array.isArray(coords)) { @@ -145,3 +157,5 @@ export default class ParsePolygon { return points; } } + +export default ParsePolygon; diff --git a/src/ParsePromise.js b/src/ParsePromise.js index c5625bc92..f1b2c01a9 100644 --- a/src/ParsePromise.js +++ b/src/ParsePromise.js @@ -7,6 +7,9 @@ * of patent rights can be found in the PATENTS file in the same directory. */ + /** + * @private + */ var isPromisesAPlusCompliant = true; /** @@ -22,10 +25,9 @@ var isPromisesAPlusCompliant = true; * }); * * - * @class Parse.Promise - * @constructor + * @alias Parse.Promise */ -export default class ParsePromise { +class ParsePromise { constructor(executor) { this._resolved = false; this._rejected = false; @@ -39,7 +41,7 @@ export default class ParsePromise { /** * Marks this promise as fulfilled, firing any callbacks waiting on it. - * @method resolve + * @param {Object} result the result to pass to the callbacks. */ resolve(...results) { @@ -61,7 +63,7 @@ export default class ParsePromise { /** * Marks this promise as fulfilled, firing any callbacks waiting on it. - * @method reject + * @param {Object} error the error to pass to the callbacks. */ reject(error) { @@ -86,7 +88,7 @@ export default class ParsePromise { * chaining. If the callback itself returns a Promise, then the one returned * by "then" will not be fulfilled until that one returned by the callback * is fulfilled. - * @method then + * @param {Function} resolvedCallback Function that is called when this * Promise is resolved. Once the callback is complete, then the Promise * returned by "then" will also be fulfilled. @@ -191,7 +193,7 @@ export default class ParsePromise { /** * Add handlers to be called when the promise * is either resolved or rejected - * @method always + */ always(callback) { return this.then(callback, callback); @@ -199,7 +201,7 @@ export default class ParsePromise { /** * Add handlers to be called when the Promise object is resolved - * @method done + */ done(callback) { return this.then(callback); @@ -208,7 +210,7 @@ export default class ParsePromise { /** * Add handlers to be called when the Promise object is rejected * Alias for catch(). - * @method fail + */ fail(callback) { return this.then(null, callback); @@ -216,7 +218,7 @@ export default class ParsePromise { /** * Add handlers to be called when the Promise object is rejected - * @method catch + */ catch(callback) { return this.then(null, callback); @@ -224,7 +226,7 @@ export default class ParsePromise { /** * Run the given callbacks after this promise is fulfilled. - * @method _thenRunCallbacks + * @param optionsOrCallback {} A Backbone-style options callback, or a * callback function. If this is an options object and contains a "model" * attributes, that will be passed to error callbacks as the first argument. @@ -276,7 +278,7 @@ export default class ParsePromise { * array of results for its first argument, or the error as its second, * depending on whether this Promise was rejected or resolved. Returns a * new Promise, like "then" would. - * @method _continueWith + * @param {Function} continuation the callback. */ _continueWith(continuation) { @@ -289,7 +291,7 @@ export default class ParsePromise { /** * Returns true iff the given object fulfils the Promise interface. - * @method is + * @param {Object} promise The object to test * @static * @return {Boolean} @@ -303,7 +305,7 @@ export default class ParsePromise { /** * Returns a new promise that is resolved with a given value. - * @method as + * @param value The value to resolve the promise with * @static * @return {Parse.Promise} the new promise. @@ -319,7 +321,7 @@ export default class ParsePromise { * If that value is a thenable Promise (has a .then() prototype * method), the new promise will be chained to the end of the * value. - * @method resolve + * @param value The value to resolve the promise with * @static * @return {Parse.Promise} the new promise. @@ -336,7 +338,7 @@ export default class ParsePromise { /** * Returns a new promise that is rejected with a given error. - * @method error + * @param error The error to reject the promise with * @static * @return {Parse.Promise} the new promise. @@ -351,7 +353,7 @@ export default class ParsePromise { * Returns a new promise that is rejected with a given error. * This is an alias for Parse.Promise.error, for compliance with * the ES6 implementation. - * @method reject + * @param error The error to reject the promise with * @static * @return {Parse.Promise} the new promise. @@ -383,7 +385,7 @@ export default class ParsePromise { * console.log(results); // prints [1,2,3] * }); * - * @method when + * @param {Array} promises a list of promises to wait for. * @static * @return {Parse.Promise} the new promise. @@ -464,7 +466,7 @@ export default class ParsePromise { * console.log(r3); // prints 3 * }); * - * @method all + * @param {Iterable} promises an iterable of promises to wait for. * @static * @return {Parse.Promise} the new promise. @@ -521,7 +523,7 @@ export default class ParsePromise { * complete is rejected, the returned promise will be rejected with the * same reason. * - * @method race + * @param {Iterable} promises an iterable of promises to wait for. * @static * @return {Parse.Promise} the new promise. @@ -557,7 +559,7 @@ export default class ParsePromise { * Runs the given asyncFunction repeatedly, as long as the predicate * function returns a truthy value. Stops repeating if asyncFunction returns * a rejected promise. - * @method _continueWhile + * @param {Function} predicate should return false when ready to stop. * @param {Function} asyncFunction should return a Promise. * @static @@ -583,3 +585,5 @@ export default class ParsePromise { isPromisesAPlusCompliant = false; } } + +export default ParsePromise; diff --git a/src/ParseQuery.js b/src/ParseQuery.js index 796856c79..e4f5586d4 100644 --- a/src/ParseQuery.js +++ b/src/ParseQuery.js @@ -1,4 +1,4 @@ -/** +/* * Copyright (c) 2015-present, Parse, LLC. * All rights reserved. * @@ -40,12 +40,13 @@ export type QueryJSON = { * Converts a string into a regex that matches it. * Surrounding with \Q .. \E does this, we just need to escape any \E's in * the text separately. + * @private */ function quote(s: string) { return '\\Q' + s.replace('\\E', '\\E\\\\E\\Q') + '\\E'; } -/** +/* * Handles pre-populating the result data of a query with select fields, * making sure that the data object contains keys for all objects that have * been requested with a select, so that our cached state updates correctly. @@ -116,61 +117,63 @@ function handleSelectResult(data: any, select: ArrayParse.Query defines a query that is used to fetch Parse.Objects. The
* most common use case is finding all objects that match a query through the
- * find method. For example, this sample code fetches all objects
- * of class MyClass. It calls a different function depending on
+ * find method. for example, this sample code fetches all objects
+ * of class myclass. it calls a different function depending on
* whether the fetch succeeded or not.
*
*
- * var query = new Parse.Query(MyClass);
+ * var query = new parse.query(myclass);
* query.find({
* success: function(results) {
- * // results is an array of Parse.Object.
+ * // results is an array of parse.object.
* },
*
* error: function(error) {
- * // error is an instance of Parse.Error.
+ * // error is an instance of parse.error.
* }
* });
*
- * A Parse.Query can also be used to retrieve a single object whose id is
- * known, through the get method. For example, this sample code fetches an
- * object of class MyClass and id myId. It calls a
+ *
a parse.query can also be used to retrieve a single object whose id is
+ * known, through the get method. for example, this sample code fetches an
+ * object of class myclass and id myid. it calls a
* different function depending on whether the fetch succeeded or not.
*
*
- * var query = new Parse.Query(MyClass);
- * query.get(myId, {
+ * var query = new parse.query(myclass);
+ * query.get(myid, {
* success: function(object) {
- * // object is an instance of Parse.Object.
+ * // object is an instance of parse.object.
* },
*
* error: function(object, error) {
- * // error is an instance of Parse.Error.
+ * // error is an instance of parse.error.
* }
* });
*
- * A Parse.Query can also be used to count the number of objects that match
- * the query without retrieving all of those objects. For example, this
- * sample code counts the number of objects of the class MyClass
+ *
a parse.query can also be used to count the number of objects that match
+ * the query without retrieving all of those objects. for example, this
+ * sample code counts the number of objects of the class myclass
*
- * var query = new Parse.Query(MyClass);
+ * var query = new parse.query(myclass);
* query.count({
* success: function(number) {
- * // There are number instances of MyClass.
+ * // there are number instances of myclass.
* },
*
* error: function(error) {
* // error is an instance of Parse.Error.
* }
* });
+ * @alias Parse.Query
*/
-export default class ParseQuery {
+class ParseQuery {
+ /**
+ * @property className
+ * @type String
+ */
className: string;
_where: any;
_include: Array* A class that is used to access all of the children of a many-to-many * relationship. Each instance of Parse.Relation is associated with a * particular parent object and key. *
+ * @alias Parse.Relation */ -export default class ParseRelation { +class ParseRelation { parent: ?ParseObject; key: ?string; targetClassName: ?string; + /** + * @param {Parse.Object} parent The parent of this relation. + * @param {String} key The key for this relation on the parent. + */ constructor(parent: ?ParseObject, key: ?string) { this.parent = parent; this.key = key; this.targetClassName = null; } - /** + /* * Makes sure that this relation has the right parent and key. */ _ensureParentAndKey(parent: ParseObject, key: string) { @@ -71,7 +72,7 @@ export default class ParseRelation { /** * Adds a Parse.Object or an array of Parse.Objects to the relation. - * @method add + * @param {} objects The item or items to add. */ add(objects: ParseObject | ArrayRoles must have a name (which cannot be changed after creation of the * role), and must specify an ACL.
- * @class Parse.Role - * @constructor - * @param {String} name The name of the Role to create. - * @param {Parse.ACL} acl The ACL for this role. Roles must have an ACL. - * A Parse.Role is a local representation of a role persisted to the Parse - * cloud. + * @alias Parse.Role + * @extends Parse.Object */ -export default class ParseRole extends ParseObject { +class ParseRole extends ParseObject { + /** + * @param {String} name The name of the Role to create. + * @param {Parse.ACL} acl The ACL for this role. Roles must have an ACL. + * A Parse.Role is a local representation of a role persisted to the Parse + * cloud. + */ constructor(name: string, acl: ParseACL) { super('_Role'); if (typeof name === 'string' && (acl instanceof ParseACL)) { @@ -44,7 +46,7 @@ export default class ParseRole extends ParseObject { /** * Gets the name of the role. You can alternatively call role.get("name") * - * @method getName + * @return {String} the name of the role. */ getName(): ?string { @@ -67,7 +69,7 @@ export default class ParseRole extends ParseObject { * *This is equivalent to calling role.set("name", name)
* - * @method setName + * @param {String} name The name of the role. * @param {Object} options Standard options object with success and error * callbacks. @@ -84,7 +86,7 @@ export default class ParseRole extends ParseObject { * *This is equivalent to calling role.relation("users")
* - * @method getUsers + * @return {Parse.Relation} the relation for the users belonging to this * role. */ @@ -100,7 +102,7 @@ export default class ParseRole extends ParseObject { * *This is equivalent to calling role.relation("roles")
* - * @method getRoles + * @return {Parse.Relation} the relation for the roles belonging to this * role. */ @@ -144,3 +146,5 @@ export default class ParseRole extends ParseObject { } ParseObject.registerSubclass('_Role', ParseRole); + +export default ParseRole; diff --git a/src/ParseSession.js b/src/ParseSession.js index 2e9c0f198..878f953ab 100644 --- a/src/ParseSession.js +++ b/src/ParseSession.js @@ -19,14 +19,17 @@ import type { AttributeMap } from './ObjectStateMutations'; import type { RequestOptions, FullOptions } from './RESTController'; /** - * @class Parse.Session - * @constructor - * *A Parse.Session object is a local representation of a revocable session. * This class is a subclass of a Parse.Object, and retains the same * functionality of a Parse.Object.
+ * @alias Parse.Session + * @extends Parse.Object */ -export default class ParseSession extends ParseObject { +class ParseSession extends ParseObject { + /** + * + * @param {Object} attributes The initial set of data to store in the user. + */ constructor(attributes: ?AttributeMap) { super('_Session'); if (attributes && typeof attributes === 'object'){ @@ -38,7 +41,7 @@ export default class ParseSession extends ParseObject { /** * Returns the session token string. - * @method getSessionToken + * @return {String} */ getSessionToken(): string { @@ -62,7 +65,7 @@ export default class ParseSession extends ParseObject { /** * Retrieves the Session object for the currently logged in session. - * @method current + * @static * @return {Parse.Promise} A promise that is resolved with the Parse.Session * object after it has been fetched. If there is no current user, the @@ -92,7 +95,7 @@ export default class ParseSession extends ParseObject { * use revocable sessions. If you are migrating an app that uses the Parse * SDK in the browser only, please use Parse.User.enableRevocableSession() * instead, so that sessions can be automatically upgraded. - * @method isCurrentSessionRevocable + * @static * @return {Boolean} */ @@ -123,3 +126,5 @@ var DefaultController = { }; CoreManager.setSessionController(DefaultController); + +export default ParseSession; diff --git a/src/ParseUser.js b/src/ParseUser.js index ff0c58832..ac04bb0e2 100644 --- a/src/ParseUser.js +++ b/src/ParseUser.js @@ -30,16 +30,18 @@ var currentUserCache = null; var authProviders = {}; /** - * @class Parse.User - * @constructor - * *A Parse.User object is a local representation of a user persisted to the * Parse cloud. This class is a subclass of a Parse.Object, and retains the * same functionality of a Parse.Object, but also extends it with various * user specific methods, like authentication, signing up, and validation of * uniqueness.
+ * @alias Parse.User + * @extends Parse.Object */ -export default class ParseUser extends ParseObject { +class ParseUser extends ParseObject { + /** + * @param {Object} attributes The initial set of data to store in the user. + */ constructor(attributes: ?AttributeMap) { super('_User'); if (attributes && typeof attributes === 'object'){ @@ -51,7 +53,7 @@ export default class ParseUser extends ParseObject { /** * Request a revocable session token to replace the older style of token. - * @method _upgradeToRevocableSession + * @param {Object} options A Backbone-style options object. * @return {Parse.Promise} A promise that is resolved when the replacement * token has been fetched. @@ -74,7 +76,6 @@ export default class ParseUser extends ParseObject { /** * Unlike in the Android/iOS SDKs, logInWith is unnecessary, since you can * call linkWith on the user (even if it doesn't exist yet on the server). - * @method _linkWith */ _linkWith(provider: any, options: { authData?: AuthData }): ParsePromise { var authType; @@ -128,7 +129,7 @@ export default class ParseUser extends ParseObject { /** * Synchronizes auth data for a provider (e.g. puts the access token in the * right place to be used by the Facebook SDK). - * @method _synchronizeAuthData + */ _synchronizeAuthData(provider: string) { if (!this.isCurrent() || !provider) { @@ -153,7 +154,7 @@ export default class ParseUser extends ParseObject { /** * Synchronizes authData for all providers. - * @method _synchronizeAllAuthData + */ _synchronizeAllAuthData() { var authData = this.get('authData'); @@ -169,7 +170,7 @@ export default class ParseUser extends ParseObject { /** * Removes null values from authData (which exist temporarily for * unlinking) - * @method _cleanupAuthData + */ _cleanupAuthData() { if (!this.isCurrent()) { @@ -189,7 +190,7 @@ export default class ParseUser extends ParseObject { /** * Unlinks a user from a service. - * @method _unlinkFrom + */ _unlinkFrom(provider: any, options?: FullOptions) { var authType; @@ -207,7 +208,7 @@ export default class ParseUser extends ParseObject { /** * Checks whether a user is linked to a service. - * @method _isLinked + */ _isLinked(provider: any): boolean { var authType; @@ -225,7 +226,7 @@ export default class ParseUser extends ParseObject { /** * Deauthenticates all providers. - * @method _logOutWithAll + */ _logOutWithAll() { var authData = this.get('authData'); @@ -241,7 +242,7 @@ export default class ParseUser extends ParseObject { /** * Deauthenticates a single provider (e.g. removing access tokens from the * Facebook SDK). - * @method _logOutWith + */ _logOutWith(provider: any) { if (!this.isCurrent()) { @@ -267,7 +268,7 @@ export default class ParseUser extends ParseObject { /** * Returns true ifcurrent would return this user.
- * @method isCurrent
+
* @return {Boolean}
*/
isCurrent(): boolean {
@@ -277,7 +278,7 @@ export default class ParseUser extends ParseObject {
/**
* Returns get("username").
- * @method getUsername
+
* @return {String}
*/
getUsername(): ?string {
@@ -290,7 +291,7 @@ export default class ParseUser extends ParseObject {
/**
* Calls set("username", username, options) and returns the result.
- * @method setUsername
+
* @param {String} username
* @param {Object} options A Backbone-style options object.
* @return {Boolean}
@@ -308,7 +309,7 @@ export default class ParseUser extends ParseObject {
/**
* Calls set("password", password, options) and returns the result.
- * @method setPassword
+
* @param {String} password
* @param {Object} options A Backbone-style options object.
* @return {Boolean}
@@ -319,7 +320,7 @@ export default class ParseUser extends ParseObject {
/**
* Returns get("email").
- * @method getEmail
+
* @return {String}
*/
getEmail(): ?string {
@@ -332,7 +333,7 @@ export default class ParseUser extends ParseObject {
/**
* Calls set("email", email, options) and returns the result.
- * @method setEmail
+
* @param {String} email
* @param {Object} options A Backbone-style options object.
* @return {Boolean}
@@ -345,7 +346,7 @@ export default class ParseUser extends ParseObject {
* Returns the session token for this user, if the user has been logged in,
* or if it is the result of a query with the master key. Otherwise, returns
* undefined.
- * @method getSessionToken
+
* @return {String} the session token, or undefined
*/
getSessionToken(): ?string {
@@ -358,7 +359,7 @@ export default class ParseUser extends ParseObject {
/**
* Checks whether this user is the current user and has been authenticated.
- * @method authenticated
+
* @return (Boolean) whether this user is the current user and is logged in.
*/
authenticated(): boolean {
@@ -380,7 +381,7 @@ export default class ParseUser extends ParseObject {
*
* Calls options.success or options.error on completion.
* - * @method signUp + * @param {Object} attrs Extra fields to set on the new user, or null. * @param {Object} options A Backbone-style options object. * @return {Parse.Promise} A promise that is fulfilled when the signup @@ -414,7 +415,7 @@ export default class ParseUser extends ParseObject { * *Calls options.success or options.error on completion.
* - * @method logIn + * @param {Object} options A Backbone-style options object. * @return {Parse.Promise} A promise that is fulfilled with the user when * the login is complete. @@ -479,7 +480,7 @@ export default class ParseUser extends ParseObject { /** * Adds functionality to the existing Parse.User class - * @method extend + * @param {Object} protoProps A set of properties to add to the prototype * @param {Object} classProps A set of static properties to add to the class * @static @@ -518,7 +519,7 @@ export default class ParseUser extends ParseObject { /** * Retrieves the currently logged in ParseUser with a valid session, * either from memory or localStorage, if necessary. - * @method current + * @static * @return {Parse.Object} The currently logged in Parse.User. */ @@ -532,7 +533,7 @@ export default class ParseUser extends ParseObject { /** * Retrieves the currently logged in ParseUser from asynchronous Storage. - * @method currentAsync + * @static * @return {Parse.Promise} A Promise that is resolved with the currently * logged in Parse User @@ -553,7 +554,7 @@ export default class ParseUser extends ParseObject { * *Calls options.success or options.error on completion.
* - * @method signUp + * @param {String} username The username (or email) to sign up with. * @param {String} password The password to sign up with. * @param {Object} attrs Extra fields to set on the new user. @@ -577,7 +578,7 @@ export default class ParseUser extends ParseObject { * *Calls options.success or options.error on completion.
* - * @method logIn + * @param {String} username The username (or email) to log in with. * @param {String} password The password to log in with. * @param {Object} options A Backbone-style options object. @@ -613,7 +614,7 @@ export default class ParseUser extends ParseObject { * *Calls options.success or options.error on completion.
* - * @method become + * @param {String} sessionToken The sessionToken to log in with. * @param {Object} options A Backbone-style options object. * @static @@ -647,7 +648,7 @@ export default class ParseUser extends ParseObject { * Logs out the currently logged in user session. This will remove the * session from disk, log out of linked services, and future calls to *current will return null.
- * @method logOut
+
* @static
* @return {Parse.Promise} A promise that is resolved when the session is
* destroyed on the server.
@@ -670,11 +671,12 @@ export default class ParseUser extends ParseObject {
*
* Calls options.success or options.error on completion.
* - * @method requestPasswordReset + * @param {String} email The email address associated with the user that * forgot their password. * @param {Object} options A Backbone-style options object. * @static + * @returns {Parse.Promise} */ static requestPasswordReset(email, options) { options = options || {}; @@ -696,7 +698,7 @@ export default class ParseUser extends ParseObject { * User to _User for legacy reasons. This allows developers to * override that behavior. * - * @method allowCustomUserClass + * @param {Boolean} isAllowed Whether or not to allow custom User class * @static */ @@ -711,7 +713,7 @@ export default class ParseUser extends ParseObject { * It is not necessary to call this method from cloud code unless you are * handling user signup or login from the server side. In a cloud code call, * this function will not attempt to upgrade the current token. - * @method enableRevocableSession + * @param {Object} options A Backbone-style options object. * @static * @return {Parse.Promise} A promise that is resolved when the process has @@ -734,7 +736,7 @@ export default class ParseUser extends ParseObject { * Enables the use of become or the current user in a server * environment. These features are disabled by default, since they depend on * global objects that are not memory-safe for most servers. - * @method enableUnsafeCurrentUser + * @static */ static enableUnsafeCurrentUser() { @@ -745,7 +747,7 @@ export default class ParseUser extends ParseObject { * Disables the use of become or the current user in any environment. * These features are disabled on servers by default, since they depend on * global objects that are not memory-safe for most servers. - * @method disableUnsafeCurrentUser + * @static */ static disableUnsafeCurrentUser() { @@ -1029,3 +1031,5 @@ var DefaultController = { }; CoreManager.setUserController(DefaultController); + +export default ParseUser; diff --git a/src/Push.js b/src/Push.js index b3c1911fe..b5c910188 100644 --- a/src/Push.js +++ b/src/Push.js @@ -27,11 +27,13 @@ export type PushData = { * Contains functions to deal with Push in Parse. * @class Parse.Push * @static + * @hideconstructor */ /** * Sends a push notification. * @method send + * @name Parse.Push.send * @param {Object} data - The data of the push notification. Valid fields * are: *