Merge "Fix 'Tags' padding to keep it farther from the edge and document the source...
[lhc/web/wiklou.git] / docs / extension.schema.v1.json
1 {
2 "$schema": "http://json-schema.org/schema#",
3 "description": "MediaWiki extension.json schema",
4 "type": "object",
5 "properties": {
6 "manifest_version": {
7 "type": "integer",
8 "description": "Version of the extension.json schema the extension.json file is in.",
9 "required": true
10 },
11 "name": {
12 "type": "string",
13 "description": "The extension's canonical name.",
14 "required": true
15 },
16 "namemsg": {
17 "type": "string",
18 "description": "i18n message key of the extension's name."
19 },
20 "type": {
21 "type": "string",
22 "description": "The extension's type, as an index to $wgExtensionCredits.",
23 "default": "other"
24 },
25 "author": {
26 "type": [
27 "string",
28 "array"
29 ],
30 "description": "Extension's authors.",
31 "items": {
32 "type": "string"
33 }
34 },
35 "version": {
36 "type": "string",
37 "description": "The version of this release of the extension."
38 },
39 "url": {
40 "type": "string",
41 "description": "URL to the homepage for the extension.",
42 "format": "uri-reference"
43 },
44 "description": {
45 "type": "string",
46 "description": "Raw description of the extension."
47 },
48 "descriptionmsg": {
49 "type": "string",
50 "description": "Message key for a i18n message describing the extension."
51 },
52 "license-name": {
53 "type": "string",
54 "description": "SPDX identifier for the license under which the extension is released."
55 },
56 "requires": {
57 "type": "object",
58 "description": "Indicates what versions of MediaWiki core or extensions are required. This syntax may be extended in the future, for example to check dependencies between other services.",
59 "additionalProperties": false,
60 "properties": {
61 "MediaWiki": {
62 "type": "string",
63 "description": "Version constraint string against MediaWiki core."
64 },
65 "extensions": {
66 "type": "object",
67 "description": "Set of version constraint strings against specific extensions."
68 },
69 "skins": {
70 "type": "object",
71 "description": "Set of version constraint strings against specific skins."
72 }
73 }
74 },
75 "ResourceFileModulePaths": {
76 "type": "object",
77 "description": "Default paths to use for all ResourceLoader file modules",
78 "additionalProperties": false,
79 "properties": {
80 "localBasePath": {
81 "type": "string",
82 "description": "Base path to prepend to all local paths, relative to current directory"
83 },
84 "remoteExtPath": {
85 "type": "string",
86 "description": "Base path to prepend to all remote paths, relative to $wgExtensionAssetsPath"
87 },
88 "remoteSkinPath": {
89 "type": "string",
90 "description": "Base path to prepend to all remote paths, relative to $wgStylePath"
91 }
92 }
93 },
94 "ResourceModules": {
95 "type": "object",
96 "description": "ResourceLoader modules to register",
97 "patternProperties": {
98 "^[a-zA-Z0-9-\\.]+$": {
99 "type": "object",
100 "anyOf": [
101 {
102 "description": "A ResourceLoaderFileModule definition",
103 "additionalProperties": false,
104 "properties": {
105 "localBasePath": {
106 "type": "string",
107 "description": "Base path to prepend to all local paths in $options. Defaults to $IP"
108 },
109 "remoteBasePath": {
110 "type": "string",
111 "description": "Base path to prepend to all remote paths in $options. Defaults to $wgScriptPath"
112 },
113 "remoteExtPath": {
114 "type": "string",
115 "description": "Equivalent of remoteBasePath, but relative to $wgExtensionAssetsPath"
116 },
117 "skipFunction": {
118 "type": "string",
119 "description": "Path to a file containing a JavaScript \"skip function\", if desired."
120 },
121 "scripts": {
122 "type": ["string", "array"],
123 "description": "Scripts to always include (array of file paths)",
124 "items": {
125 "type": "string"
126 }
127 },
128 "languageScripts": {
129 "type": "object",
130 "description": "Scripts to include in specific language contexts (mapping of language code to file path(s))",
131 "patternProperties": {
132 "^[a-zA-Z0-9-]{2,}$": {
133 "type": [
134 "string",
135 "array"
136 ],
137 "items": {
138 "type": "string"
139 }
140 }
141 }
142 },
143 "skinScripts": {
144 "type": "object",
145 "description": "Scripts to include in specific skin contexts (mapping of skin name to script(s)",
146 "patternProperties": {
147 ".+": {
148 "type": [
149 "string",
150 "array"
151 ],
152 "items": {
153 "type": "string"
154 }
155 }
156 }
157 },
158 "debugScripts": {
159 "type": ["string", "array"],
160 "description": "Scripts to include in debug contexts",
161 "items": {
162 "type": "string"
163 }
164 },
165 "loaderScripts": {
166 "type": ["string", "array"],
167 "description": "Scripts to include in the startup module",
168 "items": {
169 "type": "string"
170 }
171 },
172 "dependencies": {
173 "type": ["string", "array"],
174 "description": "Modules which must be loaded before this module",
175 "items": {
176 "type": "string"
177 }
178 },
179 "styles": {
180 "type": ["string", "array", "object"],
181 "description": "Styles to always load",
182 "items": {
183 "type": "string"
184 }
185 },
186 "skinStyles": {
187 "type": "object",
188 "description": "Styles to include in specific skin contexts (mapping of skin name to style(s))",
189 "patternProperties": {
190 ".+": {
191 "type": [
192 "string",
193 "array"
194 ],
195 "items": {
196 "type": "string"
197 }
198 }
199 }
200 },
201 "messages": {
202 "type": ["string", "array"],
203 "description": "Messages to always load",
204 "items": {
205 "type": "string"
206 }
207 },
208 "group": {
209 "type": "string",
210 "description": "Group which this module should be loaded together with"
211 },
212 "deprecated": {
213 "type": ["object", "string", "boolean"],
214 "description": "Whether the module is deprecated and usage is discouraged. Either a boolean, or a string or an object with key message can be used to customise deprecation message."
215 },
216 "position": {
217 "type": "string",
218 "description": "Position on the page to load this module at",
219 "enum": [
220 "bottom",
221 "top"
222 ]
223 },
224 "templates": {
225 "type": ["object", "array"],
226 "description": "Templates to be loaded for client-side usage"
227 },
228 "targets": {
229 "type": ["string", "array"],
230 "description": "ResourceLoader target the module can run on",
231 "items": {
232 "type": "string"
233 }
234 },
235 "noflip": {
236 "type": "boolean",
237 "description": "Whether to skip CSSJanus LTR-to-RTL flipping for this module. Recommended for styles imported from libraries that already properly handle their RTL styles. Default is false, meaning CSSJanus will be applied on RTL-mode output."
238 }
239 }
240 },
241 {
242 "description": "A ResourceLoaderWikiModule definition",
243 "additionalProperties": false,
244 "properties": {
245 "class": {
246 "enum": ["ResourceLoaderWikiModule"]
247 },
248 "group": {
249 "type": "string",
250 "description": "Group which this module should be loaded together with"
251 },
252 "position": {
253 "type": "string",
254 "description": "Position on the page to load this module at",
255 "enum": [
256 "bottom",
257 "top"
258 ]
259 },
260 "targets": {
261 "type": ["string", "array"],
262 "description": "ResourceLoader target the module can run on",
263 "items": {
264 "type": "string"
265 }
266 },
267 "scripts": {
268 "type": "array",
269 "items": {
270 "type": "string"
271 }
272 },
273 "styles": {
274 "type": "array",
275 "items": {
276 "type": "string"
277 }
278 }
279 }
280 },
281 {
282 "description": "A ResourceLoaderImageModule definition",
283 "additionalProperties": false,
284 "properties": {
285 "class": {
286 "enum": ["ResourceLoaderImageModule"]
287 },
288 "defaultColor": {
289 "type": "string"
290 },
291 "data": {
292 "type": "string"
293 },
294 "prefix": {
295 "type": "string"
296 },
297 "selector": {
298 "type": "string"
299 },
300 "selectorWithoutVariant": {
301 "type": "string"
302 },
303 "selectorWithVariant": {
304 "type": "string"
305 },
306 "variants": {
307 "type": "object"
308 },
309 "images": {
310 "type": "object"
311 },
312 "position": {
313 "enum": [
314 "top",
315 "bottom"
316 ]
317 }
318 }
319 },
320 {
321 "description": "An arbitrary ResourceLoaderModule definition",
322 "properties": {
323 "class": {
324 "type": "string",
325 "pattern": "^((?!ResourceLoader(File|Image)Module).)*$"
326 }
327 },
328 "required": ["class"]
329 }
330 ]
331 }
332 }
333 },
334 "ResourceModuleSkinStyles": {
335 "type": "object",
336 "description": "ResourceLoader modules for custom skin styles"
337 },
338 "ResourceLoaderSources": {
339 "type": "object",
340 "description": "ResourceLoader sources to register"
341 },
342 "ResourceLoaderLESSVars": {
343 "type": "object",
344 "description": "ResourceLoader LESS variables"
345 },
346 "ConfigRegistry": {
347 "type": "object",
348 "description": "Registry of factory functions to create Config objects"
349 },
350 "SessionProviders": {
351 "type": "object",
352 "description": "Session providers"
353 },
354 "AuthManagerAutoConfig": {
355 "type": "object",
356 "description": "AuthManager auto-configuration",
357 "additionalProperties": false,
358 "properties": {
359 "preauth": {
360 "type": "object",
361 "description": "Pre-authentication providers"
362 },
363 "primaryauth": {
364 "type": "object",
365 "description": "Primary authentication providers"
366 },
367 "secondaryauth": {
368 "type": "object",
369 "description": "Secondary authentication providers"
370 }
371 }
372 },
373 "CentralIdLookupProviders": {
374 "type": "object",
375 "description": "Central ID lookup providers"
376 },
377 "namespaces": {
378 "type": "array",
379 "description": "Method to add extra namespaces",
380 "items": {
381 "type": "object",
382 "properties": {
383 "id": {
384 "type": "integer"
385 },
386 "constant": {
387 "type": "string"
388 },
389 "name": {
390 "type": "string"
391 },
392 "gender": {
393 "type": "object",
394 "properties": {
395 "male": {
396 "type": "string"
397 },
398 "female": {
399 "type": "string"
400 }
401 }
402 },
403 "subpages": {
404 "type": "boolean",
405 "default": false
406 },
407 "content": {
408 "type": "boolean",
409 "default": false
410 },
411 "defaultcontentmodel": {
412 "type": "string"
413 },
414 "protection": {
415 "type": ["string", "array"],
416 "description": "Userright(s) required to edit in this namespace"
417 },
418 "capitallinkoverride": {
419 "type": "boolean",
420 "description": "Set $wgCapitalLinks on a per-namespace basis"
421 },
422 "conditional": {
423 "type": "boolean",
424 "description": "Whether the namespace is conditional upon configuration and should not be registered (requires separate registration via a hook)",
425 "default": false
426 }
427 },
428 "required": ["id", "constant", "name"]
429 }
430 },
431 "TrackingCategories": {
432 "type": "array",
433 "description": "Tracking category message keys",
434 "items": {
435 "type": "string"
436 }
437 },
438 "DefaultUserOptions": {
439 "type": "object",
440 "description": "Default values of user options"
441 },
442 "HiddenPrefs": {
443 "type": "array",
444 "description": "Preferences users cannot set",
445 "items": {
446 "type": "string"
447 }
448 },
449 "GroupPermissions": {
450 "type": "object",
451 "description": "Default permissions to give to user groups",
452 "patternProperties": {
453 "^[a-z]+$": {
454 "type": "object",
455 "patternProperties": {
456 "^[a-z]+$": {
457 "type": "boolean"
458 }
459 }
460 }
461 }
462 },
463 "RevokePermissions": {
464 "type": "object",
465 "description": "Default permissions to revoke from user groups",
466 "patternProperties": {
467 "^[a-z]+$": {
468 "type": "object",
469 "patternProperties": {
470 "^[a-z]+$": {
471 "type": "boolean"
472 }
473 }
474 }
475 }
476 },
477 "GrantPermissions": {
478 "type": "object",
479 "description": "Map of permissions granted to authorized consumers to their bundles, called 'grants'",
480 "patternProperties": {
481 "^[a-z]+$": {
482 "type": "object",
483 "patternProperties": {
484 "^[a-z]+$": {
485 "type": "boolean"
486 }
487 }
488 }
489 }
490 },
491 "GrantPermissionGroups": {
492 "type": "object",
493 "description": "Map of grants to their UI grouping",
494 "patternProperties": {
495 "^[a-z]+$": {
496 "type": "string"
497 }
498 }
499 },
500 "ImplicitGroups": {
501 "type": "array",
502 "description": "Implicit groups"
503 },
504 "GroupsAddToSelf": {
505 "type": "object",
506 "description": "Groups a user can add to themselves"
507 },
508 "GroupsRemoveFromSelf": {
509 "type": "object",
510 "description": "Groups a user can remove from themselves"
511 },
512 "AddGroups": {
513 "type": "object",
514 "description": "Groups a user can add to users"
515 },
516 "RemoveGroups": {
517 "type": "object",
518 "description": "Groups a user can remove from users"
519 },
520 "AvailableRights": {
521 "type": "array",
522 "description": "User rights added by the extension",
523 "items": {
524 "type": "string"
525 }
526 },
527 "ContentHandlers": {
528 "type": "object",
529 "description": "Mapping of model ID to class name",
530 "patternProperties": {
531 "^[A-Za-z]+$": {
532 "type": "string"
533 }
534 }
535 },
536 "RateLimits": {
537 "type": "object",
538 "description": "Rate limits"
539 },
540 "RecentChangesFlags": {
541 "type": "object",
542 "description": "Flags (letter symbols) shown on RecentChanges pages"
543 },
544 "MediaHandlers": {
545 "type": "object",
546 "description": "Plugins for media file type handling. Each entry in the array maps a MIME type to a PHP class name."
547 },
548 "ExtensionFunctions": {
549 "type": [
550 "array",
551 "string"
552 ],
553 "description": "Function to call after setup has finished",
554 "items": {
555 "type": "string"
556 }
557 },
558 "ExtensionMessagesFiles": {
559 "type": "object",
560 "description": "File paths containing PHP internationalization data"
561 },
562 "MessagesDirs": {
563 "type": "object",
564 "description": "Directory paths containing JSON internationalization data"
565 },
566 "ExtensionEntryPointListFiles": {
567 "type": "object"
568 },
569 "SpecialPages": {
570 "type": "object",
571 "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
572 },
573 "AutoloadNamespaces": {
574 "type": "object",
575 "description": "Mapping of PSR-4 compliant namespace to directory for autoloading",
576 "patternProperties": {
577 "^[A-Za-z0-9\\\\]+\\\\$": {
578 "type": "string"
579 }
580 },
581 "additionalProperties": false
582 },
583 "AutoloadClasses": {
584 "type": "object"
585 },
586 "Hooks": {
587 "type": [ "string", "object" ],
588 "description": "Hooks this extension uses (mapping of hook name to callback)"
589 },
590 "JobClasses": {
591 "type": "object",
592 "description": "Job types this extension implements (mapping of job type to class name or factory function)"
593 },
594 "LogTypes": {
595 "type": "array",
596 "description": "List of new log types this extension uses"
597 },
598 "LogRestrictions": {
599 "type": "object"
600 },
601 "FilterLogTypes": {
602 "type": "object"
603 },
604 "ActionFilteredLogs": {
605 "type": "object",
606 "description": "List of log types which can be filtered by log actions",
607 "patternProperties": {
608 "^[a-z-]+$": {
609 "type": "object",
610 "patternProperties": {
611 "^[a-z-]+$": {
612 "type": "array",
613 "items": {
614 "type": "string"
615 }
616 }
617 }
618 }
619 }
620 },
621 "LogNames": {
622 "type": "object"
623 },
624 "LogHeaders": {
625 "type": "object"
626 },
627 "LogActions": {
628 "type": "object"
629 },
630 "LogActionsHandlers": {
631 "type": "object"
632 },
633 "Actions": {
634 "type": "object"
635 },
636 "APIModules": {
637 "type": "object"
638 },
639 "APIFormatModules": {
640 "type": "object"
641 },
642 "APIMetaModules": {
643 "type": "object"
644 },
645 "APIPropModules": {
646 "type": "object"
647 },
648 "APIListModules": {
649 "type": "object"
650 },
651 "ValidSkinNames": {
652 "type": "object"
653 },
654 "FeedClasses": {
655 "type": "object",
656 "description": "Available feeds objects"
657 },
658 "SkinOOUIThemes": {
659 "type": "object"
660 },
661 "PasswordPolicy": {
662 "type": "object",
663 "description": "Password policies"
664 },
665 "FileExtensions": {
666 "type": "array",
667 "description": "Preferred file extensions for uploading",
668 "items": {
669 "type": "string"
670 }
671 },
672 "callback": {
673 "type": [
674 "array",
675 "string"
676 ],
677 "description": "A function to be called right after MediaWiki processes this file"
678 },
679 "config": {
680 "type": "object",
681 "description": "Configuration options for this extension",
682 "properties": {
683 "_prefix": {
684 "type": "string",
685 "default": "wg",
686 "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
687 }
688 },
689 "patternProperties": {
690 "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
691 "properties": {
692 "_merge_strategy": {
693 "type": "string",
694 "enum": [
695 "array_merge_recursive",
696 "array_replace_recursive",
697 "array_plus_2d",
698 "array_plus",
699 "array_merge"
700 ],
701 "default": "array_merge"
702 }
703 }
704 }
705 }
706 },
707 "ParserTestFiles": {
708 "type": "array",
709 "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
710 },
711 "ServiceWiringFiles": {
712 "type": "array",
713 "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
714 },
715 "load_composer_autoloader": {
716 "type": "boolean",
717 "description": "Load the composer autoloader for this extension, if one is present"
718 }
719 }
720 }