From c526c8fe42a8ac6ac37b530217f0636ef782e82b Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Wed, 12 Jul 2017 07:08:37 -0400 Subject: [PATCH 1/2] docs: add param tags for mixin methods --- packages/datastore/src/request.js | 36 +++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/packages/datastore/src/request.js b/packages/datastore/src/request.js index 671dc4c4174..d951916e001 100644 --- a/packages/datastore/src/request.js +++ b/packages/datastore/src/request.js @@ -460,6 +460,18 @@ DatastoreRequest.prototype.get = function(keys, options, callback) { /** * Maps to {module:datastore#save}, forcing the method to be `insert`. + * + * @throws {Error} If an unrecognized method is provided. + * + * @param {object|object[]} entities - Datastore key object(s). + * @param {Key} entities.key - Datastore key object. + * @param {object|object[]} entities.data - Data to save with the provided key. + * If you provide an array of objects, you must use the explicit syntax: + * `name` for the name of the property and `value` for its value. You may + * also specify an `excludeFromIndexes` property, set to `true` or `false`. + * @param {function} callback - The callback function. + * @param {?error} callback.err - An error returned while making this request + * @param {object} callback.apiResponse - The full API response. */ DatastoreRequest.prototype.insert = function(entities, callback) { entities = arrify(entities) @@ -990,6 +1002,18 @@ DatastoreRequest.prototype.save = function(entities, callback) { /** * Maps to {module:datastore#save}, forcing the method to be `update`. + * + * @throws {Error} If an unrecognized method is provided. + * + * @param {object|object[]} entities - Datastore key object(s). + * @param {Key} entities.key - Datastore key object. + * @param {object|object[]} entities.data - Data to save with the provided key. + * If you provide an array of objects, you must use the explicit syntax: + * `name` for the name of the property and `value` for its value. You may + * also specify an `excludeFromIndexes` property, set to `true` or `false`. + * @param {function} callback - The callback function. + * @param {?error} callback.err - An error returned while making this request + * @param {object} callback.apiResponse - The full API response. */ DatastoreRequest.prototype.update = function(entities, callback) { entities = arrify(entities) @@ -1001,6 +1025,18 @@ DatastoreRequest.prototype.update = function(entities, callback) { /** * Maps to {module:datastore#save}, forcing the method to be `upsert`. + * + * @throws {Error} If an unrecognized method is provided. + * + * @param {object|object[]} entities - Datastore key object(s). + * @param {Key} entities.key - Datastore key object. + * @param {object|object[]} entities.data - Data to save with the provided key. + * If you provide an array of objects, you must use the explicit syntax: + * `name` for the name of the property and `value` for its value. You may + * also specify an `excludeFromIndexes` property, set to `true` or `false`. + * @param {function} callback - The callback function. + * @param {?error} callback.err - An error returned while making this request + * @param {object} callback.apiResponse - The full API response. */ DatastoreRequest.prototype.upsert = function(entities, callback) { entities = arrify(entities) From 52a09d43d6928aa558e6be29cd9bdb74b35bb4f3 Mon Sep 17 00:00:00 2001 From: Dave Gramlich Date: Fri, 14 Jul 2017 02:51:39 -0400 Subject: [PATCH 2/2] remove @throws --- packages/datastore/src/request.js | 6 ------ 1 file changed, 6 deletions(-) diff --git a/packages/datastore/src/request.js b/packages/datastore/src/request.js index d951916e001..8eeb7d43444 100644 --- a/packages/datastore/src/request.js +++ b/packages/datastore/src/request.js @@ -461,8 +461,6 @@ DatastoreRequest.prototype.get = function(keys, options, callback) { /** * Maps to {module:datastore#save}, forcing the method to be `insert`. * - * @throws {Error} If an unrecognized method is provided. - * * @param {object|object[]} entities - Datastore key object(s). * @param {Key} entities.key - Datastore key object. * @param {object|object[]} entities.data - Data to save with the provided key. @@ -1003,8 +1001,6 @@ DatastoreRequest.prototype.save = function(entities, callback) { /** * Maps to {module:datastore#save}, forcing the method to be `update`. * - * @throws {Error} If an unrecognized method is provided. - * * @param {object|object[]} entities - Datastore key object(s). * @param {Key} entities.key - Datastore key object. * @param {object|object[]} entities.data - Data to save with the provided key. @@ -1026,8 +1022,6 @@ DatastoreRequest.prototype.update = function(entities, callback) { /** * Maps to {module:datastore#save}, forcing the method to be `upsert`. * - * @throws {Error} If an unrecognized method is provided. - * * @param {object|object[]} entities - Datastore key object(s). * @param {Key} entities.key - Datastore key object. * @param {object|object[]} entities.data - Data to save with the provided key.