-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathschema.json
192 lines (147 loc) · 6.36 KB
/
schema.json
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
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
{
"$id": "https://github.com/argv-minus-one/dmg-license/raw/master/schema.json",
"$schema": "http://json-schema.org/draft-07/schema",
"description": "Configuration for a disk image license agreement.\n\nDisk image license agreements can be multilingual. A disk image can contain several license agreements, and macOS will show the one appropriate for the user's preferred language. Accordingly, there can be more than one `body`, one for each language.",
"definitions": {
"Charset": {
"$id": "#Charset",
"title": "Charset",
"description": "An IANA character set name, as understood by the Core Foundation framework. Case insensitive.",
"type": "string",
"pattern": "^[A-Za-z][A-Za-z0-9.:_-]*$",
"examples": ["UTF-8", "US-ASCII"],
"default": "UTF-8"
},
"Languages": {
"$id": "#Languages",
"title": "Languages",
"description": "Which language(s) this object is in. Can be an IETF language tag [1] like \"en-US\", a classic Mac OS language code [2] like 0, or an array of language tags and/or language codes.\n\n[1] https://en.wikipedia.org/wiki/IETF_language_tag\n[2] As it appears in `Script.h` of `CarbonCore.framework`. See: https://github.com/phracker/MacOSX-SDKs/blob/aea47c83334af9c27dc57c49ca268723ef5e6349/MacOSX10.6.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/Script.h#L285",
"type": ["string", "integer", "array"],
"minLength": 1,
"minimum": 0,
"minItems": 1,
"items": {
"type": ["string", "integer"],
"minLength": 1,
"minimum": 0
}
}
},
"type": "object",
"properties": {
"body": {
"type": "array",
"minItems": 1,
"items": {
"$id": "#BodySpec",
"title": "BodySpec",
"description": "Text of the license agreement. Text can be given in two ways: inline, in the \"text\" property, or in a separate file, named by the \"file\" property.",
"type": "object",
"properties": {
"type": {
"description": "Which format the text is in: either plain text or RTF.\n\nDefault is \"plain\", except when the file path ends in “.rtf”, in which case the default is \"rtf\".",
"type": "string",
"enum": ["rtf", "plain"]
},
"text": {
"description": "Text of the license agreement, specified directly in JSON.",
"type": "string"
},
"file": {
"description": "Path to the file containing the license text.",
"type": "string"
},
"charset": {
"description": "Character set that the \"file\" is encoded in.",
"$ref": "#Charset"
},
"lang": {
"$ref": "#Languages"
}
},
"dependencies": {
"charset": ["file"],
"file": {"not": {"required": ["text"]}},
"text": {"not": {"required": ["file"]}}
},
"anyOf": [
{"required": ["file", "lang"]},
{"required": ["lang", "text"]}
]
}
},
"labels": {
"type": "array",
"items": {
"$id": "#LabelsSpec",
"title": "LabelsSpec",
"description": "Localized labels for the buttons on the license agreement window. There are six: \"languageName\" (optional), \"agree\", \"disagree\", \"print\", \"save\", and \"message\".\n\nSome languages have a default set of labels that will be used if none are provided here, but for all other languages, a set of labels must be provided. Default label sets are available for en-US, fr-FR, en-GB, de-DE, it-IT, nl-NL, sv-SE, es-ES, da-DK, fr-CA, nb-NO, ja-JP, fi-FI, ko-KR, zh-CN, zh-TW, zh-Hans, zh-Hant, and pt-BR.",
"type": "object",
"properties": {
"languageName": {
"description": "Human-readable name of the language that this version of the license agreement is in, such as “English” or “Français”.",
"type": "string"
},
"agree": {
"description": "Label text for the “Agree” button.",
"type": "string"
},
"disagree": {
"description": "Label text for the “Disagree” button.",
"type": "string"
},
"print": {
"description": "Label text for the “Print” button.",
"type": "string"
},
"save": {
"description": "Label text for the “Save” button.",
"type": "string"
},
"message": {
"description": "Brief instructions for the user.\n\nFor example, the English default message is: “If you agree with the terms of this license, press \"Agree\" to install the software. If you do not agree, press \"Disagree\".”",
"type": "string"
},
"lang": {
"$ref": "#Languages"
},
"file": false
},
"required": ["agree", "disagree", "print", "save", "message", "lang"]
}
},
"rawLabels": {
"type": "array",
"items": {
"$id": "#RawLabelsSpec",
"title": "RawLabelsSpec",
"description": "Localized labels for the buttons on the license agreement window, as with the \"labels\" property, but in raw format.\n\nInstead of plain JSON strings, label sets provided this way are stored in binary files, whose contents (data fork) are copied into the disk image as a STR# resource with no parsing or character set conversion. They must be in the format that DiskImageMounter expects.\n\nThe format is described at: https://github.com/argv-minus-one/dmg-license/blob/master/docs/Raw%20labels%20format.md",
"type": "object",
"properties": {
"file": {
"description": "Path to the file containing the label strings.",
"type": "string",
"minLength": 1
},
"lang": {
"$ref": "#Languages"
},
"charset": {
"$ref": "#Charset"
}
},
"required": ["file", "lang"]
}
},
"defaultLang": {
"description": "Selects which language should be the default, if there is no license localization for the user's preferred language.\n\nIf this property is omitted, the first `lang` of the first `body` is used as the default.\n\nCan be an IETF language tag [1] like \"en-US\", or a classic Mac OS language code [2] like 0.\n\n[1] https://en.wikipedia.org/wiki/IETF_language_tag\n[2] As it appears in `Script.h` of `CarbonCore.framework`. See: https://github.com/phracker/MacOSX-SDKs/blob/aea47c83334af9c27dc57c49ca268723ef5e6349/MacOSX10.6.sdk/System/Library/Frameworks/CoreServices.framework/Versions/A/Frameworks/CarbonCore.framework/Versions/A/Headers/Script.h#L285",
"type": ["string", "integer"],
"minLength": 1,
"minimum": 0
},
"$schema": {
"type": "string"
}
},
"required": ["body"]
}