不要怂,就是干,撸起袖子干!

Commit c41bcf4b by Pedro Augusto de Paula Barbosa Committed by Sushant

build(eslint-plugin-jsdoc): update to v20.4.0 (#11866)

1 parent 22e6549b
......@@ -97,6 +97,13 @@
"no-self-compare": "error",
"no-case-declarations": "off"
},
"settings": {
"jsdoc": {
"tagNamePreference": {
"augments": "extends"
}
}
},
"parserOptions": {
"ecmaVersion": 2018,
"sourceType": "script"
......
......@@ -98,6 +98,7 @@ class Association {
/**
* The type of the association. One of `HasMany`, `BelongsTo`, `HasOne`, `BelongsToMany`
*
* @type {string}
*/
this.associationType = '';
......
......@@ -407,8 +407,8 @@ class BelongsToMany extends Association {
* {@link Model} for a full explanation of options
*
* @param {Model} instance instance
* @param {Object} [options] find options
* @param {Object} [options.where] An optional where clause to limit the associated models
* @param {object} [options] find options
* @param {object} [options.where] An optional where clause to limit the associated models
* @param {string|boolean} [options.scope] Apply a scope on the related model, or remove its default scope by passing false
* @param {string} [options.schema] Apply a schema on the related model
*
......@@ -476,8 +476,8 @@ class BelongsToMany extends Association {
* Count everything currently associated with this, using an optional where clause.
*
* @param {Model} instance instance
* @param {Object} [options] find options
* @param {Object} [options.where] An optional where clause to limit the associated models
* @param {object} [options] find options
* @param {object} [options.where] An optional where clause to limit the associated models
* @param {string|boolean} [options.scope] Apply a scope on the related model, or remove its default scope by passing false
*
* @returns {Promise<number>}
......@@ -501,7 +501,7 @@ class BelongsToMany extends Association {
*
* @param {Model} sourceInstance source instance to check for an association with
* @param {Model|Model[]|string[]|string|number[]|number} [instances] Can be an array of instances or their primary keys
* @param {Object} [options] Options passed to getAssociations
* @param {object} [options] Options passed to getAssociations
*
* @returns {Promise<boolean>}
*/
......@@ -546,9 +546,9 @@ class BelongsToMany extends Association {
*
* @param {Model} sourceInstance source instance to associate new instances with
* @param {Model|Model[]|string[]|string|number[]|number} [newAssociatedObjects] A single instance or primary key, or a mixed array of persisted instances or primary keys
* @param {Object} [options] Options passed to `through.findAll`, `bulkCreate`, `update` and `destroy`
* @param {Object} [options.validate] Run validation for the join model
* @param {Object} [options.through] Additional attributes for the join table.
* @param {object} [options] Options passed to `through.findAll`, `bulkCreate`, `update` and `destroy`
* @param {object} [options.validate] Run validation for the join model
* @param {object} [options.through] Additional attributes for the join table.
*
* @returns {Promise}
*/
......@@ -654,9 +654,9 @@ class BelongsToMany extends Association {
*
* @param {Model} sourceInstance source instance to associate new instances with
* @param {Model|Model[]|string[]|string|number[]|number} [newInstances] A single instance or primary key, or a mixed array of persisted instances or primary keys
* @param {Object} [options] Options passed to `through.findAll`, `bulkCreate` and `update`
* @param {Object} [options.validate] Run validation for the join model.
* @param {Object} [options.through] Additional attributes for the join table.
* @param {object} [options] Options passed to `through.findAll`, `bulkCreate` and `update`
* @param {object} [options.validate] Run validation for the join model.
* @param {object} [options.through] Additional attributes for the join table.
*
* @returns {Promise}
*/
......@@ -750,7 +750,7 @@ class BelongsToMany extends Association {
*
* @param {Model} sourceInstance instance to un associate instances with
* @param {Model|Model[]|string|string[]|number|number[]} [oldAssociatedObjects] Can be an Instance or its primary key, or a mixed array of instances and primary keys
* @param {Object} [options] Options passed to `through.destroy`
* @param {object} [options] Options passed to `through.destroy`
*
* @returns {Promise}
*/
......@@ -773,9 +773,9 @@ class BelongsToMany extends Association {
* Create a new instance of the associated model and associate it with this.
*
* @param {Model} sourceInstance source instance
* @param {Object} [values] values for target model
* @param {Object} [options] Options passed to create and add
* @param {Object} [options.through] Additional attributes for the join table
* @param {object} [values] values for target model
* @param {object} [options] Options passed to create and add
* @param {object} [options.through] Additional attributes for the join table
*
* @returns {Promise}
*/
......
......@@ -114,7 +114,7 @@ class BelongsTo extends Association {
* Get the associated instance.
*
* @param {Model|Array<Model>} instances source instances
* @param {Object} [options] find options
* @param {object} [options] find options
* @param {string|boolean} [options.scope] Apply a scope on the related model, or remove its default scope by passing false.
* @param {string} [options.schema] Apply a schema on the related model
*
......@@ -186,7 +186,7 @@ class BelongsTo extends Association {
*
* @param {Model} sourceInstance the source instance
* @param {?<Model>|string|number} [associatedInstance] An persisted instance or the primary key of an instance to associate with this. Pass `null` or `undefined` to remove the association.
* @param {Object} [options={}] options passed to `this.save`
* @param {object} [options={}] options passed to `this.save`
* @param {boolean} [options.save=true] Skip saving this after setting the foreign key if false.
*
* @returns {Promise}
......@@ -216,8 +216,8 @@ class BelongsTo extends Association {
* Create a new instance of the associated model and associate it with this.
*
* @param {Model} sourceInstance the source instance
* @param {Object} [values={}] values to create associated model instance with
* @param {Object} [options={}] Options passed to `target.create` and setAssociation.
* @param {object} [values={}] values to create associated model instance with
* @param {object} [options={}] Options passed to `target.create` and setAssociation.
*
* @see
* {@link Model#create} for a full explanation of options
......
......@@ -158,8 +158,8 @@ class HasMany extends Association {
* Get everything currently associated with this, using an optional where clause.
*
* @param {Model|Array<Model>} instances source instances
* @param {Object} [options] find options
* @param {Object} [options.where] An optional where clause to limit the associated models
* @param {object} [options] find options
* @param {object} [options.where] An optional where clause to limit the associated models
* @param {string|boolean} [options.scope] Apply a scope on the related model, or remove its default scope by passing false
* @param {string} [options.schema] Apply a schema on the related model
*
......@@ -243,8 +243,8 @@ class HasMany extends Association {
* Count everything currently associated with this, using an optional where clause.
*
* @param {Model} instance the source instance
* @param {Object} [options] find & count options
* @param {Object} [options.where] An optional where clause to limit the associated models
* @param {object} [options] find & count options
* @param {object} [options.where] An optional where clause to limit the associated models
* @param {string|boolean} [options.scope] Apply a scope on the related model, or remove its default scope by passing false
*
* @returns {Promise<number>}
......@@ -272,7 +272,7 @@ class HasMany extends Association {
*
* @param {Model} sourceInstance the source instance
* @param {Model|Model[]|string[]|string|number[]|number} [targetInstances] Can be an array of instances or their primary keys
* @param {Object} [options] Options passed to getAssociations
* @param {object} [options] Options passed to getAssociations
*
* @returns {Promise}
*/
......@@ -313,8 +313,8 @@ class HasMany extends Association {
*
* @param {Model} sourceInstance source instance to associate new instances with
* @param {Model|Model[]|string[]|string|number[]|number} [targetInstances] An array of persisted instances or primary key of instances to associate with this. Pass `null` or `undefined` to remove all associations.
* @param {Object} [options] Options passed to `target.findAll` and `update`.
* @param {Object} [options.validate] Run validation for the join model
* @param {object} [options] Options passed to `target.findAll` and `update`.
* @param {object} [options.validate] Run validation for the join model
*
* @returns {Promise}
*/
......@@ -388,7 +388,7 @@ class HasMany extends Association {
*
* @param {Model} sourceInstance the source instance
* @param {Model|Model[]|string[]|string|number[]|number} [targetInstances] A single instance or primary key, or a mixed array of persisted instances or primary keys
* @param {Object} [options] Options passed to `target.update`.
* @param {object} [options] Options passed to `target.update`.
*
* @returns {Promise}
*/
......@@ -416,7 +416,7 @@ class HasMany extends Association {
*
* @param {Model} sourceInstance instance to un associate instances with
* @param {Model|Model[]|string|string[]|number|number[]} [targetInstances] Can be an Instance or its primary key, or a mixed array of instances and primary keys
* @param {Object} [options] Options passed to `target.update`
* @param {object} [options] Options passed to `target.update`
*
* @returns {Promise}
*/
......@@ -441,8 +441,8 @@ class HasMany extends Association {
* Create a new instance of the associated model and associate it with this.
*
* @param {Model} sourceInstance source instance
* @param {Object} [values] values for target model instance
* @param {Object} [options] Options passed to `target.create`
* @param {object} [values] values for target model instance
* @param {object} [options] Options passed to `target.create`
*
* @returns {Promise}
*/
......
......@@ -113,7 +113,7 @@ class HasOne extends Association {
* Get the associated instance.
*
* @param {Model|Array<Model>} instances source instances
* @param {Object} [options] find options
* @param {object} [options] find options
* @param {string|boolean} [options.scope] Apply a scope on the related model, or remove its default scope by passing false
* @param {string} [options.schema] Apply a schema on the related model
*
......@@ -186,7 +186,7 @@ class HasOne extends Association {
*
* @param {Model} sourceInstance the source instance
* @param {?<Model>|string|number} [associatedInstance] An persisted instance or the primary key of an instance to associate with this. Pass `null` or `undefined` to remove the association.
* @param {Object} [options] Options passed to getAssociation and `target.save`
* @param {object} [options] Options passed to getAssociation and `target.save`
*
* @returns {Promise}
*/
......@@ -235,8 +235,8 @@ class HasOne extends Association {
* Create a new instance of the associated model and associate it with this.
*
* @param {Model} sourceInstance the source instance
* @param {Object} [values={}] values to create associated model instance with
* @param {Object} [options] Options passed to `target.create` and setAssociation.
* @param {object} [values={}] values to create associated model instance with
* @param {object} [options] Options passed to `target.create` and setAssociation.
*
* @see
* {@link Model#create} for a full explanation of options
......
......@@ -46,10 +46,10 @@ exports.addForeignKeyConstraints = addForeignKeyConstraints;
*
* @private
*
* @param {Object} association instance
* @param {Object} obj Model prototype
* @param {object} association instance
* @param {object} obj Model prototype
* @param {Array} methods Method names to inject
* @param {Object} aliases Mapping between model and association method names
* @param {object} aliases Mapping between model and association method names
*
*/
function mixinMethods(association, obj, methods, aliases) {
......
......@@ -157,7 +157,7 @@ class CITEXT extends ABSTRACT {
*/
class NUMBER extends ABSTRACT {
/**
* @param {Object} options type options
* @param {object} options type options
* @param {string|number} [options.length] length of type, like `INT(4)`
* @param {boolean} [options.zerofill] Is zero filled?
* @param {boolean} [options.unsigned] Is unsigned?
......
......@@ -61,7 +61,7 @@ class ConnectionManager {
* @param {string} moduleName Name of dialect module to lookup
*
* @private
* @returns {Object}
* @returns {object}
*/
_loadDialectModule(moduleName) {
try {
......@@ -230,7 +230,7 @@ class ConnectionManager {
* Get connection from pool. It sets database version if it's not already set.
* Call pool.acquire to get a connection
*
* @param {Object} [options] Pool options
* @param {object} [options] Pool options
* @param {string} [options.type] Set which replica to use. Available options are `read` and `write`
* @param {boolean} [options.useMaster=false] Force master or write replica to get connection from
*
......
......@@ -91,9 +91,9 @@ class QueryGenerator {
* Returns an insert into command
*
* @param {string} table
* @param {Object} valueHash attribute value pairs
* @param {Object} modelAttributes
* @param {Object} [options]
* @param {object} valueHash attribute value pairs
* @param {object} modelAttributes
* @param {object} [options]
*
* @private
*/
......@@ -243,9 +243,9 @@ class QueryGenerator {
* Returns an insert into command for multiple values.
*
* @param {string} tableName
* @param {Object} fieldValueHashes
* @param {Object} options
* @param {Object} fieldMappedAttributes
* @param {object} fieldValueHashes
* @param {object} options
* @param {object} fieldMappedAttributes
*
* @private
*/
......@@ -317,10 +317,10 @@ class QueryGenerator {
* Returns an update query
*
* @param {string} tableName
* @param {Object} attrValueHash
* @param {Object} where A hash with conditions (e.g. {name: 'foo'}) OR an ID as integer
* @param {Object} options
* @param {Object} attributes
* @param {object} attrValueHash
* @param {object} where A hash with conditions (e.g. {name: 'foo'}) OR an ID as integer
* @param {object} options
* @param {object} attributes
*
* @private
*/
......@@ -409,10 +409,10 @@ class QueryGenerator {
*
* @param {string} operator String with the arithmetic operator (e.g. '+' or '-')
* @param {string} tableName Name of the table
* @param {Object} where A plain-object with conditions (e.g. {name: 'foo'}) OR an ID as integer
* @param {Object} incrementAmountsByField A plain-object with attribute-value-pairs
* @param {Object} extraAttributesToBeUpdated A plain-object with attribute-value-pairs
* @param {Object} options
* @param {object} where A plain-object with conditions (e.g. {name: 'foo'}) OR an ID as integer
* @param {object} incrementAmountsByField A plain-object with attribute-value-pairs
* @param {object} extraAttributesToBeUpdated A plain-object with attribute-value-pairs
* @param {object} options
*
* @private
*/
......@@ -882,7 +882,7 @@ class QueryGenerator {
/**
* Quote table name with optional alias and schema attribution
*
* @param {string|Object} param table string or object
* @param {string|object} param table string or object
* @param {string|boolean} alias alias name
*
* @returns {string}
......@@ -1693,8 +1693,8 @@ class QueryGenerator {
/**
* Returns the SQL fragments to handle returning the attributes from an insert/update query.
*
* @param {Object} modelAttributes An object with the model attributes.
* @param {Object} options An object with options.
* @param {object} modelAttributes An object with the model attributes.
* @param {object} options An object with options.
*
* @private
*/
......@@ -2040,7 +2040,7 @@ class QueryGenerator {
/**
* Returns an SQL fragment for adding result constraints.
*
* @param {Object} options An object with selectQuery options.
* @param {object} options An object with selectQuery options.
* @returns {string} The generated sql query.
* @private
*/
......
......@@ -25,7 +25,7 @@ const postgresReservedWords = 'all,analyse,analyze,and,any,array,as,asc,asymmetr
*
* @param {string} dialect Dialect name
* @param {string} identifier Identifier to quote
* @param {Object} [options]
* @param {object} [options]
* @param {boolean} [options.force=false]
* @param {boolean} [options.quoteIdentifiers=true]
*
......
......@@ -7,7 +7,7 @@ const TransactionQueries = {
* Returns a query that sets the transaction isolation level.
*
* @param {string} value The isolation level.
* @param {Object} options An object with options.
* @param {object} options An object with options.
* @returns {string} The generated sql query.
* @private
*/
......
......@@ -38,10 +38,10 @@ class AbstractQuery {
* skipValueReplace: bool, do not replace (but do unescape $$). Check correct syntax and if all values are available
*
* @param {string} sql
* @param {Object|Array} values
* @param {object|Array} values
* @param {string} dialect
* @param {Function} [replacementFunc]
* @param {Object} [options]
* @param {object} [options]
* @private
*/
static formatBindParameters(sql, values, dialect, replacementFunc, options) {
......@@ -324,7 +324,7 @@ class AbstractQuery {
/**
* @param {string} sql
* @param {Function} debugContext
* @param {Array|Object} parameters
* @param {Array|object} parameters
* @protected
* @returns {Function} A function to call after the query was completed.
*/
......@@ -397,8 +397,8 @@ class AbstractQuery {
* ]
*
* @param {Array} rows
* @param {Object} includeOptions
* @param {Object} options
* @param {object} includeOptions
* @param {object} options
* @private
*/
static _groupJoinData(rows, includeOptions, options) {
......
......@@ -49,7 +49,7 @@ class ConnectionManager extends AbstractConnectionManager {
* Set the pool handlers on connection.error
* Also set proper timezone once connection is connected.
*
* @param {Object} config
* @param {object} config
* @returns {Promise<Connection>}
* @private
*/
......
......@@ -9,6 +9,7 @@ module.exports = BaseTypes => {
/**
* types: [buffer_type, ...]
*
* @see documentation : https://mariadb.com/kb/en/library/resultset/#field-types
* @see connector implementation : https://github.com/MariaDB/mariadb-connector-nodejs/blob/master/lib/const/field-type.js
*/
......
......@@ -8,7 +8,7 @@ module.exports = BaseTypes => {
/**
* Removes unsupported MSSQL options, i.e., LENGTH, UNSIGNED and ZEROFILL, for the integer data types.
*
* @param {Object} dataType The base integer data type.
* @param {object} dataType The base integer data type.
* @private
*/
function removeUnsupportedIntegerOptions(dataType) {
......@@ -23,6 +23,7 @@ module.exports = BaseTypes => {
/**
* types: [hex, ...]
*
* @see hex here https://github.com/tediousjs/tedious/blob/master/src/data-type.js
*/
......
......@@ -701,7 +701,7 @@ class MSSQLQueryGenerator extends AbstractQueryGenerator {
/**
* Generates an SQL query that returns all foreign keys details of a table.
*
* @param {string|Object} table
* @param {string|object} table
* @param {string} catalogName database name
* @returns {string}
*/
......
......@@ -15,7 +15,7 @@
@param {QueryInterface} qi
@param {string} tableName The name of the table.
@param {string} attributeName The name of the attribute that we want to remove.
@param {Object} options
@param {object} options
@param {boolean|Function} [options.logging] A function that logs the sql queries, or false for explicitly not logging these queries
@private
......
......@@ -49,7 +49,7 @@ class ConnectionManager extends AbstractConnectionManager {
* Set the pool handlers on connection.error
* Also set proper timezone once connection is connected.
*
* @param {Object} config
* @param {object} config
* @returns {Promise<Connection>}
* @private
*/
......
......@@ -8,6 +8,7 @@ module.exports = BaseTypes => {
/**
* types: [buffer_type, ...]
*
* @see buffer_type here https://dev.mysql.com/doc/refman/5.7/en/c-api-prepared-statement-type-codes.html
* @see hex here https://github.com/sidorares/node-mysql2/blob/master/lib/constants/types.js
*/
......
......@@ -488,7 +488,7 @@ class MySQLQueryGenerator extends AbstractQueryGenerator {
/**
* Generates an SQL query that returns all foreign keys of a table.
*
* @param {Object} table The table.
* @param {object} table The table.
* @param {string} schemaName The name of the schema.
* @returns {string} The generated sql query.
* @private
......@@ -501,7 +501,7 @@ class MySQLQueryGenerator extends AbstractQueryGenerator {
/**
* Generates an SQL query that returns the foreign key constraint of a given column.
*
* @param {Object} table The table.
* @param {object} table The table.
* @param {string} columnName The name of the column.
* @returns {string} The generated sql query.
* @private
......
......@@ -17,7 +17,7 @@ const sequelizeErrors = require('../../errors');
@param {QueryInterface} qi
@param {string} tableName The name of the table.
@param {string} columnName The name of the attribute that we want to remove.
@param {Object} options
@param {object} options
@private
*/
......@@ -52,7 +52,7 @@ function removeColumn(qi, tableName, columnName, options) {
* @param {QueryInterface} qi
* @param {string} tableName
* @param {string} constraintName
* @param {Object} options
* @param {object} options
*
* @private
*/
......
......@@ -9,7 +9,7 @@ module.exports = BaseTypes => {
/**
* Removes unsupported Postgres options, i.e., LENGTH, UNSIGNED and ZEROFILL, for the integer data types.
*
* @param {Object} dataType The base integer data type.
* @param {object} dataType The base integer data type.
* @private
*/
function removeUnsupportedIntegerOptions(dataType) {
......@@ -28,6 +28,7 @@ module.exports = BaseTypes => {
* oids: [oid],
* array_oids: [oid]
* }
*
* @see oid here https://github.com/lib/pq/blob/master/oid/types.go
*/
......
......@@ -19,8 +19,8 @@ const _ = require('lodash');
*
* @param {QueryInterface} qi
* @param {string} tableName Name of table to create
* @param {Object} attributes Object representing a list of normalized table attributes
* @param {Object} [options]
* @param {object} attributes Object representing a list of normalized table attributes
* @param {object} [options]
* @param {Model} [model]
*
* @returns {Promise}
......
......@@ -15,7 +15,7 @@ class Query extends AbstractQuery {
* Rewrite query with parameters.
*
* @param {string} sql
* @param {Array|Object} values
* @param {Array|object} values
* @param {string} dialect
* @private
*/
......
......@@ -6,7 +6,7 @@ module.exports = BaseTypes => {
/**
* Removes unsupported SQLite options, i.e., UNSIGNED and ZEROFILL, for the integer data types.
*
* @param {Object} dataType The base integer data type.
* @param {object} dataType The base integer data type.
* @private
*/
function removeUnsupportedIntegerOptions(dataType) {
......
......@@ -21,7 +21,7 @@ const QueryTypes = require('../../query-types');
@param {QueryInterface} qi
@param {string} tableName The name of the table.
@param {string} attributeName The name of the attribute that we want to remove.
@param {Object} options
@param {object} options
@param {boolean|Function} [options.logging] A function that logs the sql queries, or false for explicitly not logging these queries
@since 1.6.0
......@@ -48,8 +48,8 @@ exports.removeColumn = removeColumn;
@param {QueryInterface} qi
@param {string} tableName The name of the table.
@param {Object} attributes An object with the attribute's name as key and its options as value object.
@param {Object} options
@param {object} attributes An object with the attribute's name as key and its options as value object.
@param {object} options
@param {boolean|Function} [options.logging] A function that logs the sql queries, or false for explicitly not logging these queries
@since 1.6.0
......@@ -79,7 +79,7 @@ exports.changeColumn = changeColumn;
@param {string} tableName The name of the table.
@param {string} attrNameBefore The name of the attribute before it was renamed.
@param {string} attrNameAfter The name of the attribute after it was renamed.
@param {Object} options
@param {object} options
@param {boolean|Function} [options.logging] A function that logs the sql queries, or false for explicitly not logging these queries
@since 1.6.0
......@@ -104,7 +104,7 @@ exports.renameColumn = renameColumn;
* @param {QueryInterface} qi
* @param {string} tableName
* @param {string} constraintName
* @param {Object} options
* @param {object} options
*
* @private
*/
......@@ -153,7 +153,7 @@ exports.removeConstraint = removeConstraint;
/**
* @param {QueryInterface} qi
* @param {string} tableName
* @param {Object} options
* @param {object} options
*
* @private
*/
......@@ -184,7 +184,7 @@ exports.addConstraint = addConstraint;
/**
* @param {QueryInterface} qi
* @param {string} tableName
* @param {Object} options Query Options
* @param {object} options Query Options
*
* @private
* @returns {Promise}
......
......@@ -21,7 +21,7 @@ class Query extends AbstractQuery {
* rewrite query with parameters.
*
* @param {string} sql
* @param {Array|Object} values
* @param {Array|object} values
* @param {string} dialect
* @private
*/
......
......@@ -7,7 +7,7 @@ const BaseError = require('./base-error');
* Used with Promise.AggregateError
*
* @param {Error} error Error for a given record/instance
* @param {Object} record DAO instance that error belongs to
* @param {object} record DAO instance that error belongs to
*/
class BulkRecordError extends BaseError {
constructor(error, record) {
......
......@@ -11,6 +11,7 @@ class ConnectionError extends BaseError {
this.name = 'SequelizeConnectionError';
/**
* The connection specific error which triggered this one
*
* @type {Error}
*/
this.parent = parent;
......
......@@ -19,11 +19,13 @@ class DatabaseError extends BaseError {
this.original = parent;
/**
* The SQL that triggered the error
*
* @type {string}
*/
this.sql = parent.sql;
/**
* The parameters for the sql that triggered the error
*
* @type {Array<any>}
*/
this.parameters = parent.parameters;
......
......@@ -13,11 +13,13 @@ class OptimisticLockError extends BaseError {
this.name = 'SequelizeOptimisticLockError';
/**
* The name of the model on which the update was attempted
*
* @type {string}
*/
this.modelName = options.modelName;
/**
* The values of the attempted update
*
* @type {object}
*/
this.values = options.values;
......
......@@ -62,8 +62,8 @@ class ValidationErrorItem {
* @param {string} type The type/origin of the validation error
* @param {string} path The field that triggered the validation error
* @param {string} value The value that generated the error
* @param {Object} [inst] the DAO instance that caused the validation error
* @param {Object} [validatorKey] a validation "key", used for identification
* @param {object} [inst] the DAO instance that caused the validation error
* @param {object} [validatorKey] a validation "key", used for identification
* @param {string} [fnName] property name of the BUILT-IN validator function that caused the validation error (e.g. "in" or "len"), if applicable
* @param {string} [fnArgs] parameters used with the BUILT-IN validator function, if applicable
*/
......@@ -180,7 +180,7 @@ class ValidationErrorItem {
/**
* An enum that defines valid ValidationErrorItem `origin` values
*
* @type {Object}
* @type {object}
* @property CORE {string} specifies errors that originate from the sequelize "core"
* @property DB {string} specifies validation errors that originate from the storage engine
* @property FUNCTION {string} specifies validation errors that originate from validator functions (both built-in and custom) defined for a given attribute
......@@ -196,7 +196,7 @@ ValidationErrorItem.Origins = {
* that maps current `type` strings (as given to ValidationErrorItem.constructor()) to
* our new `origin` values.
*
* @type {Object}
* @type {object}
*/
ValidationErrorItem.TypeStringMap = {
'notnull violation': 'CORE',
......
......@@ -75,7 +75,7 @@ const Hooks = {
/**
* Process user supplied hooks definition
*
* @param {Object} hooks hooks definition
* @param {object} hooks hooks definition
*
* @private
* @memberof Sequelize
......@@ -229,6 +229,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before validation
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance, options
* @name beforeValidate
......@@ -237,6 +238,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after validation
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance, options
* @name afterValidate
......@@ -245,6 +247,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run when validation fails
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance, options, error. Error is the
* SequelizeValidationError. If the callback throws an error, it will replace the original validation error.
......@@ -254,6 +257,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before creating a single instance
*
* @param {string} name
* @param {Function} fn A callback function that is called with attributes, options
* @name beforeCreate
......@@ -262,6 +266,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after creating a single instance
*
* @param {string} name
* @param {Function} fn A callback function that is called with attributes, options
* @name afterCreate
......@@ -270,6 +275,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before creating or updating a single instance, It proxies `beforeCreate` and `beforeUpdate`
*
* @param {string} name
* @param {Function} fn A callback function that is called with attributes, options
* @name beforeSave
......@@ -278,6 +284,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before upserting
*
* @param {string} name
* @param {Function} fn A callback function that is called with attributes, options
* @name beforeUpsert
......@@ -286,6 +293,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after upserting
*
* @param {string} name
* @param {Function} fn A callback function that is called with the result of upsert(), options
* @name afterUpsert
......@@ -294,6 +302,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after creating or updating a single instance, It proxies `afterCreate` and `afterUpdate`
*
* @param {string} name
* @param {Function} fn A callback function that is called with attributes, options
* @name afterSave
......@@ -302,6 +311,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before destroying a single instance
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance, options
*
......@@ -311,6 +321,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after destroying a single instance
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance, options
*
......@@ -320,6 +331,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before restoring a single instance
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance, options
*
......@@ -329,6 +341,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after restoring a single instance
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance, options
*
......@@ -338,6 +351,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before updating a single instance
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance, options
* @name beforeUpdate
......@@ -346,6 +360,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after updating a single instance
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance, options
* @name afterUpdate
......@@ -354,6 +369,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before creating instances in bulk
*
* @param {string} name
* @param {Function} fn A callback function that is called with instances, options
* @name beforeBulkCreate
......@@ -362,6 +378,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after creating instances in bulk
*
* @param {string} name
* @param {Function} fn A callback function that is called with instances, options
* @name afterBulkCreate
......@@ -370,6 +387,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before destroying instances in bulk
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
*
......@@ -379,6 +397,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after destroying instances in bulk
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
*
......@@ -388,6 +407,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before restoring instances in bulk
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
*
......@@ -397,6 +417,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after restoring instances in bulk
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
*
......@@ -406,6 +427,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before updating instances in bulk
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
* @name beforeBulkUpdate
......@@ -414,6 +436,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after updating instances in bulk
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
* @name afterBulkUpdate
......@@ -422,6 +445,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before a find (select) query
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
* @name beforeFind
......@@ -430,6 +454,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before a find (select) query, after any { include: {all: ...} } options are expanded
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
* @name beforeFindAfterExpandIncludeAll
......@@ -438,6 +463,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before a find (select) query, after all option parsing is complete
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
* @name beforeFindAfterOptions
......@@ -446,6 +472,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after a find (select) query
*
* @param {string} name
* @param {Function} fn A callback function that is called with instance(s), options
* @name afterFind
......@@ -454,6 +481,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before a count query
*
* @param {string} name
* @param {Function} fn A callback function that is called with options
* @name beforeCount
......@@ -462,6 +490,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before a define call
*
* @param {string} name
* @param {Function} fn A callback function that is called with attributes, options
* @name beforeDefine
......@@ -470,6 +499,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after a define call
*
* @param {string} name
* @param {Function} fn A callback function that is called with factory
* @name afterDefine
......@@ -478,6 +508,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before Sequelize() call
*
* @param {string} name
* @param {Function} fn A callback function that is called with config, options
* @name beforeInit
......@@ -486,6 +517,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after Sequelize() call
*
* @param {string} name
* @param {Function} fn A callback function that is called with sequelize
* @name afterInit
......@@ -494,6 +526,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before a connection is created
*
* @param {string} name
* @param {Function} fn A callback function that is called with config passed to connection
* @name beforeConnect
......@@ -502,6 +535,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after a connection is created
*
* @param {string} name
* @param {Function} fn A callback function that is called with the connection object and the config passed to connection
* @name afterConnect
......@@ -510,6 +544,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before a connection is disconnected
*
* @param {string} name
* @param {Function} fn A callback function that is called with the connection object
* @name beforeDisconnect
......@@ -518,6 +553,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after a connection is disconnected
*
* @param {string} name
* @param {Function} fn A callback function that is called with the connection object
* @name afterDisconnect
......@@ -526,6 +562,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before Model.sync call
*
* @param {string} name
* @param {Function} fn A callback function that is called with options passed to Model.sync
* @name beforeSync
......@@ -534,6 +571,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after Model.sync call
*
* @param {string} name
* @param {Function} fn A callback function that is called with options passed to Model.sync
* @name afterSync
......@@ -542,6 +580,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run before sequelize.sync call
*
* @param {string} name
* @param {Function} fn A callback function that is called with options passed to sequelize.sync
* @name beforeBulkSync
......@@ -550,6 +589,7 @@ exports.applyTo = applyTo;
/**
* A hook that is run after sequelize.sync call
*
* @param {string} name
* @param {Function} fn A callback function that is called with options passed to sequelize.sync
* @name afterBulkSync
......
......@@ -12,7 +12,7 @@ const validator = require('./utils/validator-extras').validator;
* Instance Validator.
*
* @param {Instance} modelInstance The model instance.
* @param {Object} options A dictionary with options.
* @param {object} options A dictionary with options.
*
* @private
*/
......@@ -34,6 +34,7 @@ class InstanceValidator {
/**
* Exposes a reference to validator.js. This allows you to add custom validations using `validator.extend`
*
* @name validator
* @private
*/
......@@ -280,7 +281,7 @@ class InstanceValidator {
* @param {string} validatorType One of known to Sequelize validators.
* @param {string} field The field that is being validated
*
* @returns {Object} An object with specific keys to invoke the validator.
* @returns {object} An object with specific keys to invoke the validator.
*/
_invokeBuiltinValidator(value, test, validatorType, field) {
return Promise.try(() => {
......@@ -329,7 +330,7 @@ class InstanceValidator {
/**
* Will validate a single field against its schema definition (isnull).
*
* @param {Object} rawAttribute As defined in the Schema.
* @param {object} rawAttribute As defined in the Schema.
* @param {string} field The field name.
* @param {*} value anything.
*
......@@ -421,7 +422,9 @@ class InstanceValidator {
}
}
/**
* @define {string} The error key for arguments as passed by custom validators
* The error key for arguments as passed by custom validators
*
* @type {string}
* @private
*/
InstanceValidator.RAW_KEY_NAME = 'original';
......
......@@ -39,7 +39,7 @@ class ModelManager {
* Will take foreign key constraints into account so that dependencies are visited before dependents.
*
* @param {Function} iterator method to execute on each model
* @param {Object} [options] iterator options
* @param {object} [options] iterator options
* @private
*/
forEachModel(iterator, options) {
......
......@@ -15,7 +15,7 @@ class Transaction {
* Creates a new transaction instance
*
* @param {Sequelize} sequelize A configured sequelize Instance
* @param {Object} options An object with options
* @param {object} options An object with options
* @param {string} [options.type] Sets the type of the transaction. Sqlite only
* @param {string} [options.isolationLevel] Sets the isolation level of the transaction.
* @param {string} [options.deferrable] Sets the constraints to be deferred or immediately checked. PostgreSQL only
......@@ -286,7 +286,7 @@ class Transaction {
* });
* # The query will now return any rows that aren't locked by another transaction
*
* @returns {Object}
* @returns {object}
* @property UPDATE
* @property SHARE
* @property KEY_SHARE Postgres 9.3+ only
......
......@@ -380,8 +380,8 @@ exports.removeTicks = removeTicks;
* address.coordinates.longitude: 12.5964313
* }
*
* @param {Object} value an Object
* @returns {Object} a flattened object
* @param {object} value an Object
* @returns {object} a flattened object
* @private
*/
function flattenObjectDeep(value) {
......@@ -407,6 +407,7 @@ exports.flattenObjectDeep = flattenObjectDeep;
/**
* Utility functions for representing SQL functions, and columns that should be escaped.
* Please do not use these functions directly, use Sequelize.fn and Sequelize.col instead.
*
* @private
*/
class SequelizeMethod {}
......@@ -488,8 +489,8 @@ exports.Where = Where;
/**
* getOperators
*
* @param {Object} obj
* @returns {Array<Symbol>} All operators properties of obj
* @param {object} obj
* @returns {Array<symbol>} All operators properties of obj
* @private
*/
function getOperators(obj) {
......@@ -500,8 +501,8 @@ exports.getOperators = getOperators;
/**
* getComplexKeys
*
* @param {Object} obj
* @returns {Array<string|Symbol>} All keys including operators
* @param {object} obj
* @returns {Array<string|symbol>} All keys including operators
* @private
*/
function getComplexKeys(obj) {
......@@ -512,7 +513,7 @@ exports.getComplexKeys = getComplexKeys;
/**
* getComplexSize
*
* @param {Object|Array} obj
* @param {object|Array} obj
* @returns {number} Length of object properties including operators if obj is array returns its length
* @private
*/
......@@ -524,7 +525,7 @@ exports.getComplexSize = getComplexSize;
/**
* Returns true if a where clause is empty, even with Symbols
*
* @param {Object} obj
* @param {object} obj
* @returns {boolean}
* @private
*/
......@@ -549,7 +550,7 @@ exports.generateEnumName = generateEnumName;
/**
* Returns an new Object which keys are camelized
*
* @param {Object} obj
* @param {object} obj
* @returns {string}
* @private
*/
......@@ -570,9 +571,9 @@ exports.camelizeObjectKeys = camelizeObjectKeys;
*
* **Note:** This method mutates `object`.
*
* @param {Object} object The destination object.
* @param {...Object} [sources] The source objects.
* @returns {Object} Returns `object`.
* @param {object} object The destination object.
* @param {...object} [sources] The source objects.
* @returns {object} Returns `object`.
* @private
*/
function defaults(object, ...sources) {
......@@ -602,12 +603,12 @@ exports.defaults = defaults;
/**
*
* @param {Object} index
* @param {object} index
* @param {Array} index.fields
* @param {string} [index.name]
* @param {string|Object} tableName
* @param {string|object} tableName
*
* @returns {Object}
* @returns {object}
* @private
*/
function nameIndex(index, tableName) {
......
......@@ -2257,9 +2257,9 @@
"dev": true
},
"comment-parser": {
"version": "0.5.5",
"resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.5.5.tgz",
"integrity": "sha512-oB3TinFT+PV3p8UwDQt71+HkG03+zwPwikDlKU6ZDmql6QX2zFlQ+G0GGSDqyJhdZi4PSlzFBm+YJ+ebOX3Vgw==",
"version": "0.7.2",
"resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-0.7.2.tgz",
"integrity": "sha512-4Rjb1FnxtOcv9qsfuaNuVsmmVn4ooVoBHzYfyKteiXwIU84PClyGA5jASoFMwPV93+FPh9spwueXauxFJZkGAg==",
"dev": true
},
"commondir": {
......@@ -3480,14 +3480,27 @@
}
},
"eslint-plugin-jsdoc": {
"version": "4.8.4",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-4.8.4.tgz",
"integrity": "sha512-VDP+BI2hWpKNNdsJDSPofSQ9q7jGLgWbDMI0LzOeEcfsTjSS7jQtHDUuVLQ5E+OV2MPyQPk/3lnVcHfStXk5yA==",
"version": "20.4.0",
"resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-20.4.0.tgz",
"integrity": "sha512-c/fnEpwWLFeQn+A7pb1qLOdyhovpqGCWCeUv1wtzFNL5G+xedl9wHUnXtp3b1sGHolVimi9DxKVTuhK/snXoOw==",
"dev": true,
"requires": {
"comment-parser": "^0.5.4",
"jsdoctypeparser": "3.1.0",
"lodash": "^4.17.11"
"comment-parser": "^0.7.2",
"debug": "^4.1.1",
"jsdoctypeparser": "^6.1.0",
"lodash": "^4.17.15",
"object.entries-ponyfill": "^1.0.1",
"regextras": "^0.7.0",
"semver": "^6.3.0",
"spdx-expression-parse": "^3.0.0"
},
"dependencies": {
"semver": {
"version": "6.3.0",
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
"dev": true
}
}
},
"eslint-plugin-mocha": {
......@@ -5548,9 +5561,9 @@
"dev": true
},
"jsdoctypeparser": {
"version": "3.1.0",
"resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-3.1.0.tgz",
"integrity": "sha512-JNbkKpDFqbYjg+IU3FNo7qjX7Opy7CwjHywT32zgAcz/d4lX6Umn5jOHVETUdnNNgGrMk0nEx1gvP0F4M0hzlQ==",
"version": "6.1.0",
"resolved": "https://registry.npmjs.org/jsdoctypeparser/-/jsdoctypeparser-6.1.0.tgz",
"integrity": "sha512-UCQBZ3xCUBv/PLfwKAJhp6jmGOSLFNKzrotXGNgbKhWvz27wPsCsVeP7gIcHPElQw2agBmynAitXqhxR58XAmA==",
"dev": true
},
"jsdom": {
......@@ -10897,6 +10910,12 @@
"object-keys": "^1.0.11"
}
},
"object.entries-ponyfill": {
"version": "1.0.1",
"resolved": "https://registry.npmjs.org/object.entries-ponyfill/-/object.entries-ponyfill-1.0.1.tgz",
"integrity": "sha1-Kavfd8v70mVm3RqiTp2I9lQz0lY=",
"dev": true
},
"object.getownpropertydescriptors": {
"version": "2.0.3",
"resolved": "https://registry.npmjs.org/object.getownpropertydescriptors/-/object.getownpropertydescriptors-2.0.3.tgz",
......@@ -11636,6 +11655,12 @@
"integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==",
"dev": true
},
"regextras": {
"version": "0.7.0",
"resolved": "https://registry.npmjs.org/regextras/-/regextras-0.7.0.tgz",
"integrity": "sha512-ds+fL+Vhl918gbAUb0k2gVKbTZLsg84Re3DI6p85Et0U0tYME3hyW4nMK8Px4dtDaBA2qNjvG5uWyW7eK5gfmw==",
"dev": true
},
"registry-auth-token": {
"version": "4.1.0",
"resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.1.0.tgz",
......
......@@ -62,7 +62,7 @@
"esdoc-inject-style-plugin": "^1.0.0",
"esdoc-standard-plugin": "^1.0.0",
"eslint": "^6.8.0",
"eslint-plugin-jsdoc": "^4.1.1",
"eslint-plugin-jsdoc": "^20.4.0",
"eslint-plugin-mocha": "^6.2.2",
"fs-jetpack": "^2.2.3",
"husky": "^1.3.1",
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!