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