-
-
Notifications
You must be signed in to change notification settings - Fork 214
Expand file tree
/
Copy pathstackchan-mod.schema.json
More file actions
117 lines (117 loc) · 3.08 KB
/
Copy pathstackchan-mod.schema.json
File metadata and controls
117 lines (117 loc) · 3.08 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"$id": "https://stack-chan.github.io/stack-chan/web/schemas/stackchan-mod.schema.json",
"title": "Stack-chan MOD definition",
"type": "object",
"additionalProperties": false,
"required": [
"format",
"schemaVersion",
"id",
"version",
"type",
"name",
"description",
"source",
"targets"
],
"properties": {
"$schema": { "type": "string", "format": "uri-reference" },
"format": { "const": "tech.stackchan.mod" },
"schemaVersion": { "const": 1 },
"id": {
"type": "string",
"pattern": "^[a-z0-9]+(?:[.-][a-z0-9]+)+$",
"maxLength": 128
},
"version": {
"type": "string",
"pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?$"
},
"type": { "enum": ["block", "text"] },
"name": { "type": "string", "minLength": 1, "maxLength": 80 },
"description": { "type": "string", "minLength": 1, "maxLength": 400 },
"author": { "type": "string", "minLength": 1, "maxLength": 120 },
"license": { "type": "string", "minLength": 1, "maxLength": 80 },
"source": {
"type": "object",
"additionalProperties": false,
"required": ["path"],
"properties": {
"path": { "$ref": "#/$defs/relativePath" },
"entrypoint": {
"allOf": [
{ "$ref": "#/$defs/relativePath" },
{ "pattern": "\\.[cm]?[jt]sx?$" }
]
}
}
},
"setup": {
"type": "object",
"additionalProperties": false,
"required": ["url"],
"properties": {
"url": {
"type": "string",
"format": "uri",
"pattern": "^[Hh][Tt][Tt][Pp][Ss]://",
"maxLength": 2048
}
}
},
"entrypoints": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "enum": ["mod", "miniapp"] }
},
"targets": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" }
},
"capabilities": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "string",
"pattern": "^[A-Za-z0-9]+(?:[._-][A-Za-z0-9]+)*$"
}
},
"artifacts": {
"type": "array",
"items": {
"type": "object",
"additionalProperties": false,
"required": ["format", "path", "target"],
"properties": {
"format": { "const": "xsa" },
"path": { "$ref": "#/$defs/relativePath" },
"target": { "type": "string", "pattern": "^[a-z0-9][a-z0-9-]*$" }
}
}
}
},
"allOf": [
{
"if": {
"properties": { "type": { "const": "block" } },
"required": ["type"]
},
"then": {
"properties": {
"source": { "not": { "required": ["entrypoint"] } }
}
}
}
],
"$defs": {
"relativePath": {
"type": "string",
"minLength": 1,
"pattern": "^(?!/)(?!.*//)(?!.*(?:^|/)\\.(?:/|$))(?!.*(?:^|/)\\.\\.(?:/|$))(?!.*\\/$)(?!.*\\\\)(?!.*[\\u0000-\\u001f:]).+$"
}
}
}