Merge "ProtectionForm: Move JS config var to RL packageFiles"
[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 "packageFiles": {
259 "type": ["object", "array"],
260 "description": "Package files that can be require()d"
261 }
262 }
263 },
264 {
265 "description": "A ResourceLoaderWikiModule definition",
266 "additionalProperties": false,
267 "properties": {
268 "class": {
269 "enum": ["ResourceLoaderWikiModule"]
270 },
271 "group": {
272 "type": "string",
273 "description": "Group with which this module should be loaded"
274 },
275 "position": {
276 "type": "string",
277 "description": "Position on the page to load this module at",
278 "enum": [
279 "bottom",
280 "top"
281 ]
282 },
283 "targets": {
284 "type": ["string", "array"],
285 "description": "ResourceLoader target the module can run on",
286 "items": {
287 "type": "string"
288 }
289 },
290 "scripts": {
291 "type": "array",
292 "description": "A list of on-wiki pages containing JavaScript that should be loaded",
293 "items": {
294 "type": "string"
295 }
296 },
297 "styles": {
298 "type": "array",
299 "description": "A list of on-wiki pages containing CSS that should be loaded",
300 "items": {
301 "type": "string"
302 }
303 }
304 }
305 },
306 {
307 "description": "A ResourceLoaderImageModule definition",
308 "additionalProperties": false,
309 "properties": {
310 "class": {
311 "enum": ["ResourceLoaderImageModule"]
312 },
313 "defaultColor": {
314 "type": "string"
315 },
316 "data": {
317 "type": "string"
318 },
319 "prefix": {
320 "type": "string"
321 },
322 "selector": {
323 "type": "string"
324 },
325 "selectorWithoutVariant": {
326 "type": "string"
327 },
328 "selectorWithVariant": {
329 "type": "string"
330 },
331 "useDataURI": {
332 "type": "boolean"
333 },
334 "variants": {
335 "type": "object"
336 },
337 "images": {
338 "type": "object"
339 },
340 "position": {
341 "enum": [
342 "top",
343 "bottom"
344 ]
345 }
346 }
347 },
348 {
349 "description": "An arbitrary ResourceLoaderModule definition by class",
350 "properties": {
351 "class": {
352 "type": "string",
353 "pattern": "^((?!ResourceLoader(File|Image)Module).)*$"
354 }
355 },
356 "required": ["class"]
357 },
358 {
359 "description": "An arbitrary ResourceLoaderModule definition with instantiator",
360 "properties": {
361 "factory": {
362 "type": "string",
363 "description": "A static instantiator function for creating the ResourceLoaderModule object."
364 }
365 },
366 "required": ["factory"]
367 }
368 ]
369 }
370 }
371 },
372 "ResourceModuleSkinStyles": {
373 "type": "object",
374 "description": "ResourceLoader modules for custom skin styles"
375 },
376 "ResourceLoaderSources": {
377 "type": "object",
378 "description": "ResourceLoader sources to register"
379 },
380 "QUnitTestModule": {
381 "type": "object",
382 "description": "A ResourceLoaderFileModule definition registered only when wgEnableJavaScriptTest is true.",
383 "additionalProperties": false,
384 "properties": {
385 "localBasePath": {
386 "type": "string",
387 "description": "Prefix for local paths to files in $options, relative to extenion directory"
388 },
389 "remoteExtPath": {
390 "type": "string",
391 "description": "Prefix for URLs to files in $options, relative to $wgExtensionAssetsPath"
392 },
393 "remoteSkinPath": {
394 "type": "string",
395 "description": "Prefix for URLs to files in $options, relative to $wgStylePath"
396 },
397 "scripts": {
398 "type": ["string", "array"],
399 "description": "Scripts to include (array of file paths)",
400 "items": {
401 "type": "string"
402 }
403 },
404 "dependencies": {
405 "type": ["string", "array"],
406 "description": "Modules which must be loaded before this module",
407 "items": {
408 "type": "string"
409 }
410 },
411 "styles": {
412 "type": ["string", "array", "object"],
413 "description": "Styles to load",
414 "items": {
415 "type": "string"
416 }
417 },
418 "messages": {
419 "type": ["string", "array"],
420 "description": "Messages to load",
421 "items": {
422 "type": "string"
423 }
424 }
425 }
426 },
427 "ConfigRegistry": {
428 "type": "object",
429 "description": "Registry of factory functions to create Config objects"
430 },
431 "SessionProviders": {
432 "type": "object",
433 "description": "Session providers"
434 },
435 "AuthManagerAutoConfig": {
436 "type": "object",
437 "description": "AuthManager auto-configuration",
438 "additionalProperties": false,
439 "properties": {
440 "preauth": {
441 "type": "object",
442 "description": "Pre-authentication providers"
443 },
444 "primaryauth": {
445 "type": "object",
446 "description": "Primary authentication providers"
447 },
448 "secondaryauth": {
449 "type": "object",
450 "description": "Secondary authentication providers"
451 }
452 }
453 },
454 "CentralIdLookupProviders": {
455 "type": "object",
456 "description": "Central ID lookup providers"
457 },
458 "ChangeCredentialsBlacklist": {
459 "type": "object",
460 "description": "AuthenticationRequest classes which can only be used internally for credentials change"
461 },
462 "RemoveCredentialsBlacklist": {
463 "type": "object",
464 "description": "AuthenticationRequest classes which can only be used internally for credentials removal"
465 },
466 "namespaces": {
467 "type": "array",
468 "description": "Method to add extra namespaces",
469 "items": {
470 "type": "object",
471 "properties": {
472 "id": {
473 "type": "integer"
474 },
475 "constant": {
476 "type": "string"
477 },
478 "name": {
479 "type": "string"
480 },
481 "gender": {
482 "type": "object",
483 "properties": {
484 "male": {
485 "type": "string"
486 },
487 "female": {
488 "type": "string"
489 }
490 }
491 },
492 "subpages": {
493 "type": "boolean",
494 "default": false
495 },
496 "content": {
497 "type": "boolean",
498 "default": false
499 },
500 "defaultcontentmodel": {
501 "type": "string"
502 },
503 "protection": {
504 "type": ["string", "array"],
505 "description": "Userright(s) required to edit in this namespace"
506 },
507 "capitallinkoverride": {
508 "type": "boolean",
509 "description": "Set $wgCapitalLinks on a per-namespace basis"
510 },
511 "conditional": {
512 "type": "boolean",
513 "description": "Whether the namespace is conditional upon configuration and should not be registered (requires separate registration via a hook)",
514 "default": false
515 }
516 },
517 "required": ["id", "constant", "name"]
518 }
519 },
520 "TrackingCategories": {
521 "type": "array",
522 "description": "Tracking category message keys",
523 "items": {
524 "type": "string"
525 }
526 },
527 "DefaultUserOptions": {
528 "type": "object",
529 "description": "Default values of user options"
530 },
531 "HiddenPrefs": {
532 "type": "array",
533 "description": "Preferences users cannot set",
534 "items": {
535 "type": "string"
536 }
537 },
538 "GroupPermissions": {
539 "type": "object",
540 "description": "Default permissions to give to user groups",
541 "patternProperties": {
542 "^[a-z]+$": {
543 "type": "object",
544 "patternProperties": {
545 "^[a-z]+$": {
546 "type": "boolean"
547 }
548 }
549 }
550 }
551 },
552 "RevokePermissions": {
553 "type": "object",
554 "description": "Default permissions to revoke from user groups",
555 "patternProperties": {
556 "^[a-z]+$": {
557 "type": "object",
558 "patternProperties": {
559 "^[a-z]+$": {
560 "type": "boolean"
561 }
562 }
563 }
564 }
565 },
566 "GrantPermissions": {
567 "type": "object",
568 "description": "Map of permissions granted to authorized consumers to their bundles, called 'grants'",
569 "patternProperties": {
570 "^[a-z]+$": {
571 "type": "object",
572 "patternProperties": {
573 "^[a-z]+$": {
574 "type": "boolean"
575 }
576 }
577 }
578 }
579 },
580 "GrantPermissionGroups": {
581 "type": "object",
582 "description": "Map of grants to their UI grouping",
583 "patternProperties": {
584 "^[a-z]+$": {
585 "type": "string"
586 }
587 }
588 },
589 "ImplicitGroups": {
590 "type": "array",
591 "description": "Implicit groups"
592 },
593 "GroupsAddToSelf": {
594 "type": "object",
595 "description": "Groups a user can add to themselves"
596 },
597 "GroupsRemoveFromSelf": {
598 "type": "object",
599 "description": "Groups a user can remove from themselves"
600 },
601 "AddGroups": {
602 "type": "object",
603 "description": "Groups a user can add to users"
604 },
605 "RemoveGroups": {
606 "type": "object",
607 "description": "Groups a user can remove from users"
608 },
609 "AvailableRights": {
610 "type": "array",
611 "description": "User rights added by the extension",
612 "items": {
613 "type": "string"
614 }
615 },
616 "ContentHandlers": {
617 "type": "object",
618 "description": "Mapping of model ID to class name",
619 "patternProperties": {
620 "^[A-Za-z]+$": {
621 "type": "string"
622 }
623 }
624 },
625 "RateLimits": {
626 "type": "object",
627 "description": "Rate limits"
628 },
629 "RecentChangesFlags": {
630 "type": "object",
631 "description": "Flags (letter symbols) shown on RecentChanges pages"
632 },
633 "MediaHandlers": {
634 "type": "object",
635 "description": "Plugins for media file type handling. Each entry in the array maps a MIME type to a PHP class name."
636 },
637 "ExtensionFunctions": {
638 "type": [
639 "array",
640 "string"
641 ],
642 "description": "Function to call after setup has finished",
643 "items": {
644 "type": "string"
645 }
646 },
647 "ExtensionMessagesFiles": {
648 "type": "object",
649 "description": "File paths containing PHP internationalization data"
650 },
651 "MessagesDirs": {
652 "type": "object",
653 "description": "Directory paths containing JSON internationalization data"
654 },
655 "ExtensionEntryPointListFiles": {
656 "type": "object"
657 },
658 "SpecialPages": {
659 "type": "object",
660 "description": "SpecialPages implemented in this extension (mapping of page name to class name)"
661 },
662 "AutoloadNamespaces": {
663 "type": "object",
664 "description": "Mapping of PSR-4 compliant namespace to directory for autoloading",
665 "patternProperties": {
666 "^[A-Za-z0-9\\\\]+\\\\$": {
667 "type": "string"
668 }
669 },
670 "additionalProperties": false
671 },
672 "AutoloadClasses": {
673 "type": "object"
674 },
675 "Hooks": {
676 "type": [ "string", "object" ],
677 "description": "Hooks this extension uses (mapping of hook name to callback)"
678 },
679 "JobClasses": {
680 "type": "object",
681 "description": "Job types this extension implements (mapping of job type to class name or factory function)"
682 },
683 "LogTypes": {
684 "type": "array",
685 "description": "List of new log types this extension uses"
686 },
687 "LogRestrictions": {
688 "type": "object"
689 },
690 "FilterLogTypes": {
691 "type": "object"
692 },
693 "ActionFilteredLogs": {
694 "type": "object",
695 "description": "List of log types which can be filtered by log actions",
696 "patternProperties": {
697 "^[a-z-]+$": {
698 "type": "object",
699 "patternProperties": {
700 "^[a-z-]+$": {
701 "type": "array",
702 "items": {
703 "type": "string"
704 }
705 }
706 }
707 }
708 }
709 },
710 "LogNames": {
711 "type": "object"
712 },
713 "LogHeaders": {
714 "type": "object"
715 },
716 "LogActions": {
717 "type": "object"
718 },
719 "LogActionsHandlers": {
720 "type": "object"
721 },
722 "Actions": {
723 "type": "object"
724 },
725 "APIModules": {
726 "type": "object"
727 },
728 "APIFormatModules": {
729 "type": "object"
730 },
731 "APIMetaModules": {
732 "type": "object"
733 },
734 "APIPropModules": {
735 "type": "object"
736 },
737 "APIListModules": {
738 "type": "object"
739 },
740 "ValidSkinNames": {
741 "type": "object"
742 },
743 "FeedClasses": {
744 "type": "object",
745 "description": "Available feeds objects"
746 },
747 "SkinOOUIThemes": {
748 "type": "object",
749 "description": "Map of skin names to OOUI themes to use. Same format as ResourceLoaderOOUIModule::$builtinSkinThemeMap."
750 },
751 "PasswordPolicy": {
752 "type": "object",
753 "description": "Password policies"
754 },
755 "FileExtensions": {
756 "type": "array",
757 "description": "Preferred file extensions for uploading",
758 "items": {
759 "type": "string"
760 }
761 },
762 "RawHtmlMessages": {
763 "type": "array",
764 "description": "Messages which are rendered as raw HTML",
765 "items": {
766 "type": "string"
767 }
768 },
769 "ReauthenticateTime": {
770 "type": "object",
771 "patternProperties": {
772 ".*": {
773 "type": "integer"
774 }
775 }
776 },
777 "callback": {
778 "type": [
779 "array",
780 "string"
781 ],
782 "description": "A function to be called right after MediaWiki processes this file"
783 },
784 "config_prefix": {
785 "type": "string",
786 "default": "wg",
787 "description": "Prefix to put in front of configuration settings when exporting them to $GLOBALS"
788 },
789 "config": {
790 "type": "object",
791 "description": "Configuration options for this extension",
792 "patternProperties": {
793 "^[a-zA-Z_\u007f-\u00ff][a-zA-Z0-9_\u007f-\u00ff]*$": {
794 "type": "object",
795 "properties": {
796 "value": {
797 "required": true
798 },
799 "merge_strategy": {
800 "type": "string",
801 "enum": [
802 "array_merge_recursive",
803 "array_replace_recursive",
804 "array_plus_2d",
805 "array_plus",
806 "array_merge"
807 ],
808 "default": "array_merge"
809 },
810 "path": {
811 "description": "Whether this should be interpreted as a filesystem path, relative to extension directory root",
812 "type": "boolean",
813 "default": false
814 },
815 "description": {
816 "type": ["string", "array"],
817 "description": "A description of the config setting, mostly for documentation/developers"
818 },
819 "decriptionmsg": {
820 "type": "string",
821 "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."
822 },
823 "public": {
824 "type": "boolean",
825 "default": false,
826 "description": "Whether this configuration option and its value is allowed to be revealed in public or not."
827 }
828 }
829 }
830 }
831 },
832 "ParserTestFiles": {
833 "type": "array",
834 "description": "Parser test suite files to be run by parserTests.php when no specific filename is passed to it"
835 },
836 "ServiceWiringFiles": {
837 "type": "array",
838 "description": "List of service wiring files to be loaded by the default instance of MediaWikiServices"
839 },
840 "attributes": {
841 "description":"Registration information for other extensions",
842 "type": "object",
843 "patternProperties": {
844 ".*": {
845 "type": "object",
846 "patternProperties": {
847 ".*": {
848 "type": ["array", "object"]
849 }
850 }
851 }
852 }
853 },
854 "load_composer_autoloader": {
855 "type": "boolean",
856 "description": "Load the composer autoloader for this extension, if one is present"
857 }
858 }
859 }