forked from KSP-CKAN/CKAN
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CKAN.schema
495 lines (495 loc) · 18.8 KB
/
CKAN.schema
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
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
{
"$schema" : "http://json-schema.org/draft-04/schema#",
"title" : "CKAN JSON Schema",
"description" : "Schema for validating CKAN meta files",
"type" : "object",
"properties" : {
"spec_version" : {
"description" : "Version of the CKAN spec this document uses",
"oneOf" : [
{
"type" : "integer",
"description" : "The integer '1' is special case",
"minimum" : 1,
"maximum" : 1
},
{
"type" : "string",
"description" : "A vx.x string",
"pattern" : "^v[0-9]+\\.[0-9]+$"
}
]
},
"name" : {
"description" : "Human readable name of the mod",
"type" : "string"
},
"identifier" : {
"description" : "Unique identifier for this mod",
"$ref" : "#/definitions/identifier"
},
"kind" : {
"description" : "Package type, defaults to package",
"enum" : [ "package", "metapackage", "dlc" ]
},
"abstract" : {
"description" : "Short description of the mod",
"type" : "string"
},
"description" : {
"description" : "Longer description of the mod",
"type" : "string"
},
"comment" : {
"description" : "Free-form comment. Not displayed to users",
"type" : "string"
},
"author" : {
"description" : "Author, or list of authors",
"oneOf" : [
{ "type" : "string" },
{
"type" : "array",
"items" : { "type" : "string" },
"uniqueItems" : true
}
]
},
"download" : {
"description" : "URL where mod can be downloaded by tools",
"type" : "string",
"format" : "uri"
},
"download_size" : {
"description" : "The size of the download in bytes",
"type" : "integer"
},
"download_hash" : {
"description" : "A object of hashes of the downloaded file",
"type" : "object",
"properties" : {
"sha1" : {
"description" : "SHA1 hash of the file",
"type" : "string"
},
"sha256" : {
"description" : "SHA256 hash of the file",
"type" : "string"
}
}
},
"download_content_type" : {
"description" : "The content type of the download",
"type" : "string"
},
"license" : {
"description" : "Machine readable license, or array of licenses",
"$ref" : "#/definitions/licenses"
},
"version" : {
"description" : "Version of the mod",
"$ref" : "#/definitions/version"
},
"release_status" : {
"description" : "Optional release status",
"enum" : [ "stable", "testing", "development" ]
},
"ksp_version" : {
"description" : "Optional target KSP version",
"$ref" : "#/definitions/ksp_version"
},
"ksp_version_min" : {
"description" : "Optional minimum KSP version",
"$ref" : "#/definitions/ksp_version"
},
"ksp_version_max" : {
"description" : "Optional maximum KSP version",
"$ref" : "#/definitions/ksp_version"
},
"ksp_version_strict" : {
"description" : "Optional enforcement of strict version checks (defaults to false)",
"type" : "boolean"
},
"tags" : {
"description" : "A series of descriptive keywords to provide quick filtering and organization",
"type" : "array",
"items" : {
"type" : "string",
"pattern" : "^[a-z0-9-]+$"
}
},
"localizations" : {
"description" : "A list of KSP locale strings for which this mod includes localizations",
"type" : "array",
"items" : { "type" : "string" },
"uniqueItems" : true
},
"depends" : {
"description" : "Optional list of dependencies",
"$ref" : "#/definitions/relationship"
},
"recommends" : {
"description" : "Optional list of recommended mods",
"$ref" : "#/definitions/relationship"
},
"suggests" : {
"description" : "Optional list of recommended, but not essential mods",
"$ref" : "#/definitions/relationship"
},
"supports" : {
"description" : "Optional list of supported mods",
"$ref" : "#/definitions/relationship"
},
"conflicts" : {
"description" : "Optional list of conflicting mods",
"$ref" : "#/definitions/relationship"
},
"provides" : {
"description" : "A list of virtual packages this mod provides",
"type" : "array",
"items" : {
"$ref" : "#/definitions/identifier"
},
"uniqueItems" : true
},
"replaced_by" : {
"description" : "Optional pointer to mod that should be selected instead and treated as an update to this mod",
"type" : "object",
"properties" : {
"name" : {
"description" : "Identifier of the mod",
"$ref" : "#/definitions/identifier"
},
"version" : {
"description" : "Optional version",
"$ref" : "#/definitions/version"
},
"min_version" : {
"description" : "Optional minimum version",
"$ref" : "#/definitions/version"
}
},
"required" : [ "name" ]
},
"resources" : {
"description" : "Additional resources",
"type" : "object",
"properties" : {
"homepage" : {
"description" : "Mod homepage",
"type" : "string",
"format" : "uri"
},
"bugtracker" : {
"description" : "Mod bugtracker",
"type" : "string",
"format" : "uri"
},
"license" : {
"description" : "Mod license",
"type" : "string",
"format" : "uri"
},
"repository" : {
"description" : "Mod repository",
"type" : "string",
"format" : "uri"
},
"ci" : {
"description" : "Continuous Integration",
"type" : "string",
"format" : "uri"
},
"spacedock" : {
"description" : "Project on SpaceDock",
"type" : "string",
"format" : "uri"
},
"curse" : {
"description" : "Project on Curse",
"type" : "string",
"format" : "uri"
},
"manual" : {
"description" : "Mod's manual",
"type" : "string",
"format" : "uri"
},
"metanetkan" : {
"description" : "Mod's remote hosted netkan",
"type" : "string",
"format" : "uri"
},
"remote-avc" : {
"description" : "Mod's remote hosted version file",
"type" : "string",
"format" : "uri"
},
"store": {
"description" : "Purchase DLC here",
"type" : "string",
"format" : "uri"
},
"steamstore": {
"description" : "Purchase DLC on Steam here",
"type" : "string",
"format" : "uri"
}
}
},
"install" : {
"description" : "List of install directives",
"type" : "array",
"items" : {
"type" : "object",
"properties" : {
"file" : {
"description" : "Path to file to install",
"type" : "string"
},
"find" : {
"description" : "A directory to find for installation",
"type" : "string"
},
"find_regexp" : {
"description" : "A regexp that matches the directory to install",
"type" : "string"
},
"find_matches_files" : {
"description" : "If true, find directives match files as well as directories",
"type" : "boolean"
},
"install_to" : {
"description" : "Where file should be installed to",
"$ref" : "#/definitions/install_to"
},
"as": {
"description" : "The name to give the matching directory or file when installed",
"type" : "string",
"pattern" : "^[^\\\\/]+$"
},
"filter" : {
"description" : "List of files and directories that should be filtered from the install",
"$ref" : "#/definitions/one_or_more_strings"
},
"filter_regexp" : {
"description" : "List of regexps that should filter files from this install",
"$ref" : "#/definitions/one_or_more_strings"
},
"include_only" : {
"description" : "List of files and directories that should not be excluded from the install",
"$ref" : "#/definitions/one_or_more_strings"
},
"include_only_regexp" : {
"description" : "List of regexps that should include files in this install",
"$ref" : "#/definitions/one_or_more_strings"
}
},
"not" : {
"anyOf" : [
{
"required" : [ "filter", "include_only" ]
},
{
"required" : [ "filter", "include_only_regexp" ]
},
{
"required" : [ "filter_regexp", "include_only" ]
},
{
"required" : [ "filter_regexp", "include_only_regexp" ]
}
]
},
"required" : [ "install_to" ],
"oneOf": [
{
"required": [ "file" ]
},
{
"required": [ "find" ]
},
{
"required": [ "find_regexp" ]
}
]
}
},
"release_date": {
"description" : "Optional timestamp when the described version of the mod was released",
"type" : "string",
"format" : "date-time"
}
},
"required" : [
"spec_version",
"name",
"author",
"abstract",
"identifier",
"license",
"version"
],
"oneOf": [
{
"required": [ "download" ]
},
{
"properties": {
"kind": {
"enum": [ "metapackage", "dlc" ]
}
},
"not": {
"required": [ "download" ]
},
"required": [ "kind" ]
}
],
"definitions" : {
"identifier" : {
"description" : "Unique identifier for this mod.",
"type" : "string",
"pattern" : "^[A-Za-z0-9][A-Za-z0-9-]+$"
},
"version" : {
"description" : "A version string",
"type" : "string"
},
"ksp_version" : {
"description" : "A version of KSP",
"type" : "string",
"pattern" : "^(any|[0-9]+\\.[0-9]+(\\.[0-9]+)?)$"
},
"relationship" : {
"description" : "A relationship to a list of mods",
"type" : "array",
"items" : {
"oneOf": [
{
"type" : "object",
"properties" : {
"name" : {
"description" : "Identifier of the mod",
"$ref" : "#/definitions/identifier"
},
"version" : {
"description" : "Optional version",
"$ref" : "#/definitions/version"
},
"min_version" : {
"description" : "Optional minimum version",
"$ref" : "#/definitions/version"
},
"max_version" : {
"description" : "Optional maximum version",
"$ref" : "#/definitions/version"
}
},
"required" : [ "name" ]
},
{
"type": "object",
"properties": {
"any_of": {
"description": "List of modules that can satisfy this relationship",
"$ref": "#/definitions/relationship"
}
},
"required": [ "any_of" ]
}
]
}
},
"install_to" : {
"description" : "Where file should be installed to. As of v1.2, GameData may take a path",
"oneOf" : [
{
"description" : "Spec version 1 targets",
"enum" : [ "GameData", "Ships", "GameRoot", "Tutorial", "Scenarios" ]
},
{
"description" : "Spec v1.2 GameData path",
"type" : "string",
"pattern" : "^GameData/"
},
{
"description" : "Spec v1.12 Ships subfolder paths",
"type" : "string",
"pattern" : "^Ships/(SPH|VAB|Script)$"
},
{
"description" : "Spec v1.16 thumbs paths",
"type" : "string",
"pattern" : "^Ships/@thumbs/(SPH|VAB)$"
},
{
"description" : "Spec v1.25 Missions path",
"type" : "string",
"pattern" : "^Missions"
}
]
},
"license" : {
"description" : "A license.",
"enum" : [
"public-domain",
"AFL-3.0",
"AGPL-3.0",
"Apache", "Apache-1.0", "Apache-2.0",
"APSL-2.0",
"Artistic", "Artistic-1.0", "Artistic-2.0",
"BSD-2-clause", "BSD-3-clause", "BSD-4-clause",
"ISC",
"CC-BY", "CC-BY-1.0", "CC-BY-2.0", "CC-BY-2.5", "CC-BY-3.0", "CC-BY-4.0",
"CC-BY-SA", "CC-BY-SA-1.0", "CC-BY-SA-2.0", "CC-BY-SA-2.5", "CC-BY-SA-3.0", "CC-BY-SA-4.0",
"CC-BY-NC", "CC-BY-NC-1.0", "CC-BY-NC-2.0", "CC-BY-NC-2.5", "CC-BY-NC-3.0", "CC-BY-NC-4.0",
"CC-BY-NC-SA", "CC-BY-NC-SA-1.0", "CC-BY-NC-SA-2.0", "CC-BY-NC-SA-2.5", "CC-BY-NC-SA-3.0", "CC-BY-NC-SA-4.0",
"CC-BY-NC-ND", "CC-BY-NC-ND-1.0", "CC-BY-NC-ND-2.0", "CC-BY-NC-ND-2.5", "CC-BY-NC-ND-3.0", "CC-BY-NC-ND-4.0",
"CC-BY-ND", "CC-BY-ND-1.0", "CC-BY-ND-2.0", "CC-BY-ND-2.5", "CC-BY-ND-3.0", "CC-BY-ND-4.0",
"CC0",
"CDDL", "CPL",
"EFL-1.0", "EFL-2.0",
"Expat", "MIT",
"GPL-1.0", "GPL-2.0", "GPL-3.0",
"LGPL-2.0", "LGPL-2.1", "LGPL-3.0",
"GFDL-1.0", "GFDL-1.1", "GFDL-1.2", "GFDL-1.3",
"GFDL-NIV-1.0", "GFDL-NIV-1.1", "GFDL-NIV-1.2", "GFDL-NIV-1.3",
"LPPL-1.0", "LPPL-1.1", "LPPL-1.2", "LPPL-1.3c",
"MPL-1.0", "MPL-1.1", "MPL-2.0",
"Ms-PL", "Ms-RL",
"Perl",
"Python-2.0",
"QPL-1.0",
"Unlicense",
"W3C",
"WTFPL",
"Zlib",
"Zope",
"open-source", "restricted", "unrestricted", "unknown"
]
},
"licenses" : {
"description" : "A license, or array of licenses",
"anyOf" : [
{ "$ref" : "#/definitions/license" },
{
"type" : "array",
"items" : { "$ref" : "#/definitions/license" },
"uniqueItems" : true
}
]
},
"one_or_more_strings" : {
"description" : "One or more strings",
"oneOf" : [
{ "type" : "string" },
{
"type" : "array",
"items" : { "type" : "string" },
"uniqueItems" : true
}
]
}
}
}