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