2014-01-22 17:57:41 -05:00
|
|
|
c = require '../commons/schemas'
|
2014-01-17 12:53:17 -05:00
|
|
|
emailSubscriptions = ['announcement', 'tester', 'level_creator', 'developer', 'article_editor', 'translator', 'support', 'notification']
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
UserSchema = c.object {},
|
|
|
|
name: c.shortString({title: 'Display Name', default:''})
|
|
|
|
email: c.shortString({title: 'Email', format: 'email'})
|
|
|
|
firstName: c.shortString({title: 'First Name'})
|
|
|
|
lastName: c.shortString({title: 'Last Name'})
|
|
|
|
gender: {type: 'string', 'enum': ['male', 'female']}
|
|
|
|
password: {type: 'string', maxLength: 256, minLength: 2, title:'Password'}
|
|
|
|
passwordReset: {type: 'string'}
|
|
|
|
photoURL: {type: 'string', format: 'url', required: false}
|
|
|
|
|
|
|
|
facebookID: c.shortString({title: 'Facebook ID'})
|
|
|
|
gplusID: c.shortString({title: 'G+ ID'})
|
|
|
|
|
|
|
|
wizardColor1: c.pct({title: 'Wizard Clothes Color'})
|
|
|
|
volume: c.pct({title: 'Volume'})
|
|
|
|
music: {type: 'boolean', default: true}
|
2014-03-21 16:04:16 -04:00
|
|
|
autocastDelay: {type: 'integer', 'default': 5000 }
|
2014-03-21 19:49:30 -04:00
|
|
|
lastLevel: { type: 'string' }
|
2014-01-03 13:32:13 -05:00
|
|
|
|
2014-03-10 16:20:00 -04:00
|
|
|
emailSubscriptions: c.array {uniqueItems: true, 'default': ['announcement', 'notification']}, {'enum': emailSubscriptions}
|
2014-01-03 13:32:13 -05:00
|
|
|
|
|
|
|
# server controlled
|
|
|
|
permissions: c.array {'default': []}, c.shortString()
|
|
|
|
dateCreated: c.date({title: 'Date Joined'})
|
|
|
|
anonymous: {type: 'boolean', 'default': true}
|
|
|
|
testGroupNumber: {type: 'integer', minimum: 0, maximum: 256, exclusiveMaximum: true}
|
|
|
|
mailChimp: {type: 'object'}
|
|
|
|
hourOfCode: {type: 'boolean'}
|
|
|
|
hourOfCodeComplete: {type: 'boolean'}
|
2014-03-10 16:20:00 -04:00
|
|
|
|
2014-01-03 13:32:13 -05:00
|
|
|
emailLower: c.shortString()
|
|
|
|
nameLower: c.shortString()
|
|
|
|
passwordHash: {type: 'string', maxLength: 256}
|
|
|
|
|
|
|
|
# client side
|
|
|
|
#gravatarProfile: {} (should only ever be kept locally)
|
|
|
|
emailHash: {type: 'string'}
|
|
|
|
|
|
|
|
#Internationalization stuff
|
|
|
|
preferredLanguage: {type: 'string', default: 'en', 'enum': c.getLanguageCodeArray()}
|
2014-03-10 16:20:00 -04:00
|
|
|
|
2014-01-03 13:32:13 -05:00
|
|
|
signedCLA: c.date({title: 'Date Signed the CLA'})
|
2014-01-12 14:54:50 -05:00
|
|
|
wizard: c.object {},
|
|
|
|
colorConfig: c.object {additionalProperties: c.colorConfig()}
|
2014-01-03 13:32:13 -05:00
|
|
|
|
2014-03-13 21:08:31 -04:00
|
|
|
aceConfig: c.object {},
|
|
|
|
keyBindings: {type: 'string', 'default': 'default', 'enum': ['default', 'vim', 'emacs']}
|
|
|
|
invisibles: {type: 'boolean', 'default': false}
|
|
|
|
indentGuides: {type: 'boolean', 'default': false}
|
2014-03-14 13:14:48 -04:00
|
|
|
behaviors: {type: 'boolean', 'default': false}
|
2014-03-13 21:08:31 -04:00
|
|
|
|
2014-03-20 18:40:02 -04:00
|
|
|
simulatedBy: {type: 'integer', minimum: 0, default: 0}
|
|
|
|
simulatedFor: {type: 'integer', minimum: 0, default: 0}
|
|
|
|
|
2014-01-03 13:32:13 -05:00
|
|
|
c.extendBasicProperties UserSchema, 'user'
|
|
|
|
|
|
|
|
module.exports = UserSchema
|