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