{
	"type": "object",
	"additionalProperties": false,
	"properties": {
		"name": {
			"type": "string",
			"maxLength": 100,
			"title": "Name",
			"pattern": "^[A-Z][A-Za-z0-9]*$"
		},
		"slug": {
			"type": "string",
			"maxLength": 100,
			"title": "Slug",
			"format": "hidden"
		},
		"system": {
			"title": "System",
			"description": "The short name of the System this Component belongs to, like ai.",
			"type": "string",
			"enum": [
				"action",
				"ai",
				"alliance",
				"collision",
				"combat",
				"display",
				"event",
				"existence",
				"hearing",
				"inventory",
				"movement",
				"programming",
				"targeting",
				"ui",
				"vision",
				"misc",
				"physics",
				"effect",
				"magic",
				"game",
				"junior"
			]
		},
		"description": {
			"title": "Description",
			"description": "A short explanation of what this Component does.",
			"type": "string",
			"maxLength": 2000
		},
		"codeLanguage": {
			"type": "string",
			"title": "Language",
			"description": "Which programming language this Component is written in.",
			"enum": [
				"coffeescript",
				"javascript"
			]
		},
		"code": {
			"title": "Code",
			"description": "The code for this Component, as a CoffeeScript/JavaScript class. TODO: add link to documentation for how to write these.",
			"type": "string",
			"format": "coffee"
		},
		"js": {
			"title": "JavaScript",
			"description": "The transpiled JavaScript code for this Component",
			"type": "string",
			"format": "hidden"
		},
		"dependencies": {
			"type": "array",
			"items": {
				"type": "object",
				"additionalProperties": false,
				"properties": {
					"original": {
						"type": [
							"object",
							"string"
						],
						"title": "Original",
						"description": "A reference to another Component upon which this Component depends."
					},
					"majorVersion": {
						"title": "Major Version",
						"description": "Which major version of the Component this Component needs.",
						"type": "integer",
						"minimum": 0
					}
				},
				"title": "Component Dependency",
				"description": "A Component upon which this Component depends.",
				"required": [
					"original",
					"majorVersion"
				],
				"format": "latest-version-reference",
				"links": [
					{
						"rel": "db",
						"href": "/db/level.component/{(original)}/version/{(majorVersion)}"
					}
				]
			},
			"title": "Dependencies",
			"description": "An array of Components upon which this Component depends.",
			"uniqueItems": true
		},
		"propertyDocumentation": {
			"type": "array",
			"items": {
				"type": "object",
				"additionalProperties": false,
				"properties": {
					"name": {
						"type": "string",
						"title": "Name",
						"description": "Name of the property."
					},
					"componentName": {
						"type": "string",
						"description": "Component Name for ozaria."
					},
					"i18n": {
						"type": "object",
						"format": "i18n",
						"props": [
							"name",
							"shortDescription",
							"description",
							"context"
						],
						"description": "Help translate this property"
					},
					"context": {
						"type": "object",
						"title": "Example template context",
						"additionalProperties": {
							"type": "string"
						}
					},
					"codeLanguages": {
						"type": "array",
						"items": {
							"type": "string",
							"maxLength": 100,
							"title": "Code Language",
							"description": "A specific code language to show this documentation for.",
							"format": "code-language"
						},
						"title": "Specific Code Languages",
						"description": "If present, then only the languages specified will show this documentation. Leave unset for language-independent documentation.",
						"format": "code-languages-array"
					},
					"type": {
						"type": "string",
						"maxLength": 100,
						"title": "Type",
						"description": "Intended type of the property."
					},
					"shortDescription": {
						"oneOf": [
							{
								"title": "Short Description",
								"type": "string",
								"description": "Short Description of the property.",
								"maxLength": 1000,
								"format": "markdown"
							},
							{
								"type": "object",
								"title": "Language Descriptions (short)",
								"description": "Property short-descriptions by code language.",
								"additionalProperties": {
									"type": "string",
									"description": "Short Description of the property.",
									"maxLength": 1000,
									"format": "markdown"
								},
								"format": "code-languages-object",
								"default": {
									"javascript": ""
								}
							}
						]
					},
					"description": {
						"oneOf": [
							{
								"title": "Description",
								"type": "string",
								"description": "Description of the property.",
								"maxLength": 1000,
								"format": "markdown"
							},
							{
								"type": "object",
								"title": "Language Descriptions",
								"description": "Property descriptions by code language.",
								"additionalProperties": {
									"type": "string",
									"description": "Description of the property.",
									"maxLength": 1000,
									"format": "markdown"
								},
								"format": "code-languages-object",
								"default": {
									"javascript": ""
								}
							}
						]
					},
					"args": {
						"type": "array",
						"items": {
							"type": "object",
							"additionalProperties": false,
							"properties": {
								"name": {
									"type": "string",
									"pattern": "^[a-z][A-Za-z0-9]*$",
									"title": "Name",
									"description": "Name of the function argument."
								},
								"i18n": {
									"type": "object",
									"format": "i18n",
									"props": [
										"description"
									],
									"description": "Help translate this argument"
								},
								"type": {
									"type": "string",
									"maxLength": 100,
									"title": "Type",
									"description": "Intended type of the argument."
								},
								"optional": {
									"title": "Optional",
									"description": "Whether an argument may be omitted when calling the function",
									"type": "boolean"
								},
								"example": {
									"oneOf": [
										{
											"type": "object",
											"title": "Language Examples",
											"description": "Examples by code language.",
											"additionalProperties": {
												"type": "string",
												"maxLength": 100,
												"description": "Example value for the argument."
											},
											"format": "code-languages-object",
											"default": {
												"javascript": "",
												"python": ""
											}
										},
										{
											"type": "string",
											"maxLength": 100,
											"title": "Example",
											"description": "Example value for the argument."
										}
									]
								},
								"description": {
									"oneOf": [
										{
											"type": "object",
											"title": "Language Descriptions",
											"description": "Example argument descriptions by code language.",
											"additionalProperties": {
												"type": "string",
												"description": "Description of the argument.",
												"maxLength": 1000
											},
											"format": "code-languages-object",
											"default": {
												"javascript": "",
												"python": ""
											}
										},
										{
											"title": "Description",
											"type": "string",
											"description": "Description of the argument.",
											"maxLength": 1000
										}
									]
								},
								"default": {
									"title": "Default",
									"description": "Default value of the argument. (Your code should set this.)",
									"default": null
								}
							},
							"title": "Function Argument",
							"description": "Documentation entry for a function argument.",
							"default": {
								"name": "target",
								"type": "object",
								"optional": false,
								"example": "this.getNearestEnemy()",
								"description": "The target of this function."
							},
							"required": [
								"name",
								"type",
								"example",
								"description"
							]
						},
						"title": "Arguments",
						"description": "If this property has type \"function\", then provide documentation for any function arguments."
					},
					"owner": {
						"title": "Owner",
						"type": "string",
						"description": "Owner of the property, like \"this\" or \"Math\"."
					},
					"example": {
						"oneOf": [
							{
								"type": "object",
								"title": "Language Examples",
								"description": "Examples by code language.",
								"additionalProperties": {
									"type": "string",
									"description": "An example code block.",
									"format": "code"
								},
								"format": "code-languages-object",
								"default": {
									"javascript": ""
								}
							},
							{
								"title": "Example",
								"type": "string",
								"description": "An optional example code block.",
								"format": "javascript"
							}
						]
					},
					"snippets": {
						"type": "object",
						"title": "Snippets",
						"description": "List of snippets for the respective programming languages",
						"additionalProperties": {
							"type": "object",
							"additionalProperties": false,
							"properties": {
								"code": {
									"type": "string",
									"format": "code",
									"title": "Snippet",
									"default": "",
									"description": "Code snippet. Use ${1:defaultValue} syntax to add flexible arguments"
								},
								"tab": {
									"type": "string",
									"title": "Tab Trigger",
									"description": "Tab completion text. Will be expanded to the snippet if typed and hit tab."
								}
							},
							"description": "A language-specific code snippet"
						},
						"format": "code-languages-object"
					},
					"returns": {
						"type": "object",
						"additionalProperties": false,
						"properties": {
							"type": {
								"type": "string",
								"maxLength": 100,
								"title": "Type",
								"description": "Type of the return value"
							},
							"example": {
								"oneOf": [
									{
										"type": "object",
										"title": "Language Examples",
										"description": "Example return values by code language.",
										"additionalProperties": {
											"type": "string",
											"maxLength": 100,
											"description": "Example return value.",
											"format": "code"
										},
										"format": "code-languages-object",
										"default": {
											"javascript": ""
										}
									},
									{
										"type": "string",
										"maxLength": 100,
										"title": "Example",
										"description": "Example return value"
									}
								]
							},
							"description": {
								"oneOf": [
									{
										"type": "object",
										"title": "Language Descriptions",
										"description": "Example return values by code language.",
										"additionalProperties": {
											"type": "string",
											"description": "Description of the return value.",
											"maxLength": 1000
										},
										"format": "code-languages-object",
										"default": {
											"javascript": ""
										}
									},
									{
										"title": "Description",
										"type": "string",
										"description": "Description of the return value.",
										"maxLength": 1000
									}
								]
							},
							"i18n": {
								"type": "object",
								"format": "i18n",
								"props": [
									"description"
								],
								"description": "Help translate this return value"
							}
						},
						"title": "Return Value",
						"description": "Optional documentation of any return value.",
						"required": [
							"type"
						],
						"default": {
							"type": "null"
						}
					},
					"autoCompletePriority": {
						"type": "number",
						"title": "Autocomplete Priority",
						"description": "How important this property is to autocomplete.",
						"minimum": 0,
						"default": 1
					},
					"userShouldCaptureReturn": {
						"type": "object",
						"title": "User Should Capture Return",
						"properties": {
							"variableName": {
								"type": "string",
								"title": "Variable Name",
								"description": "Variable name this property is autocompleted into.",
								"default": "result"
							},
							"type": {
								"type": "object",
								"title": "Variable Type",
								"description": "Variable return types by code language. Can usually leave blank. Fill in if it is a primitive type and not auto in C++.",
								"additionalProperties": {
									"type": "string",
									"description": "Description of the return value.",
									"maxLength": 1000
								},
								"format": "code-languages-object",
								"default": {
									"cpp": "auto"
								}
							}
						}
					},
					"hideGrantedBy": {
						"type": "boolean",
						"title": "Hide \"Granted By\"",
						"description": "Whether to hide the \"Granted By\" footer section in the documentation.",
						"default": false
					}
				},
				"title": "Property Documentation",
				"description": "Documentation entry for a property this Component will add to its Thang which other Components might want to also use.",
				"default": {
					"name": "foo",
					"type": "object",
					"description": "The `foo` property can satisfy all the #{spriteName}'s foobar needs. Use it wisely."
				},
				"required": [
					"name",
					"type",
					"description"
				],
				"format": "property-documentation"
			},
			"title": "Property Documentation",
			"description": "An array of documentation entries for each notable property this Component will add to its Thang which other Components might want to also use."
		},
		"configSchema": {
			"id": "metaschema",
			"displayProperty": "title",
			"$schema": "http://json-schema.org/draft-04/schema#",
			"title": "Configuration Schema",
			"description": "A schema for validating the arguments that can be passed to this System as configuration.",
			"definitions": {
				"schemaArray": {
					"type": "array",
					"minItems": 1,
					"items": {
						"$ref": "#"
					},
					"title": "Array of Schemas",
					"default": [
						{}
					]
				},
				"positiveInteger": {
					"type": "integer",
					"minimum": 0,
					"title": "Positive Integer"
				},
				"positiveIntegerDefault0": {
					"allOf": [
						{
							"$ref": "#/definitions/positiveInteger"
						},
						{
							"default": 0
						}
					]
				},
				"simpleTypes": {
					"title": "Single Type",
					"enum": [
						"array",
						"boolean",
						"integer",
						"null",
						"number",
						"object",
						"string"
					]
				},
				"stringArray": {
					"type": "array",
					"items": {
						"type": "string"
					},
					"minItems": 1,
					"uniqueItems": true,
					"title": "String Array",
					"default": [
						""
					]
				}
			},
			"type": "object",
			"properties": {
				"id": {
					"type": "string",
					"format": "uri"
				},
				"$schema": {
					"type": "string",
					"format": "uri",
					"default": "http://json-schema.org/draft-04/schema#"
				},
				"title": {
					"type": "string"
				},
				"description": {
					"type": "string"
				},
				"default": {},
				"multipleOf": {
					"type": "number",
					"minimum": 0,
					"exclusiveMinimum": true
				},
				"maximum": {
					"type": "number"
				},
				"exclusiveMaximum": {
					"type": "boolean",
					"default": false
				},
				"minimum": {
					"type": "number"
				},
				"exclusiveMinimum": {
					"type": "boolean",
					"default": false
				},
				"maxLength": {
					"$ref": "#/definitions/positiveInteger"
				},
				"minLength": {
					"$ref": "#/definitions/positiveIntegerDefault0"
				},
				"pattern": {
					"type": "string",
					"format": "regex"
				},
				"additionalItems": {
					"anyOf": [
						{
							"type": "boolean",
							"default": false
						},
						{
							"$ref": "#"
						}
					]
				},
				"items": {
					"anyOf": [
						{
							"$ref": "#"
						},
						{
							"$ref": "#/definitions/schemaArray"
						}
					],
					"default": {}
				},
				"maxItems": {
					"$ref": "#/definitions/positiveInteger"
				},
				"minItems": {
					"$ref": "#/definitions/positiveIntegerDefault0"
				},
				"uniqueItems": {
					"type": "boolean",
					"default": false
				},
				"maxProperties": {
					"$ref": "#/definitions/positiveInteger"
				},
				"minProperties": {
					"$ref": "#/definitions/positiveIntegerDefault0"
				},
				"required": {
					"$ref": "#/definitions/stringArray"
				},
				"additionalProperties": {
					"anyOf": [
						{
							"type": "boolean",
							"default": true
						},
						{
							"$ref": "#"
						}
					],
					"default": {}
				},
				"definitions": {
					"type": "object",
					"additionalProperties": {
						"$ref": "#"
					},
					"default": {}
				},
				"properties": {
					"type": "object",
					"additionalProperties": {
						"$ref": "#"
					},
					"default": {}
				},
				"patternProperties": {
					"type": "object",
					"additionalProperties": {
						"$ref": "#"
					},
					"default": {}
				},
				"dependencies": {
					"type": "object",
					"additionalProperties": {
						"anyOf": [
							{
								"$ref": "#"
							},
							{
								"$ref": "#/definitions/stringArray"
							}
						]
					}
				},
				"enum": {
					"type": "array",
					"minItems": 1,
					"uniqueItems": true,
					"default": [
						""
					]
				},
				"type": {
					"anyOf": [
						{
							"$ref": "#/definitions/simpleTypes"
						},
						{
							"type": "array",
							"items": {
								"$ref": "#/definitions/simpleTypes"
							},
							"minItems": 1,
							"uniqueItems": true,
							"title": "Array of Types",
							"default": [
								"string"
							]
						}
					]
				},
				"allOf": {
					"$ref": "#/definitions/schemaArray"
				},
				"anyOf": {
					"$ref": "#/definitions/schemaArray"
				},
				"oneOf": {
					"$ref": "#/definitions/schemaArray"
				},
				"not": {
					"$ref": "#"
				}
			},
			"dependencies": {
				"exclusiveMaximum": [
					"maximum"
				],
				"exclusiveMinimum": [
					"minimum"
				]
			},
			"default": {
				"type": "object",
				"additionalProperties": false
			}
		},
		"official": {
			"type": "boolean",
			"title": "Official",
			"description": "Whether this is an official CodeCombat Component."
		},
		"searchStrings": {
			"type": "string"
		},
		"context": {
			"type": "object",
			"title": "Code context",
			"additionalProperties": {
				"type": "string"
			},
			"default": {}
		},
		"i18n": {
			"type": "object",
			"format": "i18n",
			"props": [
				"context"
			],
			"description": "Help translate the code context"
		},
		"archived": {
			"type": "integer",
			"description": "Marks this component to be hidden from searches and lookups. Number is milliseconds since 1 January 1970 UTC, when it was marked as hidden."
		},
		"_id": {
			"type": [
				"object",
				"string"
			],
			"links": [
				{
					"rel": "self",
					"href": "/db/level.component/{($)}"
				}
			],
			"format": "hidden"
		},
		"__v": {
			"title": "Mongoose Version",
			"format": "hidden"
		},
		"index": {
			"format": "hidden"
		},
		"_algoliaObjectID": {
			"type": "string",
			"format": "hidden"
		},
		"version": {
			"default": {
				"minor": 0,
				"major": 0,
				"isLatestMajor": true,
				"isLatestMinor": true
			},
			"format": "version",
			"title": "Version",
			"type": "object",
			"readOnly": true,
			"additionalProperties": false,
			"properties": {
				"major": {
					"type": "number",
					"minimum": 0
				},
				"minor": {
					"type": "number",
					"minimum": 0
				},
				"isLatestMajor": {
					"type": "boolean"
				},
				"isLatestMinor": {
					"type": "boolean"
				}
			}
		},
		"original": {
			"type": [
				"object",
				"string"
			],
			"links": [
				{
					"rel": "extra",
					"href": "/db/level.component/{($)}"
				}
			],
			"format": "hidden"
		},
		"parent": {
			"type": [
				"object",
				"string"
			],
			"links": [
				{
					"rel": "extra",
					"href": "/db/level.component/{($)}"
				}
			],
			"format": "hidden"
		},
		"creator": {
			"type": [
				"object",
				"string"
			],
			"links": [
				{
					"rel": "extra",
					"href": "/db/user/{($)}"
				}
			],
			"format": "hidden"
		},
		"created": {
			"type": [
				"object",
				"string"
			],
			"format": "date-time",
			"title": "Created",
			"readOnly": true
		},
		"commitMessage": {
			"type": "string",
			"maxLength": 500,
			"title": "Commit Message",
			"readOnly": true
		},
		"permissions": {
			"type": "array",
			"items": {
				"type": "object",
				"additionalProperties": false,
				"properties": {
					"target": {},
					"access": {
						"type": "string",
						"enum": [
							"read",
							"write",
							"owner"
						]
					}
				}
			},
			"format": "hidden"
		},
		"patches": {
			"type": "array",
			"items": {
				"_id": {
					"type": [
						"object",
						"string"
					],
					"links": [
						{
							"rel": "db",
							"href": "/db/patch/{($)}"
						}
					],
					"title": "Patch ID",
					"description": "A reference to the patch."
				},
				"status": {
					"enum": [
						"pending",
						"accepted",
						"rejected",
						"cancelled"
					]
				}
			},
			"title": "Patches"
		},
		"allowPatches": {
			"type": "boolean"
		},
		"watchers": {
			"type": "array",
			"items": {
				"type": [
					"object",
					"string"
				],
				"links": [
					{
						"rel": "extra",
						"href": "/db/user/{($)}"
					}
				]
			},
			"title": "Watchers"
		},
		"i18nCoverage": {
			"title": "i18n Coverage",
			"type": "array",
			"items": {
				"type": "string"
			}
		}
	},
	"title": "Component",
	"description": "A Component which can affect Thang behavior.",
	"required": [
		"system",
		"name",
		"code"
	],
	"default": {
		"system": "ai",
		"name": "AttacksSelf",
		"description": "This Component makes the Thang attack itself.",
		"code": "class AttacksSelf extends Component\n  @className: 'AttacksSelf'\n  chooseAction: ->\n    @attack @",
		"codeLanguage": "coffeescript",
		"dependencies": [],
		"propertyDocumentation": [],
		"configSchema": {},
		"context": {}
	}
}