@rheactorjs/models
Advanced tools
Comparing version 2.1.1 to 3.0.0
@@ -39,3 +39,3 @@ 'use strict'; | ||
/** | ||
* @param {{$id: URIValue, $version: Number, $createdAt: Date|undefined, $updatedAt: Date|undefined, $deletedAt: Date|undefined, email: EmailValue, firstname: String|undefined, lastname: String|undefined, avatar: URIValue|undefined, superUser: Boolean|undefined, active: Boolean|undefined, preferences: Object|undefined}} fields | ||
* @param {{$id: URIValue, $version: Number, $createdAt: Date|undefined, $updatedAt: Date|undefined, $deletedAt: Date|undefined, email: EmailValue, name: String|undefined, avatar: URIValue|undefined, superUser: Boolean|undefined, active: Boolean|undefined, preferences: Object|undefined}} fields | ||
*/ | ||
@@ -48,4 +48,3 @@ function User(fields) { | ||
_this.email = (0, _valueObjects.EmailValueType)(fields.email, ['User', 'email:EmailValue']); | ||
_this.firstname = (0, _types.NonEmptyStringType)(fields.firstname, ['User', 'firstname:String']); | ||
_this.lastname = (0, _types.NonEmptyStringType)(fields.lastname, ['User', 'lastname:String']); | ||
_this.name = (0, _types.NonEmptyStringType)(fields.name, ['User', 'name:String']); | ||
_this.avatar = (0, _valueObjects.MaybeURIValueType)(fields.avatar, ['User', 'avatar:?URIValue']); | ||
@@ -55,4 +54,2 @@ _this.superUser = (0, _tcomb.Boolean)(fields.superUser || false, ['User', 'superUser:Boolean']); | ||
_this.preferences = PreferencesType(fields.preferences || {}, ['User', 'preferences:Map(String: Any)']); | ||
_this.name = [_this.firstname, _this.lastname].join(' '); | ||
return _this; | ||
@@ -62,3 +59,3 @@ } | ||
/** | ||
* @returns {{$id: String, $version: Number, $context: String, $contextVersion: Number, $links: Array<Link>, $createdAt: String|undefined, $updatedAt: String|undefined, $deletedAt: String|undefined, email: String, firstname: String|undefined, lastname: String|undefined, avatar: String|undefined, superUser: Boolean|undefined, active: Boolean|undefined, preferences: String}} | ||
* @returns {{$id: String, $version: Number, $context: String, $contextVersion: Number, $links: Array<Link>, $createdAt: String|undefined, $updatedAt: String|undefined, $deletedAt: String|undefined, email: String, name: String|undefined, avatar: String|undefined, superUser: Boolean|undefined, active: Boolean|undefined, preferences: String}} | ||
*/ | ||
@@ -72,4 +69,3 @@ | ||
email: this.email.toString(), | ||
firstname: this.firstname, | ||
lastname: this.lastname, | ||
name: this.name, | ||
avatar: this.avatar ? this.avatar.toString() : undefined, | ||
@@ -83,3 +79,3 @@ superUser: this.superUser, | ||
/** | ||
* @param {{$id: String, $context: String, $links: Array<Link>, $createdAt: String|undefined, $updatedAt: String|undefined, $deletedAt: String|undefined, email: String, firstname: String|undefined, lastname: String|undefined, avatar: String|undefined, superUser: Boolean|undefined, active: Boolean|undefined, preferences: String}} data | ||
* @param {{$id: String, $context: String, $links: Array<Link>, $createdAt: String|undefined, $updatedAt: String|undefined, $deletedAt: String|undefined, email: String, name: String|undefined, avatar: String|undefined, superUser: Boolean|undefined, active: Boolean|undefined, preferences: String}} data | ||
* @returns {Entity} | ||
@@ -94,4 +90,3 @@ */ | ||
email: new _valueObjects.EmailValue(data.email), | ||
firstname: data.firstname, | ||
lastname: data.lastname, | ||
name: data.name, | ||
avatar: data.avatar ? new _valueObjects.URIValue(data.avatar) : undefined, | ||
@@ -143,4 +138,3 @@ superUser: data.superUser, | ||
email: _types.NonEmptyStringType, | ||
firstname: _types.NonEmptyStringType, | ||
lastname: _types.NonEmptyStringType, | ||
name: _types.NonEmptyStringType, | ||
avatar: _types.MaybeStringType, | ||
@@ -147,0 +141,0 @@ superUser: _types.MaybeBooleanType, |
{ | ||
"name": "@rheactorjs/models", | ||
"description": "A collection of models", | ||
"version": "2.1.1", | ||
"version": "3.0.0", | ||
"main": "dist/index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
72231
1401