Repository navigation
Expand file tree
/
Copy pathpackage.schema.json
More file actions
63 lines (63 loc) · 2.26 KB
/
Copy pathpackage.schema.json
File metadata and controls
63 lines (63 loc) · 2.26 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "StableBar package",
"type": "object",
"additionalProperties": false,
"required": ["id", "name", "version", "entry"],
"properties": {
"id": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" },
"name": { "type": "string" },
"version": { "type": "string", "pattern": "^[A-Za-z0-9._-]+$" },
"kind": { "enum": ["theme", "widgets"] },
"entry": { "type": "string" },
"description": { "type": "string" },
"author": { "type": "string" },
"repository": { "type": "string", "pattern": "^https://" },
"screenshot": { "type": "string" },
"minimumVersion": { "type": "string" },
"requires": { "type": "array", "items": { "type": "string" } },
"permissions": {
"type": "array",
"items": { "enum": ["calendars", "automation", "accessibility", "bluetooth", "location"] }
},
"hosts": { "type": "array", "items": { "type": "string" } },
"settings": {
"type": "object",
"additionalProperties": { "$ref": "#/definitions/setting" }
}
},
"definitions": {
"setting": {
"type": "object",
"additionalProperties": false,
"required": ["type"],
"properties": {
"type": { "enum": ["string", "number", "bool", "secret"] },
"title": { "type": "string" },
"description": { "type": "string" },
"choices": { "type": "array", "minItems": 1, "items": { "type": "string" } },
"default": {}
},
"allOf": [
{
"if": { "properties": { "type": { "const": "secret" } } },
"then": { "not": { "anyOf": [{ "required": ["default"] }, { "required": ["choices"] }] } },
"else": { "required": ["default"] }
},
{
"if": { "properties": { "type": { "const": "string" } } },
"then": { "properties": { "default": { "type": "string" } } },
"else": { "not": { "required": ["choices"] } }
},
{
"if": { "properties": { "type": { "const": "number" } } },
"then": { "properties": { "default": { "type": "number" } } }
},
{
"if": { "properties": { "type": { "const": "bool" } } },
"then": { "properties": { "default": { "type": "boolean" } } }
}
]
}
}
}