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