freeCodeCamp/common/models/user.json

206 lines
4.0 KiB
JSON

{
"name": "user",
"base": "User",
"strict": true,
"idInjection": true,
"trackChanges": false,
"properties": {
"email": {
"type": "string",
"index": {
"mongodb": {
"unique": true,
"background": true,
"sparse": true
}
}
},
"password": {
"type": "string"
},
"progressTimestamps": {
"type": "array",
"default": []
},
"isGithubCool": {
"type": "boolean",
"default": false
},
"githubId": {
"type": "string"
},
"githubURL": {
"type": "string"
},
"githubEmail": {
"type": "string"
},
"joinedGithubOn": {
"type": "date"
},
"isMigrationGrandfathered": {
"type": "boolean",
"default": false
},
"username": {
"type": "string",
"require": true,
"index": {
"mongodb": {
"unique": true,
"background": true
}
}
},
"bio": {
"type": "string",
"default": ""
},
"name": {
"type": "string",
"default": ""
},
"gender": {
"type": "string",
"default": ""
},
"location": {
"type": "string",
"default": ""
},
"picture": {
"type": "string",
"default": ""
},
"linkedinProfile": {
"type": "string",
"default": ""
},
"githubProfile": {
"type": "string",
"default": ""
},
"codepenProfile": {
"type": "string",
"default": ""
},
"twitterHandle": {
"type": "string",
"default": ""
},
"facebookProfile": {
"type": "string",
"default": ""
},
"completedBonfires": {
"type": [
{
"id": "string",
"name": "string",
"completedWith": "string",
"completedDate": "string",
"solution": "string"
}
],
"default": []
},
"uncompletedCoursewares": {
"type": "array",
"default": []
},
"completedCoursewares": {
"type": [
{
"completedDate": {
"type": "string",
"defaultFn": "now"
},
"id": "string",
"name": "string",
"completedWith": "string",
"solution": "string",
"githubLink": "string",
"verified": "boolean"
}
],
"default": []
},
"currentStreak": {
"type": "number",
"default": 0
},
"longestStreak": {
"type": "number",
"default": 0
},
"sendMonthlyEmail": {
"type": "boolean",
"default": true
},
"currentChallenge": {
"type": {}
},
"completedChallenges": {
"type": [
{
"completedDate": "number",
"id": "string",
"name": "string",
"completedWith": "string",
"solution": "string",
"githubLink": "string",
"verified": "boolean",
"challengeType": {
"type": "number",
"default": 0
}
}
],
"default": []
}
},
"validations": [],
"relations": {
"credentials": {
"type": "hasMany",
"model": "userCredential",
"foreignKey": ""
},
"identities": {
"type": "hasMany",
"model": "userIdentity",
"foreignKey": ""
}
},
"acls": [
{
"accessType": "*",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "DENY"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW",
"property": "doesExist"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW",
"property": "about"
},
{
"accessType": "EXECUTE",
"principalType": "ROLE",
"principalId": "$everyone",
"permission": "ALLOW",
"property": "giveBrowniePoints"
}
],
"methods": []
}