MCPcopy Create free account

hub / github.com/bypatryk/firestore-schema-validator / functions

Functions92 in github.com/bypatryk/firestore-schema-validator

↓ 20 callersFunctionexpectEachToBe
(array, cb, value)
test/validators.test.js:4
↓ 5 callersMethod_add
* Adds filter to stack. * * @param {Function} filter * @returns {this} * @memberof Field
lib/Field.js:164
↓ 4 callersFunctionasyncForEach
(array, callback)
lib/helpers.js:7
↓ 3 callersMethod_defineType
* Sets _isTypeDefined to true, so Field can only be of one type. * * @memberof Field
lib/Field.js:150
↓ 3 callersMethodemit
* Emits event. * * @param {String} event - Event name. * @memberof Model
lib/Model.js:185
↓ 3 callersFunctionisData
(target, key)
lib/ModelProxy.js:8
↓ 3 callersFunctionisObject
(value)
lib/helpers.js:21
↓ 3 callersFunctionmarkAsChanged
(changedKeys, value, path = [])
lib/helpers.js:33
↓ 2 callersFunctionisNumber
lib/validators.js:62
↓ 2 callersFunctionisPrivate
(key)
lib/ModelProxy.js:4
↓ 2 callersFunctionnestedHandler
(model, path = [])
lib/ModelProxy.js:15
↓ 2 callersMethodparseData
* Parses Document Data, running hooks and validating it. * * @param {*} [data=this._data] * @param {boolean} [all=false] * @returns Update
lib/Model.js:397
↓ 2 callersMethodrunHooks
* Runs hooks on Document Data. * * @param {Object} hooks * @param {Object} [data={}] * @returns Updated Document Data. * @memberof Mode
lib/Model.js:373
↓ 2 callersMethodvalidate
* Validates Field Data against Field. * * @param {*} fieldData Field Data. * @returns Validated Field Data. * @memberof Field
lib/Field.js:49
↓ 1 callersFunctionisArray
lib/validators.js:29
↓ 1 callersFunctionisBoolean
lib/validators.js:35
↓ 1 callersFunctionisDocumentReference
lib/validators.js:38
↓ 1 callersFunctionisGeoPoint
lib/validators.js:41
↓ 1 callersFunctionisMap
lib/validators.js:51
↓ 1 callersFunctionisNull
lib/validators.js:59
↓ 1 callersFunctionisString
lib/validators.js:66
↓ 1 callersFunctionisTimestamp
lib/validators.js:69
↓ 1 callersMethodvalidate
* Validates Document Data. * * @param {*} [data={}] * @param {boolean} [all=false] * @returns Validated Data. * @memberof Model
lib/Model.js:358
↓ 1 callersMethodvalidate
* Validates Document Data agains Fields. * * @param {Object} [data={}] * @param {Object<Field>} [fields=this._fields] * @returns Validated
lib/Schema.js:27
↓ 1 callersMethodvalidateArray
* Validates nested Fields of Array Field. * * @param {*} arrayData Array Data. * @returns Validated Array Data. * @memberof Field
lib/Field.js:129
↓ 1 callersMethodvalidateField
* Validated Field Data at high level. * * @param {*} fieldData Field Data. * @returns Validated Field Data. * @memberof Field
lib/Field.js:84
↓ 1 callersMethodvalidateObject
* Validates nested Fields of Object Field. * * @param {*} fieldData Field Data. * @returns Validated Field Data. * @memberof Field
lib/Field.js:106
↓ 1 callersMethodvalidateSelected
* Validates Document Data against selected Fields. * * @param {Object} [data={}] Document Data * @param {Set} [changedKeys=new Set()] Set wit
lib/Schema.js:51
FunctionModelProxy
(model)
lib/ModelProxy.js:37
Method_collectionPath
* Collection Path. * * @readonly * @type {String} * @memberof Model
lib/Model.js:111
Method_collectionRef
* Collection Reference. * * @readonly * @static * @type {CollectionReference} * @memberof Model
lib/Model.js:123
Method_createdAt
* Date of Document creation in ISO String format. * * @readonly * @type {String} * @memberof Model
lib/Model.js:74
Method_docRef
* Document Reference. * * @readonly * @type {String} * @memberof Model
lib/Model.js:147
Method_events
* Instance of EventEmitter used with this.on() and this.emit(). * * @readonly * @static * @type {EventEmitter} * @memberof Model
lib/Model.js:160
Method_id
* ID of Document. * * @readonly * @type {String} * @memberof Model
lib/Model.js:63
Method_updatedAt
* Date of Document update in ISO String format. * * @readonly * @type {String} * @memberof Model
lib/Model.js:93
Functionafter
( date, errorMessage = `%s must be after ${date}.`, )
lib/filters.js:6
FunctionallExcept
(except)
test/utils.js:96
Functionany
( errorMessage = `%s must be of one of the types accepted by Cloud Firestore: ${validators.FIRESTORE_TYPES.j
lib/filters.js:16
Functionarray
( errorMessage = '%s must be an Array.', )
lib/filters.js:25
MethodarrayOf
* Defines Field as an Array with items defined by nested Field or Schema. * * @param {Field|Schema} fieldOrSchema Field or Schema. * @param {
lib/Field.js:226
Functionbefore
( date, errorMessage = `%s must be before ${date}.`, )
lib/filters.js:34
Functionboolean
( errorMessage = '%s must be a Boolean.', )
lib/filters.js:44
Methodconstructor
* Creates an instance of Model. * * @param {DocumentSnapshot} _snapshot - Document Snapshot. * @param {Object} _data - Document Data. * @r
lib/Model.js:25
Methodconstructor
* Creates an instance of Schema. * * @param {Object<Field>} _fields Object containing Field definitions. * @memberof Schema
lib/Schema.js:15
Methodconstructor
* Creates an instance of Field. * * @param {String} _label Field's Label. * @memberof Field
lib/Field.js:21
Methodcreate
* Creates new Document. * * @static * @param {Object} [data={}] * @returns Instance of this. * @memberof Model
lib/Model.js:301
Methodcustom
* Adds custom filter to stack. * * @param {Function} filter * @returns {this} * @memberof Field
lib/Field.js:177
Functiondate
( format, errorMessage = format ? `%s must be a valid Date in ${format} format.` : '%s must be a v
lib/filters.js:53
Methoddefault
* Defines default value that will be returned if Field Data is undefined. * * @param {*} defaultValue * @returns {this} * @memberof Field
lib/Field.js:188
Methoddelete
* Deletes Document. * * @memberof Model
lib/Model.js:323
Functionemail
( errorMessage = '%s must be a valid email.', )
lib/filters.js:70
Functionequal
( compare, errorMessage = `%s must equal ${compare}.`, )
lib/filters.js:101
Functionfield
(...args)
lib/index.js:8
Functiongeopoint
( errorMessage = '% must be an instance of GeoPoint.', )
lib/filters.js:111
Functionget
(target, key)
lib/ModelProxy.js:17
MethodgetAllBy
* Fetches all Documents by key and value pair. * * @static * @param {String} key * @param {*} value * @param {array} optionalModifiers
lib/Model.js:279
MethodgetBy
* Fetches Document by key and value pair. * * @static * @param {String} key - Key. * @param {*} value - Value to compare. * @returns {t
lib/Model.js:255
MethodgetById
* Fetches Document by ID. * * @static * @param {String} id * @returns {this|null} Instance of Model or null. * @memberof Model
lib/Model.js:235
Functioninteger
( errorMessage = '%s must be an Integer Number.', )
lib/filters.js:120
FunctionisAfter
(date, value)
lib/validators.js:15
FunctionisAny
lib/validators.js:18
FunctionisBefore
(date, value)
lib/validators.js:32
FunctionisInRange
(min, max, value)
lib/validators.js:44
FunctionisInteger
lib/validators.js:48
FunctionisMatching
(regex, value)
lib/validators.js:56
Functionlength
( length, errorMessage = `%s must have length of ${length}.`, )
lib/filters.js:129
Functionmatch
( regex, errorMessage = `%s must match ${regex} pattern.`, )
lib/filters.js:139
Functionmax
( max, errorMessage = `%s must be a Number less than or equal to ${max}.`, )
lib/filters.js:149
FunctionmaxLength
( maxLength, errorMessage = `%s must have length of at most ${maxLength}.`, )
lib/filters.js:159
Functionmin
( min, errorMessage = `%s must be a Number greater than or equal to ${min}.`, )
lib/filters.js:169
FunctionminLength
( minLength, errorMessage = `%s must have length of at least ${minLength}.`, )
lib/filters.js:179
Methodnullable
* Allows Field Data to be null. * * @returns {this} * @memberof Field
lib/Field.js:200
Functionnumber
( errorMessage = '%s must be a Number.', )
lib/filters.js:189
Functionobject
( errorMessage = '%s must be a Map.', )
lib/filters.js:198
MethodobjectOf
* Defines Field as an Object with entries defined by nested object of Fields or Schema. * * @param {Object<Field>|Schema} objectOfFieldsOrSchema
lib/Field.js:241
Methodon
* Subsribes to event. * * @static * @param {String} event - Event name. * @param {Function} cb - Callback function. * @memberof Model
lib/Model.js:175
FunctiononeOf
( acceptableValues, errorMessage = `%s must be one of the accepted values (${acceptableValues.join(', ')})
lib/filters.js:81
Methodoptional
* Makes Field optional. * * @returns {this} * @memberof Field
lib/Field.js:212
Methodposthook
* Adds hook that will be fired after parsing data * if this[path] has changed. * * @static * @param {String} path - Path of property. *
lib/Model.js:217
Methodprehook
* Adds hook that will be fired before parsing data * if this[path] has changed. * * @static * @param {String} path - Path of property.
lib/Model.js:198
Functionrange
( min, max, errorMessage = `%s must be a Number between ${min} and ${max}`, )
lib/filters.js:207
Functionreference
( errorMessage = '%s must be an instance of DocumentReference.', )
lib/filters.js:218
Methodsave
* Saves changes made to Document. * * @param {*} options * @returns This. * @memberof Model
lib/Model.js:337
Functionschema
(...args)
lib/index.js:11
Functionset
(target, key, value)
lib/ModelProxy.js:30
Functionstring
( errorMessage = '%s must be a String.', )
lib/filters.js:227
Functiontimestamp
( errorMessage = '%s must be an instance of Timestamp.', )
lib/filters.js:236
MethodtoJSON
* Exposes public data to be shown in API responses. * * @returns {Object} * @memberof Model
lib/Model.js:413
FunctiontoLowerCase
( errorMessage = 'Couldn\'t turn %s to lower case.', )
lib/filters.js:255
FunctiontoUpperCase
( errorMessage = 'Couldn\'t turn %s to upper case.', )
lib/filters.js:265
Functiontrim
( errorMessage = 'Couldn\'t trim %s.', )
lib/filters.js:245