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